72433-72844

72196-73005 subjects 72661-75237

^ readline for OS X
72433 [dave cherryv] I have put together a script that will add the ruby readline module to the

^ Re:
72435 [hal9000 hype] That's fascinating! I wish we had an English translation

^ Iteration - last detection
72439 [orion2480 ho] Is there any built in functionality for iteration that will allow me to
+ 72441 [hal9000 hype] Array,
+ 72445 [spam deck.dk] hmmm... I cannot find a really elegant solution to this... it would have
| 72447 [gfb tonesoft] With arrays you can also do this as
+ 72448 [martindemell] module Enumerable
| + 72453 [ahoward fsl.] module Enumerable
| | + 72460 [martindemell] That isn't much better, though - you have the overhead of generating an
| | + 72462 [dblack super] Let Ruby do more of the work for you :-)
| | | + 72465 [martindemell] You aren't guaranteed 'size', though.
| | | | 72469 [dblack super] Yikes.  So much for conciseness :-)  Thanks for the timely correction.
| | | + 72468 [flori nixe.p] Hmmm... Too much work isn't good either. If Enumerable#size
| | | + 72472 [ahoward fsl.] this won't work for *anything* Enumerable though - though it works for Array
| | + 72478 [dblack super] OK, as penance for clouding the issue with the mythical
| |   + 72487 [nobu.nokada ] Enumerable doesn't guarantee multiple iterations. e.g. IO.
| |   + 72494 [martindemell] My flag version benchmarks fater still
| + 72681 [steven_shaw ] I like Martin's implementation. I've modified it so that it handles an empty
+ 72456 [dave cherryv] this might work for you, it has simplicity going for it.
| 72530 [pbrannan atd] I like that this solution lacks a flag to indicate whether I'm on the
| 72533 [martindemell] Also, "if prev yield prev" fails if there's a nil or a false in the
+ 72486 [volty_x yaho] I couldn't resist to post to this (so) long thread. It would be nice to
+ 72510 [angus quovad] Here is a module that implements it, but you should include it in every
| + 72514 [angus quovad] Hmmm... this should handle the #each nesting properly (but still has
| + 72515 [bob.news gmx] Detecting if the first element might in some circumstances server the same
| | 72517 [jj5412 earth] a = {}
| | 72555 [spam deck.dk] that would only work if the array is sorted...
| | + 72557 [jj5412 earth] Ah yes, this is true.
| | + 72564 [B.Candler po] More precisely, it only works if the array (or other collection) elements
| + 72516 [decoux moulo] def last?
| | 72522 [angus quovad] Thanks for advice. But this subject is no longer important; what is
| + 72518 [B.Candler po] Err??!
|   + 72523 [angus quovad] The methods in Enumerable don't call #each_with_last, they call
|   | 72532 [B.Candler po] module Enumerable
|   | 72535 [decoux moulo] In 1.8 Array#select don't call Array#each
|   | 72537 [B.Candler po] Did someone propose implementing each_with_last in terms of select? (I don't
|   | 72538 [decoux moulo] see [ruby-talk:72510]
|   | 72544 [B.Candler po] Oh OK - make 'last?' a sort of pseudo-instance variable rather than passing
|   | + 72545 [decoux moulo] But you don't solve the problem, in [ruby-talk:72510] you have
|   | + 72597 [bob.news gmx] "Brian Candler" <B.Candler@pobox.com> schrieb im Newsbeitrag
|   + 72598 [bob.news gmx] Great solution.  Thank's for showing how simple some things become if you
+ 72520 [fgp phlo.org] What about a method each_tuple(tuple_length) in Enumerable, that would be kind of a
+ 72524 [martindemell] Apologies in advance :)

^ Return from ensure
72450 [gfb tonesoft] Actually, I saw a remark on ruby-talk once that "return" is dagerous,
+ 72471 [lyle users.s] Don't trust your instincts next time? ;)
+ 72675 [bob.news gmx] "Gennady" <gfb@tonesoft.com> schrieb im Newsbeitrag
  72700 [gfb tonesoft] I understand perfectly well that I should not have done this. And in fact I
  72703 [bob.news gmx] "Gennady" <gfb@tonesoft.com> schrieb im Newsbeitrag
  72706 [gfb tonesoft] I just wanted to save on typing ;-). Now I save the data in "ensure" in an
  72710 [bob.news gmx] "Gennady" <gfb@tonesoft.com> schrieb im Newsbeitrag

