Re: routine_id() is not working
- Posted by petelomax Apr 11, 2013
- 1760 views
since the sleep in os.e is already namespaced away from misc.e,
That's not quite how euphoria namespaces work.
Yes, that "already namespaced away" struck me as a very odd thing to say. My tuppenceworth:
If the compiler finds a conflict, it cannot, repeat CANNOT, arbitrarily pick one of them - or at least would drive you absolutely nuts if it did.
There is no way that a namespace of any kind can somehow make one of them "the default".
A namespace is a qualifier which tells the compiler, explicitly, which one to use when there is such a conflict. No more, no less.
I can see a benefit from throwing an error when routine_id returns -1, but this seems like something that could significantly break a lot of code, so we'd probably need a way to toggle this behavior.
Agreed. I would suggest either:
id = routine_id("sleep") if id=-1 then puts(1,get_last_routine_id_error_description()) ?9/0 end if
or add a new optional parameter
id = routine_id("sleep",fail_on_error:=True)
Pete

