Hi,

i have this macro which is not R5RS compliant and passes in Racket (6.1) with 
#lang r5rs selected ? 
the ellipsis is not the last argument has it must be in R5RS,
perheaps it has been corrected in newer version of Racket or there is another 
explains?

regards,

damien

#lang r5rs
;;#lang racket
;; CASE adapted for string comparison
;;
;; (load "/home/mattei/Dropbox/git/LOGIKI/lib/case.scm")
;; works with Kawa but not  Bigloo not, not R5RS 
(define-syntax case-string
  
  (syntax-rules ( => )
    

    ;; (define dog "dog")
    ;; (case-string dog (("dog") "animal")   (else => "mineral or vegetable"))
    ((case-string var
                  lst
                  (else => res-else  ...))
     
     (if (member var (car (quote lst)))
           (cadr (quote lst))
           (begin
             res-else
             ...)))
  
    ;; (define cat "cat")
    ;; (case-string cat (("dog") "animal") (("cat") "my daughter say cats are 
not animals!")  (else => "mineral or vegetable"))
    ((case-string var
                  lst
                  lst2
                  ...
                  (else => res-else ...))
     
     (if (member var (car (quote lst)))
         (cadr (quote lst))
         (case-string var
                      lst2
                      ...
                      (else => res-else ...))))
  
   

    ;;(case-string dog  (else => "silly case"))
    ((case-string var
                  (else => res-else ...)) 
     
     (begin
       res-else
       ...))))

-- 
damien.mat...@unice.fr, damien.mat...@oca.eu, UNS / OCA / CNRS

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to