Prev: Which is the best implementation of LISP family of languages for real world programming ?
Next: Which is the best implementation of LISP family of languagesfor real world programming ?
From: bolega on 10 Jun 2010 23:35 On Jun 10, 6:29 pm, Barry Margolin <bar...(a)alum.mit.edu> wrote: > In article > <a50f19e2-b95f-4bc4-b389-aa5dff67f...(a)x21g2000yqa.googlegroups.com>, > > bolega <gnuist...(a)gmail.com> wrote: > > (progn (setq y '(a b c)) (setq x 'X) (setq z 'Z)) ; some > > definitions entered inside emacs > > > (list 'list 'x 'y 'z) ; > > works with C-x C-e (1) > > (eval (list 'list 'x 'y 'z)) ; > > also works > > `( (, list) list x y z) ; > > does not work though its same as (1) > > No, it's equivalent to: > > (list (list list) 'list 'x 'y 'z) > > which will probably get an error, since the variable "list" doesn't have > a value. Remember that Emacs Lisp has separate function and value > bindings. Maybe I did not explain very well. What is the equivalent to the following in the backquote/unquote terminology. (list 'list 'x 'y 'z) Second, ' = quote ` = backquote , = ??? in elisp
From: Nick Keighley on 11 Jun 2010 06:04 On 11 June, 04:35, bolega <gnuist...(a)gmail.com> wrote: > On Jun 10, 6:29 pm, Barry Margolin <bar...(a)alum.mit.edu> wrote: > > > > > > > In article > > <a50f19e2-b95f-4bc4-b389-aa5dff67f...(a)x21g2000yqa.googlegroups.com>, > > > bolega <gnuist...(a)gmail.com> wrote: > > > (progn (setq y '(a b c)) (setq x 'X) (setq z 'Z)) ; some > > > definitions entered inside emacs > > > > (list 'list 'x 'y 'z) ; > > > works with C-x C-e (1) > > > (eval (list 'list 'x 'y 'z)) ; > > > also works > > > `( (, list) list x y z) ; > > > does not work though its same as (1) > > > No, it's equivalent to: > > > (list (list list) 'list 'x 'y 'z) > > > which will probably get an error, since the variable "list" doesn't have > > a value. Remember that Emacs Lisp has separate function and value > > bindings. > > Maybe I did not explain very well. What is the equivalent to the > following in the backquote/unquote terminology. > > (list 'list 'x 'y 'z) is '(list x y z) the answer? > Second, > > ' = quote > ` = backquote > , = ??? in elisp
From: Pascal J. Bourguignon on 11 Jun 2010 08:39
bolega <gnuist006(a)gmail.com> writes: > Maybe I did not explain very well. What is the equivalent to the > following in the backquote/unquote terminology. > > (list 'list 'x 'y 'z) There is no THE equivalent, there is an infinite number of backquote forms that would be read as an expression evaluating to the same (by equal) result than (list 'list 'x 'y 'z). Most probably, none of them would read as (list 'list 'x 'y 'z), at least, the possibility would depend on the implementation. Here are four of them, but an infinite number of combinations are possible: `(list x y z) `(,'list ,'x ,'y ,'z) `(,'list ,@'(x y z)) `(,(intern (symbol-name 'list)) ,@'(x y z)) > Second, > > ' = quote > ` = backquote > , = ??? in elisp unquote. -- __Pascal Bourguignon__ http://www.informatimago.com/ |