[plt-scheme] alternative amb macro

From: michael rice (nowgate at yahoo.com)
Date: Sun Nov 26 11:19:29 EST 2006

Can this be accomplished with a single (simpler)
macro?

(define-syntax my-amb-aux
  (syntax-rules ()
    ((_ (quote (c1 ...)))
     (amb c1 ...))))

(define-syntax my-amb
  (syntax-rules ()
    ((_ choices)
     (my-amb-aux choices))))

Welcome to DrScheme, version 360.
Language: Swindle.
> (my-amb '(1 2 3))
1
> (amb)
2
> (amb)
3
> 

Michael


 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index


Posted on the users mailing list.