brownplt / pyret-docs

The documentation for Pyret.
9 stars 18 forks source link

for operators #47

Open tom-hoffman opened 5 years ago

tom-hoffman commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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.