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

"more than three arguments" for For/For scan? #22

Open
DestyNova opened this issue Feb 4, 2024 · 1 comment
Open

"more than three arguments" for For/For scan? #22

DestyNova opened this issue Feb 4, 2024 · 1 comment

Comments

@DestyNova
Copy link
Contributor

I'm not sure what's meant by this bit in the More Adverbs chapter:

When called with more than three arguments, For and For scan both use the first argument as initial value, and the rest of the arguments as input arrays.

 {x+y*z}/[1; 1 2 3; 4 5 6; 7 8 9]
29 42 57
 {x+y*z}\[1; 1 2 3; 4 5 6; 7 8 9]
(1 2 3
 4 5 6
 7 8 9
 29 42 57)

(The two examples are the same as those in the first adverbs chapter and don't make sense here. Also they don't produce the same results for me, so we should replace them in that chapter too.)

I'm not quite sure what's meant by calling For or For scan with more than three arguments. Giving it an array on the right-hand side just produces one column of results given each element as a starting value:

 8{2*x}\1 2 3 4
(1 2 3 4
 2 4 6 8
 4 8 12 16
 8 16 24 32
 16 32 48 64
 32 64 96 128
 64 128 192 256
 128 256 384 512
 256 512 768 1024)
@razetime
Copy link
Owner

razetime commented Feb 4, 2024

I think the part in the more adverbs chapter should be removed.

Giving it an array on the right-hand side just produces one column of results given each element as a starting value

The infix form of for takes two arguments (excluding the function {2*x} in the example). f/[...;...;...;] is the non-infix form that does a different thing.

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