Re: routine_id evaluation

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

> -----Original Message-----
> From: David Cuny

> Matt Lewis wrote:
>
> > I guess I finally understand what
> > you're talking about: forward referencing
> > (although that's not how you're phrasing it).

>    -- example 2: doesn't fail
>
>    procedure bar()
>    end procedure
>
>    function get_id( sequence s )
>       ? routine_id(s)
>    end function
>
>    if get_id("bar") != routine_id("bar") then
>       puts( 1, "failed" )
>    end if
>
> I respectfully submit that to claim that get_id is performing
> a "forward
> reference" here while routine_id is not is simply absurd. And
> Robert doesn't
> even make that claim. He's explained that the only reason it
> behaves this
> was to is to make it inconvenient for people to use that feature.

Well, since you mention it, I'd say that routine_id() was *not* using a
forward reference.  Only call_proc()/call_func() actually do that. :P
Sorry.

Although I didn't [want to] go into it, I agree that it might be nice to
have the 2 pass interpreter that's been talked about in the past (which
should do what Derek wants), but, as with many things on various wish lists
floating around, I wouldn't count on this being implemented.  In the
meantime, a scheme like what I proposed can be a work around.

I probably wouldn't use routine_id() much less than now if we did have a two
pass interpreter.  Although I encounter a few times where I need a simple
forward referenced function call, I typically use routine_id() for dynamic
function calling (ie, no way to know which routine needs to be called next),
as I did in matheval.

Matt Lewis

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

Search



Quick Links

User menu

Not signed in.

Misc Menu