Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add closures to leema #19

Closed
mdg opened this issue Sep 18, 2018 · 3 comments
Closed

add closures to leema #19

mdg opened this issue Sep 18, 2018 · 3 comments
Assignees

Comments

@mdg
Copy link
Owner

mdg commented Sep 18, 2018

Need to be able to make and return closures.
These will be also be used in asynchronous forks.

Still need to work out some of the syntax. Maybe something like:

func make_inc(): Int => Int ->
   fn(x) -> x + 1 --
--

or in the alternative model described in #16

func make_inc: Int -> Int
>>
   fn(x) >> x + 1 --
--

func make_inc_short: Int -> Int
>>
   fn(x) x + 1
--
@mdg mdg self-assigned this Sep 18, 2018
mdg added a commit that referenced this issue Sep 19, 2018
also included a basic skeleton for preprocessing closures
still needs to actually generate functions tho
github issue #19
@mdg
Copy link
Owner Author

mdg commented Sep 19, 2018

pausing this for now while looking at adding currying in #20 which I hope will make this easier

@mdg mdg removed their assignment Sep 19, 2018
@mdg
Copy link
Owner Author

mdg commented Sep 24, 2018

back on this now b/c looks like it's easier to implement currying in terms of closures rather than the other way around.

@mdg mdg self-assigned this Sep 24, 2018
mdg added a commit that referenced this issue Sep 25, 2018
put parens when printing function types w/ function params
improve output for leema tokens and leema ast commands
add Display for Ast
added a test to show fn(x) x + 2 tries to add 2 to a function
github issue #19
mdg added a commit that referenced this issue Sep 25, 2018
fn(x) x + 1 now parses as fn(x) (x+1) instead of (fn(x) x) + 1

github issue #19
mdg added a commit that referenced this issue Sep 25, 2018
mdg added a commit that referenced this issue Sep 25, 2018
mdg added a commit that referenced this issue Sep 26, 2018
variables are almost being brought in now
issue #19
mdg added a commit that referenced this issue Sep 26, 2018
and initialize closure data as Void during compilation
issue #19
mdg added a commit that referenced this issue Sep 26, 2018
doesn't work yet, but fixed all the compile errors and
need to checkpoint before debugging
issue #19
mdg added a commit that referenced this issue Sep 26, 2018
removed the args field from Op::ApplyFunc, just use the one inside
the funcref from now on
issue #19
mdg added a commit that referenced this issue Sep 26, 2018
recovery blocks should do that well enough now
issue #19
mdg added a commit that referenced this issue Sep 27, 2018
now recovered to before the func/closure merge I think
issue #19
mdg added a commit that referenced this issue Sep 27, 2018
seems like a fluke, but I'm committing it
add a closure call to T/test_closers.lma
issue #19
mdg added a commit that referenced this issue Sep 29, 2018
40 some commits to add closures
issue #19
@mdg
Copy link
Owner Author

mdg commented Sep 29, 2018

@mdg mdg closed this as completed Sep 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant