[ruby-core:63903] [ruby-trunk - Feature #10068] [Assigned] [PATCH] Implement monadic operator for Vector

From: shibata.hiroshi@...
Date: 2014-07-20 19:11:55 UTC
List: ruby-core #63903
Issue #10068 has been updated by Hiroshi SHIBATA.

Category set to lib
Status changed from Open to Assigned
Assignee set to Marc-Andre Lafortune
Target version set to current: 2.2.0

----------------------------------------
Feature #10068: [PATCH] Implement monadic operator for Vector
https://bugs.ruby-lang.org/issues/10068#change-47936

* Author: gogo tanaka
* Status: Assigned
* Priority: Normal
* Assignee: Marc-Andre Lafortune
* Category: lib
* Target version: current: 2.2.0
----------------------------------------


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--------------------------------
implement_uplus_for_vector.patch (842 Bytes)
implement_negate_for_vector.patch (1.25 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next