From: Conrad Schneiker Date: 2001-09-11T21:19:02+09:00 Subject: [ruby-talk:21067] Re: RCR: non-bang equivalent to []= Hi, "Hal E. Fulton" wrote: > ----- Original Message ----- > From: Yukihiro Matsumoto > > In message "[ruby-talk:20834] Re: RCR: non-bang equivalent to []=" > > on 01/09/04, "Conrad Schneiker" writes: > > > > |> > I'd like to have bang and non-bang versions of each and every method. > > |> > The names should just differ in the !, like collect and collect! > > | > > |IIRC from previous discussions, isn't this precisely the convention that > > |Scheme uses? (IIRC, this is where Matz got the idea for his particular > > |variation.) > > > > It is the origin of the bang name idea, but in fact they are > > different. As Hal pointed out, Scheme's bang is the mark for > > self-modifying functions, on the other hand, Ruby's bang is the mark > > for "more dangerous alternative; handle with care". > > Hmm, I made some related comments, though I never mentioned > Scheme (which I don't know). Someone else mentioned Scheme. Me. By the way, that reminds me of another parenthetical question that I forgot to ask. Does anyone know if Scheme users generally unhappy with the Scheme convention for using ! on all destructive methods? > It was Ralph Waldo Emerson who said, "A foolish consistency is the > hobgoblin of little minds." To me, a unilateral bang-notation falls under > the heading of a foolish consistency. [...] > If we embraced the other philosophy fully, But why push it to the point of obvious foolishness? Isn't that a little foolish? :-) It's OK to strenuously disagree, but let's fight fair, as it were. (After all, your argument could be stretched beyond reason into promoting a move toward more Python-like syntax. :-) The original request was for _moderate_ consistency in the sense of a convention that happens to better reflect _some_ people's natural semantic intuitions (and thereby get rid of what for them is a nagging pointless ambiguity). > I think we would end up > looking more like Perl, where array names are marked with a special Or we would end up, heavens forbid!, where global, class, and instance variable names are marked with a special.... :-) FWIW, IIRC, I think Perl6 is changing the Perl5 convention to a more intuitive (again, IMO) sort of consistency. Conrad