45579-47085 subjects 45883-47186

RAA: Version of Ruby
45702 [m.rokos@sh c] I just spotted at RAA that Ruby has version 1.6.6, could
+ 45703 [dblack@ca dl] Which one?
+ 45719 [matz@ru y- a] Oops.

Syntax proposal
45723 [list@NO PA c] class ...
+ 45724 [decoux@mo lo] Do you accept to have 3 characters rather than 2 ?
| 45900 [list@NO PA c] Thanks to you, to Martin and to Hal for your suggestions.  Yes, three
| + 45957 [kentda@st d.] I try to imagine an implied "if so" after the and.
| + 45995 [tom.hurst@cl] Ruby isn't trying to recreate English here.  Try to think more in terms
|   + 45996 [dblack@ca dl] One step closer and you're dead.
|   | 46013 [list@NO PA c] You're a genius.  This will probably change my perspective on it. :-)
|   | 46015 [Dave@Pr gm t] Nah - he's just got family in Texas...  :)
|   + 46012 [list@NO PA c] I can think in logical operations, it's when they blend too well with
+ 45729 [hal9000@hy e] FileTest.directory?(dir) ? raise "Directory #{dir} already exists." : nil
+ 45923 [patrick-may@] raise "Directory #{dir} already exists." if FileTest.directory?(dir)
  45953 [list@NO PA c] Uhm, wasn't this the first among my examples? :-)

ActiveRubyScript and RubyAEOSA
45737 [gehlker@fa t] I just discovered ActiveRubyScript (sometimes written as two words) by
45742 [hal9000@hy e] Isn't it actually called ActiveScriptRuby? I'm
+ 45743 [meier@me st ] of
+ 45755 [james@ja es ] You can write IIS ASP websites in ActiveScriptRuby
+ 45772 [gehlker@fa t] ActiveScriptRuby is more common. I was just copying the translation from the
  + 45775 [james@ja es ] What is the distinction for people who have not (sufficiently) used both?
  | + 45779 [ned@bi e- om] It looks like a translated version of the Perl module with a similar
  | | + 45781 [hal9000@hy e] What you say is true, Ned. But if I am not
  | | + 45782 [james@ja es ] True, but I want to open up the VBA IDE in Word and enter Ruby code, not
  | |   45790 [rich@in oe h] You all might want to look at this as well...more along the lines of
  | |   45794 [james@ja es ] Oh, thank you!  I had been looking for this a while back.  I remembered
  | + 45804 [gehlker@fa t] Hmm. Maybe it's a continuum by now. So let me make up an example comparing a
  + 45778 [hal9000@hy e] way
    + 45784 [nhodgson@bi ] Microsoft implemented COM on MacOS and for a while even encouraged
    + 45798 [gehlker@fa t] [Question about COM on MacOS]

Ruby 1.6.7 in RAA??
45762 [info@mj is d] maybe this is stupid question but at the beginning of the RAA page
45763 [djberge@qw s] No difference.  You have the latest stable release.  Matz just updated the

