Skip to content

[list-ops]: change // to / and make have foldl/foldr call func(acc, el), consistent with the problem spec#3405

Merged
BethanyG merged 6 commits intoexercism:mainfrom
IsaacG:list_ops.add_tests.c
May 9, 2023
Merged

[list-ops]: change // to / and make have foldl/foldr call func(acc, el), consistent with the problem spec#3405
BethanyG merged 6 commits intoexercism:mainfrom
IsaacG:list_ops.add_tests.c

Conversation

@IsaacG
Copy link
Member

@IsaacG IsaacG commented Apr 13, 2023

No description provided.

@BethanyG
Copy link
Member

BethanyG commented May 9, 2023

@IsaacG -- Thank you for this. Pls remember to add yourself as an exercise contributor. After that, I will approve and merge.

@IsaacG
Copy link
Member Author

IsaacG commented May 9, 2023

@IsaacG -- Thank you for this. Pls remember to add yourself as an exercise contributor. After that, I will approve and merge.

Done. Thanks!

@BethanyG BethanyG merged commit 461e6fc into exercism:main May 9, 2023
@asarkar
Copy link

asarkar commented Jun 21, 2023

The arguments to the lambda are inconsistent with the problem description.

foldr (given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the right using function(item, accumulator));

    def test_foldr_direction_dependent_function_applied_to_non_empty_list(self):
        self.assertEqual(foldr(lambda acc, el: el / acc, [1, 2, 3, 4], 24), 9)

The first argument to the lambda should be el, not acc.

@BethanyG
Copy link
Member

@asarkar - if you'd like to report an issue, please do so on our forum. A long-closed PR is not the place to do it. Thanks.

@exercism exercism locked as off-topic and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants