diff options
author | David Robillard <d@drobilla.net> | 2010-12-25 09:24:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-25 09:24:48 +0000 |
commit | 6dec2bd33e6c142664c881405bdc0f9b298e4a11 (patch) | |
tree | 8cc17f033c145f2a9467a2c2f56ee7b015fc1a03 /src/repl.cpp | |
parent | c1ee499d0b14be87b5f5664448507026b9b87fd6 (diff) | |
download | resp-6dec2bd33e6c142664c881405bdc0f9b298e4a11.tar.gz resp-6dec2bd33e6c142664c881405bdc0f9b298e4a11.tar.bz2 resp-6dec2bd33e6c142664c881405bdc0f9b298e4a11.zip |
Simplify let to fn, rather than deal with it through to compilation.
The previous implementation of let was a premature optimization intended to make let cheap/free, but screws up closure creation and variable indexing because a new scope is created by something other than fn.
Only compile top level expressions to globals (with associated store/retrieve overhead) in a REPL when it is necessary.
Add `do' form (ala scheme `begin') to backend (used by `match' simplify).
git-svn-id: http://svn.drobilla.net/resp/resp@348 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/repl.cpp')
-rw-r--r-- | src/repl.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/repl.cpp b/src/repl.cpp index 063f1e7..d5d78a6 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -177,6 +177,8 @@ eval(CEnv& cenv, Cursor& cursor, istream& is, bool execute) int repl(CEnv& cenv) { + cenv.repl = true; + const AST* exp = NULL; const AST* ast = NULL; const string replFnName = cenv.penv.gensymstr("_repl"); |