News for hackers. Stuff that matters.
Re:Practical Emacs Lisp by kazinator on Friday September 11, 2015 @09:04PM (#10206888)
In TXR Lisp:

  $ txr -i
  1> (defvarl brackets '("(" ")" "[" "]" "<" ">")))
  brackets
  2> [brackets (range 0 : 2)]
  ("(" "[" "<")
  3> [brackets (range 1 : 2)]
  (")" "]" ">")
range generates lazy list of integers with a step size (the colon symbol defaults the second upper bound argument so the list is infinite). A list of integers can be used in the brackets notation to select elements. Put the two together and you have spaced selection.

Regarding defvarl, there is defvar too; defvarl means that the symbol is not marked special and so rebindings are lexical. Often, it is overkill for a global variable to support rebinding. We just pollute the symbol with the special marker and then have to namespace it or put earmuffs on it just in case, even though it is ever used that way.

There are no comments on this comment yet.