[#18042] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — gdefty@...
Hi,
[#18052] Enumerators that know about a block — "David A. Black" <dblack@...>
Hi --
[#18086] Suggestion to change Time#to_s format to an official standard — Dirkjan Bussink <d.bussink@...>
Hello people,
[#18110] [Ruby 1.9 - Feature #403] (Open) Add support to Haiku — Anonymous <redmine@...>
Issue #403 has been reported by Anonymous.
[#18121] [Ruby 1.8.7 - Bug #405] (Open) ssl.rb:31: [BUG] Bus Error — Anonymous <redmine@...>
Issue #405 has been reported by Anonymous.
[#18130] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — Brian Candler <B.Candler@...>
> Seriously though... Array.first is a noun.
[#18145] [PATCH] error.c (Init_Exception): Rename class "fatal" to "Fatal" — Otto Hilska <otto.hilska@...>
Hi,
Hi,
Nobuyoshi Nakada wrote:
Hi,
On Thu, Aug 7, 2008 at 1:37 AM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
On Thu, Aug 7, 2008 at 15:48, Jeremy Kemper <jeremy@bitsweat.net> wrote:
[#18164] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — gdefty@...
In message "Re: [ruby-core:18133] Re: New array
[#18237] Severe problem with garbage collection — Bertram Scharpf <lists@...>
Hi,
[#18247] Thread#priority(=) will be obsolete — SASADA Koichi <ko1@...>
Hi,
[#18252] Re: result for mget [last:10 MIME/multipart] (1/1) (ruby-core ML) — "Giuseppe Bilotta" <giuseppe.bilotta@...>
>> We are planning to make Thread#priority(=) method as obsolete method
Hi,
[#18257] Definition of "Support levels", 1.9.1 supported platforms and recruitment for platform maintainers — "Yugui (Yuki Sonoda)" <yugui@...>
Hi, all.
HI! This answers the question that I asked a few days ago, thank you!
Hi,
Yukihiro Matsumoto wrote:
[#18263] Am I right that this is wrong? — "David A. Black" <dblack@...>
Hi --
Hi,
Hi --
On Wed, Aug 13, 2008 at 3:04 PM, David A. Black <dblack@rubypal.com> wrote:
[#18303] Ruby 1.8.6 yields 50%-100% performance gain when compiled at full optimization — kevin nolan <kpnolan@...>
After compiling Ruby 1.8.6 with '-O3 -mtune=K8 -march=K8' on an AMD 4800
kevin nolan:
On Sat, 2008-08-16 at 03:39 +0900, Shot (Piotr Szotkowski) wrote:
[#18314] [Bug #449] File.zero? returns true when given a directory on Windows — Anonymous <redmine@...>
Bug #449: File.zero? returns true when given a directory on Windows
Hi,
I submitted that original bug (first time using redmine :)). Here's some mo=
Hi,
Not at all - it means we're now free to do the right thing :)
On Mon, Aug 18, 2008 at 6:45 PM, John Lam (IRONRUBY)
[#18319] NEW Command: absolute_path() -- — "C.E. Thornton" <admin@...>
Core,
Hi,
Are you sure you didn't mean to use "~/oracle/bin"
Trans wrote:
[#18349] [Feature:1.9] autoload with a block — Nobuyoshi Nakada <nobu@...>
Hi,
[#18354] Retrieving bytecode for method — Michael Neumann <mneumann@...>
Hi,
[#18381] [Bug #496] DRb.start_service(nil) is very slow — Hongli Lai <redmine@...>
Bug #496: DRb.start_service(nil) is very slow
[#18387] [Bug:1.9] rubygems fails to cache spec file — "Yusuke ENDOH" <mame@...>
Hi,
[#18396] problems with test_io.rb on cygwin — Martin Duerst <duerst@...>
I have run into problems with test_io.rb on cygwin.
Hello,
[#18405] [Bug #512] String#% behavior — Federico Builes <redmine@...>
Bug #512: String#% behavior
[#18409] ruby-lang.org has old download links — Nate_Wiger@...
The download links here:
[#18414] DoS vulnerability in REXML — "Shugo Maeda" <shugo@...>
Hi,
[#18424] [Bug #528] Several ruby-mode.el improvements — Nathan Weizenbaum <redmine@...>
Bug #528: Several ruby-mode.el improvements
[ruby-core:18226] Re: New array methods cycle, choice, shuffle (plus bug in cycle)
Hi,
On Fri, August 08, 2008, 21:08:00, "David A.
Black" <dblack@rubypal.com> wrote:
|Hi --
|On Fri, 8 Aug 2008, gdefty@attglobal.net wrote:
|>
|> I think that the verb/noun difference IS at the
|> heart of it.
|
|Exactly. I realize this all the more when I
realize that this:
|
| array.take_sample!
|
|would make sense to me as a
"dangerous"/destructive method. Maybe
|other's are sensing sample on its own as a verb.
It comes across
|noun-like to me.
One of the things the appealed to me about
'sample' was its noun/verb duality, but that does
seem to break down a bit here.
|> I also thought a lot about Matz's response:
|>
|> | You Array#sample! does pick samples from array,
|> IN ADDITION TO
|> | removing picked elements from the receiver.
|> | Array#sample! does two things at once.
|>
|> .. and what this seems to me to be saying is that
|> the bang has a very specific meaning. It is not
|> just about *changes* the receiver, but that the
|> receiver is *replaced by* that value which is
|> returned by the non-bang version.
|
|I don't think the bang is necessarily that
constrained; for example:
Nor do I. I was just trying to get to the bottom
of Matz's comments. He is clearly against the
sample! method and I just wanted to understand the
basis of that objection.
|irb(main):004:0> a = [1,2,3,4]
|=> [1, 2, 3, 4]
|irb(main):005:0> a.slice!(2)
|=> 3
|irb(main):006:0> a
|=> [1, 2, 4]
Doh! Yes, I had missed the analogy with slice. And
in fact slice! and sample! are so similar that I
am really at a loss to understand what is wrong
with the latter.
| I'd stick with "modifying receivers in-place"
instead of
| "modifying the copies", which doesn't
necessarily mean a
| complete replace operation.
Absolutely right. I scanned fxri for all the !
methods and they *all* modify the receiver. (Well,
*nearly* all ;-) There are a couple of odd ones
like Tempfile#close!, where it is not really
meaningful to 'modify' the receiver, but even they
seem to do the next best thing - unlinking, in
this particular example.)
In truth, though, the more I think about these
methods, the more I feel that they are all so
simple (to the point of being trivial) that I
agree with the view that the clutter they add
outweighs the value.
graeme
_______________
PS [At the risk of being off-topic]
I read and agreed with the blog (except where it
says that not all ! methods modify the receiver -
they do seem to, with the couple of exceptions
noted above).
| And of course it's all part of "danger".[1]
But this part causes me some concern. As you state
in the blog, it is a subjective (and therefore our
purposes imprecise) term. What we are saying is
that to qualify for a ! a method must satisfy some
criteria which depends on how you are using it.
Not a healthy statement in a programming language
description IMHO.
As an example, if I inadvertently use
acct = account.fetch(12345)
acct.credit(value) # error - should be
acct.credit!(value)
acct.save
it would appear that the non-bang version is the
"dangerous" one.
I think the danger here is the use of the word
"danger".
But you are right - we are not talking about this.