6348-7087 subjects 6713-8377

A tool to generate tags?
6551 [bombadil@wa ] Does it exist such a tool for using tags in vim?
6703 [andy@to ls e] Look in the irb distribution for rtags.rb -- it does both vi and emacs.

Prototype/Classless OOP in Ruby?
6558 [brannon@ln .] found out about Ruby and even bought the Ruby book from fatbrain.com
6575 [matz@ze ab t] * have instance variables.

Relational operators in Ruby.
6561 [hgs@dm .a .u] I have been thinking about relational operators in Ruby, (which is
6562 [Dave@th ma e] Would '==' produce it's RHS on success? If so,
6572 [hgs@dm .a .u] This is a tricky one.  This doesn't come up in Icon, because it has
6600 [schneik@us i] While I think the idea of supporting Icon-style goal-directed evaluation
6602 [Dave@th ma e] A worthy goal, I agree, but can you think of any time where this
6618 [schneik@us i] #
6641 [hgs@dm .a .u] That is what I was trying to achieve.  I have only seen

Reading UTF-8 Streams
6563 [johan@ho si ] I am pretty new to ruby and I am very happy with what I have seen so far! I
6577 [matz@ze ab t] Ruby's Regexp matcher handles UTF-8 properly.  No conversion is

tab-with within Xemacs
6564 [mjais@we .d ] does anybody know how to change the tab-with for ruby
6565 [gotoken@ma h] You can control with ruby-indent-level.

Compiling Ruby on Mac OS X
6566 [jdnier@ex cp] I'm trying to compile Ruby on Mac OS X (and am new to this list). I

Ruby/C extension build question
6570 [arjen@ar go ] I'm working on an extension for the GDCHART (http://www.fred.net/brv/chart/)
+ 6571 [arjen@ar go ] That would be this weekend.
+ 6573 [Dave@th ma e] You _could_ determine if they exist (using have_library), and if not

Does win32ole work with windows 2000?
6574 [mulperi@ik .] I've been trying to get The Book's WIN32Ole samples to work, but they

6578 [duchene@ma n] ...

ANN: Ruby/GDChart 0.0.1 available
6579 [arjen@ar go ] I've made a first version of my Ruby/GDChart library available at

6580 [maurice@eu o] I was experimenting the behaviour of ruby when I came across the
6581 [Dave@th ma e] a = 1.0/0		# => Infinity

best way to interleaf arrays?
6582 [dblack@ca dl] Is there a nice Ruby idiom for interleafing arrays?  It's not hard to
+ 6583 [green@Fr eB ] What do you mean by interleave?  Normally I'd take this to mean that you'd
| 6584 [dblack@ca dl] Hmmmm.... I'm not sure what I said that implied that.  Maybe throwing
| + 6586 [mtm@cs ft ne] "
| + 6587 [green@Fr eB ] Yes, that would be the confusing part :)
| | 6588 [dblack@ca dl] Except... you haven't (un)reversed what's left of a1 and a2.  So, for
| + 6639 [cjon@sa ph r] class Array
+ 6585 [Dave@th ma e] Matz has a technique for simulating external iterators using threads,
  6593 [dblack@ca dl] What about a to_h method for arrays?  I mention this mainly for the
  6594 [Dave@th ma e] That was my thinking (if you can call it that ;-) It seems reasonable
  6611 [dblack@ca dl] Although.... what about the cases where two types have to_* methods
  6612 [Dave@th ma e] I'm convinced by this, particular if we added the block form too.
  6613 [dblack@ca dl] I was wondering about a block form.  I'm not sure exactly what it
  6614 [Dave@th ma e] or
  6663 [dblack@ca dl] Oh, ok :-)

