loredanacirstea / taylor

Measure twice, cut once. Lisp-like functional language for computable & immutable specifications, interpreted by WebAssembly & the Ethereum Virtual Machine.
https://loredanacirstea.github.io/taylor/
GNU General Public License v3.0
37 stars 2 forks source link

Fix HOFs with native functions or lambdas #24

Open loredanacirstea opened 4 years ago

loredanacirstea commented 4 years ago

map & reduce work with stored functions. E.g. (map _myfunc (list 5 8 2)), where _myfunc is stored on-chain, works.

But they don't work with native functions (e.g. (map add (list 5 8 2))) or lambdas (e.g. (map (fn* (a) (mul (add a 1) 3)) (list 5 8 2)).

loredanacirstea commented 4 years ago

Map with native function fixed: https://github.com/loredanacirstea/taylor/commit/a5aefe6ca18db2f88723fdb18e94ebdf36320925

loredanacirstea commented 4 years ago

Reduce with native function fixed: https://github.com/loredanacirstea/taylor/commit/6b93338c01f96a6dd488557c8507abf818e2345a