help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How the backquote and the comma really work?


From: Drew Adams
Subject: RE: How the backquote and the comma really work?
Date: Fri, 26 Jun 2015 06:48:56 -0700 (PDT)

> To put a slightly different slant than the other very good answers
> on it, backquote is Lisp's take on the shell's, Perl's, Pythons
> "variable interpolation". On those languages it operates on strings,
> in Lisp it operates on S-expressions. Where in Perl you might say:
>   my $amount=200;
>   my $currency="dollars";
>   print("You owe me $amount $currency\n");
>   => You owe me 200 dollars
> 
> in Lisp you think in S-expressions. Somewhat equivalent would be
>   (setq amount 200)
>   (setq currency 'dollars) ; use a symbol, just for kicks
>   (print `(You owe me ,amount ,currency))
>   => (You owe me 200 dollars)

Good explanation.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]