mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2026-02-06 08:54:32 +01:00
Author:halw
Date:2009-08-10T19:50:49.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@283 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -156,7 +156,7 @@ Here attribute declarations for <code>my_nvp</code> and <code>my_nvp_list</code>
|
||||
In a second case, there is also an Initialization rule violation (VEVI), this time on <code>Result</code>, in this routine:
|
||||
|
||||
<code>
|
||||
at_first (nm: STRING): NVP is
|
||||
at_first (nm: STRING): NVP
|
||||
-- The first found NVP with name matching nm.
|
||||
-- Or Void if not found
|
||||
require
|
||||
@@ -181,7 +181,7 @@ Here we cannot just ensure that <code>Result</code> is always attached, because,
|
||||
So the least impact to this routine will be to declare its type as <code>detachable</code>:
|
||||
|
||||
<code>
|
||||
at_first (nm: STRING): detachable NVP is
|
||||
at_first (nm: STRING): detachable NVP
|
||||
-- The first found NVP with name matching nm.
|
||||
-- Or Void if not found
|
||||
</code>
|
||||
@@ -205,7 +205,7 @@ The change to <code>at_first</code> satisfies the VEVI issue in <code>at_first</
|
||||
<code>value_at_first</code> looks like this:
|
||||
|
||||
<code>
|
||||
value_at_first (nm: STRING): detachable STRING is
|
||||
value_at_first (nm: STRING): detachable STRING
|
||||
-- Value from first found NVP with name matching nm
|
||||
-- Or Void of not found
|
||||
require
|
||||
@@ -228,7 +228,7 @@ The problem is that the local variable <code>tn</code> is declared as <code>atta
|
||||
Here the '''attached syntax''' can fix the problem and streamline the routine:
|
||||
|
||||
<code>
|
||||
value_at_first (nm: STRING): detachable STRING is
|
||||
value_at_first (nm: STRING): detachable STRING
|
||||
-- Value from first found NVP with name matching nm
|
||||
-- Or Void of not found
|
||||
require
|
||||
|
||||
Reference in New Issue
Block a user