emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] What is `, (backquote comma)?
@ 2011-09-21 17:37 Thorsten
  2011-09-21 18:42 ` Nick Dokos
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Thorsten @ 2011-09-21 17:37 UTC (permalink / raw)
  To: emacs-orgmode

Hi List, 

in org-babel-expand-body:scheme (and
e.g. org-babel-expand-body:emacs-lisp) I encounter something like this:

(lambda (var)  (format "%S" (print `(,(car var) ',(cdr var)))))
	
While this part
`(,(car var) ...)
is explained in the manual (backquote and unquote), this part
`(... ',(cdr var))
is a bit mysterious to me, and I do not find information about
backquote( ... backquote comma ())
in the manuals or the web.

Is that Emacs Lisp? What does that mean?
Cheers
Thorsten
   

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 17:37 [babel] What is `, (backquote comma)? Thorsten
@ 2011-09-21 18:42 ` Nick Dokos
  2011-09-21 18:45 ` Nick Dokos
  2011-09-21 18:46 ` Štěpán Němec
  2 siblings, 0 replies; 10+ messages in thread
From: Nick Dokos @ 2011-09-21 18:42 UTC (permalink / raw)
  To: Thorsten; +Cc: nicholas.dokos, emacs-orgmode

Thorsten <quintfall@googlemail.com> wrote:

> Hi List, 
> 
> in org-babel-expand-body:scheme (and
> e.g. org-babel-expand-body:emacs-lisp) I encounter something like this:
> 
> (lambda (var)  (format "%S" (print `(,(car var) ',(cdr var)))))
> 	
> While this part
> `(,(car var) ...)
> is explained in the manual (backquote and unquote), this part
> `(... ',(cdr var))
> is a bit mysterious to me, and I do not find information about
> backquote( ... backquote comma ())
> in the manuals or the web.
> 
> Is that Emacs Lisp? What does that mean?

If you write it like this:

`(,(car var) (quote ,(cdr var)))

does it become clearer? This form is equivalent to the previous one.

Nick

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 17:37 [babel] What is `, (backquote comma)? Thorsten
  2011-09-21 18:42 ` Nick Dokos
@ 2011-09-21 18:45 ` Nick Dokos
  2011-09-21 18:46 ` Štěpán Němec
  2 siblings, 0 replies; 10+ messages in thread
From: Nick Dokos @ 2011-09-21 18:45 UTC (permalink / raw)
  To: Thorsten; +Cc: nicholas.dokos, emacs-orgmode

Thorsten <quintfall@googlemail.com> wrote:

> Hi List, 
> 
> in org-babel-expand-body:scheme (and
> e.g. org-babel-expand-body:emacs-lisp) I encounter something like this:
> 
> (lambda (var)  (format "%S" (print `(,(car var) ',(cdr var)))))
> 	
> While this part
> `(,(car var) ...)
> is explained in the manual (backquote and unquote), this part
> `(... ',(cdr var))
> is a bit mysterious to me, and I do not find information about
> backquote( ... backquote comma ())

BTW, the second tick is a quote, not a backquote.

Nick

> in the manuals or the web.
> 
> Is that Emacs Lisp? What does that mean?
> Cheers
> Thorsten
>    
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 17:37 [babel] What is `, (backquote comma)? Thorsten
  2011-09-21 18:42 ` Nick Dokos
  2011-09-21 18:45 ` Nick Dokos
@ 2011-09-21 18:46 ` Štěpán Němec
  2011-09-21 19:05   ` Thorsten
  2 siblings, 1 reply; 10+ messages in thread
From: Štěpán Němec @ 2011-09-21 18:46 UTC (permalink / raw)
  To: Thorsten; +Cc: emacs-orgmode

On Wed, 21 Sep 2011 19:37:42 +0200
Thorsten wrote:

> in org-babel-expand-body:scheme (and
> e.g. org-babel-expand-body:emacs-lisp) I encounter something like this:
>
> (lambda (var)  (format "%S" (print `(,(car var) ',(cdr var)))))
> 	
> While this part
> `(,(car var) ...)
> is explained in the manual (backquote and unquote), this part
> `(... ',(cdr var))
> is a bit mysterious to me, and I do not find information about
> backquote( ... backquote comma ())
> in the manuals or the web.
>
> Is that Emacs Lisp? What does that mean?

Note it's not "`,", which would indeed be a no-op, but "',", which here
means "evaluate the form after "," and quote the result", IOW, the "'"
is just left there (for the same reason you also get to see the even
more funny-looking "`'," and other variations sometimes). Really nothing
new if you've read the backquote section of the Elisp manual.

-- 
Štěpán

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 18:46 ` Štěpán Němec
@ 2011-09-21 19:05   ` Thorsten
  2011-09-21 19:26     ` Štěpán Němec
  2011-09-21 19:48     ` Jambunathan K
  0 siblings, 2 replies; 10+ messages in thread
From: Thorsten @ 2011-09-21 19:05 UTC (permalink / raw)
  To: emacs-orgmode

Štěpán Němec <stepnem@gmail.com> writes:

> On Wed, 21 Sep 2011 19:37:42 +0200
> Thorsten wrote:
>
>> in org-babel-expand-body:scheme (and
>> e.g. org-babel-expand-body:emacs-lisp) I encounter something like this:
>>
>> (lambda (var)  (format "%S" (print `(,(car var) ',(cdr var)))))
>> 	
>> While this part
>> `(,(car var) ...)
>> is explained in the manual (backquote and unquote), this part
>> `(... ',(cdr var))
>> is a bit mysterious to me, and I do not find information about
>> backquote( ... backquote comma ())
>> in the manuals or the web.
>>
>> Is that Emacs Lisp? What does that mean?
>
> Note it's not "`,", which would indeed be a no-op, but "',", which here
> means "evaluate the form after "," and quote the result", IOW, the "'"
> is just left there (for the same reason you also get to see the even
> more funny-looking "`'," and other variations sometimes). Really nothing
> new if you've read the backquote section of the Elisp manual.

thanks Nick and Stepan, 

"evaluate the form after "," and quote the result"

that made me understand what its all about. 
I just read the backquote section Elisp manual, it does not cover these
strange combiniations of barely distinguable characters, but I may haved
missed it - its a thick book. 

Cheers
Thorsten

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 19:05   ` Thorsten
@ 2011-09-21 19:26     ` Štěpán Němec
  2011-09-22  2:53       ` Jude DaShiell
  2011-09-21 19:48     ` Jambunathan K
  1 sibling, 1 reply; 10+ messages in thread
From: Štěpán Němec @ 2011-09-21 19:26 UTC (permalink / raw)
  To: Thorsten; +Cc: emacs-orgmode

On Wed, 21 Sep 2011 21:05:12 +0200
Thorsten wrote:

> thanks Nick and Stepan, 
>
> "evaluate the form after "," and quote the result"
>
> that made me understand what its all about. 
> I just read the backquote section Elisp manual, it does not cover these
> strange combiniations of barely distinguable characters, but I may haved
> missed it - its a thick book.

You haven't missed anything. My point was that "the pieces are all
there" -- as Nick pointed out by the rewriting, 'foo is just a
convenient read syntax for (quote foo), so there's nothing special or
new about `',foo, it's still manipulating a list structure in a way the
manual describes.

I'm sure you can find more resources on the net, as the same notation is
used in other Lisps, in particular Common Lisp and Scheme.

Two examples I know of:
http://www.lispworks.com/documentation/HyperSpec/Body/02_df.htm
http://bc.tech.coop/blog/041205.html

(And by the way, if you really find ' and ` "barely distinguishable",
perhaps you might consider using another font? It's an important
distinction to make, as you've now found. ;-))

-- 
Štěpán

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 19:05   ` Thorsten
  2011-09-21 19:26     ` Štěpán Němec
@ 2011-09-21 19:48     ` Jambunathan K
  2011-09-21 22:02       ` Thorsten
  2011-09-22  7:10       ` peter.frings
  1 sibling, 2 replies; 10+ messages in thread
From: Jambunathan K @ 2011-09-21 19:48 UTC (permalink / raw)
  To: Thorsten; +Cc: emacs-orgmode


I learnt more about all the strange looking `', creatures by cursorily
reading the first link and casually looking at the flip-flop diagram
seen on the second link.

http://www.lisperati.com/syntax.html
http://www.lisperati.com/looking.html

I am surprised that a book that seems so playful could convey a
fundamental/foundational idea in such simple and succinct terms.

IMO, Elisp manual is too dense here to be really useful.

Jambunathan K.
-- 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 19:48     ` Jambunathan K
@ 2011-09-21 22:02       ` Thorsten
  2011-09-22  7:10       ` peter.frings
  1 sibling, 0 replies; 10+ messages in thread
From: Thorsten @ 2011-09-21 22:02 UTC (permalink / raw)
  To: emacs-orgmode

Jambunathan K <kjambunathan@gmail.com> writes:

> I learnt more about all the strange looking `', creatures by cursorily
> reading the first link and casually looking at the flip-flop diagram
> seen on the second link.
>
> http://www.lisperati.com/syntax.html
> http://www.lisperati.com/looking.html
>
> I am surprised that a book that seems so playful could convey a
> fundamental/foundational idea in such simple and succinct terms.
>
> IMO, Elisp manual is too dense here to be really useful.
>
> Jambunathan K.


Nice links, thank you!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 19:26     ` Štěpán Němec
@ 2011-09-22  2:53       ` Jude DaShiell
  0 siblings, 0 replies; 10+ messages in thread
From: Jude DaShiell @ 2011-09-22  2:53 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: emacs-orgmode, Thorsten

another, post-el.On Wed, 21 Sep 2011, ?t?p?n N?mec wrote:

> On Wed, 21 Sep 2011 21:05:12 +0200
> Thorsten wrote:
> 
> > thanks Nick and Stepan, 
> >
> > "evaluate the form after "," and quote the result"
> >
> > that made me understand what its all about. 
> > I just read the backquote section Elisp manual, it does not cover these
> > strange combiniations of barely distinguable characters, but I may haved
> > missed it - its a thick book.
> 
> You haven't missed anything. My point was that "the pieces are all
> there" -- as Nick pointed out by the rewriting, 'foo is just a
> convenient read syntax for (quote foo), so there's nothing special or
> new about `',foo, it's still manipulating a list structure in a way the
> manual describes.
> 
> I'm sure you can find more resources on the net, as the same notation is
> used in other Lisps, in particular Common Lisp and Scheme.
> 
> Two examples I know of:
> http://www.lispworks.com/documentation/HyperSpec/Body/02_df.htm
> http://bc.tech.coop/blog/041205.html
> 
> (And by the way, if you really find ' and ` "barely distinguishable",
> perhaps you might consider using another font? It's an important
> distinction to make, as you've now found. ;-))
> 
> 

Jude <jdashiel@shellworld.net>
"I love the Pope, I love seeing him in his Pope-Mobile, his three feet
of bullet proof plexi-glass. That's faith in action folks! You know he's
got God on his side."
~ Bill Hicks

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [babel] What is `, (backquote comma)?
  2011-09-21 19:48     ` Jambunathan K
  2011-09-21 22:02       ` Thorsten
@ 2011-09-22  7:10       ` peter.frings
  1 sibling, 0 replies; 10+ messages in thread
From: peter.frings @ 2011-09-22  7:10 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode, Thorsten


On 21 Sep 2011, at 21:48, Jambunathan K wrote:

> I learnt more about all the strange looking `', creatures by cursorily
> reading the first link and casually looking at the flip-flop diagram
> seen on the second link.
> 
> http://www.lisperati.com/syntax.html
> http://www.lisperati.com/looking.html
> 
> I am surprised that a book that seems so playful could convey a
> fundamental/foundational idea in such simple and succinct terms.

I can heartily recommend the book “Land Of Lisp”, by the same author.


Cheers,
Peter
-- 
You can use an eraser on the drawing table, 
or a sledge hammer on the construction site. 
                                — Frank Lloyd Wright

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-09-22  7:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 17:37 [babel] What is `, (backquote comma)? Thorsten
2011-09-21 18:42 ` Nick Dokos
2011-09-21 18:45 ` Nick Dokos
2011-09-21 18:46 ` Štěpán Němec
2011-09-21 19:05   ` Thorsten
2011-09-21 19:26     ` Štěpán Němec
2011-09-22  2:53       ` Jude DaShiell
2011-09-21 19:48     ` Jambunathan K
2011-09-21 22:02       ` Thorsten
2011-09-22  7:10       ` peter.frings

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).