Namespaces?

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

There are lots of potential problems with modifying the interpreter,
one could introduce undefined behavior or some bugs into the interpreter
itself.

I know some of the keywords will improve the experience of EUPHORIA but
changing namespace behavior so that you can use builtin names without
overriding must be too difficult for those who are getting into the
interpreter guts to do or we would have seen it already. :)

I would like to point out that you can use namespaces without overriding
builtins.  Sure connecting to an ftp site is abstractly similiar to opening
a file but you can use the function name 'connnect' instead.  Consider these
psuedocode

These identifiers you can use over and over again in some
ftp.e, http.e, map.e etc.:

type kind( object x )
-- verifies that x is the type that would be returned by connect() or new().

function connect( UnicodeString resource_string, sequence data_sequence )
-- connect to some resource that already exists.
procedure disconnect( object connectionhandle )
-- disconnect to a resource.

function new( sequence data )
-- create a new instance of something.  

function set( object x, object key, object y ) -- Sets x of key, key, to y.
-- As in a map class.

function get( object x, object key )

function exists( object x, object key )

Okay, none of these use reserved names and they are short you use namespaces
with them all.  There is no need to modify how EUPHORIA does namespacing
because they do not use any names from the builtins.

include get.e as get
include ftp.e as ftp
include http.e as http
-- everyone is happy.  Right?

Shawn Pringle

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

Search



Quick Links

User menu

Not signed in.

Misc Menu