Q: refering to a Proc from class_eval
6589 [hipster@xs a] I'm trying to wrap function definitions, and cannot find a way to
+ 6590 [aleksi.nieme] Try this, it barks at me :).
| + 6591 [hipster@xs a] Great, thanks! Maybe some more name mangling to prevent inter-object
| + 6592 [Dave@th ma e] It used to have the behavior that leading spaces were stripped (and
+ 6595 [matz@ze ab t] The solution is supplied by Aleksi in [ruby-talk:6590].  And this

Short articles for Borders newsletter
6596 [Dave@th ma e] Borders (the bookstore chain) has asked for a submission about Ruby for
6598 [mjais@we .d ] Maybe you should also point out, that there is a very
6603 [Dave@th ma e] Friendly? This lot? Sharks, all of them!  ;-)

Question on sort!
6597 [Dave@th ma e] Someone asked about a strange inconsistency in Rubicon, and I didn't
6599 [matz@ze ab t] This is very preliminary behavior following
6601 [Dave@th ma e] Although I see the reason for returning nil on methods such as gsub!,
6604 [matz@ze ab t] OK, OK.  Let's discuss.
+ 6605 [Dave@th ma e] There's another way to view consistency: sort and sort! might be
| 6634 [matz@ze ab t] I don't call it consistency, but I have to admit that returning nil is
+ 6615 [matju@ca .o ] If a justification is required, i'd say that the no-bang-method-chain rule
| 6616 [Dave@th ma e] It what way is it different from the various File and IO class methods
| + 6617 [schneik@us i] <Stuff about chaining methods.>
| + 6644 [hgs@dm .a .u] But we could introduce sub? -- takes same args as sub! but doesn't change
|   6648 [Dave@th ma e] OK, and that's effectively what Ruby does now. However, that isn't
|   6649 [hgs@dm .a .u] Its ! ops make the changes, these would not.
+ 6623 [jimm@fn rd i] []

Net::HTTP example from Ruby Book
6606 [mjais@we .d ] at work I have written an http-client in Perl and I wanted to do the
+ 6608 [aleksi.nieme] From the page 490, I assume.
+ 6609 [matz@ze ab t] Unlike get, get2 does not return an array.  So that code should be

popen vs. open3 vs. Windows....
6607 [Dave@th ma e] OK, I'll admit it. I'm spinning my wheels here, and need a clunk on
6610 [aleksi.nieme] Your first example works for W2000.

closures (rb vs lisp?)
6619 [peter.wood@w] I am trying to figure out how to do closures in Ruby. In CL I can do
+ 6620 [hipster@xs a] list = []
+ 6621 [hipster@xs a] list = []
+ 6622 [yashi@ya hi ] I guess i'm missing the point.  could you enlighten me why it needs to

Hash operators
6624 [rpmohn@pa ix] I know that Hash#- operator is defined (because I use it :-), but I can't
6625 [rpmohn@pa ix] Oops, I forgot that I had actually defined it myself. Sorry.

Extending classes
6626 [bombadil@wa ] I have a little question :)
6627 [yashi@ya hi ] module Gtk

Why is WeakRef#__getobj__ missing from the pickaxe book?
6628 [cjon@sa ph r] I notice that the discussion of WeakRef from the pickaxe book
6632 [Dave@th ma e] There are two reasons I can think of, but neither is a show-stopper.
+ 6633 [aleksi.nieme] I don't know much about weak references, but I'd guess you risk losing the
+ 6717 [cjon@sa ph r] But something like this should be in the WeakRef lib.

Best way to convert a string to an array of numbers?
6629 [cjon@sa ph r] [ 2, 3, 3.5, 5, 1.2 ]
+ 6631 [aleksi.nieme] Cullen J O'Neill asked
+ 6636 [phasis@ha an] How about
  6635 [spcoltri@hr ] Only if you can be sure s is not "2 3 3.5 exit 1.2" :)
  6721 [cjon@sa ph r] Yeah, this is much better.  Thanks!

RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2000-11-11)
6630 [schneiker@ju] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2000-11-11)

