exercism / vimscript

Exercism exercises in Vim script.
https://exercism.org/tracks/vimscript
MIT License
20 stars 24 forks source link

Add list-ops #223

Closed BNAndras closed 9 months ago

BNAndras commented 9 months ago

Related to #172.

I have two bugs in my foldl/foldr implementation to resolve

BNAndras commented 9 months ago

For folds (reduces) the given list from the left with a function -> direction dependent function applied to non-empty list and folds (reduces) the given list from the right with a function -> direction dependent function applied to non-empty list, I used the older tests but updated the argument names to the newer ones (elt and acc instead of x and y).

BNAndras commented 9 months ago

@kotp, the Reverse from reverse-string is conflicting with the Reverse from here. There's already a single community solution for reverse-string. I can either break that solution and make Reverse be ReverseString in reverse-string or prefix the functions here with My like MyAppend, MyReverse, and so on.

kotp commented 9 months ago

@kotp, the Reverse from reverse-string is conflicting with the Reverse from here. There's already a single community solution for reverse-string. I can either break that solution and make Reverse be ReverseString in reverse-string or prefix the functions here with My like MyAppend, MyReverse, and so on.

We could also use the word reversal_of or just reversal.

BNAndras commented 9 months ago

Works for me!

kotp commented 9 months ago

Works for me!

Or reverses(list) or reversed(list).