[r6rs-discuss] [Formal] body should allow mixing declarations with expressions

Chongkai Zhu czhu at cs.utah.edu
Tue Mar 13 02:52:48 EDT 2007


I just met a program that shows we do need mixing declartions:


(require (lib "plt-match.ss"))
(let ()
      (match-define (list (cons 1 m) (cons 2 n)) (list (cons 1 2) (cons 
2 3)))
      (match-define (list (cons 1 r) (cons 2 s)) (list (cons 1 2.0) 
(cons 2 3.0)))
      (list (cons 1 (* m n)) (cons 2 (* r s))))

Running it gives:

define: not allowed in an expression context in: (define r #f)

Chongkai



More information about the r6rs-discuss mailing list