"Robert Klemme" <bob.news / gmx.net> writes:

> "Lloyd Zusman" <ljz / asfast.com> schrieb im Newsbeitrag
> news:m3wu0l6kpd.fsf / asfast.com...
>>
>> [ ... ]
>>
>>   def main
>>     # my main routine
>>     #
>>     # ... etc. ...
>>     #
>>     return (exitcode)  ### or this:  exit(exitcode)
>>   end
>>
>>   def function1
>>     # ... etc. ...
>>   end
>>
>>   def function2
>>     # ... etc. ...
>>   end
>>
>>   # other functions ...
>>
>>   # final line ...
>>   exit(main)
>
> Sorry, but I get the feeling that you are trying to make Ruby similar to C
> too much.  IMHO the result is worse than straight ruby code.  Let Ruby be
> Ruby and C be C. :-)

I just want to have my program's main body at the top of the program
file, and the subsidiary functions at the end.  The only thing C-like
about this is the fact that I chose the word "main" for the routine that
houses the main body of code.

This construct is not necessary.  I could just as easily name the main
routine as "foobar", and it would look less C-like without losing the
fact that the main body of the code comes first in the program file.

Never fear ... the code that I write tends to look ruby-ish and not
C-like. :)


> Kind regards
>
>     robert

-- 
 Lloyd Zusman
 ljz / asfast.com
 God bless you.