^ substitution weirdness
72463 [ian caliban.] irb(main):119:0> foo = "'123"
+ 72464 [dblack super] What you're hitting is a special meaning of \' -- namely, the
| 72467 [ian caliban.] Thanks. I couldn't see why \' might be getting expanded like that, as I
| 72488 [nobu.nokada ] "'123".gsub(/'/, '\\&')
| 72491 [nobu.nokada ] Sorry, too stupid.  Ignore the previous post.
+ 72466 [rpav nwlink.] \' has special meaning ("after the match", iirc, which makes sense here).
+ 72512 [martindemell] foo = "'123"
  72519 [B.Candler po] But '\\' and "\\" are the same thing (a single backslash)
  72526 [martindemell] Yeah, that was simply a matter of defaulting to '' for constant strings

^ FAQ in German - some updates
72479 [ jupp gmx.de] Saluton!
72490 [hal9000 hype] Great!
72561 [ jupp gmx.de] Saluton!
72566 [dcoshel vcma] ja = de wa, as "soo jya nai" (say, it ain't so), or "X de wa" (inasmuch

^ mod_ruby installation probs
72481 [lists debona] (eval): uninitialized constant ERubyRun at Apache (NameError)
72589 [0bz63fz3m1qt] I never tried using 'eruby', so I have no clue..

^ [OT] Re: Metakit for Ruby - Would you want it?
72482 [ahoward fsl.] wow.  yet _another_ reason to hate oralce

^ Object Prevaylence vs. OODBMS or Madeleine vs. DyBase
72492 [waisun.chia ] Rubyists,
72495 [ndrsbngtssn ] Madeleine itself doesn't have the concept of multiuser access or remote
72501 [B.Candler po] *multiple concurrent method calls* - each incoming request is handled as a
72503 [ndrsbngtssn ] Since all "writes" to Madeleine have to go through the
+ 72506 [B.Candler po] As you say, reads don't benefit from this protection. It might not be as bad
| 72596 [ndrsbngtssn ] There's a little-known implementation of shared locks in the Ruby
+ 72507 [waisun.chia ] Yes, please. ;-)

^ amrita parsing
72493 [nospam123 an] I've run into a problem with amrita not liking spaces in directory names.
72542 [ahoward fsl.] eg/ruby > irb -r amrita/template
72573 [nospam123 an] Ok, it's not giving me that error now.  Not sure what I had then before.

^ output redirection within mod_ruby
72497 [ian caliban.] I have a script that runs under mod_ruby with Apache 2.0.40. At a
+ 72500 [0bz63fz3m1qt] I had kind_of? same problem, so I made a wrapper for system/backquote.
+ 72502 [B.Candler po] I think that you have to capture the output of the command yourself. Your

^ VisualuRuby openFilename starting directory
72511 [jj5412 earth] Is there a way to set the directory for a Swin::CommonDialog.openFilename()
72594 [dooby d10.ka] Last I looked, it was not implemented.

^ local variable and local variable in block behave differently
72521 [Sebastien.Cl] Dear Rubyists,
+ 72525 [dblack super] I'm not sure what aspect of it is surprising you, but maybe it has to
| 72527 [Sebastien.Cl] Sorry, I should have been more explicit. What surprises me is that in
+ 72531 [B.Candler po] From this point, variable "b" is defined (even though the assignment is
  + 72539 [ahoward fsl.] 1.times do
  | 72540 [decoux moulo] Well, it's more
  | 72543 [ahoward fsl.] i was *trying* to say that... ;-)
  | 72546 [B.Candler po] I don't think so - it parses and builds an AST in a single pass, then it
  + 72547 [matz ruby-la] Maybe a bug.  Let me check.

^ to_s and concatenation
72528 [rasputin shr] rasputin@shrike rasputin$ irb
72529 [decoux moulo] String#+ want an object which respond to #to_str
72549 [rasputin shr] Right, but when do you use one and when the other?
+ 72550 [decoux moulo] svg% ruby -e 'class A;def to_s()"A#object";end;end; p [A.new, "aa"].join(":")'"A#object:aa"
+ 72551 [B.Candler po] Interpolation into strings - "#{foo}" - uses to_s
  72562 [spam deck.dk] hmm... it seems to me that the real question is this: why have both to_s
  72563 [B.Candler po] You have a method for explicitly converting an object to a string for
  + 72565 [dblack super] Just one addendum: it does hold for to_a/to_ary -- that is, you can
  + 72572 [rasputin shr] Exactly, but I think Brians explanation makes sense to me now.

^ expandtabs
72534 [steven_shaw ] The methods for expanding tabs in the Ruby FAQ don't seem to work.
72621 [ jupp gmx.de] Saluton!
72623 [0bz63fz3m1qt] def expand_tabs(data, indent=8)
72625 [B.Candler po] When expanding a tab I guess you are actually interested in the number of
72682 [steven_shaw ] No but here's the test script I've been using. It has all the different
72705 [ jupp gmx.de] Saluton!

^ regexp operators
72556 [wjl icecaver] In doing some work with parsers the other day, I ended up with a
72567 [nobu.nokada ] Flags are preserved in 1.8.
72570 [wjl icecaver] I hadn't tried this in 1.8 yet, so that's cool to see that it has built
72593 [nobu.nokada ] As for +, is it right to just concatinate them?  Regexp#| is
72609 [wjl icecaver] Well, + meaning concatination makes sense to me. What else would it
72614 [nobu.nokada ] => /(?:foo|bar).*(?:.*)/u
72622 [wjl icecaver] I tend to think of + for regexp to be like + for strings--just a simple

^ try make dybase 010
72560 [wpinelo hotm] This is a multi-part message in MIME format.

^ assistance
72571 [savi40 fsmai] Dear Friend,

^ Marshall and StringIO objects
72574 [ahoward fsl.] rubyists-
72575 [sdate everes] irb(main):001:0> sio = Marshal.dump('foobar',StringIO.new)
72576 [sdate everes] irb(main):001:0> sio = Marshal.dump('foobar',StringIO.new)
72602 [ahoward fsl.] ahhh...  i tried 1.6 w/shim, not 1.8.  thanks!

^ IF statement in ruby 1.8.0 (2003-05-26) [i386-mswin32]
72577 [sdate everes] Just when I thought that I had perfectly understood the IF statement in
72581 [dooby d10.ka] This could be 'bug-lite' in 1.7+ (or i386)?
72582 [sdate everes] Bug or a feature ? ;-)
+ 72603 [decoux moulo] Well, you have 1 trace_func for NODE_NEWLINE and 1 for NODE_IF
| 72607 [sdate everes] Umm... what is the meaning / purpose of NODE_NEWLINE ?
| 72608 [decoux moulo] In ruby-core matz has said
| 72611 [sdate everes] Since I am not as conversant with Ruby source as you all are, I am still not
+ 72604 [matz ruby-la] A feature.  This is added to accomplish better debugger tracing.
  72674 [sdate everes] What is "call timing" ? Time when a particular call was made ?
  + 72680 [matz ruby-la] Yes.  Duplicates may be removed again when I find workaround for
  | 72694 [sdate everes] Great ! I am using this precisely for debugger tracing ... so looking
  + 72693 [dooby d10.ka] I took this to mean that the frequency and/or sequence of
    72695 [sdate everes] This is excellent ... of course, suggestions to improve are always welcome.

