20588-22393

20345-21580 subjects 20724-21364

Calling class member functions from C++
20588 [jglueck@vo .] I have been integrating Ruby into my game engine, and it works quite
20634 [decoux@mo lo] Well difficult to reply without seeing completely the code. Apparently the
20824 [jglueck@vo .] So what's the difference ? Class methods are static or singleton
20826 [ned@bi e- om] You don't call an instance method without an instance.

DRb and Global Variable Context
20589 [clem@we l. o] I've been recently working on a project in Ruby that requires a Unix
+ 20609 [m_seki@mv .b] The variable of a receiver side are used.
+ 20612 [neumann@s- i] It uses the global/environment variables in which is was started.

hml use pragmatic programmer
20590 [w3gat@be ls ] In trying to learn ruby I've been going through the book.

GetPot ported to Ruby
20592 [fschaef@ce .] I just finished porting the GetPot command line and input file
20622 [alwagner@ua ] You might want to rename GetPot itself, before you attact undue

The Rabbit
20594 [Dave@Pr gm t] Well, the English one is "The Pickaxe Book". Will the Japanese version
20658 [thegrandbrie] perhaps 'Ne' is more appropirate in this case, ne?
+ 20659 [hal9000@hy e] Oh, fie, who knows how to spell that, anyway?
+ 20682 [toddg@li ux ] or maybe
  + 20684 [hal9000@hy e] Hmm, would a "bare" installation of Python
  + 20690 [thegrandbrie] okay, nobody got it that replied so here's why... the monty python spelling
    20691 [toddg@li ux ] wakarimashita, kedo omoshirokunai desu to omotta.  kaerite, ne?
    20692 [hal9000@hy e] spelling

Clipboard
20596 [WmLi@Th ug t] Can anyone give me a sample of how to copy a string to the clipboard in
20608 [phasis@ha an] require 'Win32API'

Calling protected methods from class methods
20600 [vjoel@pa h. ] Why can't a class method call a protected instance method, as in the
+ 20602 [matz@ru y- a] Because it's protected.  I don't want my parents read my journal.
+ 20613 [decoux@mo lo] Try this
  20636 [vjoel@pa h. ] But that can be done from any context, not just class methods of the same

String.subst[!] RCR
20604 [   xm@w3 .r ] I have a proposal ;) Not sure eveyone will need it - maybe everyone is
20605 [matz@ru y- a] You mean you want "str.sub(pat, new)" without using regular
20606 [   xm@w3 .r ] I'm sure it _is_ faster ... but I believe that's it because of subst is
20607 [matz@ru y- a] I meant RE substitute can be as fast as C implemeted subst.
20611 [matz@ru y- a] By the way, if you can live with single substitution (i.e. "sub", not

Dynamic generation of class variables?
20614 [buter@CW S. ] Does anyone have an idea how to dynamically add a _class_ variable to
20629 [dblack@ca dl] At the cost of sounding thick, I'll say that I'm not sure exactly what
20767 [buter@CW S. ] In plain text, this is what I am looking for. I add the 'property'
20769 [decoux@mo lo] use the class variable @properties
20775 [buter@CW S. ] <snap>
20777 [decoux@mo lo] No, no

Weird string behaviour, I'm stuck.
20616 [recon_nospam] I've put the following Ruby program in de cgi-bin directory of my
+ 20618 [decoux@mo lo] If I'm right mod_ruby run with $SAFE = 1. At this level you can't create a
+ 20620 [kentda@st d.] You're not doing anything wrong. Ruby is just being very, very careful,

Ruby in Portland
20621 [pate@ne wo k] I thought this might be of interest to any ruby-ists in the Portland

Changes to date in 1.7.*
20623 [hal9000@hy e] Two questions here, really.
20630 [matz@ru y- a] see doc/NEWS.

Passing procedures
20635 [peterhi@sh k] I am building this class that takes a user defined procedure and then
+ 20637 [kero@d4 50 u] testproc = proc { |a, b|
+ 20638 [ned@bi e- om] but testfunc only takes two parameters...
+ 20641 [peterhi@sh k] Thanks for your quick response, both of you.

Thread newbie
20639 [alwagner@ua ] In my first try at threads the threaded block runs VERY slow. I

Ruby on IRC?
20643 [hal9000@hy e] Where is Ruby discussed in chat?

Iterating by links
20646 [vjoel@pa h. ] This is part of an Enumerable extension package I'm going to submit to RAA
20650 [dblack@ca dl] I'm still playing around with this :-)  but one possible source of
20652 [vjoel@pa h. ] Good point. Maybe it should automatically check for respond_to? before
20669 [dblack@ca dl] That still has the test-for-nil behavior, though.
20687 [vjoel@pa h. ] David,
20697 [dblack@sa ur] True, but classically speaking, all you're looking for is a pointer or

net/telnet problems
20647 [cyoungbl@le ] I'm having a problem with the Net::Telnet class.  Any help would be greatly
+ 20857 [acagle@su im] Carl,
| 20880 [cyoungbl@le ] Thanks for your help.  For me (running on Win2k server client), I get the
+ 20891 [ljohnson@re ] Don't know what to tell you other than, you're not the first person who's

ruby quine
20648 [tromp@da sy ] The web page
+ 20653 [mike@st k. o] Is the program between the quotes legal :-)
| 21077 [ser@ge ma e-] x=%q/puts "x=%q\057#{x}\057;#{x}"/;puts "x=%q\057#{x}\057;#{x}"
+ 20656 [hal9000@hy e] The issue of quines has come up twice or thrice...

Changing a program's name at run time via $0...
20651 [sean-ruby-ta] Anyone have any ideas how to change a program's name while it's
+ 20655 [green@Fr eB ] Ruby needs to be updated to use setproctitle(3) on platforms which have it.
| 20673 [matz@ru y- a] Thank you for the patch.  I fixed several bugs too.
+ 20665 [armin@ap ro ] Sorry, I don't know how to do this.
  20668 [green@Fr eB ] It's something a lot of long-lived applications running in the background do

replacing items in arrays
20660 [tobiasreif@p] 1.
20661 [ale@cr ms n.] vs.
20663 [tobiasreif@p] thank you very much for your help.
20664 [ale@cr ms n.] This is an imperative way to do it. I wouldn't dare to call it procedural

corresponding "non-bang" method to []=
20671 [tobiasreif@p] There's "collect", and the bang version "collect!"
20672 [neumann@s- i] There's no one.
20674 [tobiasreif@p] []= is bang. What's the non-bang version?

RCR: non-bang equivalent to []=
20675 [tobiasreif@p] I'm rying to modify specific items in a nested array, without modifying
+ 20676 [dblack@ca dl] I'm sorry -- I don't understand.  What exactly is supposed to happen?
| 20678 [tobiasreif@p] Would the following make sense?
| + 20679 [dblack@ca dl] That phrase sounds self-contradictory to me :-)  Anyway....
| | + 20695 [tobiasreif@p] David,
| | | 20713 [hal9000@hy e] What about Array#insert in 1.7.1? Does it modify the receiver?
| | | 20722 [matz@ru y- a] Yes.
| | + 20700 [tobiasreif@p] somehow my answer made it to the archives, but I didn't receive it, so
| + 20699 [mikkelj-anti] I think it makes perfect sense. It relates to functional programming and the
+ 20708 [matz@ru y- a] Since we have "slice" for non destructive "[]", I think it's OK to
  20709 [tobiasreif@p] with_at(position,new_value)
  20720 [matz@ru y- a] Since [] and []= accepts more than just index, I don't think "at" is
  20754 [tobiasreif@p] I do; english also isn't my first language, but my second.
  20774 [tobiasreif@p] What do others suggest?
  20778 [kevinbsmith@] Many of the Array methods are already bang-type methods,
  + 20779 [decoux@mo lo] deep-copy is something complex especially for RCO.
  + 20780 [tobiasreif@p] Kevin,
    + 20781 [decoux@mo lo] pigeon% ruby -e 'a = [1]; a << a; b = a.clone, a[1] = "a"; p b'
    | 20783 [kevinbsmith@] I guess I understand this, and I'm willing to live with it
    | 20785 [decoux@mo lo] Probably I'm missing something but you have written #clone
    | 20795 [kevinbsmith@] #clone
    | 20796 [dblack@sa ur] Are you suggesting changing #clone's name to #copy?
    | 20799 [kevinbsmith@] Doh! I hadn't encountered Object#clone recently (if ever),
    + 20784 [kevinbsmith@] If we were starting from scratch, I'd probably agree. I
    + 20786 [dblack@sa ur] Except... each and every method would include #max, #first, #last, and
    + 20800 [matz@ru y- a] Like scheme?  But imagine that every destructive (in other words, self
    | 20817 [tobiasreif@p] Matz,
    | + 20818 [Dave@Pr gm t] Being realistic, though, wouldn't you expect
    | | 20819 [tobiasreif@p] []= may not appear in a new concept+convention; it could stay like it
    | + 20821 [neumann@s- i] "!" tells you "it's more dangerous to use it than the non-bang method".
    + 20808 [hal9000@hy e] In my opinion, Ruby programs would
      20834 [schneiker@ju] IIRC from previous discussions, isn't this precisely the convention that
      + 20838 [matz@ru y- a] It is the origin of the bang name idea, but in fact they are
      | + 20860 [hal9000@hy e] Hmm, I made some related comments, though I never mentioned
      | | + 20868 [tobiasreif@p] ... but in this case may at least help beginners. (if it's not
      | | | + 20873 [hal9000@hy e] even
      | | | + 20877 [matz@ru y- a] Maybe, but remember being beginner is short transitional state,
      | | + 21067 [schneiker@ju] method.
      | + 21065 [schneiker@ju] I didn't mean to imply otherwise, but I now see my choice words wasn't very
      + 20850 [tobiasreif@p] Me too.
        + 20864 [neumann@s- i] I am not sure if this would help out here. Perhaps it'd be even worse; new
        | 20900 [fgp@ph o. rg] I think, you either
        | 20920 [neumann@s- i] me, too.
        + 20869 [dblack@sa ur] a.push!(123)
        | 20870 [tobiasreif@p] Thanks y'all for your comments; it's been an intesting thread
        | 20878 [matz@ru y- a] You don't have to tell that to beginners.  Just tell them "don't use
        + 21064 [schneiker@ju] Unfortunately not.

Do we about sub-second [amc]time on files?
20677 [green@Fr eB ] I just noticed I have an old patch lying around for file.c that implements
20680 [green@Fr eB ] Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
+ 20703 [decoux@mo lo] Forbidden
| 20705 [green@Fr eB ] That's strange.... well, I got rid of the symlink and just copied it there
| 20706 [decoux@mo lo] It work now, thanks
+ 20707 [decoux@mo lo] pigeon% make
+ 22375 [matz@ru y- a] Finally I looked through your patches.
  22391 [green@Fr eB ] That can always be conditionalized, but...
  22393 [matz@ru y- a] "go-ahead".  But I think we have to re-think about names.  I don't

install problems..
20681 [thegrandbrie] tkexample.rb:1:in `require': No such file to load -- tk (LoadError)
20694 [csawtell@pa ] You have to install all the Tcl/Tk and extentions stuff in your distribution,

eruby 0.9.6 doesn't work with ruby 1.7.1
20683 [aleksi.nieme] I can't make eruby 0.9.6 work with ruby 1.7.1. It works fine with ruby
+ 20693 [decoux@mo lo] Which version of 1.7.1 ?
| 20740 [ale@cr ms n.] I guess the issue is about the file handling differences between 1.7.1
| 20741 [decoux@mo lo] No, no problem with the GC see [ruby-talk:20698]
+ 20698 [decoux@mo lo] pigeon% diff -u eruby_lib.c~ eruby_lib.c
  20744 [shugo@ru y- ] compiler and f are auto variables, so they should be protected
  + 20746 [matz@ru y- a] Because compiler and f are NOT used after the GC point.  So that they
  | 20752 [shugo@ru y- ] f is used after the GC point, and volatile can't protect f....
  | 20758 [shugo@ru y- ] I found that &f was greater than rb_gc_stack_start. That's why f
  + 20749 [shugo@ru y- ] Shugo

RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2001-09-01)
20685 [schneiker@ju] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2001-09-01)

Printing to local printer
20686 [bartelt@ic .] I'm working on a program that needs to send output to a local attached

Ruby/Tk debugging tips
20689 [harryo@zi .c] it's a frame with a bunch of labels and a single button in it).
+ 20688 [harryo@zi .c] Well, it's not the button down versus button up.  I found some demo code
+ 20710 [kero@d4 50 u] What code? You didn't send any Ruby code, so it's a bit hard to
  20714 [harryo@zi .c] Sorry, there was a lot of code and I thought it would obscure what I

ANN: Ruby/Mock 1.0
20701 [nat.pryce@b1] I mentioned this in another thread, but thought I would announce it properly
20702 [Dave@Pr gm t] I've been playing with this for a couple of days now, and I like it a
20704 [nat.pryce@b1] I would certainly be happy for that to happen.
20712 [matz@ru y- a] Last time I talked with Masaki (the author of RubyUnit) about bundling

[ANN] Aurora (Ruby on Ruby)
20711 [kom@ma l1 ac] This past weekend, I impelemented a (subset of) Ruby interpreter

oreilly buch von matz - website online
20715 [info@mj is d] der oreilly verlag hat jetzt infos zum buch "ruby essentials" von matz online
20716 [info@mj is d] sorry,

Re: OReilly Ruby book has snail on cover
20717 [ptkwt@sh ll ] Actually, thanks for posting it here.  I was trying to search OReilly's
+ 20718 [dblack@sa ur] David
| 20719 [armin@ap ro ] Hm.. not so many people might associate it with gourmet snails.
+ 20723 [matz@ru y- a] Oh, no.  Last time I asked them sheep, they gave me goat.  This time
| + 20725 [lcb134@ps .e] In the long run the cover doesn't really matter, I think most of us have a
| | 20753 [dempsejn@ge ] Does anyone know if there is anything we can do about
| | 20892 [buggs-clr@sp] There is always the option of taking a fat eddingTM.
| | + 20894 [pehrens@no p] My favorite was the Windows Registry book with the dog
| | | 20896 [DDouthitt@cu] Tigers are taken (Visual Basic).
| | + 21133 [pehrens@no p] My favorite was the Windows Registry book with the dog
| |   20897 [hal9000@hy e] I like the Windows Annoyances book, with the world's ugliest toad
| + 20729 [james@ja es ] Well, escargot is a delicacy, is it not?
| + 20750 [mjais@gm -a ] I do not like snails too, at least not for the book cover
| | + 20751 [matz@ru y- a] I think, unfortunately, it's too late.  It always be.
| | | 20755 [henning@ik o] look, camels walk strangley, and probably do not smell good; python snakes
| | | + 20756 [sanatg@ya oo] Maybe they can put Homo Sapiens for a change :-)
| | | | 20771 [harryo@zi .c] I think we should interpret the snail as "Ruby runs fine,
| | | + 20759 [matz@ru y- a] I respect your positive way of thinking, and will try to follow.
| | | | 20794 [sean-ruby-ta] Another option would be to rally some community support.  I just
| | | | + 20797 [kevinbsmith@] Interestingly, O'Reilly already used a (different) snail
| | | | | 20830 [ptkwt@sh ll ] THe snail on the SSH books seems to be a regular old garden snail, so our
| | | | | 20835 [toddg@li ux ] Is this thread devolving into a Pokemon-esque form of mascot combat?
| | | | + 20815 [tobiasreif@p] Very good idea. I just sent my email to propsals@oreilly.com
| | | + 20793 [bdelmee@ad a] We'll get used to it, I am sure !-}
| | |   20803 [ptkwt@sh ll ] Quite true, many are quite beautiful.  And it does look as though the
| | + 20852 [pdcawley@it ] Plus, a tiger already got used for a Java book.
| + 20757 [tobiasreif@p] [...]The cover of Oreilly's Ruby book will
+ 20922 [pbrannan@at ] I think the snail is a very beautiful creature.  The spiral pattern formed
  + 20925 [matz@ru y- a] I have a sad news (or a VERY good news depending on your taste).
  | + 20927 [droux@tu s. ] Having lived all my life in the Bushveld, I can agree that the Kudu (or
  | + 20928 [tobiasreif@p] a picture, and the text
  | | 20929 [Pierre-Charl] Pierre-Charles David (pcdavid <at> emn <dot> fr)
  | + 20930 [r2d2@ac .u u] [Matz]
  | | 20932 [droux@tu s. ] Niklas, you are confusing the Kudu with a "Springbok". A very agile creature.
  | + 21079 [Stephan.Kaem] BTW, what's the animal on the Japanese Ruby book (the one @
  | | 21163 [matz@ru y- a] It's Bezoar goat.
  | | 21354 [Stephan.Kaem] Thanks.
  | | 21370 [ptkwt@sh ll ] Isn't this the book they were calling "Effective Ruby" a couple of weeks
  | | 21374 [matz@ru y- a] It was called "Ruby Essentials", and yes, they've changed the title,
  | + 21114 [szegedy@or u] Oh no!
  |   21196 [matz@ru y- a] It might be YOUR mail that moved O'Reilly to change the animal.
  + 21118 [mikkelj-anti] You might find comfort in studying the spiralled horns of the Kudu.

Possible typo bug?
20721 [csawtell@pa ] I've just noticed this in /usr/local/lib/ruby/1.6/tkcanvas.rb
20736 [matz@ru y- a] I fixed. Thank you.
20738 [decoux@mo lo] You have the same problem in tk.rb and tktext.rb, from the latest cvs
20745 [matz@ru y- a] oops, thank you.
threads.html
top