Rob idea for namespaces
Rob:
I have an idea for implementing namespaces.
When Euphoria reads in a program I assume that the routines and
functions are assigned some byte code number. The reason I assume
this is because you can get routine ID of a routine.
When you parse in a include file, you would assign a unique id
to the include file's name. This include name id would be combine
with the procedures or function id to form a unique id.
Only globals would be visible to the program. If I wished to use
a procedure or function from a include file that was not global
I would use a special procedure namespaces_id ( just like
routine_id ) that would take the include file name and
procedure/function name as arguments and return the id to call the
requested routine.
This seems like it would not be too difficult to implement since
routine_id is already implemented. You could also have a special
directive with namespaces to turn it on or off for backwords
compatability ( but that might be too complicated )
Bernie
|
Not Categorized, Please Help
|
|