Arc Forumnew | comments | leaders | submitlogin
1 point by sjs 6130 days ago | link | parent

So I guess that and thatexpr are obsoleted by this patch, no?


3 points by parenthesis 6130 days ago | link

that and ^ do the same thing (but there's also ^^, ^^^).

thatexpr is like CL + .

But (%) is like (eval thatexpr), except % is a macro that gives you what the last thing entered expanded into. And so, since % is a macro, it itself is expanded away. Hence

  arc> 2
  2
  arc> (* ^ 2)
  4
  arc> (%) ; equivalent to entering (* ^ 2) again
  8
  arc> (%) ; and again
  16
  arc> (%) ; and again
  32
Whereas

  arc> 2
  2
  arc> (* ^ 2)
  4
  arc> (eval thatexpr) ; i.e. (eval (* ^ 2))
  8
  arc> (eval thatexpr) ; i.e. (eval (eval thatexpr)) i.e. (eval (eval (eval thatexpr))) etc.
  [infinite loop]

-----