Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: A small backquote logjam

0 views
Skip to first unread message

bolega

unread,
Jun 10, 2010, 11:35:02 PM6/10/10
to
On Jun 10, 6:29 pm, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article
> <a50f19e2-b95f-4bc4-b389-aa5dff67f...@x21g2000yqa.googlegroups.com>,
>
>  bolega <gnuist...@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

Nick Keighley

unread,
Jun 11, 2010, 6:04:35 AM6/11/10
to

is

'(list x y z)

the answer?

Pascal J. Bourguignon

unread,
Jun 11, 2010, 8:39:21 AM6/11/10
to
bolega <gnui...@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/

0 new messages