Eiffel (programming language): Difference between revisions

Content deleted Content added
Line 277:
In Eiffel one defines an exception handler using the <tt>rescue</tt> keyword which defines a block of code to be executed upon failure. Using the <tt>retry</tt> keyword in the <tt>rescue</tt> section (the only section it is allowed to be used in) causes the routine to be executed again after making the changes specified. This allows the programmer to correct mistakes in the input data or to keep track of the number of attempts at executing the routine.
 
-- Connect to a server or give up after 10 attempts
<code><font color=blue>
connect_to_server (server: ''SOCKET'')
-- Connect to a server or give up after 10 attempts.
'''require'''
server /= Void and then server.address /= Void