Hi,

why this does not work with DrRacket:

#lang racket
(define-syntax then
  (syntax-rules ()
    ((_ ev)  ev)
    ((_ ev ...) (begin ev ...))))

(define-syntax else
  (syntax-rules ()
    ((_ ev)  ev)
    ((_ ev ...) (begin ev ...))))

(if #f
    (then 
     1
     2
     3)
    (else
     3
     4
     5))

(cond (#f 'never)
      (else 'always))

. else: bad syntax in: else

it works with others schemes as in bigloo or kawa:

------------------------------------------------------------------------------
Bigloo (4.1a)                                                            ,--^, 
`a practical Scheme compiler'                                      _ ___/ /|/  
Sam 26 sep 2015 04:59:46 CEST                                  ,;'( )__, ) '   
Inria -- Sophia Antipolis                                     ;;  //   L__.    
email: big...@lists-sop.inria.fr                              '   \    /  '    
url: http://www-sop.inria.fr/indes/fp/Bigloo                       ^   ^       
------------------------------------------------------------------------------


1:=> (define-syntax then
  (syntax-rules ()
    ((_ ev)  ev)
    ((_ ev ...) (begin ev ...))))
#unspecified
1:=> (define-syntax else
  (syntax-rules ()
    ((_ ev)  ev)
    ((_ ev ...) (begin ev ...))))
#unspecified
1:=> (if #f
    (then 
     1
     2
     3)
    (else
     3
     4
     5))
5
1:=> (cond (#f 'never)
      (else 'always))
always

Damien

-- 
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