|
From: Eric B. <er...@go...> - 2001-07-16 22:18:43
|
Greg C wrote:
>
> Eric Bezault wrote:
> > But we don't really need it since:
> >
> > !! my_string.make_from_string ("foo")
> >
> > can be replaced by:
> >
> > my_string := "foo"
> >
> > or:
> >
> > my_string := clone ("foo")
> >
> > depending on whether we plan to alter this string or
> > not in the next instructions.
>
> Say for some reason my_string is a descendent of STRING; will the
> assignment and/or clone still work?
No, it won't work. But in class UC_STRING 'my_string'
was a STRING, not a descendant. Therefore, also I agree
that it a shame that although `make_from_string' was
in ELKS'95 it was not supported by some Eiffel compilers,
I think that it's a little bit twisted-mind to create a
STRING (I'm not speaking about proper descendants of
STRING) with `make_from_string' when a simple assignment
or clone will work.
--
Eric Bezault
mailto:er...@go...
http://www.gobosoft.com
|