I am looking to simplify expression
x . a
At present we have "get_a x" as one interpretation. I am thinking to get rid of
this AND
field name processing as such, so "x . a" just means "a x". This means in a
struct:
struct X { a:int; };
a is just a projection function .. in particular you can actually write
x:X = X(1);
println$ a x;
In addition
a (&x)
will be the address of x.a so you can write:
a (&x) <- v;
and thus
(&x).a = v;
It has taken a few YEARS to get to this point. The point is: now this fully
uses proper value
semantics it will nest, that is:
(&x).a.b.c = v;
will work correctly.
It remains to handle arrays nicely (arrays have other problems).
Because (&x).a now returns a pointer, the old meaning is restored
with a new operator
(&x).* a == x.a .. same as (&x)->a in C
We don't use -> because in Felix it is used for function types:
A -> B -> C
and is right associative instead of the required left associativity.
--
john skaller
[email protected]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language