Skip to content

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

@DestyNova

Description

@DestyNova

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions