On Apr 5, 2009, at 9:34 PM, john skaller wrote:

> At this point some choices need to be made about lvalue stuff. In
> principle
> the idea is:
>
> a) a var is actually a pointer
> b) mutation including assignment requires a pointer
> c) offset can be added to pointers to support mutation of sub  
> components
>
> The question is what 'x' means given
>
>       var x = 1;


To play the devils advocate, do we even need lvalues? I can live  
without pre and post incrementing. We never got to finish up our  
conversation about this on #felix, so I don't completely understand  
the argument against ocaml's everything is a value but a value can  
point to a variable.

I think it depends on how functional we want felix to be. The current  
approach tries to make values and variables nearly indistinguishable.  
We can write:

fun foo (x:int) => x;
val x = 1;
println$ foo x;
val y = 2;
println$ foo y;

But I wouldn't think it'd make much of a difference for me if we had  
to write:

fun foo (x:int) => x;
val x = 1;
println$ foo x;
val y = ref 2;
println$ foo *y;

if it'd make our semantics clearer. It'd also make sense if we ever  
actually made functions are purely functional, rather than just  
assumed they were. I think it makes sense to support mutation, but I  
don't think it needs to be transparently supported.

------------------------------------------------------------------------------
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to