Array Intersect (&) question
6637 [rpmohn@pa ix] I have many uses for the Set Intersection operator on Arrays, but while I
6646 [aleksi.nieme] Ross asked something about widely known and largely ignored language (on
+ 6647 [schneik@us i] # Ross asked something about widely known and largely ignored language (on
| 6701 [steve@de f. ] It'd be good if the code presented in the Recipe of the Day could then
+ 6652 [rpmohn@pa ix] Wow! Much faster than the standard Ruby Array#&. Thanks much (I'll check
  6723 [matju@ca .o ] I translated the above code into Ruby. If you run the code below, Array#&
  6744 [matz@ze ab t] Using a hash makes it pretty fast, but it does not preserve the
  + 6747 [aleksi.nieme] I've been in need of "ordered hash" quite often. I've always hacked around,
  + 6752 [rpmohn@pa ix] 1) I certainly would prefer the speed. I never assume that my array is in
  | 6754 [hal9000@hy e] Hmm, I can't agree with you on this one. The very term "intersect"
  | 6757 [rpmohn@pa ix] Is it valid (in math) to be intersecting sets that contain duplicates? We
  | 6760 [hal9000@hy e] Well, if I were going to apply "intersection," which is a set operator,
  | + 6763 [peter.wood@w] I agree with Ross.  Presumably, if you are intersecting "pseudo-sets"
  | | + 6764 [dblack@ca dl] And order is significant, though (not(or(to digress into Lisp)anything))
  | | + 6767 [matz@ze ab t] Hmm, interesting.
  | |   + 6772 [matju@ca .o ] If we're implementing Sets using Arrays, yes. There is another formalism
  | |   | 6786 [chr@su di en] some of the examples in this thread are misleading since the elements of the
  | |   + 6800 [rpmohn@pa ix] Yes, (1 2) is definitely the proper intersection in this case. Your
  | + 6771 [matju@ca .o ] in Array#|, receiver has priority. I adopted the same behaviour in my
  | + 6799 [rpmohn@pa ix] Since this translates to something like a.&(b) I would preserve the order
  + 6755 [green@Fr eB ] Personally, I feel that a non-ordered &() method would violate the POLS for
  | 6765 [matz@ze ab t] I think I'm going to re-implement & and | using hash, preserving
  + 6756 [matju@ca .o ] Oh, I see.
  | 6759 [rpmohn@pa ix] a1 = %w# a b c c c #
  | 6758 [rpmohn@pa ix] Oops, nevermind. I didn't see the "uniq" first time through! -RPM
  + 6761 [c.hintze@gm ] for me this would be ok! If I want to rely on order, I would simply
    6762 [dblack@ca dl] I agree.  Even if & and | ignore order, there are still ways to order

Ruby & Java
6638 [rpmohn@pa ix] My team seems to have their hearts set on doing a Java project next, though
6640 [Dave@th ma e] Could you give us some idea of the project? Perhaps we can help you

Hash with a key of nil ?
6642 [rpmohn@pa ix] While reading data in from a file and populating a hash, I accidentally
6643 [Dave@th ma e] Perhaps the alternative questions might be: should you always be able
+ 6645 [rpmohn@pa ix] I guess so, but I don't know if I'm convinced yet. Maybe it's just that I'm
+ 6657 [matz@ze ab t] It did.  But I consder it was a bug.

each/for binding confusion and resolution
6653 [grady@sc m. ] As I am still learning the language, I am hitting things which are
+ 6670 [hipster@xs a] -> [2,2]
+ 6671 [c.hintze@gm ] Yes and no! The 'problem' with for vs. each is very easy to
  6680 [grady@sc m. ] The other overhead is the binding look-up every time through the loop.
  6681 [grady@sc m. ] Interesting.
  6697 [hipster@xs a] In the Hacker's Dictionary interpretation, I presume?   :)

