mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-06 14:52:03 +01:00
Corrected "my_polygons" code example to include a call to `forth' at the end of the loop, which was previously omitted.
Author:vwheeler Date:2014-04-29T19:19:58.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1350 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -258,6 +258,7 @@ As we traverse the list we would use assignment attempt to try to attach each <c
|
||||
print (l_my_rectangle.diagonal)
|
||||
print ("%N")
|
||||
end
|
||||
my_polygons.forth
|
||||
end
|
||||
</code>
|
||||
The '''attached syntax''' allows us to check both attached status and type, and provides us with a fresh local variable when appropriate:
|
||||
@@ -271,6 +272,7 @@ The '''attached syntax''' allows us to check both attached status and type, and
|
||||
print (l_my_rectangle.diagonal)
|
||||
print ("%N")
|
||||
end
|
||||
my_polygons.forth
|
||||
end
|
||||
</code>
|
||||
As with the other examples of the '''attached syntax''', it is no longer necessary to make a declaration for the local variable, in this case <code>l_my_rectangle</code>.
|
||||
|
||||
Reference in New Issue
Block a user