Re: more attempts at modifying define
| Newsgroups | gmane.comp.java.sisc.devel |
|---|---|
| Message-ID | <[email protected]> |
> > 1) can't work, AFAIK, because of how SISC expands |define| > > 2) I can't get an optimizer to load from the REPL. With a version SISC > dist: > #;> (load "file:C:/workspace/sisc/src/sisc/modules/optimizer/main.scm") > Error in load: error reading from port '#<input-port>': invalid > syntactic token > 'program'. > > 3) I can't get |eval| from init2.scm to load in the REPL. There's no > binding for _analyze! . Also, why is the first line "(set! eval" > commented out? > > 4) I'm sure I'm doing something wrong here. > (define sisc-eval eval) > (set! eval > (lambda (x . env) > (begin > (display "my eval") > (\@procedure-properties::set-procedure-property! eval 'definition > 'set) > (sisc-eval x env) > ))) > > I test it with (eval 3 (current-environment)) and it returns: > my evalError in interaction-environment: expected type environment, got > '(#<environment *toplevel*>)'. I just checked in SISC 1.9 code, which is causing your problems with 2 and 3. Check out from tag pre1_8_8 to get the 1.8 code. The last bit stems from your defining eval as (lambda (x . env), but calling sisc-eval with x env. Env is now a list because of the arity. Try (apply sisc-eval x env) instead. Scott
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAPT5Mr9IW4v3mHtQRAuE5AJ0ay5VatxDG9U5QniifeZOhrePsWwCfe7nU eL8HqMJxFZ+jvBRIshNv4gw= =r6nR -----END PGP SIGNATURE-----