Re: psyntax and compiler extension required
Scott Miller <[email protected]>
| Newsgroups | gmane.comp.java.sisc.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sat, May 17, 2003 at 11:22:07AM +0100, Matthias Radestock wrote: > (**) > > This is a known problem. There are some Schemes, notably MzScheme, that > solve the problem by providing native support for define-values / > letrec-values(*). Doing this in SISC shouldn't be too hard. My > suggestion is to: > > > A variation on the above is to leave letrec alone and instead introduce > a native letrec-values. The macro expander would then have to either > always use letrec-values for internal definitions or, if it tries to be > smarter, use letrec if there are no internal define-values and use > letrec-values otherwise. I vote for the above. Its cleaner in the interpreter, as nothing needs to be special cased within LetrecExp. What we would need, then, is an MVLetrecEval to handle the assignment part of the letrec (note that LetrecExp can remain unaffected). If we want to support toplevel define-values, we don't really need any native support, as we *should* be able to write a macro that does the following: (define-values (a b) (values 1 2)) ; => (begin (define a) (define b) (call-with-values (lambda () (values 1 2)) (lambda (tmp1 tmp2) (set! a tmp1) (set! b tmp2)))) We would obviously need expander support for an internal define-values. Scott
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+xykbr9IW4v3mHtQRAoPGAJ4q5VjVgJY2R2XwYUXcxNytRtDknQCfXxTL dHM4k9NNFmIHLTL5OTFA1H8= =G+cV -----END PGP SIGNATURE-----