[#271943] Ruby vs. PHP — Marcin Raczkowski <mailing.mr@...>

Hello

63 messages 2007/10/01
[#271948] Re: Ruby vs. PHP — "Richard Conroy" <richard.conroy@...> 2007/10/01

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

[#272001] Re: Ruby vs. PHP — Marcin Raczkowski <mailing.mr@...> 2007/10/01

Richard Conroy wrote:

[#272003] Re: Ruby vs. PHP — Marc Heiler <shevegen@...> 2007/10/01

Finally a topic I like :)

[#271996] Reference vs. Reference — "Robert Klemme" <shortcutter@...>

I feel there is a subtle point that needs clarification.

27 messages 2007/10/01
[#272607] Re: Reference vs. Reference — Paul Brannan <pbrannan@...> 2007/10/04

On Tue, Oct 02, 2007 at 12:29:37AM +0900, Robert Klemme wrote:

[#272138] a = b = c order of evaluation weird — SpringFlowers AutumnMoon <summercoolness@...>

i thought if it is

25 messages 2007/10/02
[#272140] Re: a = b = c order of evaluation weird — 7stud -- <dolgun@...> 2007/10/02

SpringFlowers AutumnMoon wrote:

[#272141] Re: a = b = c order of evaluation weird — 7stud -- <dolgun@...> 2007/10/02

7stud -- wrote:

[#272329] Searching through a sorted array — FireAphis <FireAphis@...>

Hello,

16 messages 2007/10/03

[#272427] Non-blocking 'gets' ? — Stephen Ware <sgware@...>

Hi guys, sorry if this is a stupid question, but I've been reading

27 messages 2007/10/03
[#272458] Re: Non-blocking 'gets' ? — 7stud -- <dolgun@...> 2007/10/03

Stephen Ware wrote:

[#272496] opinion on a simple method — Lloyd Linklater <lloyd@2live4.com>

I am trying to find the better way to do things ruby style. I needed to

15 messages 2007/10/04

[#272529] cygwin's Ruby (was: Re: Whats going on!?!?) — "Robert Klemme" <shortcutter@...>

2007/10/2, Phlip <phlip2005@gmail.com>:

20 messages 2007/10/04
[#272552] Re: cygwin's Ruby — Jay Levitt <jay+news@...> 2007/10/04

On Thu, 4 Oct 2007 18:15:36 +0900, Robert Klemme wrote:

[#272581] Re: cygwin's Ruby — "Garry Offord" <droffo@...> 2007/10/04

It's good to know that somebody has successfully done this. I've tried in

[#272589] Re: cygwin's Ruby — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/04

Garry Offord wrote:

[#272740] Itinerary for a Traveling Salesman (#142) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

20 messages 2007/10/05

[#272803] The Case for Multiple-Inheritance — Trans <transfire@...>

So I working on little lib that's ripe for an adapter pattern, when I

71 messages 2007/10/05
[#272918] Re: The Case for Multiple-Inheritance — MenTaLguY <mental@...> 2007/10/06

On Sat, 2007-10-06 at 19:17 +0900, Sylvain Joyeux wrote:

[#272924] Re: The Case for Multiple-Inheritance — Sylvain Joyeux <sylvain.joyeux@...> 2007/10/06

On Saturday 06 October 2007, MenTaLguY wrote:

[#272928] Re: The Case for Multiple-Inheritance — James Edward Gray II <james@...> 2007/10/06

On Oct 6, 2007, at 3:55 PM, Sylvain Joyeux wrote:

[#272979] Re: The Case for Multiple-Inheritance — Sylvain Joyeux <sylvain.joyeux@...> 2007/10/07

> Delegation does not mean duck typing. You are confusing your

[#273018] Re: The Case for Multiple-Inheritance — "Austin Ziegler" <halostatue@...> 2007/10/07

On 10/6/07, Trans <transfire@gmail.com> wrote:

[#273030] Re: The Case for Multiple-Inheritance — Trans <transfire@...> 2007/10/07

[#273120] Re: The Case for Multiple-Inheritance — "Austin Ziegler" <halostatue@...> 2007/10/08

On 10/7/07, Trans <transfire@gmail.com> wrote:

[#273132] Re: The Case for Multiple-Inheritance — Trans <transfire@...> 2007/10/08

[#273185] Re: The Case for Multiple-Inheritance — "Austin Ziegler" <halostatue@...> 2007/10/08

On 10/8/07, Trans <transfire@gmail.com> wrote:

[#272894] Can I do this perl code the same in ruby? — kazaam <kazaam@...>

Well I'm trying to "translate" a perl program to ruby and everything worked fine until the near end where I'm now. There we have this perl code:

14 messages 2007/10/06

[#272904] Ternary Usage — Greg Willits <lists@...>

New to Ruby. Having trouble with ternary statements.

13 messages 2007/10/06

[#272952] The old File.rename not working again. . . . — Peter Bailey <pbailey@...>

This always throws me. I keep getting "permission denied" messages when

24 messages 2007/10/07

[#272954] Hiding source code — |MKSM| <mksm.sama@...>

Hello.

17 messages 2007/10/07

[#272982] #sort_by and #sort_obj — Eric Hodel <drbrain@...7.net>

I haven't seen this technique in the wild before.

18 messages 2007/10/07

[#273052] Obfuscator for Ruby/RoR — "Igor K." <testmyeclipse@...>

Hello,

35 messages 2007/10/07
[#273270] Re: Obfuscator for Ruby/RoR — Ryan Davis <ryand-ruby@...> 2007/10/08

[#273308] Re: Obfuscator for Ruby/RoR — John Joyce <dangerwillrobinsondanger@...> 2007/10/09

[#273382] Re: Obfuscator for Ruby/RoR — mortee <mortee.lists@...> 2007/10/09

John Joyce wrote:

[#273403] Re: Obfuscator for Ruby/RoR — Eric Hodel <drbrain@...7.net> 2007/10/09

On Oct 9, 2007, at 09:22 , mortee wrote:

[#273057] considering writing a book on Ruby/Rails? — "Eric H." <REMOVE-CAPSburnFORout@...>

If anyone here is considering writing a book on Ruby or Rails I'd like

41 messages 2007/10/07
[#273063] Re: considering writing a book on Ruby/Rails? — "Phlip" <phlip2005@...> 2007/10/07

> I hate to gripe but as of today I'm at Ruby/Rails book number 7 and it

[#273069] Re: considering writing a book on Ruby/Rails? — John Joyce <dangerwillrobinsondanger@...> 2007/10/07

[#273079] Re: considering writing a book on Ruby/Rails? — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/07

John Joyce wrote:

[#273109] Translation Service — James Edward Gray II <james@...>

Sorry for being off topic, but I know so many of you know more

16 messages 2007/10/08

[#273152] Bug: Numeric#divmod calculates wrongly — "Dirk Traulsen" <dirk.traulsen@...>

Hi all!

13 messages 2007/10/08
[#274036] Re: Bug: Numeric#divmod calculates wrongly — "Dirk Traulsen" <dirk.traulsen@...> 2007/10/14

Am 8 Oct 2007 um 19:49 hat Dirk Traulsen geschrieben:

[#273154] MATRIX PROBLEMS (AGAIN!) — "John Nott" <JNott@...>

Hi everyone,=20

15 messages 2007/10/08
[#273172] Re: MATRIX PROBLEMS (AGAIN!) — 7stud -- <dolgun@...> 2007/10/08

John Nott wrote:

[#273175] Re: MATRIX PROBLEMS (AGAIN!) — 7stud -- <dolgun@...> 2007/10/08

7stud -- wrote:

[#273158] regexp question - look for parentheses then remove them — Max Williams <toastkid.williams@...>

I'm struggling with a regular expression problem, can anyone help?

12 messages 2007/10/08
[#273160] Re: regexp question - look for parentheses then remove them — "Jes俍 Gabriel y Gal疣" <jgabrielygalan@...> 2007/10/08

On 10/8/07, Max Williams <toastkid.williams@gmail.com> wrote:

[#273265] parts of speech in Ruby — Chad Perrin <perrin@...>

I'm curious -- exactly what class of syntactic element is `=` in Ruby,

13 messages 2007/10/08

[#273305] The Open-Closed-from-a-certain-angle Principle — Jay Levitt <jay+news@...>

Let me start off by saying that I'm SURE this is either a bad idea,

17 messages 2007/10/09

[#273423] Finding shared elements between to arrays. — Sebastian probst Eide <sebastian.probst.eide@...>

Hi

14 messages 2007/10/09

[#273453] will #in? be in ruby2? (was Re: Finding shared elements between to arrays.) — Pe, Botp <botp@...>

Eric wrote:

14 messages 2007/10/10
[#273460] Re: will #in? be in ruby2? (was Re: Finding shared elements between to arrays.) — "Devi Web Development" <devi.webmaster@...> 2007/10/10

T24gMTAvOS8wNywgUGXDsWEsIEJvdHAgPGJvdHBAZGVsbW9udGUtcGhpbC5jb20+IHdyb3RlOgo+

[#273466] Re: will #in? be in ruby2? (was Re: Finding shared elements between to arrays.) — Peña, Botp <botp@...> 2007/10/10

RnJvbTogRGV2aSBXZWIgRGV2ZWxvcG1lbnQgW21haWx0bzpkZXZpLndlYm1hc3RlckBnbWFpbC5j

[#273481] Inter-Process Messaging — Daniel DeLorme <dan-ml@...42.com>

What are the possibilities in ruby for passing information from one

32 messages 2007/10/10
[#273566] Re: Inter-Process Messaging — Joel VanderWerf <vjoel@...> 2007/10/10

Daniel DeLorme wrote:

[#273556] RubyGems Installation Problem on Solaris 10 — cratervoid@...

I've installed Ruby 1.8.6 on a Solaris 10 server without a problem.

10 messages 2007/10/10

[#273575] what does print call internally? — "Martin DeMello" <martindemello@...>

irb(main):001:0> puts nil

14 messages 2007/10/10
[#273584] Re: what does print call internally? — Eric Hodel <drbrain@...7.net> 2007/10/11

On Oct 10, 2007, at 15:31 , Martin DeMello wrote:

[#273612] Why does this use a block — "Anonymous" <jaimrk@...>

So I'm new to Ruby and I'm trying to use OptionParser to parse in some

13 messages 2007/10/11

[#273630] Should *most* memory be release back to the system? — Blackie <mudsweatandears@...>

If anyone can explain this I would appreciate it.

50 messages 2007/10/11
[#273638] Re: Should *most* memory be release back to the system? — Yohanes Santoso <ysantoso-rubytalk@...> 2007/10/11

Blackie <mudsweatandears@gmail.com> writes:

[#273655] Re: Should *most* memory be release back to the system? — "ara.t.howard" <ara.t.howard@...> 2007/10/11

[#274671] Re: [OT] Re: Should *most* memory be release back to the system? — Yohanes Santoso <ysantoso-rubytalk@...> 2007/10/18

"ara.t.howard" <ara.t.howard@gmail.com> writes:

[#274699] Re: [OT] Re: Should *most* memory be release back to the system? — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/18

Yohanes Santoso wrote:

[#274705] Re: [OT] Re: Should *most* memory be release back to the system? — Yohanes Santoso <ysantoso-rubytalk@...> 2007/10/18

"M. Edward (Ed) Borasky" <znmeb@cesmail.net> writes:

[#274709] Re: [OT] Re: Should *most* memory be release back to the system? — "ara.t.howard" <ara.t.howard@...> 2007/10/18

[#274761] Re: [OT] Re: Should *most* memory be release back to the system? — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/19

ara.t.howard wrote:

[#274810] Re: [OT] Re: Should *most* memory be release back to the system? — khaines@... 2007/10/19

On Fri, 19 Oct 2007, M. Edward (Ed) Borasky wrote:

[#274826] Re: [OT] Re: Should *most* memory be release back to the system? — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/19

khaines@enigo.com wrote:

[#274884] Re: [OT] Re: Should *most* memory be release back to the system? — "Michal Suchanek" <hramrach@...> 2007/10/19

On 19/10/2007, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

[#274942] Why don't we have "C" machines? (was Re: [OT] Re: Should *most* memory be release back to the system?) — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/20

Michal Suchanek wrote:

[#275118] Re: Why don't we have "C" machines? (was Re: [OT] Re: Should *most* memory be release back to the system?) — "Michal Suchanek" <hramrach@...> 2007/10/21

On 20/10/2007, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

[#275170] Re: Why don't we have "C" machines? (was Re: [OT] Re: Should *most* memory be release back to the system?) — "Martin DeMello" <martindemello@...> 2007/10/22

On 10/21/07, Michal Suchanek <hramrach@centrum.cz> wrote:

[#275223] Re: Why don't we have "C" machines? (was Re: [OT] Re: Should *most* memory be release back to the system?) — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/22

Martin DeMello wrote:

[#275227] Re: Why don't we have "C" machines? (was Re: [OT] Re: Should *most* memory be release back to the system?) — Xavier Noria <fxn@...> 2007/10/22

On Oct 22, 2007, at 4:23 PM, M. Edward (Ed) Borasky wrote:

[#273707] How to delete specific characters from a string? — Bazsl <hs@...>

Is there really no method that allows me to delete N characters starting

13 messages 2007/10/11

[#273718] range max — Marek Kasperkiewicz <m.kasperkiewicz@...>

If i try this

31 messages 2007/10/12
[#273727] Re: range max — Brian Adkins <lojicdotcom@...> 2007/10/12

On Oct 11, 9:30 pm, Marek Kasperkiewicz <m.kasperkiew...@gmail.com>

[#273800] Re: range max — Yossef Mendelssohn <ymendel@...> 2007/10/12

On Oct 11, 9:55 pm, Brian Adkins <lojicdot...@gmail.com> wrote:

[#273823] Re: range max — Brian Adkins <lojicdotcom@...> 2007/10/12

On Oct 12, 8:56 am, Yossef Mendelssohn <ymen...@pobox.com> wrote:

[#273755] Syntax error when redefining >> operator to take a block — John Woods <jqwoods@...>

I'm trying to redefine the >> operator for a particular class such that

9 messages 2007/10/12

[#273828] ANN: English 0.1 — Trans <transfire@...>

English 0.1

17 messages 2007/10/12

[#273887] Is there a standard pattern for threaded access to a file? — Jon Handler <jhandler@...>

I'm pretty new to ruby and this is one of those areas where I can't

37 messages 2007/10/12
[#273891] Re: Is there a standard pattern for threaded access to a file? — "ara.t.howard" <ara.t.howard@...> 2007/10/13

[#273896] Re: Is there a standard pattern for threaded access to a file? — 7stud -- <bbxx789_05ss@...> 2007/10/13

ara.t.howard wrote:

[#273940] Re: Is there a standard pattern for threaded access to a file? — "Francis Cianfrocca" <garbagecat10@...> 2007/10/13

On 10/12/07, Jon Handler <jhandler@shopping.com> wrote:

[#273955] Re: Is there a standard pattern for threaded access to a file? — Eric Hodel <drbrain@...7.net> 2007/10/13

On Oct 13, 2007, at 07:29 , Francis Cianfrocca wrote:

[#273974] Re: Is there a standard pattern for threaded access to a file? — Brian Adkins <lojicdotcom@...> 2007/10/13

On Oct 13, 1:32 pm, Eric Hodel <drbr...@segment7.net> wrote:

[#273919] RubyGems Beta 0.9.4.5 — Eric Hodel <drbrain@...7.net>

RubyGems 0.9.4.5 is a beta release for the upcoming 0.9.5 which adds

13 messages 2007/10/13

[#273980] top 10 last played mp3's — Robin Wagenaar <robin87_msn@...>

Hello everyone,

18 messages 2007/10/13
[#273983] Re: top 10 last played mp3's — "Andreas S." <x-ruby-forum.com@...> 2007/10/13

Robin Wagenaar wrote:

[#273995] Re: top 10 last played mp3's — Konrad Meyer <konrad@...> 2007/10/13

Quoth Andreas S.:

[#273984] write_noblock is blocking? — Christoffer Lern<lerno@...>

Anyone know what's up with TCPSocket#write_noblock actually blocking

15 messages 2007/10/13

[#274031] Mac OS X Tiger comes with Tk? — SpringFlowers AutumnMoon <summercoolness@...>

I thought it is said that Mac OS X Tiger comes with Tk?

23 messages 2007/10/14
[#274032] Re: Mac OS X Tiger comes with Tk? — Ben Bleything <ben@...> 2007/10/14

On Sun, Oct 14, 2007, SpringFlowers AutumnMoon wrote:

[#274062] MIT vs. Ruby/GPL License — Trans <transfire@...>

Rails uses the MIT license. The Ruby license is essentially the GPL

46 messages 2007/10/14
[#274075] Re: MIT vs. Ruby/GPL License — Randy Kramer <rhkramer@...> 2007/10/14

On Sunday 14 October 2007 09:31 am, Trans wrote:

[#274080] Re: MIT vs. Ruby/GPL License — Trans <transfire@...> 2007/10/14

[#274093] Re: MIT vs. Ruby/GPL License — "Terry Poulin" <bigboss64@...> 2007/10/14

I don't think the difference between MIT and GPL License has much purpose in

[#274098] Re: MIT vs. Ruby/GPL License — Trans <transfire@...> 2007/10/14

[#274066] Parameter in a block is not local? — SpringFlowers AutumnMoon <summercoolness@...>

I thought a iterator with a block is like an nameless function call...

21 messages 2007/10/14

[#274120] nil.to_i returning zero — "Gerardo Santana Gez Garrido" <gerardo.santana@...>

zero in Ruby is true, not false, in a boolean context.

38 messages 2007/10/14
[#274289] Re: nil.to_i returning zero — "Gerardo Santana Gez Garrido" <gerardo.santana@...> 2007/10/15

John Joyce wrote:

[#274227] Re: [ANN] RubyTraits 0.1 — Yukihiro Matsumoto <matz@...>

Hi,

22 messages 2007/10/15
[#274239] Re: RubyTraits 0.1 — Trans <transfire@...> 2007/10/15

[#274242] Re: RubyTraits 0.1 — Yukihiro Matsumoto <matz@...> 2007/10/15

Hi,

[#274244] Re: RubyTraits 0.1 — Trans <transfire@...> 2007/10/15

[#274236] ruby wish-list — Roger Pack <rogerpack2005@...>

My personal ruby wish-list (for any feedback):

177 messages 2007/10/15
[#274243] Re: ruby wish-list — Yukihiro Matsumoto <matz@...> 2007/10/15

Hi,

[#274245] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/10/15

Thanks Matz.

[#274263] Re: ruby wish-list — Robert Klemme <shortcutter@...> 2007/10/15

On 15.10.2007 17:24, Roger Pack wrote:

[#274264] Re: ruby wish-list — Robert Klemme <shortcutter@...> 2007/10/15

On 15.10.2007 18:45, Robert Klemme wrote:

[#274271] Re: ruby wish-list — James Tucker <jftucker@...> 2007/10/15

I don't really see the reason why the GC would need or want a specific thread to itself - for a start, such a design makes the system slower on low end systems. There may also be cases where it is possible to choose 'optimal' times to run the GC within a single thread context.

[#274282] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/10/15

So you'd prefer a few tweaks:

[#274721] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/10/18

GC wish list:

[#274898] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/10/19

Roger Pack wrote:

[#274910] Re: ruby wish-list — Suraj Kurapati <snk@...> 2007/10/19

Oh, wishing star! Here are my wishes:

[#277588] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/11/05

Suraj Kurapati wrote:

[#277760] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/11/06

> Take care.

[#277902] Re: ruby wish-list — "Rick DeNatale" <rick.denatale@...> 2007/11/07

On 11/6/07, Roger Pack <rogerpack2005@gmail.com> wrote:

[#278435] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/11/11

>> I wish... that Range.to_a wouldn't become obselete, as it seems quite useful

[#278460] Re: ruby wish-list — "Rick DeNatale" <rick.denatale@...> 2007/11/11

On Nov 11, 2007 1:13 AM, Roger Pack <rogerpack2005@gmail.com> wrote:

[#278461] Re: ruby wish-list — Marc Heiler <shevegen@...> 2007/11/11

"unless you wanted to introduce ';'s to ruby too:"

[#279154] Re: ruby wish-list — Suraj Kurapati <snk@...> 2007/11/15

Marc Heiler wrote:

[#279174] Re: ruby wish-list — "Todd Benson" <caduceass@...> 2007/11/15

On Nov 15, 2007 11:48 AM, Suraj Kurapati <snk@gna.org> wrote:

[#279181] Re: ruby wish-list — Suraj Kurapati <snk@...> 2007/11/15

Todd Benson wrote:

[#279189] Re: ruby wish-list — James Britt <james.britt@...> 2007/11/15

Suraj Kurapati wrote:

[#279197] Re: ruby wish-list — "Rick DeNatale" <rick.denatale@...> 2007/11/15

On Nov 15, 2007 5:30 PM, James Britt <james.britt@gmail.com> wrote:

[#279203] Re: ruby wish-list — "Todd Benson" <caduceass@...> 2007/11/16

On Nov 15, 2007 5:28 PM, Rick DeNatale <rick.denatale@gmail.com> wrote:

[#279213] Re: ruby wish-list — James Britt <james.britt@...> 2007/11/16

Todd Benson wrote:

[#279226] Re: ruby wish-list — Suraj Kurapati <snk@...> 2007/11/16

James Britt wrote:

[#279232] Re: ruby wish-list — James Britt <james.britt@...> 2007/11/16

Suraj Kurapati wrote:

[#279318] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/11/16

> I'm arguing that methods that end in "?" should be designed and used as

[#279348] Re: ruby wish-list — "Todd Benson" <caduceass@...> 2007/11/16

On Nov 16, 2007 9:26 AM, Roger Pack <rogerpack2005@gmail.com> wrote:

[#281415] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2007/11/30

My latest wish for the wishing tree...

[#281422] Re: ruby wish-list — Trans <transfire@...> 2007/11/30

[#281423] Re: ruby wish-list — "Paul McMahon" <pm@...> 2007/11/30

On Fri, 30 Nov 2007 12:06:18 +0900, Trans <transfire@gmail.com> wrote:

[#281427] Re: ruby wish-list — Trans <transfire@...> 2007/11/30

[#286855] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/01/09

My biggest wish list currently is...I wish I didn't have to use # within

[#286856] Re: ruby wish-list — "Alex LeDonne" <aledonne.listmail@...> 2008/01/09

On Jan 9, 2008 2:37 PM, Roger Pack <rogerpack2005@gmail.com> wrote:

[#288183] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/01/21

[#288228] Re: ruby wish-list — "Robert Klemme" <shortcutter@...> 2008/01/22

2008/1/21, Roger Pack <rogerpack2005@gmail.com>:

[#288267] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/01/22

Robert Klemme wrote:

[#289182] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/01/30

I know this is controversial, but I wish that if you did

[#289229] Re: ruby wish-list — Chad Perrin <perrin@...> 2008/01/30

On Thu, Jan 31, 2008 at 04:34:49AM +0900, Roger Pack wrote:

[#309521] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/07/29

> Now you know you can.

[#295325] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/03/21

Roger Pack wrote:

[#295469] Re: ruby wish-list — Nobuyoshi Nakada <nobu@...> 2008/03/24

Hi,

[#296028] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/03/27

Next wish :)

[#296030] Re: ruby wish-list — "Thomas Wieczorek" <wieczo.yo@...> 2008/03/27

On Fri, Mar 28, 2008 at 12:21 AM, Roger Pack <rogerpack2005@gmail.com> wrote:

[#296031] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/03/27

> You want to create a two-dimensional array, right?

[#296035] Re: ruby wish-list — Tim Hunter <TimHunter@...> 2008/03/27

Roger Pack wrote:

[#296067] Re: ruby wish-list — Damjan Rems <d_rems@...> 2008/03/28

[#296083] Re: ruby wish-list — "Thomas Wieczorek" <wieczo.yo@...> 2008/03/28

On Fri, Mar 28, 2008 at 8:34 AM, Damjan Rems <d_rems@yahoo.com> wrote:

[#296810] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/04/02

> Ruby 1.9 supports named parameters, but I don't know anything about

[#296813] Re: ruby wish-list — Gary Wright <gwtmp01@...> 2008/04/02

[#296815] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/04/02

Gary Wright wrote:

[#296854] Re: ruby wish-list — Chad Perrin <perrin@...> 2008/04/02

On Thu, Apr 03, 2008 at 02:06:21AM +0900, Roger Pack wrote:

[#306230] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/06/25

[#298009] Re: ruby wish-list — Chris Shea <cmshea@...> 2008/04/12

On Apr 12, 10:49 am, Roger Pack <rogerpack2...@gmail.com> wrote:

[#298058] Re: ruby wish-list — Robert Klemme <shortcutter@...> 2008/04/13

On 12.04.2008 20:40, Chris Shea wrote:

[#298237] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/04/15

[#299044] Re: ruby wish-list — Roger Pack <roger@...> 2008/04/21

I wish this worked :)

[#299045] Re: ruby wish-list — "Robert Klemme" <shortcutter@...> 2008/04/21

2008/4/21, Roger Pack <roger@doachristianturndaily.info>:

[#299933] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/04/29

Robert Klemme wrote:

[#301521] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/05/12

All right ruby-genie. My next wish!

[#302766] Re: ruby wish-list — Roger Pack <rogerpack2005@...> 2008/05/23

Back to the wishing well...

[#274338] A Ruby/Rails bibliography — "Jeremy McAnally" <jeremymcanally@...>

Howdy all,

13 messages 2007/10/15

[#274374] equal? versus eql? versus == versus === verus <=> — Paul Butcher <paul@...>

I recently found myself explaining to a friend how Ruby's various

13 messages 2007/10/16

[#274400] How to remove "~" in those files — Vidya Vidya <vidhu1232001@...>

14 messages 2007/10/16

[#274426] Struct is slow — Wayne Magor <wemagor2@...>

I have a script in which I was using a 2-element array where a struct

20 messages 2007/10/16
[#274430] Re: Struct is slow — Alex Fenton <aff28@...> 2007/10/16

Wayne Magor wrote:

[#274460] Compound conditionals in case when statements? Syntax? — Randy Kramer <rhkramer@...>

I need (or want ;-) to do something like the following:

12 messages 2007/10/16

[#274461] recommendations for working with PostgreSQL — Chad Perrin <perrin@...>

I have need to work with PostgreSQL via Ruby. What gems/modules do you

13 messages 2007/10/16

[#274470] Mind giving a little help? — Tj Superfly <nonstickglue@...>

Hello everyone! I posted a topic a few days go and got an answer, and I

13 messages 2007/10/16
[#274475] Re: Mind giving a little help? — Ben Giddings <bg-rubytalk@...> 2007/10/17

On Oct 16, 2007, at 19:56, Tj Superfly wrote:

[#274561] rocaml 0.6.0: fast, easy Ruby extensions in Objective Caml — Mauricio Fernandez <mfp@...>

16 messages 2007/10/17
[#274604] Re: rocaml 0.6.0: fast, easy Ruby extensions in Objective Caml — Daniel Berger <djberg96@...> 2007/10/17

[#274611] Re: rocaml 0.6.0: fast, easy Ruby extensions in Objective Caml — Daniel Berger <djberg96@...> 2007/10/17

[#274619] Re: rocaml 0.6.0: fast, easy Ruby extensions in Objective Caml — Mauricio Fernandez <mfp@...> 2007/10/17

On Thu, Oct 18, 2007 at 04:48:13AM +0900, Daniel Berger wrote:

[#274571] extracting values from consecutive lines — baptiste Augui<ba208@...>

16 messages 2007/10/17

[#274615] Class instance variable idiom — Perry Smith <pedz@...>

I am using this technique for class instance variables:

27 messages 2007/10/17
[#274650] Re: Class instance variable idiom — Brian Adkins <lojicdotcom@...> 2007/10/18

On Oct 17, 4:10 pm, Perry Smith <p...@easesoftware.com> wrote:

[#274661] Re: Class instance variable idiom — "Robert Klemme" <shortcutter@...> 2007/10/18

2007/10/18, Brian Adkins <lojicdotcom@gmail.com>:

[#274708] Re: Class instance variable idiom — Brian Adkins <lojicdotcom@...> 2007/10/18

On Oct 18, 2:44 am, "Robert Klemme" <shortcut...@googlemail.com>

[#274717] Re: Class instance variable idiom — "David A. Black" <dblack@...> 2007/10/18

Hi --

[#274770] Re: Class instance variable idiom — "ara.t.howard" <ara.t.howard@...> 2007/10/19

[#274646] combinations listing — Michael Linfield <globyy3000@...>

Making an form of an anagram solver. My approach would be the code

20 messages 2007/10/18
[#274706] Re: combinations listing — mortee <mortee.lists@...> 2007/10/18

Others have already shown you how you can generate all permutations of a

[#274769] Re: combinations listing — Peña, Botp <botp@...> 2007/10/19

RnJvbTogbW9ydGVlIFttYWlsdG86bW9ydGVlLmxpc3RzQGthdmVtYWxuYS5odV0gDQojIEhvd2V2

[#274774] Re: combinations listing — Michael Linfield <globyy3000@...> 2007/10/19

Thanks all ----

[#274840] Re: combinations listing — Brian Adkins <lojicdotcom@...> 2007/10/19

On Oct 19, 2:01 am, Michael Linfield <globyy3...@hotmail.com> wrote:

[#274773] the level of Ruby programmers vs PHP's — SpringFlowers AutumnMoon <summercoolness@...>

i asked the same question on Ruby: how do you write some code to print

18 messages 2007/10/19
[#274779] Re: the level of Ruby programmers vs PHP's — Shuaib Zahda <shuaib.zahda@...> 2007/10/19

do you mean something like this

[#274820] Is it always the norm to skip 'return'? — Tito Ciuro <tciuro@...>

Hello,

24 messages 2007/10/19
[#274822] Re: Is it always the norm to skip 'return'? — "Glen Holcomb" <damnbigman@...> 2007/10/19

On 10/19/07, Tito Ciuro <tciuro@mac.com> wrote:

[#274936] Why's (Poignant) Guide to Ruby (is this guy ok?) — "Jayson Williams" <williams.jayson@...>

Recently, I was looking for a Ruby guide that could help my son catch

11 messages 2007/10/20

[#274958] RubyGems Beta 0.9.4.6 — Eric Hodel <drbrain@...7.net>

RubyGems 0.9.4.6 is a beta release for the upcoming 0.9.5 which adds

20 messages 2007/10/20
[#274979] Re: [ANN] RubyGems Beta 0.9.4.6 — Sasa Ebach <se@...> 2007/10/20

Hi Eric,

[#274986] Re: [ANN] RubyGems Beta 0.9.4.6 — Eric Hodel <drbrain@...7.net> 2007/10/20

On Oct 20, 2007, at 09:43 , Sasa Ebach wrote:

[#275007] Re: [ANN] RubyGems Beta 0.9.4.6 — Sasa Ebach <se@...> 2007/10/20

> On Oct 20, 2007, at 09:43 , Sasa Ebach wrote:

[#275025] Is Ruby For Me? — Tony De <tony@...>

Hi all,

25 messages 2007/10/21

[#275037] Problem using FileUtils to sort JPEG files — forgottenwizard <phrexianreaper@...>

This is an odd problem, I admit. I'm currently working on a short script

14 messages 2007/10/21

[#275156] IronRuby...will it be like J++? — Thufir <hawat.thufir@...>

Could it be that Microsoft won't fully implement the language

22 messages 2007/10/22

[#275177] REXML (1.8.6-p110) backwards compatibility problem with rcov — Brian Candler <B.Candler@...>

When I upgraded my Ubuntu 6.06.1 system from its stock ruby-1.8.4 to

10 messages 2007/10/22

[#275190] Conflicts between using respond_to? and extending Ruby — Trans <transfire@...>

Hi--

27 messages 2007/10/22
[#275193] Re: Conflicts between using respond_to? and extending Ruby — "David A. Black" <dblack@...> 2007/10/22

Hi --

[#275250] Re: Conflicts between using respond_to? and extending Ruby — "ara.t.howard" <ara.t.howard@...> 2007/10/22

[#275280] Re: Conflicts between using respond_to? and extending Ruby — "Sean O'Halpin" <sean.ohalpin@...> 2007/10/22

On 10/22/07, ara.t.howard <ara.t.howard@gmail.com> wrote:

[#275282] Re: Conflicts between using respond_to? and extending Ruby — "Sean O'Halpin" <sean.ohalpin@...> 2007/10/22

On 10/22/07, Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

[#275230] Re: IronRuby...will it be like J++? — James Britt <dangerwillrobinsondanger@...>

Check the archives of Ruby-Talk.

41 messages 2007/10/22
[#275359] Re: IronRuby...will it be like J++? — "Todd Benson" <caduceass@...> 2007/10/23

On 10/23/07, Robert Dober <robert.dober@gmail.com> wrote:

[#275312] Ruby Certification Test — John Joyce <dangerwillrobinsondanger@...>

In the Japanese page of Ruby Association, at http://www.ruby-assn.org/

24 messages 2007/10/23

[#275324] pop/push, shift/unshift — "Simon Schuster" <significants@...>

the inconsistency in naming bothers me. :P I would imagine that it

51 messages 2007/10/23
[#275338] Re: pop/push, shift/unshift — Robert Klemme <shortcutter@...> 2007/10/23

On 23.10.2007 05:53, Simon Schuster wrote:

[#275354] Re: pop/push, shift/unshift — "Simon Schuster" <significants@...> 2007/10/23

*yawn* oh, what? people have been using these terms for a long time?

[#275360] Re: pop/push, shift/unshift — "richard.j.dale@..." <richard.j.dale@...> 2007/10/23

On Oct 23, 10:50 am, "Simon Schuster" <significa...@gmail.com> wrote:

[#275396] Re: pop/push, shift/unshift — "Jes俍 Gabriel y Gal疣" <jgabrielygalan@...> 2007/10/23

On 10/23/07, richard.j.dale@gmail.com <richard.j.dale@gmail.com> wrote:

[#275400] Re: pop/push, shift/unshift — "David A. Black" <dblack@...> 2007/10/23

Hi --

[#275326] recursive array — "Simon Schuster" <significants@...>

207:0> a = [1,2,3,4]

12 messages 2007/10/23

[#275378] to_yaml and international characters — h3raLd <h3rald@...>

Hello,

15 messages 2007/10/23
[#275383] Re: to_yaml and international characters — "Luis Parravicini" <lparravi@...> 2007/10/23

On 10/23/07, h3raLd <h3rald@gmail.com> wrote:

[#275644] Ruby is simple? NooooT! — Casimir P <pikselNOSPAMMi@...>

Hehe whoever said that ruby is not verbose was WRONG!! ;)

16 messages 2007/10/24

[#275697] .each do |foo, bar| what does bar do? — Thufir <hawat.thufir@...>

"code_words.each do |real, code|

27 messages 2007/10/24
[#276096] Re: .each do |foo, bar| what does bar do? — Thufir <hawat.thufir@...> 2007/10/27

On Thu, 25 Oct 2007 06:14:12 +0900, Ben Giddings wrote:

[#276097] Re: .each do |foo, bar| what does bar do? — "David A. Black" <dblack@...> 2007/10/27

Hi --

[#276149] Re: .each do |foo, bar| what does bar do? — Brian Adkins <lojicdotcom@...> 2007/10/27

On Oct 27, 7:05 am, "David A. Black" <dbl...@rubypal.com> wrote:

[#276162] Re: .each do |foo, bar| what does bar do? — 7stud -- <bbxx789_05ss@...> 2007/10/27

Brian Adkins wrote:

[#275742] Intervals in Ruby — Steven D'Aprano <steve@...>

Howdy,

24 messages 2007/10/25

[#275839] Change a string to an integer, report an error if the string does not represent an integer? — Randy Kramer <rhkramer@...>

Can anybody point me to a way to check if a string represents a valid integer

14 messages 2007/10/25

[#275853] Need help understanding metaclassing — Chris Czub <chris.czub@...>

I've been reading lots of Ruby tutorials trying to figure out

17 messages 2007/10/25

[#275866] Ruby Changes in Leopard — "Laurent Sansonetti" <laurent.sansonetti@...>

Hi,

41 messages 2007/10/25
[#276143] Re: [ANN] Ruby Changes in Leopard — Bil Kleb <Bil.Kleb@...> 2007/10/27

John Joyce wrote:

[#276150] Re: Ruby Changes in Leopard — Brian Adkins <lojicdotcom@...> 2007/10/27

On Oct 27, 2:21 pm, Bil Kleb <Bil.K...@NASA.gov> wrote:

[#276154] Re: Ruby Changes in Leopard — James Edward Gray II <james@...> 2007/10/27

On Oct 27, 2007, at 2:15 PM, Brian Adkins wrote:

[#276161] Re: Ruby Changes in Leopard — "David A. Black" <dblack@...> 2007/10/27

Hi --

[#276172] Re: Ruby Changes in Leopard — "Pat Maddox" <pergesu@...> 2007/10/27

Are there any compelling reasons to use the built-in install? I was

[#275888] What's in YOUR Ruby??? Could Ruby ever be a g.p. dev language? — CodeToad <TheOldCodeToad@...>

Hi Folks,

11 messages 2007/10/25

[#275891] cant seem to get system() & pipe to work together — "dtown22@..." <dtown22@...>

I am trying to run a command line utility which converts a wma file to

11 messages 2007/10/25

[#275911] Skip the first invocation e.g. skip_first { foo } — Brian Adkins <lojicdotcom@...>

Consider the following code:

31 messages 2007/10/25

[#275968] Editing Text (#145) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

34 messages 2007/10/26

[#276035] Newlines included in bracket negation — "Chris Morris" <the.chrismo@...>

(... that subject probably makes no sense ...)

12 messages 2007/10/26

[#276085] open-uri + OpenSSL — Matthew Lagace <matthewlagace@...>

Hello,

13 messages 2007/10/27

[#276137] Checkers library — "Helder Ribeiro" <helder@...>

Does anyone know if there's a sort of library for the game Checkers in

14 messages 2007/10/27

[#276179] A memcached-like server in Ruby - feasible? — Tom Machinski <tom.machinski@...>

Hi group,

27 messages 2007/10/27
[#276216] Re: A memcached-like server in Ruby - feasible? — "ara.t.howard" <ara.t.howard@...> 2007/10/28

[#276185] convert string format — Junkone <junkone1@...>

Hello

18 messages 2007/10/27

[#276228] Talking more about JRuby — Charles Oliver Nutter <charles.nutter@...>

For the most part, we've been pretty good about keeping JRuby

30 messages 2007/10/28

[#276231] JRuby disabling ObjectSpace: what implications? — Charles Oliver Nutter <charles.nutter@...>

As some of you may have heard, we're considering disabling

26 messages 2007/10/28
[#276235] Re: JRuby disabling ObjectSpace: what implications? — Charles Oliver Nutter <charles.nutter@...> 2007/10/28

ara.t.howard wrote:

[#276262] Re: JRuby disabling ObjectSpace: what implications? — Robert Klemme <shortcutter@...> 2007/10/28

On 28.10.2007 08:06, Charles Oliver Nutter wrote:

[#276288] Re: JRuby disabling ObjectSpace: what implications? — Charles Oliver Nutter <charles.nutter@...> 2007/10/28

Robert Klemme wrote:

[#276259] Duplicate elements in array — Shuaib Zahda <shuaib.zahda@...>

Hello

15 messages 2007/10/28
[#276263] Re: Duplicate elements in array — "Sean O'Halpin" <sean.ohalpin@...> 2007/10/28

On 10/28/07, Shuaib Zahda <shuaib.zahda@gmail.com> wrote:

[#276334] Enhancing the Gateway (Help Needed) — James Edward Gray II <james@...>

Here's the short-story on the current situation with our mailing list =20=

23 messages 2007/10/28

[#276422] HTML parser Hpricot? and how to get all text — SpringFlowers AutumnMoon <summercoolness@...>

Would a good HTML parser be Hpricot? I wonder if anyone knows an easy

13 messages 2007/10/29

[#276500] Problem with socket.recv() — "Frank Preiswerk" <frank.preiswerk@...>

Hi everyone,

13 messages 2007/10/29

[#276502] find the closest items in an array to a given value. — trebor777 <mrobert@...777.net>

16 messages 2007/10/29

[#276539] Zip an existing directory? — Peter Marks <petertmarks@...>

Hello,

18 messages 2007/10/29
[#276544] Re: Zip an existing directory? — "Phlip" <phlip2005@...> 2007/10/30

> I am trying to zip an existing directory using the following code:

[#276546] Re: Zip an existing directory? — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/30

Phlip wrote:

[#276550] Re: Zip an existing directory? — Peter Marks <petertmarks@...> 2007/10/30

Thanks for the help guys. I am developing in osx and will deploy in

[#276587] Re: Zip an existing directory? — "M. Edward (Ed) Borasky" <znmeb@...> 2007/10/30

Peter Marks wrote:

[#276547] Gateway Upgraded — James Edward Gray II <james@...>

We are now running on my new gateway code that will hopefully get

27 messages 2007/10/30

[#276618] the result of Ruby official logo contest — Yukihiro Matsumoto <matz@...>

Hello All,

81 messages 2007/10/30
[#276621] Re: [ANN] the result of Ruby official logo contest — Yukihiro Matsumoto <matz@...> 2007/10/30

Hi,

[#276643] Re: [ANN] the result of Ruby official logo contest — Peter Szinek <peter@...> 2007/10/30

Robert Dober wrote:

[#276711] Re: [ANN] the result of Ruby official logo contest — James Britt <james.britt@...> 2007/10/30

Peter Szinek wrote:

[#276746] Re: [ANN] the result of Ruby official logo contest — "Martin DeMello" <martindemello@...> 2007/10/30

On 10/30/07, James Britt <james.britt@gmail.com> wrote:

[#276799] Re: [ANN] the result of Ruby official logo contest — "Jeremy McAnally" <jeremymcanally@...> 2007/10/30

You can see my comments on the http://www.rubyinside.com/ page, and I

[#276808] Re: [ANN] the result of Ruby official logo contest — Yukihiro Matsumoto <matz@...> 2007/10/30

Hi,

[#277215] Re: the result of Ruby official logo contest — Willem Källman <lefteus@...> 2007/11/02

Yukihiro Matsumoto wrote:

[#277288] Re: the result of Ruby official logo contest — Chad Perrin <perrin@...> 2007/11/02

On Fri, Nov 02, 2007 at 06:07:21PM +0900, Willem K??llman wrote:

[#276682] InstantRails windows Installation, problem with Gem — Ronald Dsouza <rondsouza2000@...>

Hi Good Morning,

15 messages 2007/10/30

[#276686] Array and ASCII Help needed... — "Hiato Xaero" <hiato3@...>

Hello there,

13 messages 2007/10/30

[#276710] RUBY DRY to replace 6 lines in 1 — Josselin <josselin@...>

I have a group of lines (used in Googlemaps display) based on 2 arrays :

17 messages 2007/10/30

[#276767] Bounty: $250 - Successfully log in to AOL Webmail with Mechanize — "dave.myron@..." <dave.myron@...>

We're about to release a gem called Blackbook that will automate

12 messages 2007/10/30

[#276801] Why, oh, why, little regexp? — Daniel Waite <rabbitblue@...>

'cost * tax'.match(/([a-z]+)*/).to_a

15 messages 2007/10/30

[#276831] Rubyconf Attendees — "Rick DeNatale" <rick.denatale@...>

Just wondering how many other regulars of ruby-talk will be in

26 messages 2007/10/31

[#276918] Dinner / drink recommendations for Charlotte? — Francis Hwang <francisphwang@...>

With RubyConf 2007 almost upon us, do any Charlotte natives care to

12 messages 2007/10/31

[#276978] Sorting a string... — Daniel Waite <rabbitblue@...>

I was porting a small Python script over to Ruby and realized Ruby does

15 messages 2007/10/31

Re: Class instance variable idiom

From: "Rick DeNatale" <rick.denatale@...>
Date: 2007-10-19 16:22:18 UTC
List: ruby-talk #274844
On 10/19/07, ara.t.howard <ara.t.howard@gmail.com> wrote:
>
> On Oct 18, 2007, at 11:22 AM, David A. Black wrote:
>
> and ara responds to him but mostly to the general thread:
>
> >
> > I'm on record as saying that class variables are the thing I dislike
> > most about Ruby, so I'll try to explain why.
> >
> > They break encapsulation.
>
> i honestly don't think they do - inheritance breaks encapsulation.
> for example
>
>   class A
>     CONST = 42
>
>     class << self
>       def shared() 42.0 end
>     end
>   end
>
>   class B < A
>   end
>
>   p B::CONST
>   p B::shared
>
> class vars are exactly like this - only with state that happens to be
> resettable.  i don't see anything particular about the way class vars
> behave that is different from constants or singleton (note the
> *single* in singleton methods that can be called on multiple
> objects!).

The main reason, I've never been completely comfortable with the Ruby
conflation of singleton class and metaclass.  Or maybe it's the
conflation of singleton methods and class methods.

Seems to me that singleton methods SHOULD only be applicable to a
single object.  A singleton class of a non-class is constrained to
containing only singleton methods in that sense, because it can't be
subclassed. A singleton class of a class is not.  It's actually the
class that's the singleton here in that it's the only allowed instance
of its, dare I say it, metaclass.

But I digress.

> it's the concept of inheritance that breaks
> encapsulation, this is of course generally accepted by oop geeks, and
> ruby doesn't change this wart on oop's many graces.

Agreed.

Inheritance is a power tool, valuable and sometimes dangerous. Did I
mention that it's valuable!

> > They are visible to a weird assortment of
> > objects: class C, instances of C, class D < C, instances of D... all
> > the same variable. This cross-section of objects doesn't have anything
> > in common except that they can all see each other's class variables.
> >
>
> and constants and singleton methods....  of course class singleton
> methods, in an instance context, require a 'self.class' prefix to
> invoke while constants do not but this is not encapsulation - it's
> the breaking of it - instances *should* be allowed to access the
> unfettered methods of their class because requiring the 'self.class'
> prefix also makes them *public* which, of course, seriously breaks
> encapsulation.

I'm not sure that I totally agree here. There might well be class
methods which the class doesn't/shouldn't expose even to its
instances.

Perhaps there are use cases for a fourth visibility (in addition to
public, protected, and private) which makes a method visible to
instances, between public and protected.

> in point of fact inheritance is *designed* to break encapsulation so
> that we can reuse code and remain sane.  child classes, mixins,
> friend classes et al are all about tearing down the barriers between
> bits of code so we don't descend.into.dot.dot.dot.dot.hell and
> develop carpal tunnel from all that code pasting

Yes.

> > The prefix @@ makes it appear that they have some connection or
> > kinship with instance variables. Actually, they're almost the
> > opposite. Instance variables represent state on a strictly per-object
> > basis. Class variables cut across many different objects and scopes.
> > I would prefer them to look like $$this, since they're really a
> > kind of restricted global variable rather than an extended instance
> > variable.
>
> i can see that.  still, they *are* associated with an instance - an
> instance of a class hierarchy.  i realize people don't generally seem
> to grasp this concept though.

I understand what you're saying Ara, but it's a little hard to grasp
because there really isn't anything which reifies 'a class hierarchy'.
 In reality a class variable is associated with a class, which of
course is the root of a class hierarchy, but the way they are
implemented, it really means they get associated with a kind of
snapshot of the hierarchy as it existed at the time the class variable
was defined.  I say this by way of explaining the problems of defining
a class variable in a superclass, AFTER a subclass has already defined
a class variable with the same name.

This is one instance of a small set of curiosities in Ruby due to
problems in re-building the runtime structures when certain
inheritance related changes occur.  To me it seems to be similar to
the problems with the semantics of module re-inclusion.

Now I'm not sure that Matz was directly inspired by Smalltalk in
coming up with class variables, but given my background I tend to
think so.  Ruby class variable have a lot in common with Smaltalk's
certainly in terms of inheritance and visibility in both class and
instance methods. Assuming he was...

One of the biggest differences (and I'd say for the most part it's an
improvement) between Ruby and Smalltalk is that in Smaltalk variables
are declared, whereas in Ruby they are defined in the process of
expression parsing/execution.

In Smalltalk, you declare a class with something like

   Object subclass: #Foo
                instanceVariableNames: 'instVar'
                classVariableNames: 'ClassVar'
                classInstanceVariableNames: 'classInstVar'
                poolDictionaries: 'PoolDict'

And the compiler uses these declarations when compiling a method. In
Smalltalk instance variables and class instance variables can be bound
to a slot at a fixed offset from the begining of the instance, or
class.  Class variables can be bound to the value slot in a dictionary
associated with the class.  I'll ignore pool dictionaries, they serve
some of the purposes of the name space aspect of modules.

The compiler searches up the hierarchy to find inherited class
variables, and the methods for manipulating the classVariableNames
list of a class validate that a conflict can't be created.  Changing
the class declaration in Smalltalk triggers a recompilation of all
methods of the class and its subclasses.

Ruby substitutes run-time binding binding of variables, rather than
being at a fixed offset, ruby instance (and class instance) variables
are bound to a value slot in a hash associated with the instance or
class, class variables are bound to a hash as well (the last time I
looked it was the same hash, which works because the key contains the
sigil, so the keys :@instance_var, and :@@class_var can both be in the
hash, reflection methods like Object#instance_variables filter their
results to hide this implementation.  Note also that this description
is from my memory of reading the MRI 1.8.x code, other Ruby 1.8
implementations might well use different implementation techniques but
should have the same semantics.

So what was my point here?  Oh yes. I was talking about what happens
when you make certain changes to the inheritance structure.  If we
had:

class A
end

class B < A
     @@cv = 42
end

And then later
class A
    @@cv = 57
end

Ruby currently at most warns about a conflict then goes ahead and adds
a new class variable to A, leaving the existing one in C.

I think that the change in 1.9 was motivated by this anomaly, by doing
away with the inheritance of class variables we avoid the surprise.
On the other hand, as you point out below, the baby might be being
thrown out with the bath water!

It seems to me that another solution would be to simply remove the
class variable from a subclass when a superclass subsequently creates
one with the same name.  Sure B's view of @@cv would change from 42 to
57, but that's consistent with the intended semantics, I think.

On the other hand, there might be subtleties I can't yet fathom, much
like I still don't understand why 1.9 changed the semantics of:

module M
    def meth
        "M"
    end
end

class A
   include M
end

class B < A
   def meth
         "B"
   end
end

class C
    include M
end

C.new.meth

So that in 1.9 this used to result in "M" but then they changed it
back to the 1.8 semantics which ignore the re-inclusion and results in
"B".

> > The worst thing about them, in my view, is the amount of confusion
> > they have caused. The fact that there is something called a "class
> > variable" -- and that it looks vaguely like an instance variable --
> > has been a huge obstacle for people trying to get a grasp on the idea
> > that classes are objects and can, via *instance* variable, have their
> > own state. Class variables throw a big shadow over that otherwise very
> > consistent and lucid state of things. I've seen this happen again and
> > again for seven years.
>
> absolutely correct.

i think that the problem should be dissected, it's really two problems:

   1) Ruby class variables look too much like instance variables
because of syntax @@ vs @
   2) The Ruby class variable implementation has a few rough edges.

The first problem makes me tend to agree that it would have been
better to choose another sigil for denoting class variables, although
this would seem to have a pretty sizable cost in backward
compatibility.

The second problem would seem to be fixable, at some cost to backward
compatibility, but 1.9 has already taken one path at fixing it.

> >
> > In Ruby > 1.8, class variables are going to be somewhat more strictly
> > per-class. That's a mixed blessing. They're going to come closer to
> > representing a class's state, but then the question will arise: why
> > have both that *and* instance variables of classes? It's not
> > impossible to answer that, but it's not a bad question.

I guess that the only difference between class variables and class
instance variables in 1.9 is that the former are visible in instance
methods.

It seems to me that the baby is in the bathwater here, the baby being
uses which rely on inheritance of class variables.

It might be interesting to see what happens when rails steps up to
ruby 1.9.  It appears to use class variables pretty extensively.  I'm
not sure how much it relies on class variable inheritance though.

> > That sums up my views. Just so you know: I love Ruby madly :-) This is
> > one of the very few areas where I dissent strongly from the way it's
> > designed.
> >
>
> yeah i see all that.  still, i've deigned quite a few ruby classes
> and i can assure people that they will miss them when they are gone/
> limited.  the reason, curiously, is that classes do not have an
> initialize method/hook.  let me explain: let's say you want to do
> something quite reasonable like so
>
.. Long example justifying inheritable class variables snipped.
>
> in short there are a million reasons to use class variables revolving
> around the glitch that class inheritance in ruby does not provide a
> straightforward way for child classes to have any sort of setup step
> performed and that class variables let you perform that setup once in
> a way that is inherited and yet settable by client code.

Not much to disagree with here.

An interesting side note.  In Smalltalk, the declaration of variables
doesn't initialize them.  Conventionally, class variables are
initialized in a class method called initialize.  I'm a bit rusty on
this but IIRC this is something which has to be done manually after
defining the method and before instantiating any instances of the
class.

> anyhow i really think it's the syntax, not the concept, that is cause
> for confusion.

To summarize what I've said, I think it's a combination of the
semantics and the implementation.

> ps.  there are a lot of powerful concepts in ruby that are mostly mis-
> understood: closures, mixins, singleton classes, callcc, throw/catch,
> and lambda abstraction are part of what allows ruby to grow in
> usefulness beyond the realm of the 'mere scripting language' some
> people set out to learn. i would be loathe so any of them vanish.

Amen.


> pss.  encapsulation is vastly overrated.  when is that last time you
> used 'protected' in any ruby code?  ;-)

Careful, Ara, the thought police are lurking! <G>

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

In This Thread