On Wed, Feb 16, 2011 at 8:25 AM, Brian Lavender <[email protected]> wrote: > I have been reading "Essentials of Programming Languages" and I came > across the following sample code. What does the backtick do? > > brian > > ;; var-exp : Var -> Lc-exp > (define var-exp > (lambda (var) > `(var-exp ,var))
It's analogous to the distinction between single-quotes strings and double-quoted strings in many popular scripting languages. Where '(var-exp var) would create a list with 2 items, the second of which is the var atom, analogous to 'var-exp var', `(var-exp ,var) creates a list, and interpolates the items preceded by commas, analogous to "var-exp $var". --Ken _______________________________________________ vox-tech mailing list [email protected] http://lists.lugod.org/mailman/listinfo/vox-tech
