[#86787] [Ruby trunk Feature#14723] [WIP] sleepy GC — ko1@...

Issue #14723 has been updated by ko1 (Koichi Sasada).

13 messages 2018/05/01
[#86790] Re: [Ruby trunk Feature#14723] [WIP] sleepy GC — Eric Wong <normalperson@...> 2018/05/01

ko1@atdot.net wrote:

[#87095] [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — ko1@...

Issue #14767 has been updated by ko1 (Koichi Sasada).

9 messages 2018/05/17

[ruby-core:87098] [Ruby trunk Bug#14699] Subtle behaviors with endless range

From: naruse@...
Date: 2018-05-17 05:21:54 UTC
List: ruby-core #87098
Issue #14699 has been updated by naruse (Yui NARUSE).

Target version set to 2.6

Need to be discussed with mrkn before December.

----------------------------------------
Bug #14699: Subtle behaviors with endless range
https://bugs.ruby-lang.org/issues/14699#change-72066

* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 2.6
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Currently, some Range's methods behaves weirdly with endless range.

## Range#max

Range#max always returns nil.  Is this okay, or is another result expected? 

```
p (0..).max #=> nil
p (0..).max(3) #=> nil
p (0..).max {|a, b| a <=> b } #=> nil
```

Note that `(0..).min {|a, b| a <=> b }` gets stuck.  I think Range#min and Range#max should behave the same if a block are passed, but I'm uncertain what behavior is preferable.

## Range#last

Range#last returns nil if no argument is passed.  But it gets stuck if a length argument is passed.  Is this okay?

```
p (0..).last #=> nil
p (0..).last(3) #=> stuck
```

## Range#size

Range#size returns nil for endless range.  I think this is somewhat reasonable because `("a".."z").size` returns nil.



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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next