[#8484] strptime fails to properly parse certain inputs — <noreply@...>

Bugs item #5263, was opened at 2006-08-01 23:14

13 messages 2006/08/02
[#8485] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — Yukihiro Matsumoto <matz@...> 2006/08/02

Hi,

[#8538] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — nobu@... 2006/08/06

Hi,

[#8561] sandbox timers & block scopes — why the lucky stiff <ruby-core@...>

Two puzzles I am trying to solve:

28 messages 2006/08/08
[#8624] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

raise ThisDecayingInquisition, "anyone? anyone at all?"

[#8627] Re: sandbox timers & block scopes — MenTaLguY <mental@...> 2006/08/15

On Wed, 2006-08-16 at 00:35 +0900, why the lucky stiff wrote:

[#8628] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

On Wed, Aug 16, 2006 at 02:46:30AM +0900, MenTaLguY wrote:

[#8629] Re: sandbox timers & block scopes — "Charles O Nutter" <headius@...> 2006/08/15

On 8/15/06, why the lucky stiff <ruby-core@whytheluckystiff.net> wrote:

[#8690] a ruby-core primer — why the lucky stiff <ruby-core@...>

Hello, all. I've been working on the ruby-core page for the new Ruby site.

21 messages 2006/08/22

Re: [ ruby-Bugs-5293 ] "ri File.open" is misleading

From: Mathieu Bouchard <matju@...>
Date: 2006-08-05 15:03:16 UTC
List: ruby-core #8534
On Fri, 4 Aug 2006, noreply@rubyforge.org wrote:

> $ ri1.9 File.open
> Nothing known about File.open
> okay, i know that File extends IO, so how about IO.open?

Why wouldn't ri redirect to IO.open in case of missing documentation or 
non-reimplementated class-method ?

>     IO.open(fd, mode_string="r" )               => io
>     IO.open(fd, mode_string="r" ) {|io| block } => obj

This suggests that File.new is overriding IO.new, because IO.new
really only take integer arguments (filehandle numbers).

>     With no associated block, +open+ is a synonym for +IO::new+.

This means that if File.new is overridden then File.open needs to because 
else it'll call IO.open which will call non-overridden IO.new. To describe 
a "covariant" behaviour it should be documented as synonym for self.new, 
if it works that way. Actually, it does not work that way, e.g.:

class Vile<File; def self.new(); puts "hahaha" end end; Vile.open
# ArgumentError: wrong number of arguments (0 for 1)

>                 File.open( fileName, aModeString="r" ) {| file | block } -> nil
>                 File.open( fileName [, aModeNum [ aPermNum ] ] ) {| file | block } -> nil
>  With no associated block, open is a synonym for File.new . If the
>  optional code block is given, it will be passed file as an argument,
>  and the file will automatically be closed when the block terminates.
>  In this instance, File.open returns nil.

This is also wrong, as File.open(){} returns the return value of the 
block.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - t駘:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montr饌l QC Canada

In This Thread

Prev Next