Eckard Brauer wrote:
> ...
> It's because I found my beforementioned problem caused in
> $MOZART_SRC/share/lib/wp/Tk.oz:
> 
>            Platform = {Property.get 'platform.name'}
>            PLTFRM = ({Property.get 'oz.home'} #
>              '/platform/'#Platform#'/')
>            TKEXE = case {Property.get 'platform.arch'}
>                of 'darwin' then 'OzWish.app/Contents/MacOS/OzWish'
>                else 'tk.exe' end
> 
> where I took the # operator as string (or list) concatenuation and tried
> to find out what's really happening with the very limited knowledge of a
> beginner (Using {Show SOMETHING} in the emulator).
> 
> Your explaination tells me, that Mozart has some implicit (lazy) type
> conversion mechanism or that atoms can be used as strings, because in
> the 2nd line PLTFRM is bound to a concatenuation of a string and 3
> atoms.

There is no implicit type conversion in the language (though library function 
might of course implement conversion of their arguments).

PLTFRM is a so called "virtual string". A virtual string is a (possibly nested) 
tuple of strings, atoms and numbers. It allows to construct string literals in 
an efficient way.

Virtual strings are more efficient than plain old string concatenation because 
a virtual string like S1#S2#S3#S4 can be converted to a real string in {Length 
S1}+{Length S2}+{Length S3} steps while concatenation takes {Length 
S1}+({Length S1}+{Length S2})+({Length S1}+{Length S2}+{Length S3}) steps.

See also http://www.mozart-oz.org/home/doc/op/node4.html .

Cheers,
  Wolfgang

-- 
Nur bis 31.05.: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und
Telefonanschluss nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to