Re: [Felix-language] Namespaces

2007-09-23 Thread skaller
On Mon, 2007-09-24 at 06:08 +1000, skaller wrote: Hmmm .. how about translating this: > namespace Foo { val a = 1; } > namespace Foo { val b = 2; } > moduleFoo::Bar { val c = 3; } > > println Foo::a; > println Foo::b; > println Foo::Bar::c; > > open Foo; > println a; > println b;

[Felix-language] Namespaces

2007-09-23 Thread skaller
Namespaces in Felix don't work as might be expected: What happens everything in a namespace is collated in order of writing, then the namespaces initialisations are executed first in order of introduction of the namespace, and then order of writing. This is just as if all the stuff in a namespac

Re: [Felix-language] namespaces

2007-01-15 Thread skaller
On Fri, 2007-01-12 at 13:28 -0800, Erick Tryzelaar wrote: > Could we do: > > namespace foo::bar[t]::baz[u where u = t + 1] { ... > > ? This should work now, a bit painful, but almost everything is converted. Known exceptions: * parallel initialisations var X::a,Y::b,Z::c = 1,2,3; // and the v

Re: [Felix-language] namespaces

2007-01-15 Thread skaller
On Fri, 2007-01-12 at 13:28 -0800, Erick Tryzelaar wrote: > skaller wrote: [] Ok, this now works for functions and procedures ONLY at the moment: // #import print "b4 fred"; endl; namespace fred { print "fred1 start"; endl; var x = 1; p

Re: [Felix-language] namespaces

2007-01-12 Thread Erick Tryzelaar
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

Re: [Felix-language] namespaces

2007-01-12 Thread skaller
On Fri, 2007-01-12 at 11:42 -0800, Erick Tryzelaar wrote: > skaller wrote: > > I have just added a first cut of namespaces to felix. > > It is fairly crude: > > Great! That can be a big help for the standard library. One thing I > always wished c++ had for shorthand namespaces is something like:

Re: [Felix-language] namespaces

2007-01-12 Thread Erick Tryzelaar
skaller wrote: > I have just added a first cut of namespaces to felix. > It is fairly crude: Great! That can be a big help for the standard library. One thing I always wished c++ had for shorthand namespaces is something like: namespace foo::bar::baz { ... } which would be sugar for: namesp

[Felix-language] namespaces

2007-01-12 Thread skaller
I have just added a first cut of namespaces to felix. It is fairly crude: // #import print "b4 fred"; endl; namespace fred { print "fred1 start"; endl; var x = 1; proc f() { print "f"; endl; } print "fred1 end"; endl; } print "between freds "; endl;