[comp.lang.pascal] What does

djakman@fwi.uva.nl (Kemal Djakman -- I89) (05/03/91)

 
A few days ago there was some talk in comp.lang.pascal about optimizing
a null string assignment.  So, instead of doing:
 
  S:= '';   { S is a string variable }
 
You should do:
 
  S(.0.):= #0;   { assign 0 to the length byte }
 
That piece of code puzzles me.  Normally I would code it by:
 
  S[0]:= #0;
 
What interest me here is the notation itself.  Is the use of "(." and ".)"
just a synonym for "[" and "]" ?  Like the two known notations for comment?
Is it defined in the standard or specific to Turbo Pascal?
 
By the way:  Since version 5.0 of Turbo Pascal,  The above mentioned code
             {S:= '';} is automatically optimized by the compiler.  As well
             as the expression in:  if (S='') then ...
 
---kemal---

-- 

/* --- limited warranty: ------------------------------------------------------
   This e-mail is only guaranteed to take some space in your mailbox file.  (k)
*/

damm@diku.dk (Kristian Damm Jensen) (05/05/91)

djakman@fwi.uva.nl (Kemal Djakman  -- I89) writes:

>What interest me here is the notation itself.  Is the use of "(." and ".)"
>just a synonym for "[" and "]" ?  Like the two known notations for comment?
>Is it defined in the standard or specific to Turbo Pascal?

Yes, the notation is a synomym ofr (. .). 
And Yes, it is standard.
-- 
Kristian Damm Jensen (damm@freja.diku.dk)
"Life is like a sewer - what you get out of it depends on what you put into it"
- Tom Lehrer