Proposal: variable

Notices and updates
Locked
Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Proposal: variable

Post by Kazimir Majorinc »

Newlisp has constant:

Code: Select all

> (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:

Code: Select all

(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.

Locked