mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 07:12:25 +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 (l_my_rectangle.diagonal)
|
||||||
print ("%N")
|
print ("%N")
|
||||||
end
|
end
|
||||||
|
my_polygons.forth
|
||||||
end
|
end
|
||||||
</code>
|
</code>
|
||||||
The '''attached syntax''' allows us to check both attached status and type, and provides us with a fresh local variable when appropriate:
|
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 (l_my_rectangle.diagonal)
|
||||||
print ("%N")
|
print ("%N")
|
||||||
end
|
end
|
||||||
|
my_polygons.forth
|
||||||
end
|
end
|
||||||
</code>
|
</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>.
|
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