Two small design issues

Pondering the philosophy behind the language
Locked
Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Two small design issues

Post by Kazimir Majorinc »

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)?

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Two small design issues

Post by Lutz »

Not sure what you mean in the first request. Is it this?

Code: Select all

> (local (x) (constant 'x 123))

ERR: not allowed on local symbol in function constant : x
> 
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.

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

Re: Two small design issues

Post by Kazimir Majorinc »

Yes, it was that.
If it was turned off because of efficiency issues, OK, since it is really minor issue.

Locked