The following program:

#!r6rs
(import (rnrs))
(with-syntax ((a 1))
  (define b 1)
  (write 2))

fails with:

;;; note: source file /home/marco/var/tmp/proof.sps
;;;       newer than compiled 
/home/marco/.cache/guile/ccache/2.0-LE-4-2.0/home/marco/var/tmp/proof.sps.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/marco/var/tmp/proof.sps
;;; WARNING: compilation of /home/marco/var/tmp/proof.sps failed:
;;; key syntax-error, throw_args (#f "definition in expression context" #f 1 b)
module/ice-9/psyntax.scm:896:30: In procedure dobody:
module/ice-9/psyntax.scm:896:30: Syntax error:
unknown location: definition in expression context in subform b of 1

but it is my understanding  that WITH-SYNTAX has a body like
let.
-- 
Marco Maggi

Reply via email to