Proposal: variable

Started by Kazimir Majorinc, March 08, 2009, 11:02:50 AM

Previous topic - Next topic

Kazimir Majorinc

Newlisp has constant:


> (set 'x 3)
3
> (constant 'x)
3
> x
3
> (set 'x 4)

ERR: symbol is protected in function set : x
>


May I suggest variable as opposite to constant? It should be also applicable on the symbols assigned to primitives. Theoretical reasons: completeness, distinguishing concept of variable and symbol, some increase of expressive power. Practical reasons: constant can replace set, but not let, letex, expand , delete... For example, something like this is currently impossible:


(letex ((println my-print))
         my-code)


Although it clearly has sense. In the case variable is introduced, form (constant sym-1 exp-1 [...]) is redundant and it can be deprecated or not.
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.