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

List - native code, based only on Boolean, Pair, Integer #6

Open
8 tasks
booch opened this issue Apr 21, 2021 · 2 comments
Open
8 tasks

List - native code, based only on Boolean, Pair, Integer #6

booch opened this issue Apr 21, 2021 · 2 comments
Labels
refactor Need to clean up the implementation of something

Comments

@booch
Copy link
Member

booch commented Apr 21, 2021

We can cheat and implement the constructor in Ruby, because we won't have varargs support for a while.

  • constructor
  • size, length, empty?
  • first, head
  • rest, tail
  • last
  • map, includes?
  • reduce, fold, foldl (might need to punt on this)
  • foldr (probably need to punt on this, unless we can easily implement reverse)
@booch booch added the refactor Need to clean up the implementation of something label Apr 21, 2021
@booch
Copy link
Member Author

booch commented Apr 29, 2021

Actually, I think we should make List a built-in function, that calls cons for each element.

@booch
Copy link
Member Author

booch commented Apr 29, 2021

We should not rely on Pair, but a Church-encoding implementation of cons, first (car), and rest (cdr).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Need to clean up the implementation of something
Projects
None yet
Development

No branches or pull requests

1 participant