Re: "eval"?
Matthias Blume <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
The easiest way is to use Backend.Interact.useStream. (Just open Backend.Interact to see the signature.) The trick is to arrange for some ref-cell of known type to be in scope (bound at the interactive toplevel), and have the code that you send to useStream set that ref cell. This way you can later get access to the value. A bit more tricky is using Backend.Interact.evalStream, since you have to provide an explicit environment. You will have to make use of structure EnvRef to get access to the various environments that the toplevel loop manipulates. (Just say open EnvRef.) See sml/base/compiler/TopLevel/interact/* for more info on what's going on. (This is in 110.60.) Hope this helps... Matthias On Nov 23, 2006, at 10:49 AM, Geoffrey Alan Washburn wrote: > > Is there a straightforward way to implement something a little like > Scheme, etc. "eval" using the visable compiler? I've looked some > at the > signatures, but I haven't been able to puzzle anything out based upon > the types alone. > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Smlnj-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/smlnj-list > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV