Closed alexeyraspopov closed 6 years ago
Hey, thanks for giving it a try and reporting this!
You're right, that was a "bug" in the standard library definition. (I say "bug" because it worked, but you're right that it wasn't great.) I had fixed it on d8e09fb5f6031f6cefafff7b524da47ce8b34326 a few weeks back, but had forgotten to push it. If you pull the most recent master it should work now.
Let me know if it works for you or if you have any further questions! 😃
@tadeuzagallo, pulled latest master, verified, it now works. Thanks for that quick response.
Generics docs seem to not directly describe functions from Std, though use the pattern that now no longer applicable (for the sake of using functions as methods). Do you think the page should also be updated?
@tadeuzagallo, I've opened #53 based on my previous comment.
Hi!
I'm really excited to try Verve. I like the syntax and ideas behind it. Looking forward to try the lang on nontrivial tasks.
I've tried to write a bit of code today, and wanted to try how functions can be used as a method (I found this idea amazing).
So, basically, I have a function:
Which I want to apply to the list of numbers. And that's what I can easily do by using
map()
However, when I try to use
map
as a method, I receive next output:As I understand, it happens because 1) function as a method receives the target as a first argument 2)
map()
,filter()
, and others receive the data as a second argument. I understand the idea behind the second point though.Edit: as also expected from the things above, next code works
Though, in a chain of calls like
list.map(f).filter(g).reduce(h)
, I can't imagine the way to describe it in Verve.Do you think there is any way the usage of map/filter/etc as methods can be achieved?
Thanks