how to do typecasting?
45767 [lists@de on ] is there a way to typecast values?
+ 45769 [hal9000@hy e] a.each {|l| print l.to_s.length }
+ 45770 [1028495857.a] a.each { |v|
  45771 [lists@de on ] *smackself*

File.new :  having problems in windows
45773 [khabibiuf@ho] I'm a relatively new user to ruby.  I was trying to use the File.new
45774 [pabs@pa lo r] You should either use single quotes to store filenames (so the

How to create a directory
45776 [briqueabraqu] How can I create a directory (inside another)? I'm using Ruby 1.6,
45777 [james@ja es ] ruby -e "Dir.mkdir( 'newdir') "

Ruby Portable Runtime?
45780 [mikkelfj-ant] many bright people still hanging out :-)
+ 45786 [matz@ru y- a] Probably.  It can reduce my burden.
+ 45833 [comp.lang.ru] Why is this any better than Cygwin? A software layer is a
  45867 [mikkelfj-ant] Cygwin doesn't work. It's practically impossible to have to Cygwin dependent
  45878 [charleshixsn] MS feels that any friction between programs working well on both the Win

Ruby and Ocaml - my two favorite languages
45787 [mikkelfj-ant] While being away from Ruby land, I did investigate the OCaml language
+ 45788 [jweirich@on ] I'm curious.  Could you give an example of this?
| 45789 [mikkelfj-ant] In the past year there have been some threads on this topic and some
| 45815 [meier@me st ] ld
| 45826 [mikkelfj-ant] a = new X
+ 45857 [ned@bi e- om] Of course, there's no reason why you couldn't use GC with C++; there
  + 45868 [Ephaeton@gm ] Agreed. Many people go searching for a new language instead of using
  | 46039 [gsinclair@so] Good point, but C++ and Perl can't be reasonably considered to occupy the
  + 45872 [mikkelfj-ant] Actually STL greatly reduces the need for GC thanks to its built in memory

ADV: Harvest lots of E-mail addresses quickly !
45795 [emailharvest] ...

RE: Ruby in the rainforest (postlude)
45797 [botp@de mo t] Besides that, it has substance... I even like the SysAdmin stuff... overall,

Question about GetoptLong
45799 [patrick.benn] I'm trying to recreate a Perl script in Ruby and have run into a problem.
45800 [jim@fr ez .o] I use getoptlong alot, but I'm not quite sure I understand your problem.
45802 [patrick.benn] I thought my message was fairly self-explanatory, but I guess not.  Here
45803 [jim@fr ez .o] Ok, now I see. My question is why do you call it twice?
45805 [patrick.benn] Because I have separate methods/classes that are standalone (OO
+ 45806 [nobu.nokada@] So set opts.ordering to GetoptLong::REQUIRE_ORDER, and make new
| 45807 [patrick.benn] Sorry, that won't work.
| + 45810 [pit@ca it in] 1) call GetoptLong in the beginning of the program with all possible
| | + 45811 [gotoken@no w] ARGV.replace(saved_ARGV)
| | + 45845 [patrick.benn] Not possible since some of the arguments have different meanings (and
| + 45812 [nobu.nokada@] AFAIK, GetoptLong never eat non-option arguments regardless
|   45848 [patrick.benn] Well with Ruby 1.6.6 it does.  If I have XXXX -c -a and the GetoptLong
|   + 45849 [hgs@dm .a .u] Consuming all the options so they are out of the way is a feature
|   | 45851 [patrick.benn] It certainly makes sense for it to eat the options it understands, but I
|   + 45980 [nobu.nokada@] You need to call GetoptLong#terminate seeing "-c".
+ 45808 [jim@fr ez .o] Hmm, I would not consider many of the options very pretty.
  45809 [patrick.benn] Reasonable idea, but.... it still won't work since GetoptLong (wrongly
  45824 [jim@fr ez .o] Yes. This method only works if you know all possible command options.

Unicode in Ruby now?
45829 [tpeters@in a] I've read the thread "Unicode in Ruby's Future?" [ruby-talk: 40016]. It
45840 [matz@ru y- a] Yes.
+ 45922 [cjh_nospam@m] Matz,
| + 45931 [cjs@cy ic ne] Yes.
| | + 45932 [hal9000@hy e] Well, here is your chance to contribute to
| | | 45933 [cjs@cy ic ne] I doubt it. My opinion of the matter is that the correct way to
| | | 46032 [dan@si he or] This is just a comment from an interested but mildly uninvolved
| | | 46041 [cjs@cy ic ne] I don't think it's so presumptious.
| | + 45934 [matz@ru y- a] I don't think we hate I18N in general, but I admit many Japanese hate
| |   45937 [matz@ru y- a] By the way, what are the required I18N features to satisfy you?
| |   45951 [cjs@cy ic ne] Me? Not so much, actually. I need to be able to read in ISO-8859-1,
| |   45952 [matz@ru y- a] Reasonable.  How do you want to specify the reading/writing charset?
| |   + 45958 [cjs@cy ic ne] Well, what Java does works fine for me. Basically, java has "streams"
| |   | 45992 [matz@ru y- a] Thank you for information.
| |   | + 46027 [maki@ru yc l] IMHO, Mojikyo is a character-glyph set. It defines detail
| |   | | 46034 [cjh_nospam@m] That sounds fair, but computers still need to process such symbols.
| |   | | 46040 [tpeters@in a] Then we would delay i18n string processing until the iso 10646 people have
| |   | | 46109 [matz@ru y- a] I'm not against Unicode or any other charset.  I just want that the
| |   | + 124366 [chen_levkovi] Take a look at http://www.muftah-alhuruf.com you can find there an
| |   + 45975 [tpeters@in a] How about
| + 45935 [matz@ru y- a] Mojikyo character set contains all the CJK characters in ISO 10646.
+ 45954 [tpeters@in a] Nice. I still think sources and sinks of characters also need an
| 45960 [cjs@cy ic ne] Yeah. This is getting into complex nightmare city. That's why I'd prefer
| + 45961 [ontologist_2] As for someone who just wants to use a set of
| + 45964 [tpeters@in a] Sorry, with "other" I meant besides Mojikyo. ?
| | 45972 [cjs@cy ic ne] No, and no. As specified in section 2.2 of the standard (I quote
| + 45965 [meier@me st ] y,
| + 45969 [a.bokovoy@sa] Unicode 3.1 is 32-bit wide. I do not see reason to exist projects like
| | 45973 [cjs@cy ic ne] I have just looked at my 3.0 standard and the 3.1 and 3.2 updates on the
| | 45979 [a.bokovoy@sa] 3 Relation to ISO/IEC 10646 and UCS-4
| | 45982 [cjs@cy ic ne] Actually, I was looking for someone to attack my argument, not
| | 45993 [a.bokovoy@sa] difference in ISO/IEC 10646 and Unicode very soon in sense of covered code
| | + 46005 [ontologist_2] I beg your pardon,
| | | 46018 [matz@ru y- a] Probably you're asking Curt, but I will answer what I can.
| | + 46042 [cjs@cy ic ne] Right. They're *reducing* the ISO/IEC code space to match Unicode.
| |   46260 [cjh_nospam@m] No. Unicode uses UCS-4 characters, 32 bits. It also provides UCS-2,
| |   46266 [cjs@cy ic ne] These statements are both very wrong. Please consult the Unicode
| |   46281 [cjh_nospam@m] I was deliberately being "reinterpretive", but what I said is the effective
| |   46284 [cjs@cy ic ne] What part of "UTF-32 is restricted in values to the range 0..10FFFF16,
| |   46347 [cjh_nospam@m] I see you have built a new 21-bit computer which is going to conquer
| |   46353 [cjs@cy ic ne] If I want to store 21-bit values, I store them in a 32-bit word, wasting
| |   + 46362 [cjh_nospam@m] Hey, no need to shout. Why is there a Mojikyo standard if no-one's being
| |   | 46363 [cjs@cy ic ne] Because certain very specialized applications, mainly to do with
| |   | 46376 [cjh_nospam@m] I intend to drop the discussion too, since you seem to want to
| |   | + 46377 [transami@tr ] its a fight! :)
| |   | | + 46397 [bjsp123@ya o] i'd like to hear.
| |   | | + 46499 [cjs@cy ic ne] Unicode covers a lot of what people want to do, but not everything.
| |   | + 46497 [cjs@cy ic ne] I wish you'd said that at the beginning. I would never have started
| |   + 46372 [akr@m1 n. rg] Because Unicode has all JIS X 0208 characters in BMP.  However new
| |     46501 [cjs@cy ic ne] Yes. And also all JIS X 212 characters.
| |     + 46565 [qrczak@kn .o] Well, not that much: at most 3/2 times larger.
| |     | + 46570 [taw@us rs so] UTF-8 is 50% larger than UTF-16 only for text which consist only of
| |     | + 46590 [cjs@cy ic ne] Sorry; you're right.
| |     |   46777 [unet@re x. o] UTF-8 is designed so that you always know if you are in the
| |     |   + 46783 [mikkelfj-ant] I have nothing against UTF-8, but it isn't really a strong point. When would
| |     |   | 46945 [cjs@cy ic ne] Well, in a lot of cases it's no big deal, because you just want to
| |     |   | 47054 [unet@re x. o] UTF-8 parsers must ignore "broken" characters because, as I pointed
| |     |   | 47288 [cjs@cy ic ne] Ah. So does this mean that if I break a String into two in the
| |     |   + 46947 [cjs@cy ic ne] I agree. What we may not agree on is that surrogates work very well
| |     |     + 46951 [matz@ru y- a] They are both fully present in Unicode BMP, but mapping is not
| |     |     + 47058 [unet@re x. o] What is in use is determined not only by what character sets and
| |     |       47059 [Dave@Pr gm t] Which leads to some interesting Orwellian possibilities: not just
| |     |       47128 [bjsp123@ya o] character set so
| |     + 46591 [akr@m1 n. rg] For Shift_JIS people, JIS X 0213 provides a Shift_JIS compatible encoding.
| + 45989 [mikkelfj-ant] respectively,
|   46044 [cjs@cy ic ne] No, because then you have to deal with conversions. Most popular
|   46100 [mikkelfj-ant] Not really, you just produce a runtime error that the data cannot be - say -
|   46182 [cjs@cy ic ne] I don't have my spec. handy, so I'm going from memory here; someone with
+ 46451 [qrczak@kn .o] On Unix it's generally the encoding determined by the locale.
  46453 [qrczak@kn .o] Unicode is not 16-bit. The code point range is 0..0x10FFFF.
  46500 [cjs@cy ic ne] UTF-8, UTF-16 and UTF-32 are all able to represent all Unicode

How to Emulate C/C++ Pointer/Reference in Ruby?
45834 [billtj@gl e.] Is there any easy way to emulate C pointer or C++ reference in Ruby?
+ 45835 [decoux@mo lo] Well, rather than give the File object to the Childs just give it the Root
+ 45841 [nat.pryce@b1] You could wrap the File object owned by the Root in another object that
+ 45843 [pbrannan@at ] There is no need to emulate references.  With the exception of certain
  45880 [billtj@z. lu] Thanks for all the responses.  For efficiency purposes (because the file
  45884 [dblack@ca dl] [My understanding, subject to corrective intervention]
  + 45894 [justinj@mo i] nil, true, false and FixNum are internally stored by value.  The runtime
  + 45898 [billtj@z. lu] Well, probably for the temporary variable it is not very useful to have a
  + 45899 [pbrannan@at ] #include <iostream>

Individual elements of regular expressions
45836 [briqueabraqu] Guys,
+ 45842 [dblack@ca dl] (Performing some joins on the above, as per your verbal description of
+ 45854 [hal9000@hy e] I think David perhaps answered half your question...
  45871 [briqueabraqu] Great! That's exactly what I want. There's only one missing point: how
  45875 [dblack@ca dl] /regexp/m
  45888 [briqueabraqu] 877

Ruby code is the shortest (language shootout)
45837 [gunnar.ander] Sorry if this has been posted already and I missed it.
45892 [rawlins@cs u] This study skipped something that seems rather important to me if he's

Determining whether a file has been moved vs. deleted
45846 [djberge@v5 h] Is there a way, once a file has been opened, to determine whether it's
+ 45847 [hgs@dm .a .u] Depending on OS, can you create a hard link to the file so that when
+ 45921 [jeremy@ch os] Um, but the file *does* still exist.  The thing that no longer exists

Late contribution to discussions
45850 [gsinclair@so] I just joined the mailing list, having but read it through the web for
+ 45904 [ned@bi e- om] As long as you're dealing with systems with no files, potentially
| 46010 [gsinclair@so] Good point.  Controlling these suckers using Ruby would be much better than
| 46014 [ned@bi e- om] But it's not going to happen any time soon; Ruby's footprint is much
+ 46046 [justinj@mo i] *not*
  46073 [hal9000@hy e] Actually, one place this might be useful is

FXRuby: how do you capture a canvas resize?
45858 [paul@fl or a] I'm building a small drawing application by hacking the Scribble example
45873 [lyle@us rs s] @canvas.connect(SEL_CONFIGURE) do |sender, sel, evt|
45891 [paul@fl or a] the
45903 [lyle@us rs s] If I add the lines I showed in my previous e-mail (i.e. catching the
45906 [paul@fl or a] Did the same here on windows, it looks like it is a windows-only quirk: I
45928 [lyle@kn lo y] OK, I'm seeing the same behavior here under Windows. Looks like you might
45950 [paul@fl or a] Excellent, that worked, thanks!

matrix challange
45859 [lists@de on ] I'd like to see the various solutions for coming up with code to
+ 45860 [decoux@mo lo] pigeon% ruby -rmatrix -e 'a = Matrix[[1,2],[1,3],[2,4]]; p a.transpose'
+ 45861 [pbrannan@at ] irb(main):001:0> require 'matrix'
+ 45862 [dblack@ca dl] require 'matrix'
+ 45863 [gsinclair@so] Isn't there a Matrix class in the distro?
+ 45864 [mulperi@ik .] irb
| 45866 [lists@de on ] Sorry all, I actually checked for a matrix class, but I must have missed
| + 45869 [lists@de on ] I've been looking at the PP's Guide and I can't seem to see it in there.
| | 45870 [pbrannan@at ] ruby -rrbconfig -e 'puts Dir.entries(Config::CONFIG["rubylibdir"])'
| + 45889 [pit@ca it in] I guess using one of my own libraries doesn't qualify either, but
|   46036 [vjoel@PA H. ] require 'enum/op'
+ 45865 [STUCKNER@MU ] For those of us who didn't know Matrix was built in, my first crack at it
+ 45874 [transami@tr ] funny you should ask. i just had to do that myself.
| 45879 [dblack@ca dl] There's nothing for Ruby to pick up on.  If Ruby's first exposure to
+ 45926 [pizza@pa se ] ruby -rmatrix -e'puts Matrix[[1,2],[1,3],[2,4]].transpose'

Emacs is dead, long live whatever comes after that as long as it is made with Ruby
45876 [jani.alanko@] Subject is not exactly right but I was too lazy to invent something that
+ 45877 [putsch@mx m.] VIM has the ability to have an embedded Ruby interpreter.
| + 45881 [charleshixsn] I didn't see any reference there to using Ruby as a scripting language.
| | + 45885 [1028570860.4] Well, perhaps you didn't read enough?
| | | + 45896 [tsiivola@cc ] Every lisp is sacred,
| | | + 46000 [charleshixsn] Mea culpa, you are correct.  I guess that when I saw the list of files
| | + 45929 [tim@ve et .a] If you don't like using the search feature of the user manual on the
| + 45930 [web2ed@ya oo] Well, (Emacs) is great!, however, I'd have to hold {gcc} over Emacs.
| | 45981 [michael_s_ca] Well, plus a cast of hundreds, if not thousands of others.
| + 45994 [tom.hurst@cl] It's not really the same thing though.  If you remove Lisp from emacs,
+ 45886 [dblack@ca dl] If you hate Emacs, I have to wonder why you're interested in
  45988 [jani.alanko@] I don't hate it, in fact I would love to use program like Emacs but I just