mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:manus
Date:2009-12-07T22:28:01.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@367 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -447,7 +447,7 @@ As with assignment, there is also a form that works on objects rather than refer
|
||||
</code>
|
||||
will return true when <code>x</code> and <code>y</code> are both non-void and attached to field-by-field identical objects. This can be true even when <code>x = y</code> is not, for example, in the figure, ''before'' the assignment, if the two objects shown are field-by-field equal.
|
||||
|
||||
The expression <code>x.is_equal (y)</code> can be written alternatively in a notation similar in form to <code>x = y</code> . The expression:
|
||||
The expression <code>x.is_equal (y)</code> can be written alternatively, using the ''tilde'' ('~") character, in a notation similar in form to <code>x = y</code> . The expression:
|
||||
<code>
|
||||
x ~ y
|
||||
</code>
|
||||
@@ -459,6 +459,8 @@ A more general variant of <code>is_equal</code> is used under the form:
|
||||
</code>
|
||||
This is always defined, even if <code>x</code> is void, returning true whenever <code>is_equal</code> would but also if <code>x</code> and <code>y</code> are both void. (In contrast, <code>x.is_equal (y)</code> is not defined for void <code>x</code> and would, if evaluated, yield an exception as explained in [[ET: Design by Contract (tm), Assertions and Exceptions#Exception_handling|"Exception handling"]] below.)
|
||||
|
||||
{{note|The <code>~</code> operator performs an object equality comparison, using the (possibly redefined) version of feature <code>is_equal</code> that is appropriate for the operand types. The operand types must be the same, or the result will be <code>False</code>. As such, the use of <code>~</code> is preferred to over the use of direct use of either <code>x.is_equal (y)</code> or <code>equal (x, y)</code>, which can be susceptible to [[ET: Inheritance#Catcalls|catcalls]].}}
|
||||
|
||||
<code>Void</code> denotes a void reference. So you can make <code>x</code> void through the assignment
|
||||
<code>
|
||||
x := Void
|
||||
|
||||
@@ -24,7 +24,7 @@ The following syntax can be used to declare .NET custom attributes on Eiffel ent
|
||||
empty: BOOLEAN
|
||||
note
|
||||
description: "Is Current empty?"
|
||||
attribute: create {OBSOLETE_ATTRIBUTE}.make_obsoleteattribute_1 ("Use `is_empty' instead") end
|
||||
metadata: create {OBSOLETE_ATTRIBUTE}.make_obsoleteattribute_1 ("Use `is_empty' instead") end
|
||||
obsolete
|
||||
"Use is_empty instead"
|
||||
do
|
||||
@@ -32,7 +32,14 @@ The following syntax can be used to declare .NET custom attributes on Eiffel ent
|
||||
end
|
||||
</code>
|
||||
|
||||
The previous example shows the declaration of the obsolete feature <code> empty </code> . The custom attribute defined by <code>OBSOLETE_ATTRIBUTE</code> is used to ensure that any consumer of the resulting assembly will see the feature as being obsolete. The custom attribute is defined in the <code>note</code> clause <code>attribute</code>. The definition consists of a creation expression that creates the custom attribute with the right parameters.
|
||||
The previous example shows the declaration of the obsolete feature <code> empty </code> . The custom attribute defined by <code>OBSOLETE_ATTRIBUTE</code> is used to ensure that any consumer of the resulting assembly will see the feature as being obsolete. The custom attribute is defined in the <code>note</code> clause <code>metadata</code>. The definition consists of a creation expression that creates the custom attribute with the right parameters.
|
||||
|
||||
Using the <code>metadata</code> tag is the most general way of applying a custom attribute. There are however some variations that are explained below:
|
||||
*<code>metada</code>: most general way, it applies a custom attribute to both the class and interface generated by the Eiffel compiler.
|
||||
*<code>class_metadata</code>: applies only to the class generated by the Eiffel compiler (mostly for advanced users).
|
||||
*<code>interface_metadata</code>: applies only to the interface generated by the Eiffel compiler (mostly for advanced users).
|
||||
*<code>property_metadata</code>: applies a custom attribute to the associated property generated by the Eiffel compiler for a query.
|
||||
*<code>assembly_metadata</code>: applies a custom attribute for the current assembly. It only works when present in the Eiffel system root class <code>note</code> clause.
|
||||
|
||||
==Differences between Eiffel for .NET and .NET==
|
||||
|
||||
|
||||
Reference in New Issue
Block a user