[#3907] Obtaining mode information on an IO object — Jos Backus <jos@...>

The attached patch implements IO#mode. This method returns the mode the IO

17 messages 2004/12/06
[#3909] Re: [patch] Obtaining mode information on an IO object — nobu.nokada@... 2004/12/07

Hi,

[#3910] Re: [patch] Obtaining mode information on an IO object — Jos Backus <jos@...> 2004/12/07

On Tue, Dec 07, 2004 at 09:25:13AM +0900, nobu.nokada@softhome.net wrote:

[#3925] Re: [patch] Obtaining mode information on an IO object — James Britt <ruby@...> 2004/12/09

Jos Backus wrote:

[#4009] cgi.rb -- more GET/POST stuff — mde@...26.com

First of all, I think it would be great, as Eustaquio suggests, to

17 messages 2004/12/23
[#4016] Re: [PATCH] cgi.rb -- more GET/POST stuff — Francis Hwang <sera@...> 2004/12/24

GETs and POSTs are defined to be fairly different actions. I'd read

[#4027] Allowing custom number literal suffixes? — Florian Gro<florgro@...>

Moin!

35 messages 2004/12/27
[#4070] Re: Allowing custom number literal suffixes? — nobu.nokada@... 2005/01/02

Hi,

[#4072] Re: Allowing custom number literal suffixes? — Mathieu Bouchard <matju@...> 2005/01/02

[#4079] Re: Allowing custom number literal suffixes? — Florian Gro<florgro@...> 2005/01/03

Mathieu Bouchard wrote:

[#4081] Re: Allowing custom number literal suffixes? — Mathieu Bouchard <matju@...> 2005/01/03

[#4082] Re: Allowing custom number literal suffixes? — Florian Gro<florgro@...> 2005/01/03

Mathieu Bouchard wrote:

[#4084] Re: Allowing custom number literal suffixes? — Brent Roman <brent@...> 2005/01/04

I'm not sure I would advocate making Ruby's grammar even more

[#4086] Re: Allowing custom number literal suffixes? — Mathieu Bouchard <matju@...> 2005/01/04

[#4033] Garbage collection trouble — Christian Neukirchen <chneukirchen@...>

Hello,

13 messages 2004/12/27

Re: [patch] Obtaining mode information on an IO object

From: James Britt <ruby@...>
Date: 2004-12-09 05:40:33 UTC
List: ruby-core #3932
>>Yes, it came from O_ACCMODE.
>>cf. http://www.opengroup.org/onlinepubs/007908799/xsh/fcntl.h.html
>>
>>And ruby also has it.
>>  $ ruby -rfcntl -e 'p Fcntl::O_ACCMODE'
>>  3
> 
> 
> Hm, then again that in turn is a good argument for sticking with `accmode', as
> it conforms to a known standard at least. Plus it's not too cryptic, is it?

Well, that's the question.  Who is the target audience, such that this 
would be known, and what is gained from either name?

For those used to a certain sort of Unix C coding, many otherwise 
cryptic names and commands are second nature, and carrying those names 
over to a high level language conveys useful information.

On the other hand, there seems to be a general exhortation (certainly 
something I've often seen mentioned among Rubyists) to write 
self-documenting code and to use clear, descriptive names, rather than 
terse abbreviations that save typing at the expense of long-term clarity.

But see my first point; for the Unix-heads, "accmode" might be terribly 
expressive.  For the rest of the world, people who code in Ruby unless 
there is a compelling reason to drop down to C, "accmode" is probably 
too terse.

"access_mode" should be clear enough to both camps, unless there is 
something about it's behavior that is tied to some special quality of 
the Unix variant, or is likely something only to be of interest to those 
accustomed to a certain low-level coding.

But maybe it's me; I still find myself writing, for example, [].unique, 
only to be reminded that, in RubyWorld, 'unique' has a, um, uniq spelling.


James

In This Thread