[gambit-list] Conflict bewteen #<<c-declare-end and syntax-case?

Marc Feeley feeley at iro.umontreal.ca
Wed Feb 7 20:06:00 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 7-Feb-07, at 7:46 PM, Raffael Cavallaro wrote:

> A simple example will show the problem I'm running into - is there  
> any workaround?
>
> rafimac:/scheme raffaelc$ cat test.scm
> (c-declare #<<c-declare-end
>         double test(double afloat, double anotherfloat) {
>         return  (afloat + anotherfloat);
> }
> c-declare-end
> )
>
> (define test
>         (c-lambda (double double)
>         double
>         "test"))rafimac:/scheme raffaelc$
> rafimac:/scheme raffaelc$ gsc
> Gambit Version 4.0 beta 20
>
> > (compile-file "/scheme/test.scm")
> #t
> > (load "/scheme/test")
> "/scheme/test.o1"
> > (test 2.0 2.0)
> 4.
> > (exit)
> rafimac:/scheme raffaelc$ gsc
> Gambit Version 4.0 beta 20
>
> > (load "~~/syntax-case")
> "/usr/local/Gambit-C/4.0b20/syntax-case.scm"
> > (compile-file "/scheme/test.scm")
> *** ERROR IN "/scheme/test.scm"@1.1 -- Argument to 'c-declare' must  
> be a string
> #f
> >

That's a problem with the syntax-case expander, it has nothing to do  
with the #<< syntax.  Unfortunately the syntax-case expander turns  
things like

    (foo "abc")

into

    (foo '"abc")

which is incorrect when foo is c-declare, or include, etc.  It's  
probably easy to fix for the implementors of syntax-case (Dybvig et  
al), but I shudder at the thought of figuring out which of the over  
40 usages of 'quote in syntax-case.scm has to be made conditional on  
the object being quoted (the quote should be dropped for strings,  
numbers, booleans, and characters).

Marc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFynd4//V9Zc2T/v4RAhyNAKC8X9KfBpALTJ8zNRD6MU0OPduCJwCeLp9R
EMYPepsEsIL8d6jHuRn5on4=
=/b5u
-----END PGP SIGNATURE-----



More information about the Gambit-list mailing list