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

for operators #47

Open
tom-hoffman opened this issue Oct 14, 2018 · 2 comments
Open

for operators #47

tom-hoffman opened this issue Oct 14, 2018 · 2 comments

Comments

@tom-hoffman
Copy link
Contributor

We could use a list of the built-in valid for operators in addition to map, filter and fold.

I just wrote one for fold_n (https://code.pyret.org/editor#share=11xDUUtBkp-FtsvXGV3izsA3sOeJhY89U&v=be0f222) for myself and was just going to start on fold2 when I discovered to my surprise that it already works. I couldn't find the relevant code in the Pyret source tree.

The longer explanation of for operators should also be moved from the tour to section 2.1.

@tom-hoffman
Copy link
Contributor Author

Ah! OK, I see, fold_n doesn't work because you need the prefix. So do all the built in list functions work as for operators? If so, we just need to say that.

@sorawee
Copy link
Contributor

sorawee commented Apr 20, 2019

Not sure what do you mean by that.

  1. The explanation of for is here.
  2. Some list functions are automatically imported, while the rest is needed to be imported explicitly. This is not documented, but you can see stuff that are automatically imported here.

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

2 participants