[plt-scheme] Can I abuse with quasi...quotes?

 From: Jos Koot (jos.koot at telefonica.net) Date: Wed Jul 18 19:48:12 EDT 2007 Previous message: [plt-scheme] Can I abuse with quasi...quotes? Next message: [plt-scheme] Can I abuse with quasi...quotes? Messages sorted by: [date] [thread] [subject] [author]

```Both methods are allright and they are equivalent to each other.
In fact the quasiquote form is expanded into an expression that does the same as
In your example I dont see any abuse of quasiquote.
,@ must be followed by an expression that evaluates to a list.
This list is spliced in. This means that , at expr is replaced by the list but
without its (outer) pair of parentheses.
, at expr must be part of a list (possibly an improper list) Your correct example
makes me think that you already know this.
Good luck, Jos Koot

----- Original Message -----
From: "Paulo J. Matos" <pocm at soton.ac.uk>
To: "mzscheme Mailing List" <plt-scheme at list.cs.brown.edu>
Sent: Thursday, July 19, 2007 12:21 AM
Subject: [plt-scheme] Can I abuse with quasi...quotes?

> Hi all,
>
> I've been working a lot with propositional logic formulas where the
> operator is prefixed, like:
> '(and x1 (or x2 x3) (<=> x4 (not x1)))
>
> Now, to build formulas I'm using quasiquote and sometimes even abusing it.
> For example, given two list of variables of equal length. I do the
> following to create an assertion of equivalence between them:
> `(and ,@(map (lambda (var1 var2) `(<=> ,var1 ,var2)) varlst1 varlst2))
>
> I don't really understand what happens inside with ,@ and , but I keep
> wondering if this is better:
> (cons 'and (map (lambda (var1 var2) (list '<=> var1 var2)) varlst1 varlst2))
>
> I don't know if it matter but for the record, I don't use list
> mutation, so is this better than the first form?
> Is there a better form?
>
> Cheers,
>
> --
> Paulo Jorge Matos - pocm at soton.ac.uk
> http://www.personal.soton.ac.uk/pocm
> PhD Student @ ECS
> University of Southampton, UK
> _________________________________________________