[plt-scheme] PLT 399, keyword arguments and SRFI 26

From: Dave Gurnell (d.j.gurnell at gmail.com)
Date: Fri Jan 18 13:53:41 EST 2008

Hi all,

I'm converting some code from PLT 37x to the scheme/base language in  
PLT v399, and I'm getting a rather odd error. When I combine keywords  
and the "cut" macro I get an error message. For example:

   1  #lang scheme/base
   2
   3  (require srfi/26/cut)
   4
   5  (define (add #:a a #:b b)
   6    (+ a b))
   7
   8  (define add2
   9    (cut add #:a <> #:b 2))
   10
   11 (display (add2 1))

I get the following error message (in this example at line 9):

   #%datum: keyword used as an expression in: #:a

It doesn't seem like this should cause a problem because AFAIK "cut"  
rewrites to a simple lambda. However, it did occur to me that the  
lambda in the mzscheme language (in which "cut.ss" is presumably  
written) is different to the lambda from scheme/base. Is this the  
source of the problem or am I barking up the wrong tree?

It'd be really nice to convince cut to work with keyword lambdas - I  
use it *everywhere*.

Cheers,

-- Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080118/41341139/attachment.html>

Posted on the users mailing list.