mzero/plush — pull request #15 by warrenharris (2012-11-08 04:25:14+00:00)
Title: Fun

Here's a first attempt at function definitions. It mostly works, but has the problem that if export is called within a function it won't mark the variable as exported in the global context. I'd like to fix that in a subsequent change. Also, I'm setting up the function context by runStateT and copying/modifying the current state. I'm not sure this is entirely correct, and probably won't work if I get a chance to implement lambda that carry their own context.

Also, I'm not quite sure of my changes to the lexer. I had to make {}() be nonWordChars, otherwise } was being seen as a word... but maybe they should be operators? BTW, what would you think about using Text.Parsec.Language for the lexer? I think it would be really cool to support {- -} style comments that nest (maybe we could use #( ... )# syntax for them).

Also, on the git front I had some problems that I don't understand. First I pulled Evan's for branch, then created my own fun branch, then pushed them to my warren-plush repo, then edited locally, and finally tried to push again. This told me that both for and fun pushes were rejected because of non-fast-forward. So I pulled them down, and ended up with merge conflicts in both of them that I had to resolve (from where - I don't know). Anyway, you'll see that my fun branch has 2 commits on it instead of one because of this.

Warren