Skip to content

Commit

Permalink
ignore multiple-value return from interleaved init expressions in top…
Browse files Browse the repository at this point in the history
…-level-program
  • Loading branch information
owaddell-beckman committed Mar 27, 2019
1 parent ed4ca61 commit f5fd9d1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions LOG
Original file line number Diff line number Diff line change
Expand Up @@ -1251,3 +1251,6 @@
embed git revision in exported source archives
bintar/Makefile Mf-install.in wininstall/*nt.wxs
s/Mf-base s/.gitattributes s/update-revision
- ignore multiple-value return from interleaved init expressions in
top-level-program
syntax.ss, 8.ms
12 changes: 12 additions & 0 deletions mats/8.ms
Original file line number Diff line number Diff line change
Expand Up @@ -10715,6 +10715,18 @@
(remprop 'tlp-spam 'spam)
(remprop 'tlp-spam 'tlp)
#t))
; make sure we ignore return value(s) of interleaved init expressions
(equal?
(with-output-to-string
(lambda ()
; prevent cp0 from fixing the problem
(parameterize ([run-cp0 (lambda (f x) x)])
(eval '(top-level-program (import (scheme))
(define (f) (printf "hello\n") (values 1 2 3))
(f)
(define x 'world)
(pretty-print x))))))
"hello\nworld\n")
)

(mat library-meta
Expand Down
3 changes: 2 additions & 1 deletion s/syntax.ss
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,8 @@
[interleaved-init (frob)
(process-bindings mb* r
(cons (build-lexical-var no-source 't) dv*)
(cons frob de*))]
(cons (make-frob #`(begin #,(frob-e frob) (void)) (frob-meta? frob))
de*))]
[else (process-bindings mb* r dv* de*)]))))))))

(define chi-top-module
Expand Down

0 comments on commit f5fd9d1

Please sign in to comment.