46553-47644

46357-47516 subjects 46773-47326

Inherited question
46553 [alan@di ik t] I'm playing around with the inherited hook and I'm having some problems.
46555 [gotoken@no w] Class#inherited would be called when the line "class Sub1 < Base" is
46688 [alan@di ik t] Thanks, I suppose the fix is to delay instantiation of the child classes

struct needs to be a constant?
46557 [djberge@v5 h] test.rb:3:in `require': identifier Proto::ProtoStruct needs to be constant (NameError) from
46560 [gotoken@no w] try replacing the last two lines by
46592 [nobu.nokada@] * rb_struct_define() with NULL for first argument,
46634 [djberge@qw s] Actually, it looks like either a bug or a behaviorial change in 1.7.2.  I
+ 46639 [decoux@mo lo] This is this that 1.7 don't like, and I understand it.
| 46646 [djberge@qw s] I'm not sure what mean here (I'm having difficulty translating).  Are you
| 46648 [decoux@mo lo] Yes expected behavior and yes I agree with it : you have strange
| 46656 [nobu.nokada@] They are in different modules, and names from extension
| 46699 [decoux@mo lo] And if someone want to have a static version of ruby with these libraries,
| 46700 [nobu.nokada@] I see.  The issue would need discussion.  How do you consider?
| 46701 [decoux@mo lo] No good idea, actually. but try to compile a static version of ruby with
| 46799 [nobu.nokada@] What about searching Init_"feature"() function first?  If it
| 46810 [decoux@mo lo] Yes, this is this case
| 46815 [nobu.nokada@] In this case, I guess extmk.rb.in should be fixed.
| 46821 [matz@ru y- a] Yes, but in a different manner.  $static should be updated if $target
+ 46655 [matz@ru y- a] You have to supply a constant name for the first argument, so that

Non trivial features changes in 1.7.2 via CVS
46558 [comp.lang.ru] If you are tracking the cvs version of ruby1.7.2 there has been a
+ 46563 [Dave@Pr gm t] I'd look at it, but... the current CVS 1.7 doesn't build on my Linux
| + 46574 [hal9000@hy e] Obviously a plot by Microsoft.
| | 46581 [rich@in oe h] Oh no, Microsoft got to Matz ;-)
| + 46614 [eban@os ri .] Hmm, do you have libkernel32.a in library path?
|   46637 [Dave@Pr gm t] dave[ext/Win32API 7:52:26] ruby -d extconf.rb
|   46693 [eban@os ri .] Bingo.
+ 46566 [dblack@ca dl] dblack@laptop:~$ ruby -ve 'p %q{abc.def.ghi}.split(".")'
  46652 [comp.lang.ru] - - DOH! No wonder my patches don't work... I am the master of

TkAfter module
46562 [alwagner@tc ] What exactly is the TkAfter module for?  Can anyone point me to an example?  I
46796 [jean-francoi] @timer = TkAfter.new(interval, 1, proc{show})
46797 [alwagner@tc ] Thank you.

Fun with shifting bytes / Python translation
46578 [mark.firesto] I'm trying to read what is referred to in this Python code as "weird
46619 [angus@qu va ] I don't know about the math, but with regard to the lambdas, I suppose the

CGI testing
46586 [patrick-may@] NARF is a fork of cgi that I'm working on.  One of our goals is to

Bug in TkText
46587 [alwagner@tc ] Ruby-1.6.7;Tcl/Tk-8.3.4
46598 [x@ic im nk .] text.dump('tag', '1.0', '1.14'){|x| puts x}
+ 46599 [x@ic im nk .] text.dump('tag', '1.0','1.14'){|x| puts x.inspect}
+ 46602 [alwagner@tc ] Thanks, Michael.  I'll try that.  I also seemed to fix working without a block
  46636 [x@ic im nk .] The line that needs to be changed is line 415 by my count.

Redefining send()
46593 [harryo@zi .c] I tried to write a small piece of code as a wrapper around send(), but for
46595 [dblack@ca dl] class Fred
46596 [harryo@zi .c] Sorry.  For some reason, I was under the impression that all calls to methods

how do i mock the presence / absence of a constant w/out getting warnings?
46600 [patrick-may@] I need to write tests for some behavior that needs to check a
+ 46603 [vjoel@PA H. ] Not sure I understand the problem, but if you're trying to redefine a
+ 46606 [gotoken@no w] (1) ignore that warning.
| 46632 [patrick-may@] This looks promising.
+ 46607 [eban@os ri .] If you want to judge whether it is called from mod_ruby,

Re: A very small challenge [OT]
46604 [gsinclair@so] The opposite of "win" is "lose".
46775 [wheelerwjx9@] yes, and 'no' usually isn't spelled with a 'w'. guess i need a better

automagic
46608 [transami@tr ] i am bringing a discussion over from the GUtopIa mailing list to get
+ 46610 [hal9000@hy e] My first thought is that you redefine all of these
+ 46907 [matju@sy pa ] MetaRuby (http://artengine.ca/matju/MetaRuby/) does what you want. It

The whole 'Spades' thing: GA and cardbots
46615 [hal9000@hy e] OK, I have more useful things to be doing.
+ 46651 [james@ja es ] Is there a reason to use GA instead of genetic programming (GP)?
| 46677 [hal9000@hy e] Sorry, I've always been unclear on the difference.
| 46679 [james@ja es ] GP operates at the function/terminal level of a functional programming
+ 46665 [stephen.hill] I have a reasonable amount of experience with GA's (PhD + some

Boolean class update?
46644 [gsinclair@so] As per the quote below, is Boolean still on the agenda?  I accept that it may
46653 [matz@ru y- a] No one has told me enough usefulness yet.

Standard Unit Testing Framework?
46649 [lyle@us rs s] Was a decision ever made about incorporating one of the unit testing
46654 [matz@ru y- a] authors.
46710 [djberge@qw s] Along these same lines, is there any chance of automatically adding targets
46822 [matz@ru y- a] Once we adopt Test::Unit in the distribution.

optimization module and tail recursion
46661 [ttate@kt ja ] The implementation is rough and I don't exactly understand how to construct
46816 [chr_news@gm ] construct
46832 [ttate@kt ja ] Thanks,

ruby sample code runtime problem
46663 [markgriffin@] ie = WIN32OLE.new('InternetExplorer.Application')
46667 [tom@li ux ri] require 'win32ole'
46714 [markgriffin@] From same link I had ran different example that did have require statement
46761 [tom@li ux ri] That's fair enough - it's quite possible that the ruby package you
47042 [markgriffin@] Tom,

Enumerable#any? (was: Re: Coding challenge (on Ruby Garden) [long])
46664 [dblack@ca dl] At first glance I thought that #any? didn't add anything to just using
46670 [chr_news@gm ] Hm, the #detect method was new to me;-)
46671 [chr_news@gm ] Sigh ...

Testing for mod_ruby (was "how do i mock the presence / absence of a constant w/out getting warnings?")
46669 [patrick-may@] Currently, the only reliable way to test for the mod_ruby enviroment
46686 [nobu.nokada@] Use Module#remove_const.
46869 [patrick-may@] Thanks for your suggestion, sorry it took me a while to respond.
46871 [nobu.nokada@] What are the contexts?
46943 [patrick-may@] This is roughly what was happening.  A bit later this week, I'm going
46954 [nobu.nokada@] defined? operator returns string representing object type or

Variable validation
46672 [chrismo@cl b] I've got a class that has a number of instance variables, some of which must
46675 [kentda@st d.] If all these are accessible from the outside in reader methods, you
46709 [g_ogata@op u] class C
46754 [chrismo@cl b] RequiredAttributes = [:loginName, :password, :firstName, :lastName,
46758 [pit@ca it in] the line above should be inside the following if
46996 [chrismo@cl b] Yeup - good catch. Thanks!

Rite vs Parrot: rationale?
46676 [batsman.geo@] I'm been looking for the rationale of implementing Ruby's own bytecode
+ 46678 [hal9000@hy e] I can only address part of this.
+ 46687 [dan@si he or] While I can't give you Matz's rationale for it, I can tell you why I

Dr. Dobbs Ruby Article
46681 [james@ja es ] The September issue of Dr Dobbs has an article by Phil Tomson on distributed
+ 46683 [khindenburg@] Should I be the first to point out that it would be helpful to provide a URL?
| 46685 [james@ja es ] URL? Well, I guess whatever newstand or magazine shop sells it.  It's
| 46692 [gsinclair@so] It can be found here: http://www.ddj.com/articles/2002/0209/
| 46694 [gsinclair@so] Hmmm... the article itself can't be read online, it seems.  The source
| 46733 [smalllinux@n] It costs 5 USD to purchase the article, online. It will let Dr. Dobbs
| + 46738 [james@ja es ] True, but a hard-copy of the entire issue costs USD 6.  Writing letters to
| | 46742 [transami@tr ] the dead tree's and the lumber jacks and the saw millers and the print
| + 46806 [gsinclair@so] 5USD!?!?  Are you KIDDING!??  For ONE article!?
|   46826 [nojgoalbyspa] It does seem a lot.  I think I would fork out 1USD for the article without
|   46835 [mikkelfj-ant] Well DDJ charges a completely unrealistic overprice for overseas
+ 46786 [ptkwt@sh ll ] Thanks.

Don't go further into debt!
46691 [cr6to@ly os ] ...

Fw: Python vs. Ruby (and os.path.walk)
46695 [lyle@kn lo y] As seen on comp.lang.python...

Ruby in EETimes
46696 [ptkwt@sh ll ] Phil
+ 46697 [hal9000@hy e] Well, double congrats! Keep up the
+ 46713 [lyle@us rs s] OK, Phil; exactly *how* many times do you need to see your name in print
  46717 [rich@in oe h] Three times is the key (from a Marketing perspective).

Ruby/LibGlade: multiple GladeXML objects
46698 [transami@tr ] i am trying to load two glade files one after another. is there a
+ 46705 [transami@tr ] well, i gave up on having two seperate files and stuck both my windows
| 46792 [smalllinux@n] I have used ruby-libglade in several projects under
| 46793 [transami@tr ] i'm using DEBIAN as well, Woody.
| 46805 [mutoh@hi hw ] See http://sourceforge.net/projects/ruby-gnome/
+ 47644 [transami@tr ] this is a follow up on how to properly use glade with ruby, if anyone is

print vs puts behaviour for overloaded Array#to_s
46706 [stephen.hill] I've come across the following feature when using an overloaded to_s
46707 [decoux@mo lo] Because test is an Array, and #puts do something different with an

Getting the file name from a File::Stat object?
46715 [ljz@as as .c] Is there a way to get the file name from a File::Stat object?
46718 [gotoken@no w] Only way is to search files which have the inode number File::Stat#ino.
46720 [ljz@as as .c] Thank you very much.
46721 [gotoken@no w] You can redefine File.stat as follows, however, I don't recommend this
+ 46723 [matju@sy pa ] Maybe you want to say: File::Stat is not an API for a filename but just
| 46729 [gotoken@no w] Yes.  Sorry for inaccuracy.
+ 46740 [ljz@as as .c] I totally agree with you, in the general case for the use of File::Stat.
  46745 [gotoken@no w] I see.  But why not File#textfile?.  For normal files, you can
  46750 [ljz@as as .c] Yes, I could indeed do it that way, but the "File::Stat#textfile?" method

RE: Standard Unit Testing Framework? (slight correction)
46716 [djberge@qw s] That should read "...is there any chance of automatically adding targets for

Are All C Destructors Guaranteed to Be Called?
46719 [billtj@y. lu] Are all C destructors, i.e., the "free" function that is specified in
46728 [pbrannan@at ] They get called when the object needs to be destroyed.  I think all
47030 [billtj@gl e.] Yes, after performing repetitive test (i.e., creating the objects and

Catching script end?
46725 [Laurent.Jull] All,
+ 46726 [decoux@mo lo] Something like this ?
| 47105 [Laurent.Jull] at_exit is exactly what I was looking for. I combined this with aliasing
+ 46778 [WayneFChin@f] How about using an END block?

nil || //
46730 [pbrannan@at ] [pbrannan@zaphod scripts]$ ruby -v -e 'p nil || //'
+ 46731 [decoux@mo lo] pigeon% /usr/bin/ruby -riis -ve 'puts dump; p nil || //'
| 46735 [pbrannan@at ] My appologies.  I do not understand your response.
+ 46744 [batsman.geo@] batsman@kodos:~$ ruby -v -e 'a=//; p nil || a'
+ 46787 [kjana@dm la ] No, it works, but completely different way.

ambiguity between local variable assignment and writter method
46732 [transami@tr ] does anyone else find it annoying that local variable assignment is
+ 46734 [pbrannan@at ] self.localvar = x
| 46737 [transami@tr ] code smell.
| + 46739 [Dave@Pr gm t] I don't think it's a smell: it is distinguishing different uses.
| | 46741 [gotoken@no w] But what will I get from:  puts .setter = 123
| | + 46743 [transami@tr ] good question
| | | 46747 [hal9000@hy e] I can't agree with that.
| | | 46752 [billk@ct .c ] And how do bugs like this ever get in the code?  By people
| | + 46748 [Dave@Pr gm t] I'm guessing that the parser can distinguish the 'start of something'
| |   + 46751 [alan@di ik t] For me, this is more a point of style. When I write non-trivial
| |   + 46753 [transami@tr ] well i think the shortcut of .setter is really backways-around, not
| |     + 46755 [Dave@Pr gm t] It would have to check on every single assignment, at all times, in
| |     | + 46756 [transami@tr ] oh! the strangness of ruby's beauty! :-)
| |     | + 46771 [transami@tr ] i ran a little benchmark to see what kind of speed hit my solution would
| |     + 46759 [matju@sy pa ] Because of the wild ways in which Ruby can do inheritance
| |       + 46760 [rich@in oe h] class Person
| |       | 46763 [transami@tr ] that's not a bad option. this way you could actually use @instance=
| |       | 46764 [Dave@Pr gm t] The behavior of parent classes would vary if they were subclassed by
| |       | 46767 [transami@tr ] could you elaborate on that a touch more? perhaps a small example?
| |       | 46802 [batsman.geo@] class A
| |       + 46762 [transami@tr ] leakage of influence? in all other cases the method is looked up. if i
| + 47044 [charleshixsn] To me it seems that efficiency issues can dominate here (as to which
+ 46788 [dblack@ca dl] (Not ignoring the rest of the thread -- just wanted to comment on the
| 46791 [transami@tr ] 2. you have to know when you need the extra self and when you don't
| + 46794 [dblack@ca dl] Isn't it good to have to know when you're calling a method and when
| | 46798 [transami@tr ] i see. yes, that would be a problem. although there are plenty of
| | + 46804 [g_ogata@op u] You're kidding, right?  I think one of the things that makes Perl so unreadable is the
| | | 46807 [transami@tr ] no, if i were creating ruby now, i would very much consider doing that.
| | | + 46809 [kentda@st d.] Isn't this a step _backwards_ to "feeding compilers" instead of solving
| | | | + 46834 [transami@tr ] how might you do that? as far i can tell that would involve declaring
| | | | | 46838 [kentda@st d.] We already use accessor methods to hide @ away, all the time from the
| | | | + 46836 [transami@tr ] just to throw this out, i'm wondering why placement wasn't used to
| | | | + 46970 [justinj@mo i] Personally, I disagree.  I do a lot of C++ programming with large systems
| | | | | + 46972 [kentda@st d.] I think you misunderstand me. Since you are using setter/getter methods,
| | | | | + 46976 [transami@tr ] i too tend to think that it is better to have these then not, even
| | | | | + 47083 [mikkelfj-ant] identification.
| | | | + 46979 [justinj@mo i] Personally, I disagree.  I do a lot of C++ programming with large systems
| | | + 46891 [g_ogata@op u] I think it makes things less distinct.  @, @@, and $ appear quite scarcely
| | |   46894 [dblack@ca dl] I didn't mean that as an anti o.member = 'x' argument though :-)  It
| | |   47068 [g_ogata@op u] I know I was putting it in a different context.  I didn't mean to imply you
| | + 46844 [alwagner@tc ] Smalltalker?
| |   46917 [transami@tr ] nope, not a SmallTalker, and i assume there's no pun intended ;-) but
| |   46925 [alwagner@tc ] Just curious.  I used Smalltalk exclusively for about 15 years.  The syntax is
| |   46953 [transami@tr ] well, given that there dosen't seem a reasonable solution to the
| |   + 47004 [michael_s_ca] This seems more reasonable than "this."?  Wow.
| |   + 47026 [dblack@ca dl] 1. Don't check for method existence.  Use -w, and let Ruby warn you
| |     47286 [transami@tr ] by the way, thanks for this david. much nicer than mine --very elegant.
| + 46808 [kentda@st d.] The real base of the exception is that Ruby allows some rather wierd
+ 47067 [list@ch om t] [On calling setter from inside the class]
  47142 [gsinclair@so] Very nice analogy!  And good example, too.

ǿվͼ Time:12:59:32
46736 [ruby-talk-ad] ...

Problems installing FLTK on Windows
46746 [axel.friedri] I tried to install RUBY-FLTK for my Windows-cygwin-Ruby, but couldn't

Suggestion for which Linux + Windows GUI API to code to?
46765 [harryo@zi .c] I'm about to start helping a friend of mine learn Ruby by building a small GUI
+ 46769 [mikkelfj-ant] GUI
| + 46770 [mikkelfj-ant] Sorry, should read - haven't tried it on Linux. On Windows it has a rather
| + 46774 [lyle@us rs s] Just so I can be sure to follow up on potential bugs, what kinds of
+ 46772 [transami@tr ] unfortunately no. it's still too early. although its coming along pretty

ICFP programming contest
46766 [mikkelfj-ant] It's announced in comp.lang.functional.
46789 [nojgoalbyspa] I just requested that they add Ruby, just in case it may provide a good
47088 [nojgoalbyspa] of

Possible to get source for arbitrary class?
46768 [james@ja es ] Is there a way to get a string version (i.e., a "source code"
46825 [ptkwt@sh ll ] In TaskMaster I did this by reading a file to be required, stringifying it
46830 [james@ja es ] Exactly.  I haven't looked at TaskMaster until the Dobbs article (lack of
threads.html
top