Re: procedures calling procedure calling procedure...
I agree. It'd be nice if routine_id() wasn't scoped, but that probably can't
be helped for the same reasons RDS can't add forward referencing directly.
(I wrote a program which would allow you to access any function before
it was declared via the name in a string, but this used routine_id() as the
underlying system.)
jbrown
On 0, francis at gmx.co.uk wrote:
>
> Cunning? Well, you can define routine ID constants/variables at the top of the
>
> file, reference them in the middle and set them at the end. Even in C, it is
> ordinary programming practice to "#define function(parameters);" if it is
> called
> before it is instantiated. It would be slightly more convenient to be able to
> call *before* it is defined, ut we are talking about an interpreted language!
> In
> terms of coding, I think is is not too much work around at all.
>
> >Sorry but there isn't. RDS believes this is the best way to do it. I strongly
> >
> disagree with RDS on
> >that issue.
> >
> >The RDS philosophy seems to be that good programming practice is to only
> >refer
> to things that have
> >already been "seen" by the one-pass interpreter. Thus you cannot refer to any
> >
> identifier that is
> >defined lower down in the file. So yes, the physical layout of indentifier
> definitions in a source
> >code file has been deemed to be vitally significant by RDS.
> >
> >This means that you as a programmer have to invent cunning ways to get around
> >
> this limitation in the
> >language (as implemented by RDS). Of course, RDS has also recognised that
> >there
> are legitimate
> >reasons for coders to do this, so Euphoria has been provided with
> >routine_id(),
> call_proc/func()
> >routines.
> >
> >My suspicions are that it is now too hard for RDS to change the way the
> interpreter works to allow
> >for forward referencing, so we are stuck with this limitation for now.
> >
> >Whenever I get a spare 12-months, I'll write a new implementation of the
> interpreter
> >
> >-------------
> >Derek.
> >
> >15/10/2002 7:21:59 AM, rubis at fem.unicamp.br wrote:
> >
> >>
> >>Hi people !
> >>
> >>How do I call a procedure that is after the call ?
> >>
> >>for example:
> >>
> >>--begin
> >>procedure a()
> >>?1
> >>end procedure
> >>
> >>procedure b()
> >>a()
> >>c()
> >>end procedure
> >>
> >>procedure c()
> >>?3
> >>end procedure
> >>
> >>--end
> >>
> >>I'm doing this using call_proc(c(), {}), but something tells me that there
> >>is a more easy or intellignet way to do this...
> >>
> >>thanks
> >>Rubens
> >>
> >>
> >---------
> >Cheers,
> >Derek Parnell
> >ICQ# 7647806
> >
> >
|
Not Categorized, Please Help
|
|