[#8976] Insecure warnings on sticky-bit directories — "Laurent Sansonetti" <laurent.sansonetti@...>
Hi,
[#8978] Inheritance and Autorunner: Default_test causes a problem — <noreply@...>
Bugs item #5990, was opened at 2006-10-02 10:05
Hi,
[#8997] Re: [ruby-cvs:18323] ruby: * eval.c (splat_value): use "to_splat" instead of "to_ary" to — Mathieu Bouchard <matju@...>
On Tue, 3 Oct 2006, matz wrote:
Hi,
On Wed, 4 Oct 2006, Yukihiro Matsumoto wrote:
Hi,
Hi --
Yukihiro Matsumoto wrote:
Hi,
Hi --
Hi,
Hi --
Hi,
Hi --
On Oct 9, 2006, at 10:19 AM, dblack@wobblini.net wrote:
On 2006.10.10 00:31, James Edward Gray II wrote:
On Oct 9, 2006, at 11:50 AM, Eero Saynatkari wrote:
Hi --
dblack@wobblini.net wrote:
Thomas Enebo wrote:
Hi --
Hi --
Hi,
Hi --
Hi,
On 10/10/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Hi,
On Oct 10, 2006, at 8:43 AM, Yukihiro Matsumoto wrote:
From: <dblack@wobblini.net>
Hi --
> to_a was too general. All enumerable objects (and even
Brown, Warren wrote:
> -----Original Message-----
[#8999] making FileUtils.rm_rf robust: is anyone interested? — Jim Meyering <list+ruby@...>
Hello,
Hi,
"Nobuyoshi Nakada" <nobu@ruby-lang.org> wrote:
[#9014] C#'s ?? Operator — "Nikolai Weibull" <now@...>
Hi!
[#9021] argument passing bug — Mathieu Bouchard <matju@...>
[#9024] — Shashank Date <sdate@...>
Hi All,
[#9077] how to create a NODE_ARGSPUSH? — Ryan Davis <ryand-ruby@...>
Is it possible for plain ruby code to create a NODE_ARGSPUSH? It
[#9104] Loop over array.delete breaks at first hit — <noreply@...>
Bugs item #6090, was opened at 2006-10-10 22:33
Hi,
[#9119] What about 'splay'? — dblack@...
Hi --
On 2006.10.12 02:32, dblack@wobblini.net wrote:
On Wednesday 11 October 2006 13:55, Eero Saynatkari wrote:
Hi --
dblack@wobblini.net wrote:
Hi --
On 2006.10.12 03:36, Sean Russell wrote:
On 10/11/06, dblack@wobblini.net <dblack@wobblini.net> wrote:
[#9152] regular expressions tainting? — hadmut@... (Hadmut Danisch)
Hi,
Hi,
On Thu, Oct 12, 2006 at 01:01:36PM +0900, Nobuyoshi Nakada wrote:
It's worse:
Hi,
On Oct 15, 2006, at 1:20 AM, Hadmut Danisch wrote:
On Sun, Oct 15, 2006 at 05:33:16PM +0900, Eric Hodel wrote:
[#9158] Module#class_variable_defined? — Mauricio Fernandez <mfp@...>
[#9188] Symbol < String in Ruby > 1.8 — dblack@...
Hi --
Hi
Yukihiro Matsumoto wrote:
Charles Oliver Nutter wrote:
Charles Oliver Nutter wrote:
Jim Weirich wrote:
On Thu, Oct 19, 2006 at 05:06:02AM +0900, Charles Oliver Nutter wrote:
Hi,
Quoting matz@ruby-lang.org, on Thu, Oct 19, 2006 at 01:40:42PM +0900:
Hi,
Quoting matz@ruby-lang.org, on Thu, Oct 19, 2006 at 02:49:30PM +0900:
Hi,
Quoting matz@ruby-lang.org, on Thu, Oct 19, 2006 at 11:22:18PM +0900:
On 10/15/06, dblack@wobblini.net <dblack@wobblini.net> wrote:
Hi --
On 10/15/06, dblack@wobblini.net <dblack@wobblini.net> wrote:
Hi,
On 10/16/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
On Oct 16, 2006, at 3:06 PM, Rick DeNatale wrote:
On Tue, Oct 17, 2006 at 05:14:09AM +0900, James Edward Gray II wrote:
On 10/16/06, Sam Roberts <sroberts@uniserve.com> wrote:
Hi,
Hi --
On Oct 17, 2006, at 7:29 PM, dblack@wobblini.net wrote:
Hi --
On Oct 18, 2006, at 4:18 AM, dblack@wobblini.net wrote:
On 10/18/06, Eric Hodel <drbrain@segment7.net> wrote:
On 10/18/06, Nikolai Weibull <now@bitwi.se> wrote:
On 10/18/06, mathew <meta@pobox.com> wrote:
On Thu, Oct 19, 2006 at 04:24:24AM +0900, Nikolai Weibull wrote:
On 10/18/06, Mauricio Fernandez <mfp@acm.org> wrote:
Hi --
On 10/18/06, dblack@wobblini.net <dblack@wobblini.net> wrote:
Hi -
Hi,
Hi --
Rick DeNatale wrote:
Hi --
Hi,
Hi --
On 10/19/06, dblack@wobblini.net <dblack@wobblini.net> wrote:
Hi --
On 10/19/06, dblack@wobblini.net <dblack@wobblini.net> wrote:
Hi --
dblack@wobblini.net wrote:
Hi --
Hi,
Hi --
Hi,
Hi --
On 10/20/06, dblack@wobblini.net <dblack@wobblini.net> wrote:
Hi --
Hi,
On Sat, Oct 21, 2006 at 01:11:36AM +0900, dblack@wobblini.net wrote:
Hi,
On Oct 18, 2006, at 11:37 AM, Nikolai Weibull wrote:
[#9197] Ruby Threads — "Abhisek Datta" <abhisek@...>
Hello,
[#9282] Re: String not enumerable, what about IO? — "Michael Selig" <michael.selig@...>
I am fairly new to ruby, and I have just started listening to this mailing
[#9341] array.c - defining aliases as aliases — "Daniel Berger" <djberg96@...>
Hi all,
On Oct 27, 2006, at 11:12 AM, Daniel Berger wrote:
[#9351] Module#method_aliased and Module#singleton_method_aliased — "Daniel Berger" <djberg96@...>
Hi all,
Re: String not enumerable, what about IO?
Hi --
On Fri, 20 Oct 2006, Michael Selig wrote:
> ----- Original Message -----
> From: <dblack@wobblini.net>
>
>>> What I would prefer (and this would probably be a major change to the
>>> implementation) is to be able to treat ALL enumerable classes as Arrays.
> In
>>> other words, I'd like to suggest that Array and Enumerable effectively
> be
>>> the same thing, and that "Array" would be the superclass instead of
>>> "Enumerable".
>>
>> Enumerable isn't a superclass; it's a module. Don't forget you can
>> mix it in to your own classes, so it's not just a matter of the
>> behavior of Ruby core classes that are Enumerable.
>>
>> Also, in some respects Array is the common currency of Enumerables, in
>> the sense that a lot of Enumerable methods return arrays. But that
>> doesn't mean that Array itself is more Enumerable, so to speak, than
>> other Enumerable classes.
>
> I take your point about Enumerable being a module. I guess I said it badly,
> but I am trying to reconcile the way an Array works with that of an
> arbitrary Enumerable. They are similar, yet (at times) frustratingly
> different.
>
> 1) There are several methods in Array which I think could (should?) also be
> in Enumerable (eg: uniq, +, | etc).
>
> 2) Presumably, as an alternative to most of the Enumerable methods, you
> could use "to_a", and then use Array methods. I guess the Enumerable methods
> would be more efficient than doing this, so is that the reason for using
> them, or is it brevity or something else?
I think it's because they're not arrays, and not particularly
array-like in their native form. Maybe some of them are -- but the
nice thing is that it doesn't have to be decided up front.
> 3) It has been mentioned before that Enumerable is a collection, which is
> unordered (ie: you can't index them). However characters or lines in a
> string or file *are* ordered. When you iterate over them you expect them to
> come back in order.
>
> 4) Other posts proposed having String#lines & String#bytes return an Array,
> so the same efficiency comment as (2) applies. They could also return an
> Enumerable object, which maybe more efficient but this relies on "each"
> returning them in order (which it probably would!).
>
> What I was getting at is that much of the time Enumerables *are* ordered,
> whether we need it or not. If we accept this, it makes sense, for example,
> to make things like "reverse" an Enumerable method.
>
> So why not make Enumerables indexable also? Presumably the base method would
> have to define the "[]" method to do this, but it would be sort of nice to
> efficiently index the n'th line in a string or m'th record in a file using
> Array style syntax without having to convert the whole thing to an array.
> You could even go the whole hog, and use "[]=" to make virtually all the
> Array methods available (delete, insert etc). May be a new module, rather
> than polluting Enumerable?
>
> Does that make sense?
I think it puts constraints on the idea of being enumerable, based on
one particular enumerable class (Array). (I'm thinking not only about
the enumerable classes already in Ruby, but about Enumerable as a
programmer tool for use in new classes.) It may be that arrays are
the most common enumerables, but we're not operating under a mandate
to elect the most popular one and replace Enumerable with it :-) You
mention things that "probably" happen -- and that's fine, but, again,
there's no reason to go for a winner-take-all code reorganization
where enumerable classes that aren't array-like are viewed as
exceptional or unidiomatic.
I do think that there's room to adjust and fine-tune how Enumerable
works, but I wouldn't want to go in the direction of subordinating it
to Array.
David
--
David A. Black | dblack@wobblini.net
Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org