When you enclose the x or 'x in a list expression, you see it working correctly:
Code: Select all
> (letex ((x ''y)) '('x))
(''y)
> (letex ((x ''y)) '(x))
('y)
>
Code: Select all
> (set 'x ''y)
'y
> (set 'x 'y)
y
Code: Select all
> (letex ((x ''y)) '('x))
(''y)
> (letex ((x ''y)) '(x))
('y)
>
Code: Select all
> (set 'x ''y)
'y
> (set 'x 'y)
y
which is what you were expecting.[/quote]When symbol-on-top-level expansion+evaluation is needed, than do an evaluation assignment without expansion. The 'letex' expression is then redundant:
Code: Select all
> (set 'x ''y) 'y > (set 'x 'y) y
Code: Select all
(letex((x (f)))
(letex((y (g)))
x)) ; <= we cannot know
;whether inner letex is redundant,
;because x will be replaced with (f)
;which might be known only during runtime
Code: Select all
(letex((x (f)))
(if (not (list? x))
x
(letex ((y (g)))
x)))
Code: Select all
(set 'x 123 'y 456)
(expand 'x 'x) => 123
(letex (x '(+ 3 4)) 'x) => (+ 3 4)
(letex (x '(+ 3 4)) x) => 7
Code: Select all
(unify 'S 'v) => ((S v))
Kazimir wrote:What are your favourite fonts?
I thought you might be trying for the serious look there. If you post this picture to reddit, maybe you can become a part of the whole "Sad Keanu" meme ;-)Kazimir wrote:I abandoned vehement photo because I've read somewhere that readers are less likely to return to site if they see ugly photos. On last one I tried to look serious, and I didn't seen immediately that it looks like I'm sad.