This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: unquote in quasisyntax


On 02/06/2012 12:48 PM, Jamison Hope wrote:
Another incompatibility/shortcoming when compared to R6RS/Dybvig is that
Kawa can't handle a syntax-case pattern that isn't a list with the macro
name in the first car.

It most certainly can - there are a number of examples - for example kawa/lib/syntax.scm.

What Kawa can't handle is the use of *square* brackets in definitions.
I think that could actually be fixed, without conflicting with Kawa's use
of square brackets for vector constructors, since Rackets and R6RS
use square brackets mainly for "clauses" in definitions.

I did an experiment, changing let in std_syntax.scm to:

(define-syntax let
  (syntax-rules ($bracket-apply$)
    ((let ([var . rest] ...) . body)
     (%let ((var . rest) ...) . body))
   ... as before ...

At which point this works:

(let ([x 10] [y 12]) [y x])

The above fix isn't really satisfactory, since it only works
if all or none of the clauses use brackets.  Worse, it somehow
fails while compiling list-tail in lists.scm; I don't know why.
Tweaking kawa/standard/let.java instead fixes both problems, FWIW,
though using macros would be cleaner.

I'll accept patches to accept square brackets in appropriate "clauses".
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]