Re: routine_id() is not working

new topic     » goto parent     » topic index » view thread      » older message » newer message
useless_ said...
petelomax said...
mattlewis said...
useless_ said...

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,

But the thing is, the way Matt explained it, there is a conflict, and no error was thrown. The sleep in os could be referred to as os:sleep, but it was still in the same namespace as misc's sleep.

No error was thrown when the two files both included a sleep, and none was thrown when routine_id() was used on sleep.

Pete's explanation was a little odd, too, in that he referred to the compiler. A routine_id call is entirely handled at runtime. So it's really the interpreter dealing with this at runtime. The error is returned as -1 (albeit without much help at figuring out why).

useless_ said...

So i also suggested, and maybe to limit the scope of the post i shouldn't have, mentioned it might be more helpful for the crash-on-start to list the routine_id(sleep) lines when it found two sleeps in the same namespace.

We could add warnings, perhaps, for routine_id calls with literals that we know cannot be resolved. Since you can dynamically build the name of the routine, we obviously cannot do this for all calls to routine_id.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu