41437-42205 subjects 41883-43622

ruby equivalent for perl multi-index sort?
41677 [rick@ri kb a] Coming from a perl background I have a lot of programs which do
+ 41678 [pit@ca it in] Try
+ 41690 [fokke_wulf@h] That code seems redundant, because you're doing a seperate sort on the
| 41696 [rick@ri kb a] $ perl -e '@a=(1,2,"2.1","2.10", "2.2", 3); @a = sort { $a <=> $b } @a; print join(", ", @a)."\n";'
+ 41691 [eban@os ri .] filelist = Dir.open(".").
  41698 [rick@ri kb a] Thanks!

41688 [jlj@cf rc co] [Copied from the SWIG users' mailing list. Although it's not specifically

ruby-dev summary #17208-17251
41693 [maki@ru yc l] This is a summary of ruby-dev ML in these days.
+ 41724 [wakou@ru y- ] something wrong. I propose StringIO#stat.size. Because IO#stat is exist.
+ 41741 [timsuth@ih g] Thanks for the summary.
  48386 [matz@ru y- a] They are all fixed in 1.7;  Should I backport them?

[ANN] Sys::Uname
41694 [djberge@qw s] This is a C extension for the utsname.h file found in *nix environments.  It

super bug or (most likely) I am doing something wrong ?
41699 [philip@dy as] I can't seem to get it right with a super (newbie stuff :)).
+ 41702 [tobiasreif@p] -   super.say_what
| 41708 [philip@dy as] Thank you Tobias and thank you Marko.
| 41733 [patrick-may@] super # <== looks for say_what in superclass
+ 41703 [in6x059@pu l] To quote matz from ruby-talk:38327

Word for Windows Ruby Trick
41704 [james@ru yx ] This may be of limited value to many folks here, but I thought it kinda
+ 41705 [tobiasreif@p] Neat.
| 41715 [james@ru yx ] I use some Ruby menu items that map a few function keys to Ruby calls
| 41736 [tobiasreif@p] Can you select only a portion of a line and have it executed? (instead
+ 41706 [tobiasreif@p] perhaps simply send
  41716 [james@ru yx ] I'll have to play with that one.  I get an error, so SendKeys is either
  41732 [tobiasreif@p] perhaps try

Extensions & importing defined constants
41709 [djberge@qw s] #define SOME_VAL 255
41710 [pbrannan@at ] Perhaps HAVE_TEST_H isn't getting defined?  Put some junk code between

Annoucement: Interactive Learning Environment + Ocelot Servlet Engine
41712 [bcox@vi tu l] Interactive Learning Environment (ILE) Announcement
41714 [tom.hurst@cl] Thomas 'Freaky' Hurst  -  freaky@aagh.net  -  http://www.aagh.net/
41722 [bcox@vi tu l] Dang, sorry about that. Trying to whip apache config issues. I'm
41726 [bcox@vi tu l] Sorry about the outage. Its back online now. Botched a rewrite rule in

(G)Vim Ruby question (was:Word for Windows Ruby Trick)
41713 [tobiasreif@p] Selecting a portion of Ruby code (visual mode),

Declaring variables?
41717 [pmak@an me l] As I understand it, there isn't really a concept of "declaring" a
+ 41721 [alwagner@tc ] no
+ 41725 [home@cl bs o] irb(main):001:0> numbr += 1

Ruby Weekly News
41720 [Dave@Pr gm t] Ruby Weekly News: 06/03/2002
41731 [lucsky@ma .c] Just a small note: RubyStudio is not written in Ruby, it's a native Cocoa application written in Objectice-C.
41750 [pate@ey er a] Ahh, thanks for the correction.

gtk drag and drop
41723 [alan@di ik t] I've been fooling around with getting drag and drop to work in ruby
41739 [mutoh@hi hw ] ruby-gtk/sample/dnd.rb may help you.
41757 [alan@di ik t] Thanks, I'll look there.

Styles of language design
41728 [marick@vi ib] Here's an interesting short essay on language design. I'm not sure I

dynamic attr_accessor again using a hash
41734 [mjais@we .d ] thanks for all your answers to my question yesterday.
+ 41735 [decoux@mo lo] Use #send
| 41738 [mjais@we .d ] of course!!! I tried this but had a stupid typo. maybe one
+ 41737 [phasis@ha an] How about this?

update Tk
41740 [nagai@ai ky ] I've updated Tk libraries on CVS. This update includes some important

class inheritance tree
41742 [matthias_vei] I miss a convenient way to ask a class, if it is a subclass of
+ 41743 [decoux@mo lo] Use the comparison operator
| 41751 [matthias_vei] ... there are reasons to love ruby
+ 41744 [nvivek@ko ar] Both superclass as well as ancestors should do the trick
+ 41745 [nobu.nokada@] Integer > Fixnum

Rexml / OpenSSL on Windows
41746 [stephan.schm] "I would like to deploy a Ruby application on Windows and need some
+ 41747 [tobiasreif@p] REXML is Ruby.
| 41748 [stephan.schm] Thanks,
| 41749 [chris.morris] ... and is distributed with the pragprog distro 1.6.6-0 (though it is an
+ 41753 [jlj@cf rc co] REXML is "100% pure Ruby" ;) so no special requirements there. The OpenSSL
  41754 [stephan.schm] Thanks,

HTML Parser suggestions wanted
41755 [ned@bi e- om] I've written an HTML parser that builds trees from HTML source. After
+ 41756 [james@ru yx ] I started looking at your parser (thanks!)  and wanted to load the
| 41759 [ned@bi e- om] Yes, it's just another dependency.
| 41761 [james@ru yx ] Oh if I only had time ... :)
+ 41758 [nat.pryce@b1] I think implementing your HTML parser as an add-on to REXML is a great idea.
  + 41760 [ned@bi e- om] Of course, I can extend the REXML Document/Element to do this. And the
  + 41767 [tobiasreif@p] The current version of HTML is XHTML is XML.
    + 41779 [nat.pryce@b1] There is still a need for older versions of HTML.  For example, Pocket
    | + 41783 [tobiasreif@p] A "HTML compatible" [1] (MIME Type) [2] subset of XHTML works for most
    | + 41788 [james@ru yx ] There are, I suspect, elements appearing in numerous web pages that are not
    |   41792 [tobiasreif@p] Yes; unfortunately, most web pages are neither well-formed XML nor valid
    + 41796 [tom.hurst@cl] XHTML has certain guidelines to maintain compatability with clients

keyboard input
41762 [kalldrexx@pr] _______________________________________________
41774 [ruby-talk@je] As long as you use the IO functions from the IO class, ruby won't
41778 [kalldrexx@pr] Well the collect() method would be running on the main thread, my question wasnt' really about if the gets method would block, since yeah that woudln't matter if it blocked if it was in another thread, but if the collect method blocks or not.
41784 [kalldrexx@pr] Where can I find information of Ruby's IO class?  And what do you mean by C libraries?  was ruby made in C?
41787 [kentda@st d.] *peeks in the source*

When should actually freeze work ?
41763 [philip@dy as] I have the following cases where I thought freeze should work. It doesn't,
+ 41764 [martine@cs w] You need to be careful to distinguish a frozen string from the reference
| + 41765 [chris.morris] You're not modifying the string "abc", you're re-assigning s to a new string
| + 41768 [tobiasreif@p] Watch out; this is not always true.
|   41769 [martine@cs w] Really?  Man, I've been spoiled by Scheme or something... :)
|   41826 [tobiasreif@p] irb(main):001:0> a=[1,2,3]
|   41827 [tobiasreif@p] irb(main):001:0> ary=[1,2,3]
+ 41766 [ned@bi e- om] Because objects are frozen, not variables.
+ 41770 [kentda@st d.] Common newbie misunderstanding. Please remember that all variables are
  41772 [dossy@pa op ] Really?  I thought assignment was shallow copy (both variables
  41776 [ruby-talk@je] Assignment is analogous to changing the value of a C's pointer

irb bug with $SAFE?
41771 [pmak@an me l] I was just playing with $SAFE in irb and it said "Maybe IRB bug!!" at
41773 [tobiasreif@p] Tobi
41782 [kentda@st d.] Or spawn of threads that set the $SAFE level and call the methods you

Solving logic problems with Ruby
41775 [vmreyes@us i] During my college days I experimented with a language called Prolog.
+ 41781 [    s@xs .d ] Not that I venture a solution here, but you might
| 41785 [vmreyes@us i] Book Description
| + 41786 [rick@be rd i] I believe that is a later book in a series, the first of which is On a
| + 41789 [khaines@en g] A variation on the brick puzzle that you put forward, using coins instead
| + 41864 [    s@xs .d ] You might also want to get the other six books ...
|   41866 [cparrish@co ] I have no idea how we got so OT here but I have to add I *LOVE* that series. I started with the one on Time and didn't feel lost so with the exception of the last two I don't think you have to worry about order.
|   41895 [vmreyes@us i] be
+ 41823 [ahumphreys@R] Take a look at the AI section in the RAA. Peter Hickman's SIE, expert
  41837 [vmreyes@us i] be

How safe is $SAFE=4?
41777 [pmak@an me l] How safe is $SAFE=4? I read the description of $SAFE in "Programming
+ 41780 [chris.morris] No, it wouldn't work (IIRC). $SAFE=4 here would not allow the code to be
| 41797 [pmak@an me l] I just managed to make a program that reads a line from standard input
+ 41800 [matz@ru y- a] It's designed to be.  It's safe unless I made mistake.
  41830 [chris.morris] Huh - I tweaked the above to check expr.tainted? and it is true when it's
  41831 [decoux@mo lo] Try it with $SAFE = 3
  41833 [chris.morris] Ahhhhhhhh... I've been assuming the SAFE levels were cumulative. Thx for the
  41834 [decoux@mo lo] There are cumulative for 1 .. 3. For example, for #eval you can't use it

Dynamic local variables ?
41790 [han@po ox co] Is it possible at all to generate local variables dynamically ?
41812 [phasis@ha an] I think PHP's extract and compact function is useful.
41858 [han@po ox co] Yes, my problem was with _local_ variables.

ANN: ruby-htmltools v1.04 (was Re: HTML Parser suggestions wanted)
41791 [ned@bi e- om] I decided to have it both ways: you can either make an "old-style"

Calling a (any) superclass method when already have one by that name
41793 [philip@dy as] Sorry if I did change the thread, but I seem to have at least clarified the
+ 41794 [ned@bi e- om] What's wrong with aliasing?
| 41795 [philip@dy as] Wrong ? Nothing, I just wanted another way...
| + 41799 [ned@bi e- om] But how often does that happen? In my experience with Smalltalk, not
| + 41801 [reeses@as ro] To me, the bad smell is that you're trying to call the superclass
+ 41804 [dossy@pa op ] I ran into this before as well.  I was _very_ surprised to find
  41810 [ruby-talk@je] It's useable in most cases, and I think you'll love it.

Is this a bug in the defined? operator?
41806 [jeff.gray@in] [1, 2, 3, 4].each { |x|
+ 41807 [nobu.nokada@] `defined? local-variable' is determined statically regardless
+ 41808 [matz@ru y- a] I think what you want is
  41853 [jeff.gray@in] Aha.

eval and local variable
41809 [phasis@ha an] in following script
41816 [decoux@mo lo] When ruby compile the script, it find `foo' at this time there is no local
+ 41820 [phasis@ha an] local
| + 41821 [decoux@mo lo] It can when you make for example an assignement
| + 41822 [kentda@st d.] When and why is a method called with prefix '&'? I haven't seen this, so
|   41824 [phasis@ha an] '&' is Perl's prefix, not Ruby's.
+ 41885 [klischat@cs ] Then at least the error message is confusing, isn't it?
  41886 [decoux@mo lo] Not for me, this mean that
  41893 [chr_news@gm ] since you understand whats going on anyway;-)
  41894 [decoux@mo lo] You are using 1.7, no ?
  41897 [chr_news@gm ] Yes ...
  41898 [decoux@mo lo] Then try it with 1.6.7 (but protect NameError in the rescue clause) and
  41908 [chr_news@gm ] Interesting (I just complied  a 1.6 cvs branch), the result for the eval and
  + 41911 [decoux@mo lo] Well, I must say that it can seems strange to have as result `true' or
  + 42182 [qrczak@kn .o] For me eval is evil and static name resolving is preferable,

Where can I get reference for tk?
41811 [ChaiXV@ee ua] ...
41814 [kturing@ya o] Help please,

bug in ruby-talk.com
41813 [phasis@ha an] When I submit a word 'cgi' at (Subjects, Regular Expression),
41817 [sinara@bl de] I fixed the bug. Thank you for your report.

Don't miss this incredible new Visual Basic tool - ActiveOptimizer 2.0
41818 [sales@pl tf ] ...

mod_ruby and module space
41819 [sean@BU BY S] It seems that if I execute a script using mod_ruby, I cannot call
+ 41843 [sean@BU BY S] No one has any idea what causes this or how I can get around it?
| + 41844 [james@ru yx ] # -------------------------------
| + 41845 [kentda@st d.] Sorry, I get the same problems. Though it screams error when trying to
|   41847 [sean@BU BY S] Oh, did I use require in my example...oops.  Yes, I use load, require
|   41848 [kentda@st d.] Well, using those functions worked for me when I loaded the module as an
|   41850 [sean@BU BY S] Actually, my actual test over here used an .rb file, not an .rbx...but
|   41851 [sean@BU BY S] Ah ha!
|   41856 [kentda@st d.] Hmm. But if I move the empty module definition into a third .rb file and
|   41857 [kentda@st d.] <CODE filename="testscr.rbx">
|   41860 [sean@BU BY S] That's the conclusion I came to here, that the first script is in an
|   41862 [kentda@st d.] The loaded (or required) module falls into the toplevel namespace, where
|   41863 [sean@BU BY S] I'm going to use mod_ruby where I can...but it does freak me out.
|   41865 [sean@BU BY S] BTW, where is that module?  I'd like to set it up here.
|   41881 [kentda@st d.] In the mod_ruby-0.9.8 source, it is in the lib/apache/ directory. The .rb
|   42181 [sean@ch tt n] Along the lines of debugging and quality, there's another approach
|   42185 [kentda@st d.] Neat!
+ 41876 [wakou@ru y- ] mod_ruby/lib/apache/ruby-run.rb

win32ole Copy/Paste
41825 [Chad.Fowler@] Has anyone had any issues with using copy/paste with win32ole and Excel?
41829 [Chad.Fowler@] Nevermind.  I solved my own problem.  Needed to call "Select" on the the

is the sourcecode of scat.rb available?
41832 [  rw@we t. e] does anybody know if the sourcode of the mailinglist webarchiv used on

rdtool and extensions
41835 [djberge@qw s] Is there a way to use rd style documention within a .c extension?  Is there
41836 [danny@fr uk ] Do you want to do this?
+ 41838 [djberge@qw s] Oh, cool.  Didn't even think of that.  Thanks!
+ 41840 [Dave@Pr gm t] It does it right now: if you feed the C source code for a Ruby
  41841 [djberge@qw s] Oh, that's very nice.  Thanks.

new SmallEiffel elj-win32 release (-0.74)
41839 [geoff@el .c ] A new version of elj-win32 has been prepared and is now available from ..
41849 [gerhard@bi f] I wonder if we should post all our Python announcements to the Eiffel

How might "Apocalypse 5" affect Ruby?
41842 [todd@du kl n] Larry Wall is redesigning regular expressions, in his latest "Apocalypse 5".
+ 41846 [gehlker@fa t] Couldn't the old regex code be loaded with a require? That way people could
+ 41855 [tom.hurst@cl] Read it, came out with a headache :)
  41874 [fokke_wulf@h] There's nothing to say that ruby couldn't just as easily be implemented.
  41906 [tom.hurst@cl] Could you perhaps change your quote string too '> ' rather than just

Ruby 1.6.7, tainted, Net::FTP
41852 [hwyss@yw se ] I am running a CGI-Script that should write a file to a remote FTP-Server.

method/class query
41854 [moebius@bi s] I am researching a way to create ssl enabled xmlrpc servers.  While

net/ftp is CPU bound
41859 [jheard@ac io] I was noticing the other day that FTPing large files over fast
41861 [hal9000@hy e] Interesting idea. Maybe just add a

Pascal-like 'with' statement?
41867 [pmak@an me l] Is there something like Pascal's with statement? I'd like to turn this
+ 41868 [home@cl bs o] I don't think so ...
+ 41869 [sean@BU BY S] That's something I would LOVE to see added.
| + 41872 [home@cl bs o] FWIW, many Delphi programmers discourage the use of with -- although that
| | 41877 [sean@BU BY S] I've never heard of its use discouraged, but then Pascal is hardly my
| | 41878 [jean_hugues_] I once designed a "with statement" in some language. Inside the body, one
| + 41924 [rjp@br ws r.] hostname is wrong.  Look at http://ipy.frottage.org/rjp/ruby/with.html
+ 41870 [chrris@ma l.] If you have
| 41871 [chrris@ma l.] ...though I'm aware that you're actually just asking for a short hand rather
+ 41873 [tom.hurst@cl] Cfg.set(
+ 41875 [nobu.nokada@] IMO, `with' statement is a misdesign of Pascal.
+ 41880 [r2d2@ac .u u] I think "with" is confusing and evil, especially in Ruby where
+ 41882 [avi@be a4 co] My favorite solution to this is Smalltalk's cascades: end a method
| 41889 [nobu.nokada@] It allows only each one methods, i.e., denies method chains in
| 41923 [avi@be a4 co] That's right.  Actually, it depends on dialect - I think Dolphin has
+ 41917 [pbrannan@at ] I think this latter one used to be implemented using instance_eval,
  41931 [rjp@br ws r.] I'd update that, but the passphrase information is on the machine
  41936 [pbrannan@at ] My apologies; I didn' have the source, so I was going by memory. :)

tk question
41879 [Jean-Francoi] I would like to add some interactive help to my Tk app.
41884 [nagai@ai ky ] 'tcltk-ext' library (see RAA) maybe help you.
41890 [Jean-Francoi] thank you
41961 [nagai@ai ky ] If user's Ruby/Tk returns no error for "TkPackage.require('Tix')",