forward routine_id (was Re: Comments on ORAC)

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

Bernie Ryan wrote:
> 
> If Euphoria did multipass parsing; then allot of routine_id complications
> could be handle internally by the interpeter.
> That would go along way to simplify the language.
> 
In fact, it's simpler than that.  Since there is now strict separation 
between compile time and runtime, and since routine_ids are evaluated only
at runtime, all of the information is available.  If you recall, when the
euphoria-in-euphoria code was first released/used (v2.5), Rob had introduced a
'bug' that allowed routine_id() to do forward referencing.  Here is the 
thread about that:

http://www.openeuphoria.org/cgi-bin/esearch.exu?thread=1&fromMonth=B&fromYear=9&toMonth=1&toYear=A&keywords=%22Secret+new+routine_id()+feature.+(Attn:+Rob)%22

It got pretty heated (at least as much as any goto thread).  I'm somewhat
fearful of where this thread will now go, but I still think it's possibly 
a worthy change.  I guess that the only problem I see is if a routine gets
overridden after the routine_id call.  How should this situation be addressed?
include foo.e
  -- foo.e
  global procedure foo()
  end procedure

? routine_id("foo")

procedure foo()
end procedure


I suppose that you only allow a forward reference if there is no 'regular' 
reference to be resolved.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu