53298-54221

53120-60465 subjects 53491-54326

Ruby GC Change
53298 [billtj@z. lu] ..... as inspired by how gc is exactly done in Lua, perhaps?  :)

Where is socket defined
53303 [web2ed@ya oo] Can someone tell me where the implementation source is for socket.so?
53305 [billtj@z. lu] In some linux/unix distribution, "socket.c" is placed under

Sorry, just a test
53312 [ kosha@Kp ru] WBR

Is the debugger broken?
53315 [gsinclair@so] Is it just me or does the debugger not work the way it is supposed to?
+ 53317 [nahi@ke na t] It is expected behaviour because the current debugger does
| + 53333 [gsinclair@so] I'll look out for it.  It may take me a few days, but I will get back to you.
| | 53424 [nahi@ke na t] Here is another workaround for debug.rb in 1.6 althourgh
| + 53554 [laurent@mo d] Actually, any one line loop makes the debugger enter in a endless
| + 53622 [gsinclair@so] Hmmm... I was going from memory when writing "there are problems with loops".
|   53623 [gsinclair@so] too
+ 53665 [gsinclair@so] you
  53670 [meier@me st ] story
  53809 [jfh@ci e. fl] I've just run into this problem this morning. The pattern I seem to be

PostgreSQL samples
53316 [ kosha@Kp ru] Where can i find an example code for postgresql ruby module ?
53318 [davinci@es o] You have a "sample" directory included with ruby-postgres source. It
53319 [ kosha@Kp ru] Thanks.

Starting interactive shell/irb from within a script?
53322 [paul@fl or a] I was wondering if there exists a module that allows you to start an
53327 [stefan.schol] Take a look at irb. It's a very easy and small script.

Hooking on method invocation
53328 [viking@fu ca] Is there a way to hook on invocation of *any* instance method of an
+ 53338 [batsman.geo@] Delegation maybe?
| 53346 [batsman.geo@] module Observable
| 53354 [ahoward@fs .] that seems pretty complicated - it seems like what is needed is a
| 53360 [batsman.geo@] In fact this could be meaningful w/ any method that changes the state
+ 53367 [avi@be a4 co] ...
| 53431 [decoux@mo lo] Look at fwrap, I think that you can have a better interface with it
+ 53373 [billtj@z. lu] I am sorry that I think the whole discussion has advanced to a new

gsub and Backslashes
53331 [billtj@y. lu] Can you give an example of how it may be tricky (causing
53377 [n1k0@ro er .] I'm assuming he was referring to Botp's wish list not the ruby newcomers list (my mail reader thinks he was replying to that post).
53543 [umarumohamme] ibz@ignoramus:$ irb
53547 [billtj@y. lu] Thanks for the input.  I will include it in the list.

XML-RPC connection failed
53349 [pooh@cs tu b] Dear Ruby Experts,
53352 [kentda@st d.] Try setting the server hostname or IP when you create the server. The

Things That Newcomers to Ruby Should Know (10/16/02)
53359 [billtj@y. lu] I just updated the list, which is also available in HTML format at
+ 53541 [kgergely@ml ] Also notice (performance tip), that
| + 53548 [billtj@y. lu] Thanks.  Although I think performance-related issues should be in another
| + 53772 [ian@ca ib n.] Hmm, why does 'string += another' need to create a new object? string
|   53774 [hal9000@hy e] It's a feature. :) The notation a+=b really, REALLY
|   53775 [ian@ca ib n.] I understand that, but since 'a' already exists prior to assigning a + b
|   + 53776 [rich@in oe h] 'a' is a variable...not an object.
|   + 53778 [hal9000@hy e] Look at it this way: The expression a + b yields a
|   + 53822 [billtj@z. lu] Based on previous responses, I think a standard example answer to your
|   | 53984 [ian@ca ib n.] Thanks, William. Your example is both succinct and very clear.
|   | 53998 [billtj@y. lu] I will put it in the list.
|   + 53933 [bulatz@in eg] main problem is that object pointed by 'a' mauy be also pointed by
|     53940 [batsman.geo@] Would it be possible for Ruby to know whether an object is referenced by
|     + 53941 [bulatz@in eg] simple things must remain simple :)  instead of counting references
|     | 53951 [batsman.geo@] Yeah, KISS applies always, but I may anyway try to implement this in the
|     | + 53953 [app1tam@up .] But why does it really, REALLY mean that?  Was there a reason for doing
|     | | + 53956 [gsinclair@so] It's just the way it is.  In C++, the following are separate overloadable
|     | | | 53999 [eric.armstro] begin
|     | | + 53960 [billtj@z. lu] As already been pointed out, this is because in Ruby when a variable is
|     | | + 53961 [austin@ha os] It's non-sensical. << exists only as Array#<<, String#<<, and IO#<<
|     | | + 54007 [hal9000@hy e] It's fairly trivial to change the behavior, but the
|     | |   54015 [billtj@y. lu] In my opinion, for any "reasonable" programmer, it is usually not the
|     | |   54043 [dblack@ca dl] I don't think "a += 'str'" (or whatever) is creating an intermediate
|     | |   + 54052 [billtj@z. lu] Probably "intermediate" is not an exact terminology; maybe "new" object is
|     | |   + 54072 [austin@ha os] intermediate
|     | |     54077 [dblack@ca dl] I think that's kind of a roundabout way to describe it though.  I
|     | |     54108 [kgergely@ml ] BTW, ONE or TWO intermediate objects?
|     | |     54114 [bulatz@in eg] ONE intermediate object and ONE assigned to b. this intermediate
|     | + 54091 [bulatz@in eg] operation 1
|     |   54124 [billtj@y. lu] I am not sure if it will make ruby fatter; I cannot verify whether
|     + 53942 [gsinclair@so] I don't think so.  += is syntax sugar for you-know-what.  Imagine trying to
|       53950 [batsman.geo@] [Disclaimer: I'm not proposing a modification of the language, see [52838]
|       53955 [billtj@z. lu] If you do "incomplete RC", basically you have to find all the places where
|       53966 [batsman.geo@] What I was thinking of isn't really GC, but a rather elaborated COW with
|       + 53982 [app1tam@up .] It's not non-sensical.  If it appeared that I mean for all objects to use
|       | + 53983 [app1tam@up .] Actually, the way you describe '+=' makes sense to me.  It is what I would
|       | | 54001 [billtj@y. lu] Actually Ruby still gives you a choice.  When you have
|       | | 54012 [dblack@ca dl] True, although the term "side effects" might be ascribing more
|       | | 54019 [billtj@y. lu] Your example is really interesting (surprising to me, actually).  Aren't
|       | | 54221 [B.Candler@po] I also find this interesting, as it's a side-effect of subclassing I hadn't
|       | + 53986 [austin@ha os] It still remains non-sensical because it then becomes necessary to
|       |   + 53990 [alan@di ik t] I totally agree with you. Ruby's way of doing it makes the performance
|       |   + 54003 [billtj@y. lu] I probably would not call C++ nonsensical and broken; I think it is just a
|       + 54000 [billtj@y. lu] I guess then basically the optimization will work only with Ruby
|         54034 [batsman.geo@] Writing extensions is always quite unsafe, so we're already trusting the
|         54050 [billtj@z. lu] I think there are already existing Ruby applications/library/extensions
|         54051 [batsman.geo@] How many do need several references to the same string from the C side?
|         54057 [billtj@z. lu] I think the point is not *how many* but just if *there exists* some C code
|         54066 [batsman.geo@] I was thinking 'how many' because I could always "fix" them if it's only
+ 53558 [eric.armstro] Online copy of the Pragmatic Programmer's Guide available
+ 53680 [billtj@z. lu] Based on the comments that I received, I just updated the list
  53754 [botp@de mo t] Are you linked to ruby-lang or ruby.ch? I do hope so since I may forget your
  53769 [billtj@z. lu] I am not.  But fortunately, a gentleman (Armin Roehrl) has included the

Marshaling with ARGF
53368 [google@to pa] The Marshal.load function demands an object of type IO. Unfortunately,
53399 [nobu.nokada@] Dirty hack.
53402 [nobu.nokada@] Oops, forgot to flush at the end and propagate taintness.
53419 [matz@ru y- a] Commit these fixes, please.
53466 [google@to pa] Thanks Nobu & Matz.

Plugin autoregistration (inherited method call)
53376 [rubytalk@bo ] i'm trying to write some kind of plugin system for my project ... and
53382 [ruby-talk@wh] I believe Transport.inherited is called before the TCPTransport class definition
+ 53384 [rubytalk@bo ] Thanks a lot! That's exactly what i dreamt about :)
+ 53436 [pit@ca it in] thanks for the code. Very nice idea.

Precompiling eval expressions
53378 [B.Candler@po] What ways are there to pre-compile an "eval" expression which is going to be
+ 53380 [tsiivola@cc ] Like this?
| 53428 [B.Candler@po] Ah, some things falling into place now :-)
+ 53383 [tsiivola@cc ] Procs are closures: they contain their enclosing environment (ie. as a
  53432 [B.Candler@po] I kind-of got that bit already. It's clear that this cannot be a traditional
  53451 [tsiivola@cc ] I suspect that this is caused be the eval, not by the closures.
  53453 [gsinclair@so] frame,

Invalid HTML code in mailing list archives
53381 [pmak@aa ni e] In the mailing list archives at
53389 [tom.hurst@cl] The page doesn't claim to be HTML 4.01; it's just tag soup.  Really bad

Method#arity problem
53385 [info@mj is d] def get_arity(c)
53395 [pbrannan@at ] irb(main):001:0> Kernel.instance_method(:putc).arity

DBI:Pg 'autocommit' is not a valid option name
53388 [schuerig@ac ] I'm trying to use transactions with DBI and PostgreSQL and I'm running
53405 [jweirich@on ] This works for me with DBI ...
53408 [schuerig@ac ] Doesn't work for me, although I'm sure it should. I have no idea what's
53414 [jweirich@on ] Here's the full script.  This one was written against the Pg DBD.  When
53421 [schuerig@ac ] Here's where it fails with
53698 [520079130762] Try the previous version (0.0.16) of Ruby/DBI until this has been

fork and exec
53390 [mengx@tv at ] I ran the program below.
53398 [nobu.nokada@] exec ("exec cat < ttt") if pid.nil?
53566 [web2ed@ya oo] Is there any chance Ruby will eventually have its `own' OS hooks so
53761 [nobu.nokada@] Though I'm not sure what you mean by "OS hooks", do you want to

How to tell if a method accepts this many arguments?
53394 [pmak@aa ni e] m = board.method(cmd)
53420 [pmak@aa ni e] Thinking more about this, wouldn't it make more sense for Method#arity

IPC
53413 [hyukjoon@e5 ] Can anyone tell me the way to get rid of the intermediate temporary file
53418 [nobu.nokada@] What you want is an equivalent to `cmd1 | cmd2 | cmd3' in

Strings or symbols?
53417 [pmak@aa ni e] When working with a record that has various fields represented using a
+ 53423 [gsinclair@so] Your examples are the wrong way around!
| 53425 [kentda@st d.] Or converting strings to symbols, if I understood the OP correctly :-)
+ 53435 [ndrsbngtssn@] I would probably use symbols, since it is the same few values used many

Date handling with DBI
53422 [gsinclair@so] Rubyists,
+ 53454 [meier@me st ] andler
| 53467 [gsinclair@so] stm = dbh.prepare("intert into test values (?)")
| + 53476 [meier@me st ] date
| + 53502 [gsinclair@so] date
|   53532 [ahoward@fs .] silly question, but have you tried quoting the date string?
|   53569 [gsinclair@so] Thanks 'a' :)
+ 53601 [jweirich@on ] This worked for me (using the PostgreSQL driver) ....
  53606 [gsinclair@so] Thanks Jim.  I didn't even *know* about DBI::Date, and I've spent ages reading

Converting String to Time would be nice
53426 [gsinclair@so] Comments?
+ 53427 [nahi@ke na t] +1 to ParseDate.
| 53429 [gsinclair@so] "%x %X" *is* according to locale.
| 53433 [nahi@ke na t] My apologies.  I completely missed the point...  You need
+ 53430 [phasis@ko ne] require 'time'

Multiple constructors in a .c extension?
53437 [paul@fl or a] I was wondering if it is wise/common practice/allowed to have multiple
+ 53438 [enric@1s ar ] This brings another question, why does ruby use as default an instance
| 53452 [gsinclair@so] When you perform "x = Froz.new", you're not calling Froz.new, you're callnig
| 53456 [enric@1s ar ] Sorry to ask, I'm a newbie with Ruby, and I don't understand what means
| 53460 [billtj@z. lu] I think what Gavin meant was to replace "Test.new_from_file" with
+ 53449 [nobu.nokada@] You would be surprised when you create a subclass.
  53464 [billtj@z. lu] "... Data_Make_Struct. However, although this allocates memory for the

Subclass IO ...
53439 [marco.koegle] I'm writing an application with a graphical (OpenGL) console, which is
+ 53445 [nobu.nokada@] $defout needs "write" method.
+ 53450 [gsinclair@so] You may not need to subclass IO.  Just create a class or object that implements

behaviour of nil
53440 [cedric.foll-] why the '+' method of nil isn't defined ?
+ 53446 [peter@se an ] The problem here is that nil + "aaa" doesn't work the same way as in
| 53458 [michael_s_ca] =====
| 53462 [peter@se an ] However he also stated that it worked in Perl which to me shows that he
| 53472 [cedric.foll-] No ! Be sure that "he has thinking in terms of object / method / reciever"
+ 53448 [gsinclair@so] Some people will give you good reasons why it's not like that in Ruby.  You
+ 53457 [Dave@Pr gm t] The current behavior is a useful way to catch programming errors such
  53515 [kgergely@ml ] This can be tracked down if all fields must be explicitly defined.
  + 53518 [decoux@mo lo] What is the next step : declare all classes, all variables, all methods ?
  + 53538 [ahoward@fs .] if what you mean by defined is that storage is reserved for a symbol, as
    + 53539 [kgergely@ml ] What if smu is the correct spelling?
    + 53731 [qute@kl g. k] ======================================================
      53738 [ahoward@fs .] duh!  can't believe i didn't think of that... i do it perl all the time too!

Buggy shebang behavior with different newline style
53441 [paul@fl or a] After some puzzling I found out why my script with correct shebang line
+ 53442 [paul@fl or a] Dang, that's in 1.6.7, BTW
+ 53443 [nobu.nokada@] It's due to the kernel behavior.  Claim to the linux
+ 53444 [tom.hurst@cl] This is an operating system thing, nothing to do with Ruby; the error is
+ 53455 [nobu.nokada@] An easy workaround. ;-)

Enumerable.partition
53471 [google@to pa] I see that Enumerable.partition has been added somewhere between 1.6.7
53501 [nobu.nokada@] This seems nice.
+ 53642 [google@to pa] Fair enough, but there's no need to include both "partition" and
| 53647 [matz@ru y- a] But still, I feel they are different.  The original one does split
+ 53700 [qrczak@kn .o] s1, s2 = s.partition {|x| ...}

File.makedirs and permissions
53473 [pbrannan@at ] def makedirs(*dirs)
53484 [tarasis@bt p] My guess would be that mode is only really supported on *nix platforms

DevelAALogger - missing ?
53474 [rgroenenberg] ...
53507 [nahi@ke na t] I'm sorry for strange name. :)

Hashes v.s. Classes (was Re: Strings or symbols?)
53477 [pmak@aa ni e] I've thought of doing that, but I found certain properties of the hash
53480 [ndrsbngtssn@] You can get the names of all instance variables of an object with
53500 [hal9000@hy e] 1. Give your class a to_hash method (maybe

Ruby on RedHat 8.0?
53478 [web2ed@ya oo] Does anybody know whether Ruby made it into RedHat's last release
+ 53487 [W.L.Kleb@la ] It's been in there since RedHat 7.2, IIRC.
+ 53488 [lyle@us rs s] Yes, it's Ruby 1.6.7. (I believe it was also there in the Red Hat 7.x
| 53497 [ian@ca ib n.] It was introduced in Red Hat Linux 7.3, but the packages are rather
| 53511 [botp@de mo t] I see it. It's simply cool and helpful.
| 54101 [zx@is pk .e ] I do not find it on ruby-lang.What is raa?
| 54122 [alwagner@tc ] ...
+ 53489 [ianm@Ac iv S] It also ships with Mandrake 9. As I discovered just after I'd built it

Having trouble installing OSSL
53481 [sera@fh an .] I'm trying to install OSSL, but it gives me this error when I run
53483 [gotoken@no w] Try
53540 [sera@fh an .] I looked for ssl.h, and it's in /usr/local/ssl/include/openssl/ ...
+ 53542 [gotoken@no w] % ruby extconf.rb --with-ssl-include=/usr/local/include/openssl \
+ 53546 [m.rokos@sh c] ruby extconf.rb --with-openssl-dir=/usr/local/ssl
  53695 [sera@fh an .] gcc -fPIC -g -O2  -I. -I/usr/local/lib/ruby/1.6/i686-linux -I.
  53705 [m.rokos@sh c] What version of OSSL do you have? 0.1.2a?
  53870 [sera@fh an .] I've been trying to install 0.1.2, on a Linux box.

FW: DevelAALogger - missing ?
53482 [rgroenenberg] ...

Help
53486 [ricard@bu fa] and I have a problem, I have created a php page that generates a html

Assignment
53490 [marnaudo@in ] error = 0
53492 [billk@ct .c ] Did you mean != ... (not-equal, as opposed to equal not?)
53552 [marnaudo@in ] Thanks Bill,
53555 [marnaudo@in ] Hemm, NOW it works!
threads.html
top