printing/accessing arrays and hashes
6656 [raja@cs in i] I'm coming to Ruby with a Python & Common Lisp background.
+ 6658 [Dave@th ma e] #inspect returns a String representation of the array or hash
+ 6659 [raja@cs in i] I answer to part of my earlier post I've come up with the following using
| + 6660 [dblack@ca dl] (See Dave's remarks on #inspect.)
| + 6661 [phasis@ha an] class Array
| + 6662 [Dave@th ma e] If you don't want to use inspect, you could rewrite the above slightly
+ 6664 [raja@cs in i] Thanks to all for the pointer to #inspect and the behavior of #join in Ruby.
  + 6665 [Dave@th ma e] Actually, what happens is that when you concatenate something to an
  | + 6672 [hal9000@hy e] That's interesting, Dave. Is the behavior of << the same? Because I
  | | 6676 [Dave@th ma e] It works the same way.
  | + 6678 [raja@cs in i] aha!  So it's not really #joins behavior but that of concatenation (akin to
  |   + 6683 [hgs@dm .a .u] irb(main):001:0> print ( { "a" => "b" } )
  |   + 6684 [cjon@sa ph r] The problem with showing structure in join seems to me to be that
  |   + 6768 [matz@ze ab t] Probably Hash#fetch equivalent for Array is good answer.  What do you
  |     + 6769 [Dave@th ma e] at (for the Smalltalkers out there).
  |     | + 6774 [matz@ze ab t] Ruby already has Array#at which only gives an element, not a
  |     | | + 6775 [matz@ze ab t] Sorry, It was live only. not archived.
  |     | | + 6781 [Dave@th ma e] Yeah - I was thinking of extending it to accept ranges and/or a length
  |     | + 6776 [matju@ca .o ] I think that for the SmallTalkers out there, it will be called "fetch",
  |     |   6782 [Dave@th ma e] Which brings up a point I raise every now and then.
  |     |   + 6803 [hgs@dm .a .u] I've wondered what the thing called "miniruby" (which is
  |     |   + 6808 [matju@ca .o ] I agree 100%.
  |     + 6785 [cjon@sa ph r] You could require || after the opening { for blocks, that would make
  + 6686 [matz@ze ab t] My short comment.  'inspect' is for human readable representation.  So
    6705 [aleksi.nieme] I'd love to see inspecting to have some warp on it's evolution. Basically
    6741 [hipster@xs a] Just an idea: introduce a Visitor pattern. The default implementation

Suggestion for addition to Begin/End syntax
6666 [drew@lo al o] I'm very new to Ruby so this might be a bit of a shot in the dark,
+ 6667 [yashi@ya hi ] if end modifier(??) is optional how about
| + 6668 [grady@sc m. ] On a similar note, has the possibility of using more traditional
| | 6685 [matz@ze ab t] Yes.  Somewhere around 0.60, almost 6 years ago.  Braces did not fit
| + 6674 [drew@lo al o] Well, _Ideally_ it would help the interpreter provide more usefull
|   + 6675 [hipster@xs a] I don't mean to be harsh, but adding syntactic sugar isn't going to
|   + 6688 [matz@ze ab t] The another reason I removed modifiers was that auto indentation of
+ 6673 [hal9000@hy e] See below.
+ 6687 [matz@ze ab t] It used to, before version 0.60.  It was removed for control
  6698 [fit0298@fi e] At last, "suffixed for" is... ??
  6711 [matz@ze ab t] Do you mean you want it?  Like Perl?
  6736 [fit0298@fi e] Now, I don't want it. I like to use each method.

6669 [aamer@an -o ] unsubscribe

GTK on Win
6677 [mvesely@sc .] My question is this: Iดไ like to use Gtk  on Windows. What everything I
6679 [hipster@xs a] Martin, could you please adjust your MUA not to send these weird

behavior of Proc#arity?
6682 [grady@sc m. ] I was looking at the library reference, and I have to say I'm confused
6712 [matz@ze ab t] They accept any number of arguments without causing error, thus their
6714 [grady@sc m. ] Ah.  That would certainly explain the behavior of Proc#arity (and
+ 6719 [matju@ca .o ] a = [1]   #=> [1]
| 6726 [grady@sc m. ] (Thanks for the pointer to the previous thread -- unfortunately,
+ 6743 [matz@ze ab t] Hmm, let me think about this for a while.
  6746 [ms@ia ta e. ] a,b,c = 1,2,3    # a=1; b=2; c=3
  6766 [matz@ze ab t] What do you suppose the value of `a' after `a=1,2'?
  + 6770 [dblack@ca dl] a,b = 1,2,3  # a==1, b==[2,3]
  | 6773 [matz@ze ab t] This should be
  | + 6777 [dblack@ca dl] Wow -- what's it like? :-)
  | + 6779 [ms@ia ta e. ] Sorry, I missed intervening messages in this thread before posting my
  |   6784 [dblack@ca dl] Yes, me too -- mainly I was just musing on the fact that not every
  + 6778 [ms@ia ta e. ] This illustrates how a Principle Of No Surprise language would be

6689 [dred010@ho e] ...

Syntax highlighting in XEmacs
6690 [ntalbott@ro ] For starters, I'm running XEmacs 21.1 on Windows 2000. I'm more new to emacs
+ 6691 [jweirich@on ] I get green strings and red comments.  But that's it.  Syntax
| 6692 [ntalbott@ro ] I was afraid you were going to say that. At least I don't feel left out any
+ 6693 [Dave@th ma e] The problem is that the ruby-mode.el file checks for the presence of
  6694 [schneik@us i] #
  + 6696 [hipster@xs a] Yes, the FAQ should be updated. Mirko Nasato and I--unknowingly of
  | 6709 [matz@ze ab t] I'm back from the conference.
  | 6740 [hipster@xs a] The ruby.vim syntax highlighting entry. It's obsolete.
  | 6812 [schneik@us i] Well, my expectation that syntax colored HTML pages of program code would
  | 6813 [aleksi.nieme] Producing output like
  | 6815 [jweirich@on ] Source2html only does HTML write now, and only uses bold/italics for
  | 6839 [jweirich@on ] In Version 0.9.3 the HTML code emitted for keywords and comments is
  + 6699 [hgs@dm .a .u] About a quarter of males are red-green colour blind. (In Western
    6702 [peter.wood@w] Fortunately, I don't think it's _possible_ to go down that route :-)
    6706 [schneik@us i] #
    6708 [aleksi.nieme] Before we (you :) delve into lengthy discussion, I'd like to note couple of

Re: Syntax highlighting in XEmacs [LARGE]
6695 [Dave@th ma e] ...

Problem executing gnobrows.rb
6700 [bombadil@wa ] I get an error executing example gnobrows.rb, distributed with Gnome
6780 [yashi@ya hi ] current gnome/ruby implicitly expect you to have imlib extension,

dump format error with recent snapshots
6704 [feldt@ce ch ] Recent snapshots has started to "break" some of my older Ruby code. The
6710 [matz@ze ab t] I've never merged md5 dump patch yet.  Probably you applied the patch

Ruby and Emacs (was: Re: [...])
6707 [hgs@dm .a .u] I had the feeling that Ruby inherited _some_ ideas from lisp.
+ 6716 [perin@pa ix ] Not, I suspect, if the Ruby code were the output of a machine
| 6801 [hgs@dm .a .u] I meant for the code that the user of Emacs adds, to tune it.
+ 6724 [dblack@ca dl] Practical, I don't think so.  Really difficult, definitely :-)
| 6802 [hgs@dm .a .u] That is why I thought it might be possible...
| 6804 [dblack@ca dl] I said elisp, not Lisp :-)
+ 6809 [joe@vp p. et] does it.  He links perl into emacs.  Here is part of the