Updated wikipage Differences between ETL 2nd printing and Eiffel Software implementation. (Signed-off-by:jocelyn).

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2163 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2019-07-09 08:33:40 +00:00
parent 37dcb562c8
commit 759d679913

View File

@@ -1,4 +1,4 @@
[[Property:modification_date|Tue, 09 Jul 2019 08:25:22 GMT]] [[Property:modification_date|Tue, 09 Jul 2019 08:33:39 GMT]]
[[Property:publication_date|Tue, 09 Jul 2019 08:25:22 GMT]] [[Property:publication_date|Tue, 09 Jul 2019 08:25:22 GMT]]
[[Property:title|Differences between ETL 2nd printing and Eiffel Software implementation]] [[Property:title|Differences between ETL 2nd printing and Eiffel Software implementation]]
[[Property:link_title|ETL 2nd printing vs implementation]] [[Property:link_title|ETL 2nd printing vs implementation]]
@@ -20,23 +20,12 @@
* <code>reference</code>: new keyword to specify that a type is used as a reference type. * <code>reference</code>: new keyword to specify that a type is used as a reference type.
* <code> agent</code>: new keyword used by the agent mechanism. * <code> agent</code>: new keyword used by the agent mechanism.
* <code>create</code>: Instead of using the famous exclamation mark to create an instance of a class, you can use the keyword <code>create</code>. Below you will find a correspondence table between the old and the new syntaxes. The old syntax is still valid, but at some points Eiffel Software will remove it from its implementation: * <code>create</code>: Instead of using the famous exclamation mark to create an instance of a class, you can use the keyword <code>create</code>. Below you will find a correspondence table between the old and the new syntaxes. The old syntax is still valid, but at some points Eiffel Software will remove it from its implementation:
{|
|- ** Old syntax `!! a` => new syntax `create a`
| Old syntax ** Old syntax `!! a.make` => new syntax `create a.make`
| New syntax ** Old syntax `!B! a` => new syntax `create {B} a`
|- ** Old syntax `!B! a.make` => new syntax `create {B} a.make`
| !! a
| <code>create</code> a
|-
| !! a.make
| <code>create</code> a.make
|-
| !<eiffel>B</eiffel>! a
| <code>create</code> {<eiffel>B</eiffel>} a
|-
| !<eiffel>B</eiffel>! a.make
| <code>create</code> {<eiffel>B</eiffel>} a.make
|}
* <code>note</code>: replacement for the keyword <code>indexing</code>. * <code>note</code>: replacement for the keyword <code>indexing</code>.
* <code>attribute</code>: new keyword to declare attribute body. * <code>attribute</code>: new keyword to declare attribute body.
* <code>attached</code>: new keyword to specify attached types and object tests. * <code>attached</code>: new keyword to specify attached types and object tests.
@@ -46,12 +35,7 @@
==Added semantics== ==Added semantics==
* [[ET: Genericity and Arrays|Generic creation]] * [[ET: Genericity and Arrays|Generic creation]]
* Expression creation: you can now create an object within an expression. For example, you want to create an object and pass it as an argument to a function. Whereas you had to create a local variable, create the object and pass it to the function, you now simply need to pass to the function the creation expression. Here is a small example: * Expression creation: you can now create an object within an expression. For example, you want to create an object and pass it as an argument to a function. Whereas you had to create a local variable, create the object and pass it to the function, you now simply need to pass to the function the creation expression. Here is a small example:
{| ** Old method:
|-
| Old method
| New method
|-
|
<code> <code>
local local
a: STRING a: STRING
@@ -60,17 +44,15 @@ do
f (a) f (a)
end end
</code> </code>
** 'New method:
|
<code> <code>
do do
f (create {STRING}.make (10)) f (create {STRING}.make (10))
end end
</code> </code>
|}
This is also very useful since it can improve the power of assertions. This is also very useful since it can improve the power of assertions.
* Mutually recursive constraints: one can now write class A [H, G->H] or class B [H -> C, G -> ARRAY [H]]. As a result, the declaration A [D, E] is valid only if E is a descendant of D. Similarly, the declaration B [E, ARRAY [D]] is not valid, if E is a descendant of D. * Mutually recursive constraints: one can now write class `A [H, G->H]` or class `B [H -> C, G -> ARRAY [H]]`. As a result, the declaration `A [D, E]` is valid only if `E` is a descendant of `D`. Similarly, the declaration `B [E, ARRAY [D]]` is not valid, if `E` is a descendant of `D`.
* [[ET: Other Mechanisms|Tuples]] * [[ET: Other Mechanisms|Tuples]]
* [[ET: Agents|Agents]] * [[ET: Agents|Agents]]
* Feature access: <br/> * Feature access: <br/>