Re: . or : for namespace?
Mike wrote:
>
> Jeremy Cowgar wrote:
> >
> > The next argument against it is that if we use . for a namespace delimiter,
> > then we cannot use it for a future structured sequence? that we cannot seem
> > to agree what it should look like. However, again, . is used in other
> > languages as the namespace delimiter, object delimiter and structure
> > delimiter as well w/o problem,
>
> I think dot-notation for sequence access is a good thing and that the majority
> of users would agree, in fact, expect it to happen. However, this will produce
> a semantic anomaly if . is used as the namespace delimiter, eg:
>
> a.b.c
>
> What does this mean? If I have just written the code, I know exactly. If I
> had to read 3rd party code or my own code 6 months later, I don't know
> without further investigation. Is it simply a sequence access or is it a
> namespaced sequence access?
Yes, I still think that this is the strongest argument against changing to
the dot. Other languages may do this, but that doesn't mean that it's a
good idea for euphoria. There are other things that some languages allow,
which also promote errors, such as:
if( x = foo()) -- assignment x = foo(), and test the value of x
-- vs
if( x == foo()) -- test value of x against return value of foo()
Structured data access (with whatever extra OO flavors) is probably the next
evolutionary stage of euphoria.
Matt
|
Not Categorized, Please Help
|
|