Skip to content

Conversation

@lrusso96
Copy link

@lrusso96 lrusso96 commented Aug 4, 2022

I think there is a typo in this example: the switch clause is wrong.
Check the code on an array of integers all greater than 2 and the result would be false as well.

OK/README.md

Lines 381 to 391 in d150075

```go
let every = fn(arr, check) {
let passed = true;
map(arr, fn(e) {
switch check(e) { case true: passed = false; } }
)
return passed;
};
result = every([5,2,4,1,3], fn(e) { return e >= 2 }); // false
```

@lrusso96 lrusso96 closed this by deleting the head repository Sep 28, 2022
@lrusso96 lrusso96 reopened this Nov 2, 2022
let passed = true;
map(arr, fn(e) {
switch check(e) { case true: passed = false; } }
switch check(e) { case false: passed = false; } }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

};

result = every([5,2,4,1,3], fn(e) { return e >= 2 }); // false
result1 = every([5,2,4,1,3], fn(e) { return e >= 2 }); // false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep things simple I would just leave this bit as it was

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this. Just one thing

@lrusso96
Copy link
Author

I close this as explained in #19.

@lrusso96 lrusso96 closed this Nov 17, 2022
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

Successfully merging this pull request may close these issues.

2 participants