[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: scheme-reports@x*Subject*: Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs*From*: "Aaron W. Hsu" <arcfide@x>*Date*: Thu, 11 Oct 2012 23:55:31 -0400*In-reply-to*: <CABzzEgkhGqyDuzDQO1=kzx-PTeMVed7hvy00u0kfJT9HSKEnOw@mail.gmail.com>*Organization*: Indiana University*References*: <20121011200614.GE11985@mercury.ccil.org> <CABzzEgk+LdM9KAkJR0FnC-9STZKJkUSN0H05_+r1SqQkE7T-AA@mail.gmail.com> <op.wl1lvcoo0p3ku8@localhost> <CABzzEgkhGqyDuzDQO1=kzx-PTeMVed7hvy00u0kfJT9HSKEnOw@mail.gmail.com>

On Thu, 11 Oct 2012 22:21:05 -0400, John Boyle <johnthescavenger@x> wrote: > Aaron, I can't get your example to run. Sorry, that was a quick one-off and not intended to be runnable (the export list is completely invalid for one). Here's an example that you can actually cut and paste as a series of libraries. (library (extended-if) (export if) (import (rename (rnrs) (if %if))) (define-syntax if (syntax-rules () [(_) (%if #f #t)] [(_ t c r ...) (%if t c (if r ...))]))) (library (example) (export result) (import (except (rnrs) if) (for (extended-if) run expand)) (define-syntax test (lambda (x) (let ([x (cadr (syntax->datum x))]) (if x 42 (not x) 24)))) (define result (list (test #t) (test #f)))) Notice that you only need the explicit FOR when you are dealing with explicit phasing systems like Racket. On systems like Chez or Vicare/Ikarus, you should be able to just specify the (extended-if) library and have things work. -- Aaron W. Hsu | arcfide@x | http://www.sacrideo.us Programming is just another word for the Lost Art of Thinking. _______________________________________________ Scheme-reports mailing list Scheme-reports@x http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

**Follow-Ups**:**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs***From:*John Cowan <cowan@x>

**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs***From:*John Boyle <johnthescavenger@x>

**References**:**[Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs***From:*John Cowan <cowan@x>

**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs***From:*John Boyle <johnthescavenger@x>

**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs***From:*"Aaron W. Hsu" <arcfide@x>

**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs***From:*John Boyle <johnthescavenger@x>

- Prev by Date:
**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs** - Next by Date:
**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs** - Previous by thread:
**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs** - Next by thread:
**Re: [Scheme-reports] Formal Response #382: Allow "if" to accept arbitrarily many if-then pairs** - Index(es):