^ Ruby 1.8, mod_ruby-1.1.1, and Apache 2
72579 [ljz asfast.c] Can anyone point me to a coookbook recipe (or at least some detailed
72587 [ ted php.net] Is this what you mean?
72592 [ljz asfast.c] Thank you very much.

^ Tk - list all options available for configure()
72584 [phlipcpp yah] Me again, droning about Ruby/Tk again.
+ 72590 [ptkwt shell1] Is it just that it returns a hash (er... dictionary) and prints all the
+ 72612 [nagai dumbo.] In this case, please use canvas.configinfo().

^ console tables
72595 [culley fastm] Has anyone seen or developed a class for producing tables on the
+ 72605 [spam deck.dk] ncurses may be a bit overkill for just a few tables... but there is an
+ 72606 [B.Candler po] Have a look at DBI::Utils::TableFormatter in the ruby-dbi-all package.

^ What is BER compression? (was RCR: unpack/pack Bignum)
72600 [sroberts uni] Is it documented anywhere, what this 'w' template is useful for?
72648 [matz ruby-la] Ask Perl people, it's there only for Perl pack compatibility.
+ 72649 [W.B.Hill uea] s/pack/back/
| 72650 [matz ruby-la] Did I have to say "compatibility with Perl pack function"?
| + 72654 [dcoshel mac.] No, one can always stack nouns in English, just like German :)
| + 72655 [martindemell] No, it was just a pun on 'back compatibility'.
|   72659 [hal9000 hype] Ohh... I thought he was misunderstanding Matz.
+ 72651 [dan sidhe.or] It's an old format for storing indefinite precision integers. I have
| 72670 [cjh_nospam m] BER = Basic Encoding Rules. The term comes from ISO networking, all
+ 72662 [sroberts uni] Well, I can't find any reference to its usefulness in Perl, and I don't

^ Marshaling
72601 [dwerder gmx.] I need to dump some objects but they have references to files. These
+ 72615 [ahoward fsl.] i *just* had this same problem yesterday... here's the two approaches i
+ 72689 [jbshaldane h] class File

^ Patch for mod_ruby-1.1.1 (was: Ruby 1.8, mod_ruby-1.1.1, and Apache 2)
72610 [ljz asfast.c] This is a MIME-formatted message.  If you see this text it means that your

^ Accessing utmp/wtmp in Ruby
72616 [ralph dolphy] Please be gentle, if this is a stupd or often
72619 [dcoshel vcma] `who`.each { |w| p w }

