diff --git a/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki b/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki index cb167df7..bfae7e7d 100644 --- a/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki +++ b/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki @@ -447,7 +447,7 @@ As with assignment, there is also a form that works on objects rather than refer will return true when x and y are both non-void and attached to field-by-field identical objects. This can be true even when x = y is not, for example, in the figure, ''before'' the assignment, if the two objects shown are field-by-field equal. -The expression x.is_equal (y) can be written alternatively in a notation similar in form to x = y . The expression: +The expression x.is_equal (y) can be written alternatively, using the ''tilde'' ('~") character, in a notation similar in form to x = y . The expression: x ~ y @@ -459,6 +459,8 @@ A more general variant of is_equal is used under the form: This is always defined, even if x is void, returning true whenever is_equal would but also if x and y are both void. (In contrast, x.is_equal (y) is not defined for void x 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 ~ operator performs an object equality comparison, using the (possibly redefined) version of feature is_equal that is appropriate for the operand types. The operand types must be the same, or the result will be False. As such, the use of ~ is preferred to over the use of direct use of either x.is_equal (y) or equal (x, y), which can be susceptible to [[ET: Inheritance#Catcalls|catcalls]].}} + Void denotes a void reference. So you can make x void through the assignment x := Void diff --git a/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net-integration.wiki b/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net-integration.wiki index 6f33e19a..d30e8009 100644 --- a/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net-integration.wiki +++ b/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net-integration.wiki @@ -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 -The previous example shows the declaration of the obsolete feature empty . The custom attribute defined by OBSOLETE_ATTRIBUTE 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 note clause attribute. 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 empty . The custom attribute defined by OBSOLETE_ATTRIBUTE 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 note clause metadata. The definition consists of a creation expression that creates the custom attribute with the right parameters. + +Using the metadata tag is the most general way of applying a custom attribute. There are however some variations that are explained below: +*metada: most general way, it applies a custom attribute to both the class and interface generated by the Eiffel compiler. +*class_metadata: applies only to the class generated by the Eiffel compiler (mostly for advanced users). +*interface_metadata: applies only to the interface generated by the Eiffel compiler (mostly for advanced users). +*property_metadata: applies a custom attribute to the associated property generated by the Eiffel compiler for a query. +*assembly_metadata: applies a custom attribute for the current assembly. It only works when present in the Eiffel system root class note clause. ==Differences between Eiffel for .NET and .NET==