[#11073] segfault printing instruction sequence for iterator — <noreply@...>

Bugs item #10527, was opened at 2007-05-02 14:42

14 messages 2007/05/02
[#11142] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Nobuyoshi Nakada <nobu@...> 2007/05/10

Hi,

[#11188] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Paul Brannan <pbrannan@...> 2007/05/16

On Thu, May 10, 2007 at 04:51:18PM +0900, Nobuyoshi Nakada wrote:

[#11234] Planning to release 1.8.6 errata — Urabe Shyouhei <shyouhei@...>

Hi all.

17 messages 2007/05/25

Re: Pathname ascend and descend inclusive parameter

From: Joel VanderWerf <vjoel@...>
Date: 2007-05-20 21:19:14 UTC
List: ruby-core #11217
TRANS wrote:
> On 5/20/07, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:
...
>> Is it better in some cases to control this behavior by argument passing
>> rather than by calling an extra method?
> 
> In can avoid an if condition:
> 
>  path.ascend(condition) {|v| p v}
> 
> vs.
> 
>  condition ?  path.ascend {|v| p v} : path.parent.ascend {|v| p v}

which can be refactored:

(condition ? path : path.parent).ascend {|v| p v}

> Though a variable condition is probably pretty rare, so maybe yours is
> the better suggestion.
> 
> However I've made the same extensions to String (ie. String#ascend)
> for use with File.join. In this case, we can't use #parent, so the
> parameter becomes much more important. Unless there's going to be some
> big push for the use of Pathname over File.join (which I would happily
> support btw) then I think it would be nice to have corresponding
> parameters for Pathname's methods.

I'd prefer using Pathname too. Why should a String method (#ascend) know 
anything about file paths?

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

In This Thread

Prev Next