^ newbie questions
72617 [stedak chart] Moving from C++
+ 72618 [mneumann nte] BLUE, RED, WHITE = (0..2).to_a
| 72626 [stedak chart] I am probably confusing concepts but in C++ you can pass a parameter by reference, pointer or value. Copy constructors,
| + 72627 [B.Candler po] - the thing passed is always a reference to an object (even if it's just
| + 72629 [jweirich one] You have a "shoebox" mentally.  In other words, you are thinking of
+ 72620 [jim freeze.o] Is this what you are looking for?
| 72624 [stedak chart] ...snip...
| + 72633 [lyle users.s] If you're just using an enumerated type to differentiate between
| + 72636 [jim freeze.o] I think Lyle answered this for me.
+ 72637 [jj5412 earth] Congratulations!

^ Auction Education -->E B A Y<--  genus leucadendron
72628 [zg39x34a7yf ] This is a multi-part message in MIME format.

^ ncurses + redirect output
72630 [0bz63fz3m1qt] I am having a hard time debugging my ncurses code...
72631 [B.Candler po] I think such things are normally written to stderr, so you should be able to
72634 [0bz63fz3m1qt] Thanks Brian.

^ [RCR] attr_reader :foo?
72632 [vjoel PATH.B] Would it make sense for attr_reader and friends to associate :foo? with
+ 72635 [nobu.nokada ] Like this?
+ 72639 [B.Candler po] instance_variables works for me: I get
  72640 [nobu.nokada ] attr_(reader|writer|accessor) don't create instance variable

^ 'line' trace event  (was Re: IF statement in ruby 1.8.0 ......)
72638 [dooby d10.ka] < abbreviated ri 1.8 description>

^ rdoc: embarrassingly minor complaint
72641 [martindemell] Posted in the hope that someone (i) agrees with me and (ii) has the
72643 [dave pragpro] I'd love to have folks submit templates that produce better-looking output.
+ 72653 [martindemell] Won't be me, I'm afraid - my sole brush with web design is my
+ 72838 [rodrigo.berm] how would you like this templates  ?
  72844 [dave pragpro] Check out rdoc from sf.net/projects/rdoc (get the cvs version, not the

^ Advantages of Symbols over constants
72642 [childNOSPAM ] I wonder what are the advantages of using symbols over constants.  For
+ 72644 [jim freeze.o] One advantage is that symbols are faster than constants.
| + 72646 [jj5412 earth] One of my concerns with symbols is they spring into exsistence on their own,
| | + 72656 [jim freeze.o] I see your point. If the code was supposed to be
| | | 72657 [qrczak knm.o] Dnia nie 1. czerwca 2003 21:06, Jim Freeze napisa
| | + 72660 [vangczung ya] def foo(op)
| + 72707 [childNOSPAM ] I don't use constants too much, so speed is not a problem.
+ 72647 [vjoel PATH.B] One advantage of symbols is that they know how to print themselves, but
  72663 [jweirich one] Well, yes ... but I imagine that in the cases we are talking about the
  + 72708 [childNOSPAM ] Isn't it better to do eg.
  + 72711 [B.Candler po] class Myclass

^ thread-unsafe stuff: could you summarize?
72645 [schatten nos] I'd be glad to see a short summary of what I should be aware of when writing
72673 [tcfelker mtc] While you're asking that, I have a similar question: is the following
72678 [bob.news gmx] First, accesses to @deferRunning should be done synchronized. But: Why do
72794 [tcfelker mtc] Looking back, I can't remember why I even have that.  If you remove all
72819 [bob.news gmx] "Tom Felker" <tcfelker@mtco.com> schrieb im Newsbeitrag

^ Re: [European Ruby Conference] - Accomodation...
72652 [Stephan.Kaem] I guess it will be time to choose some kind of accomodation in the near
72683 [mneumann nte] University, Karlsruher Castle and the central city are next to each other.

^ [OT] Re: Metakit for Ruby - Would you want it?
72658 [news-1 nospa] I know this is offtopic, but you could probably use "UPPER(foo) LIKE
72712 [B.Candler po] Thanks, not a bad idea, although I imagine that Oracle would not use the
+ 72713 [hal9000 hype] that)
| 72720 [pit capitain] If you're going The Ruby Way, why not
| + 72722 [ahoward fsl.] relation.select(:field0, :field1){|tuple| tuple[:field0, :field1] === [/foo/, /bar/]}
| | 72726 [hal9000 hype] [/foo/, /bar/]}
| | 72727 [ahoward fsl.] sure, i considered it, but it doesn't work out too well (IMHO) in actual dbms
| + 72725 [hal9000 hype] Touche', mon capitain. :)
+ 72721 [news-1 nospa] That's why Oracle let you create function based indexes, e.g. you can
threads.html
top