[plt-scheme] Syntax && SchemeQL

From: Toon Verwaest (verwaest at camden.be)
Date: Thu May 20 16:18:04 EDT 2004

Yes, I know it hasn't got anything to do with srpersist.
Did I say that? Well, I fixed the problem already now, 
amongst a few others (to much if you ask me :))
Maybe I should put my new ("working") version available somewhere :)

greetz&tnx,
Toon

On (20/05/04 15:41), Matthias Felleisen wrote:
> Cc: Toon Verwaest <camden at camden.be>, plt-scheme at po.cs.brown.edu
> From: Matthias Felleisen <matthias at ccs.neu.edu>
> Subject: Re: [plt-scheme] Syntax && SchemeQL
> Date: Thu, 20 May 2004 15:41:47 -0400
> To: Ryan Culpepper <ryan_sml at yahoo.com>
> 
> 
> This has nothing to do with SrPersist. When you use ` (quasiquote)
> then the , (unquote) must be physically nested inside. By the time
> you macro expand, the cons structures have been formed from
> quasiquote and unquote. -- Matthias
> 
> 
> On May 20, 2004, at 2:33 PM, Ryan Culpepper wrote:
> 
> >  For list-related administrative tasks:
> >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
> >--- Toon Verwaest <camden at camden.be> wrote:
> >>I'm trying out the SchemeQL, but it still seems to have a few
> >>bugs...
> >>One of the things I can't figure out how to fix it:
> >>
> >>  (define-syntax (add-constraint-to-table! stx)
> >>      (syntax-case stx ()
> >>            [(_ table . cons)]
> >>	    (syntax
> >>	    	(let  ((tab (quasiquote table))
> >>		       (con (quasiquote cons)))
> >>	  (if (table-definition? tab)
> >>	      (begin (set-table-definition-constraint!
> >>		      table
> >>		      (map format-table-named-constraint con))
> >>		     table)
> >>	      (raise-type-error 'add-check-to-table "table-definition
> >>structure" tab))))]))
> >>
> >>When I call this, I can send stuff to the . cons part, with
> >>unquote, but the table I can't unquote.
> >>
> >>I don't really know how the syntax-stuff works, but I would think
> >>from the (quasiquote table),
> >>that table should be able to have an unquote also..
> >>
> >>When I run it with unquote, it just says: not in quasiquote.
> >
> >I haven't examined the SchemeQL code, but this snippet looks like it
> >should be using the local variable "tab" instead of the pattern
> >variable "table" within the body of the let.
> >
> >Try replacing the code with this:
> >
> >(define-syntax (add-constraint-to-table! stx)
> >  (syntax-case stx ()
> >    [(_ table . cons)]
> >     (syntax
> >       (let  ((tab (quasiquote table))
> >              (con (quasiquote cons)))
> >         (if (table-definition? tab)
> >             (begin (set-table-definition-constraint!
> >                      tab ;; CHANGED!
> >                      (map format-table-named-constraint con))
> >                    tab) ;; CHANGED!
> >             (raise-type-error 'add-check-to-table
> >                               "table-definition structure"
> >                                tab))))]))
> >
> >Hope that helps,
> >Ryan
> >
> >
> >
> >	
> >		
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Domains ? Claim yours for only $14.70/year
> >http://smallbusiness.promotions.yahoo.com/offer
> 


Posted on the users mailing list.