Feature #10068
closed
[PATCH] Implement monadic operator for Vector
Added by gogotanaka (Kazuki Tanaka) over 10 years ago.
Updated about 10 years ago.
Description
Before
v = Vector[1, 2, 3]
+ v
=> NoMethodError: undefined method `+@' for Vector[1, 2, 3]:Vector
- v
=> NoMethodError: undefined method `-@' for Vector[1, 2, 3]:Vector
After
v = Vector[1, 2, 3]
+ v
=> Vector[1, 2, 3]
- v
=> Vector[-1, -2, -3]
Files
I'm sorry my report looks ugly... I fix it. ↓
Before
v = Vector[1, 2, 3]
+ v
=> NoMethodError: undefined method `+@' for Vector[1, 2, 3]:Vector
- v
=> NoMethodError: undefined method `-@' for Vector[1, 2, 3]:Vector
After
v = Vector[1, 2, 3]
+ v
=> Vector[1, 2, 3]
- v
=> Vector[-1, -2, -3]
I am not sure the term monadic is a proper one, but I like the idea.
Matz.
- Related to Feature #10069: [PATCH] Implement monadic operator for Matrix added
- Category set to lib
- Status changed from Open to Assigned
- Assignee set to marcandre (Marc-Andre Lafortune)
- Target version set to 2.2.0
- Status changed from Assigned to Closed
Done.
Thanks for catching this omission, and for the patch.
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0