numo-narray icon indicating copy to clipboard operation
numo-narray copied to clipboard

Define ! operator as an alias of Numo::NArray#inplace

Open masa16 opened this issue 5 years ago • 5 comments

a.inplace + 1

is equivalent to

!a + 1

Any problem?

  • In Ruby, ! is used to be added to the name of some destructive method.
  • Some ruby committer seems declined to change the semantics of +=.

masa16 avatar Apr 18 '19 06:04 masa16

!!

kojix2 avatar Apr 18 '19 06:04 kojix2

I've recently talked with matz. We are thinking to

  1. If += method is defined, call it
  2. Define +! operator newly

etc

sonots avatar Apr 18 '19 12:04 sonots

!a looks like returning boolean value

sonots avatar Apr 18 '19 12:04 sonots

I agree. > !a looks like returning boolean value

naitoh avatar Apr 18 '19 12:04 naitoh

I see. I leave this issue just an idea.

masa16 avatar Apr 18 '19 14:04 masa16