I see two possibilities for small design improvement, worth only if implementation is simple and there is little loss of speed.
First - extending constant so it works on local bindings as well. It is less probable that one need it, however, it is not completely impossible (especially because local binding is dynamic as well) and it would make the feature more orthogonal. Constant already works in form (constant '<variable name>).
Second - extending set so it can be applied on "implicit indexing". If
(set 'X 5) = (setf X 5)
then why not
(set '(L 1) 5) = (setf (L 1) 5)?
Two small design issues
-
- Posts: 388
- Joined: Thu May 08, 2008 1:24 am
- Location: Croatia
- Contact:
Re: Two small design issues
Not sure what you mean in the first request. Is it this?
This was actually possible some years ago, but required extra checks for each symbol when restoring the old environment of the symbol on function exit. It was eventually taken out for efficiency/speed reasons.
Code: Select all
> (local (x) (constant 'x 123))
ERR: not allowed on local symbol in function constant : x
>
-
- Posts: 388
- Joined: Thu May 08, 2008 1:24 am
- Location: Croatia
- Contact:
Re: Two small design issues
Yes, it was that.
If it was turned off because of efficiency issues, OK, since it is really minor issue.
If it was turned off because of efficiency issues, OK, since it is really minor issue.