2010/12/10 Davis Herring
<address@hidden>
> If, in my loss of knowledge , emacs can make lexical scope, how do you
> re-write this chunk of Scheme code in elisp ?
>
> (define (create-tab x)
> (lambda (m)
> (cond ((equal? m ':init)
> (display (string-append x ":init") ) )
> ((equal? m ':activate)
> (display (string-append x ":activate") ) ) ) ) )
In the absence of lexbind, just put ` before the (lambda and , before each x.
(defun create-tab (x)
`(lambda (m)
(cond ((equal m ':init)
(message (concat ,x ":init") ) )
((equal m ':activate)
(message (concat ,x ":activate") ) ) ) ) )
(setq tab (create-tab "xxx"))
(funcall tab :init)
LOL. It works :).
Alin