On Wed, May 13, 2009 at 1:57 AM, Tom Cloyd <tomcloyd@comcast.net> wrote:
Why can't ruby just do what I mean, rather than what I say? Is that asking
too much? (heh heh)
But it does, I am sure you just forgot the *, right?
[*0..5].include? 42
--> false
Cheers
Robert
Robert,
Interesting, but obscure. I just did a quick dig into Thomas (Pickaxe, 3rd ed.), to try to figure out what [*1..5] does, and I still don't get it. Can you explain?
t.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The"pre-appending" (yes I'm aware that's not a word or proper
conjuction) _star_ flattens arrays/ranges. Well, not exactly; it
allows you to use a "list" of things. Some people avoid it because of
a supposed performance issue. Pick your battle, I guess.
It happens to be useful to me. I really hope they don't get rid of
that nomenclature (much like getting rid of #inject; if so, goodbye
Ruby for me).
Todd
···
On Tue, May 12, 2009 at 8:34 PM, Tom Cloyd <tomcloyd@comcast.net> wrote:
Robert Dober wrote:
On Wed, May 13, 2009 at 1:57 AM, Tom Cloyd <tomcloyd@comcast.net> wrote:
Why can't ruby just do what I mean, rather than what I say? Is that
asking
too much? (heh heh)
But it does, I am sure you just forgot the *, right?
[*0..5].include? 42
--> false
Cheers
Robert
Robert,
Interesting, but obscure. I just did a quick dig into Thomas (Pickaxe, 3rd
ed.), to try to figure out what [*1..5] does, and I still don't get it. Can
you explain?
I do not believe I have ever heard of that intention, if they get rid
of *0..3 than there is nothing one can do, if they get rid of inject
we will just reimplement it
Robert
···
On Wed, May 13, 2009 at 4:02 AM, Todd Benson <caduceass@gmail.com> wrote:
On Tue, May 12, 2009 at 8:34 PM, Tom Cloyd <tomcloyd@comcast.net> wrote:
Robert Dober wrote:
On Wed, May 13, 2009 at 1:57 AM, Tom Cloyd <tomcloyd@comcast.net> wrote:
Why can't ruby just do what I mean, rather than what I say? Is that
asking
too much? (heh heh)
But it does, I am sure you just forgot the *, right?
[*0..5].include? 42
--> false
Cheers
Robert
Robert,
Interesting, but obscure. I just did a quick dig into Thomas (Pickaxe, 3rd
ed.), to try to figure out what [*1..5] does, and I still don't get it. Can
you explain?
The"pre-appending" (yes I'm aware that's not a word or proper
conjuction) _star_ flattens arrays/ranges. Well, not exactly; it
allows you to use a "list" of things. Some people avoid it because of
a supposed performance issue. Pick your battle, I guess.
It happens to be useful to me. I really hope they don't get rid of
that nomenclature (much like getting rid of #inject; if so, goodbye
Ruby for me).
--
Si tu veux construire un bateau ...
Ne rassemble pas des hommes pour aller chercher du bois, préparer des
outils, répartir les tâches, alléger le travail… mais enseigne aux
gens la nostalgie de l’infini de la mer.
If you want to build a ship, don’t herd people together to collect
wood and don’t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.
I'm pretty sure the word you want is either "prefixing" or, if you like
the hypercorrect neologism, "prepending".
···
On Wed, May 13, 2009 at 11:02:45AM +0900, Todd Benson wrote:
The"pre-appending" (yes I'm aware that's not a word or proper
conjuction) _star_ flattens arrays/ranges. Well, not exactly; it
--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
Quoth Edward Murphy, Jr. (Murphy's Law): "If there's more than one way
to do a job and one of those ways will end in disaster, then someone
will do it that way."
It happens to be useful to me. I really hope they don't get rid of
that nomenclature (much like getting rid of #inject; if so, goodbye
Ruby for me).
I never heard any proposal to get rid of Enumberable#inject, and I don't
think it's something you need to worry about. Ruby 1.9 has been adding
hundreds of new methods, not taking them away.
On Wed, May 13, 2009 at 11:02:45AM +0900, Todd Benson wrote:
The"pre-appending" (yes I'm aware that's not a word or proper
conjuction) _star_ flattens arrays/ranges. Well, not exactly; it
I'm pretty sure the word you want is either "prefixing" or, if you like
the hypercorrect neologism, "prepending".
Hrm. I had always thought of 'prepend' as a commonplace, dictionary
word, and was about to point out that it was such, until I accidentally
looked it. Neologismtastic!
--
Posted via http://www.ruby-forum.com/\.
It happens to be useful to me. I really hope they don't get rid of
that nomenclature (much like getting rid of #inject; if so, goodbye
Ruby for me).
I never heard any proposal to get rid of Enumberable#inject, and I don't
think it's something you need to worry about. Ruby 1.9 has been adding
hundreds of new methods, not taking them away.
1.9.1 adds Enumerable#reduce as synonym (which makes more sense to me)
and
still retains inject
The"pre-appending" (yes I'm aware that's not a word or proper
conjuction) _star_ flattens arrays/ranges. Well, not exactly; it
I'm pretty sure the word you want is either "prefixing" or, if you like
the hypercorrect neologism, "prepending".
Hrm. I had always thought of 'prepend' as a commonplace, dictionary word, and was about to point out that it was such, until I accidentally looked it. Neologismtastic!
Actually, this is all unnecessary. In linguistics, for eons, we have spoken of prefix and suffix usage, So, this is a prefix asterisk, as in "...the meaning of this prefix asterisk is blah blah...". That says it just fine, with no new language. Travel light.
t.
···
On Wed, May 13, 2009 at 11:02:45AM +0900, Todd Benson wrote:
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Actually IMHO which makes more sense is situational. To me reduce
makes sense when the optional initial argument is not used, and inject
makes more sense when it is:
collection.reduce {|memo, element| ...}
vs
collection.inject(initial_value) {|memo, element| ...}
Several of the Enumerable method names were pretty obviously inspired
by the Smalltalk collection hierarcy, select, detect, reject, and
inject among them. The Smalltalk method is inject:info: which makes
the meaning of inject a bit clearer, in Smalltalk you would write the
second example as:
Personally I think it's good to have such synonyms, they make it
easier to be express subtleties just as they do for authors in natural
languages.
In my humble opinion I believe that having different words meaning the
same thing is not bad. It enables a certain ease to adapt our programs
slightly accordingly to slightly different cases. This is exactly what
they do for people expressing themselves in human idioms.
I guess that was what you meant, though I apologize for a certain lack
of subtlety.
R.
···
On Fri, May 15, 2009 at 2:51 PM, Rick DeNatale <rick.denatale@gmail.com> wrote: