kleopatra999 / owl-lisp

Automatically exported from code.google.com/p/owl-lisp
3 stars 1 forks source link

Add support for variable arity lambdas, case-lambda and apply #126

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There are a few reasonable options
 - support R7RS
    + cons: further away from LC, makes types messier
    + pros: would make owl and scheme intersection much larger
 - as is
    + cons: essentially worst of both worlds
    + minor pros: arity errors get caught easily at runtime
 - allow currying
    + cons: not R7RS, arity errors effectively need some type inference
    + pros: good for type inference, closer to LC

Original issue reported on code.google.com by aohelin on 15 Jan 2012 at 10:19

GoogleCodeExporter commented 9 years ago
Sigh. Currying feels like a lot better in the functional setting, and type 
inference is on the long-term todo list... WontFixing.

Original comment by aohelin on 20 Feb 2012 at 8:30

GoogleCodeExporter commented 9 years ago
Back from the dead.

Original comment by aohelin on 1 May 2012 at 3:24

GoogleCodeExporter commented 9 years ago
Ok, importance of type inference dropped a lot after noticing how powerful even 
simple randomized tests are, so in name of Scheme compatibility variable arity 
lambdas and apply will most likely be added. This will likely hurt...

Original comment by aohelin on 1 May 2012 at 3:56

GoogleCodeExporter commented 9 years ago

Original comment by aohelin on 1 May 2012 at 3:57

GoogleCodeExporter commented 9 years ago
The best (and most painful) option seems to be to support only case-lambda 
natively, drop the current one, and also somehow future proof the dispatch code 
to be able to handle pattern matching. 

Looks like this will involve a lot of rewriting and rethinking all over the 
place... but might be worth it.

Original comment by aohelin on 1 May 2012 at 4:43

GoogleCodeExporter commented 9 years ago

Original comment by aohelin on 5 May 2012 at 1:30

GoogleCodeExporter commented 9 years ago
Changed function calling protocol (and broke C macroinstruction compiler for a 
while in the process), added support for easy cases of variable arity and fixed 
case-lambda so far. Some work still be done to handle all combinations of fixed 
point computation & CPS w/ variable case-lambda arities, but it should be 
possible to start Schemeifying standard functions in a few days.

Original comment by aohelin on 9 May 2012 at 12:19

GoogleCodeExporter commented 9 years ago

Original comment by aohelin on 9 May 2012 at 12:24

GoogleCodeExporter commented 9 years ago
VM and C- and bytecode compiler can do simple cases of variable arity, which is 
already used for +, min, etc. Splitting the remaining issues as distinct bugs.

Original comment by aohelin on 13 May 2012 at 5:20