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

From: Jos Koot (jos.koot at telefonica.net)
Date: Thu Jul 19 06:33:57 EDT 2007

Hi Paulo,

----- Original Message ----- 
From: "Paulo J. Matos" <pocm at soton.ac.uk>
To: "Jos Koot" <jos.koot at telefonica.net>
Cc: "mzscheme Mailing List" <plt-scheme at list.cs.brown.edu>
Sent: Thursday, July 19, 2007 11:23 AM
Subject: Re: [plt-scheme] Can I abuse with quasi...quotes?


> On 19/07/07, Jos Koot <jos.koot at telefonica.net> wrote:
>> Since I don't know what your goals are, the following may be irrelevant to 
>> you.
>> Anyway, macros and language defining modules can also help a lot for formula
>> manipulation.
>
> What do you mean? You mean that for formula manipulation using macros
> would be better?

Oh no. That's not what I wanted to say. Only that it may be in some cases.
Don't attach too much value to my remark about macros, please.
Macros, or better 'transformers', may help for complicated transformations of 
sexprs, e.g. when a lot of complicated patterns are to be matched. I advice you 
to think first before spending time at this matter. The relevant question is: 
what can you do easily with transformers that would be hard to do without them? 
I dont want to sell you something you may not need at all.

Cheers, Jos Koot

> Yeah, I think I understand what you mean but I'll have to try a couple
> of things before and then I'll get back to the list. I'm sure I'll
> have some problems with macros. ;)
>
>> 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
>> > _________________________________________________
>> >  For list-related administrative tasks:
>> >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> >
>>
>>
>>
>>
>
>
> -- 
> Paulo Jorge Matos - pocm at soton.ac.uk
> http://www.personal.soton.ac.uk/pocm
> PhD Student @ ECS
> University of Southampton, UK
> 



Posted on the users mailing list.