[#1026] Is this a bug? — Dave Thomas <Dave@...>

18 messages 2000/01/03

[#1084] Infinite loop — Dave Thomas <Dave@...>

17 messages 2000/01/11

[#1104] The value of while... — Dave Thomas <Dave@...>

24 messages 2000/01/11

[ruby-talk:01159] Re: Is this expected behavior?

From: Dave Thomas <Dave@...>
Date: 2000-01-21 20:28:05 UTC
List: ruby-talk #1159
Dave Thomas <Dave@thomases.com> writes:

> Playing around with ranges, I bumped into this...
> 
>      (1..10).end
>    10
> 
>      (1...10).end
>    -e:1: undefined method `end' for nil (NameError)

Doh... answered my own question - it's a precedence thing.
The two calls were in different circumstances--the second was

    p (1...10).end

it should have been

    p ((1...10).end)


Sorry to waste bandwidth

Dave

In This Thread