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

Compiler: fix passing recursive alias to proc #7568

Merged

Conversation

Projects
None yet
3 participants
@asterite
Copy link
Member

commented Mar 20, 2019

Fixes #7567

@wontruefree

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2019

Small side note but I think that was blocking an implementation of cons, car, cdr. Could you do this in Crystal now?

https://gist.github.com/tenderlove/908d016b611726389d03b887d63c49ca

This is from a conversation on Twitter.
https://twitter.com/tenderlove/status/1011346534158368768

@asterite

This comment has been minimized.

Copy link
Member Author

commented Mar 21, 2019

@wontruefree I don't think so. How's the Crystal implementation of that? What are the types of those lambda arguments?

@wontruefree

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2019

There was a solution with boxing and unboxing but I don't think there was ever a solution with recursive types.

@wontruefree

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2019

@asterite I was hoping something like this would work.

alias M = Proc(Int32, M?)
cons = ->(a: Int32, b : M) { ->(m: M?) { m ? m.call(a, b.not_nil!) : nil }}

@asterite asterite added this to the 0.28.0 milestone Apr 2, 2019

@asterite asterite merged commit d787ccd into crystal-lang:master Apr 2, 2019

5 checks passed

ci/circleci: check_format Your tests passed on CircleCI!
Details
ci/circleci: test_darwin Your tests passed on CircleCI!
Details
ci/circleci: test_linux Your tests passed on CircleCI!
Details
ci/circleci: test_linux32 Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@asterite asterite deleted the asterite:bug/pass-recursive-alias-to-proc branch Apr 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.