skaller wrote:
> I guess that is possible to do. Do foo and bar have to exist?
> What about baz?
>
> The pro is that is enables a check on spelling, the con is
> it forces you to define an ugly tree like:
>
> namespace foo { namespace bar { namespace baz {} } }
>
> first, as a workaround. 

I think  thats a pretty small pro. The error message should be pretty 
clear if you try to access "foo::bar2::...".

> Note we can also have type variables ..
>
> namespace foo[t] { namespace bar[u] ...
>
> and even constraints:
>
> namespace foo[t] { namespace bar[u where u = t + 1] { ...

Could we do:

namespace foo::bar[t]::baz[u where u = t + 1] { ...

?

> and these have to be repeated every time either which way ..
> an alternative is not to allow them except on the first
> instance, and another is allow different names (but that's
> harder because it requires renaming them all for consistency
> in the enclosed code ;(

For the initial implementation of namespaces, I'd be fine with them not 
being generic. But if it's easy to do, then no reason to remove the 
functionality. I'd vote that you'd have to fully specify the type 
variables and constraints, if you want to use them, as thats the 
simplest solution. So:

namespace foo::bar[t]::baz[u where u = t + 1] { var x = 1; }
namespace foo::bar[t]::baz[u where u = t + 1] { var y = 1; }

I think the self-documenting features of this are pretty handy. Of 
course, having to propagate changes could get obnoxious. Do you think 
something like this would be that popular vs just using modules? If not, 
it might not be worth putting the effort into coming up with a solution.

Lastly, does this suggest that namespaces are really just open modules? 
I can't remember, do we have functors yet? If not and we add them, could 
(and should) we be able to pass a namespace to one?

-e

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to