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

From: Chongkai Zhu <czhu>
Date: Tue Mar 13 01:53:32 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
Received on Tue Mar 13 2007 - 02:52:48 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC