Re: Declaring a Function Before it is used

new topic     » goto parent     » topic index » view thread      » older message » newer message

Mike Nelson wrote:
> ... 
> In Eu, I must code this as
> 
> procedure bar()
> -- do highly technical stuff
> end procedure
> 
> global procedure foo()
> -- do stuff
> bar()
> -- do more stuff
> end procedure
> 
> Admittedly on reading foo, I have already read bar and "know what it does".
> On the other hand, as likely as not I can't really understand what bar does
> until I see it in its context in foo.  If forward referencing were allowed,
> I would put the general routine foo first and the implementation routine
> bar()  after it.
> ...

Mike, would it be possible to write your example code like this:


global procedure foo()
-- do stuff
bar()
-- do more stuff
end procedure

So, you have not (or would not) read bar() in advance of foo().

Have a nice day, Rolf

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu