[#61424] [REJECT?] xmalloc/xfree: reduce atomic ops w/ thread-locals — Eric Wong <normalperson@...>

I'm unsure about this. I _hate_ the extra branches this adds;

13 messages 2014/03/12

[ruby-core:61372] [ruby-trunk - Bug #9611] Arithmetic operator following parentheses-less method gives ArgumentError

From: matias@...
Date: 2014-03-07 19:28:05 UTC
List: ruby-core #61372
Issue #9611 has been updated by Mat鱈as Battocchia.


Even though this also happens with +, * and /, I guess it is on purpose to pass negative numbers, not a bug. My mistake.

----------------------------------------
Bug #9611: Arithmetic operator following parentheses-less method gives ArgumentError
https://bugs.ruby-lang.org/issues/9611#change-45683

* Author: Mat鱈as Battocchia
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* Category: syntax
* Target version: 
* ruby -v: 2.0.0p195
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
It would be better to explain this with an example:

    > 'a'.length -1                                                                                                          
    ArgumentError: wrong number of arguments (1 for 0)
    from (pry):1:in `length'

Other ways of writing this expression work as expected:

    > 'a'.length() -1
    => 0

    > 'a'.length-1
    => 0

    > 'a'.length- 1
    => 0

    > 'a'.length - 1                                                                                                         
    => 0



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

In This Thread

Prev Next