Hello Alexander,
comments see below.
A general remark:
ECMA Eiffel is a great step forward in introducing void safety to the
language. For void safety attached/detachable types are crucial. However
some details have been forgotten to think through thoroughly. One is the
issue of ?INTEGER.
If you want allow formal generics to be attached or detachable you have
to allow the '?' mark on expandeds as well, because an actual generic
can be expanded or reference. So you can have ?INTEGER implicitely anyhow.
If you can declare ?INTEGER it must be possible to assign Void to that
entity. Otherwise it would not be detachable.
Introducing expanded and reference at the class level is a good thing in
general. But attaching reference/copy semantics to the object and not to
the entity has some strange consequences. E.g.
local
a,b: ANY
do
a := 1
b := a -- has to create an new object of type INTEGER
end
This does not convince me. b:=a should attach b to the same object as a.
I don't see any bad consequences because of this, but a better
performance. Do you see any bad consequences? If yes, can you give an
example?
Regards
Helmut
The Eiffel Compiler:
http://tecomp.sourceforge.nethttp://www.sourceforge.net/projects/tecomp
Alexander Kogtenkov wrote:
> Helmut Brandl wrote:
>
>
>> ?T is detachable, an entity declared with type ?T is a
>> reference entity and can be void or attached, before use a void test or
>> obect test is required, ....
>>
>
> It means that we'll have a way to change the status of a type
> from expanded to reference, like it was possible earlier with a
> "reference" keyword: `t: reference T'. However the latter was
> not adopted in the standard. Moreover, the previously allowed
> `e: expanded T' was removed.
>
> The rationale behind is that the expanded vs. reference semantics
> is selected at the class level, because usually it involves redefinition
> of `copy', `is_equal', etc. and ensures the designer that the objects
> of this type are never shared.
>
> If you mean that this is only an entity definition, where the type
> is treated as a reference one, but any creation causes the expanded
> object to be created, this is a possible solution, but I guess,
> it would involve other changes in the language specification.
>
What other language specifications do you see. If there are some, I am
afraid we have to bite the bullet, because we must give ?INTEGER a
meaning. There is no way out, because of generics.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
freeelks-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freeelks-devel