Re: Manifest Strings

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Organization Gobo
Message-ID <[email protected]>
Brian Heilig wrote:
> When implementing a function like:
> 
> a_string: STRING is
>     -- A string
>   do
>     ...
>   end
> 
> why do you use:
> 
>   Result := STRING_.cloned_string ("A string!")
> 
> instead of just
> 
>   Result := "A string!"
> 
> ???

This is legacy code, and as much as possible I try to replace
the first occurrences by the latter.

The reason why we used to write the former form in Gobo was
that a few years ago the following instruction:

   Result := "A string!"

had different meanings for SmallEiffel and the other Eiffel
compilers. SE was always returning the same string whereas
the other compilers were returning a new string at each call.
Nowadays all Eiffel compilers, including SE, return a new
string. The old SE semantics can be achieved with the new
ECMA Eiffel construct:

   Result := once "A string!"

-- 
Eric Bezault
mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
http://www.gobosoft.com



To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.