69942-71079
69703-70768 subjects 70075-70780
^ open 'no-exist' rescue true - idiom
69942 [ahoward fsl.] rubyists-
69943 [B.Candler po] I use 'rescue nil' which is only one character less :-)
69947 [ahoward fsl.] i like that better actually. it seems to read - 'rescue by doing nothing'.
^ grep and regular expressions in ruby
69956 [kpd krishnad] I'm quite taken with ruby, but recently I ran into trouble using grep. I
+ 69958 [rodrigo.berm] ar.select {|e| e =~ /cat|small/ }
| 69960 [dcarrera mat] ?>
| + 69962 [kpd krishnad] Thanks Bermejo and Daniel.
| | 69964 [rodrigo.berm] I widely recommend you (if you are a newbie) the 'Sam's Teach Yourself
| + 69963 [michael_s_ca] Does the "!~" operator help you out here?
| | 69965 [dcarrera mat] 1) That only solves a small subset of the problems I'm referring to.
| + 69979 [ahoward fsl.] </snip>
| + 70024 [wkb airmail.] Ara,
| + 70029 [wkb airmail.] Ara,
+ 69971 [dave pragpro] Have you had a look at lib/eregexp? It doesn't quite do what you need,
+ 69983 [B.Candler po] To make this run I had to add some $ signs in front of your variable names
| 69987 [batsman.geo ] => nil
+ 69990 [matz ruby-la] ar2 = ar.select{|x| /cat/ =~ x and /small/ =~ x}
^ two oddities in ruby 1.8.0p2
69957 [davekam pobo] OK, recently a cool feature has been added to ruby to start assigning
69984 [B.Candler po] Oh, it has been discussed many a time :-)
70037 [davekam pobo] Oh, right... yeah, if I knew it had anything to do with that, I could
70040 [B.Candler po] Well, I agree that it's a declaration in all but name :-)
70343 [qrczak knm.o] Dnia czw 24. kwietnia 2003 20:13, Brian Candler napisa
^ Subject: Re: [ANN] Ruby.shop
69969 [jweirich one] UML uses the convention that any arrow will point in the direction of a
69970 [hal9000 hype] OK, I see. So my blue arrows already follow that convention,
+ 69972 [dave pragpro] dave[Work/rubybook 1:59:09] irb
| + 69973 [hal9000 hype] Sure, the class of Object is Class... or
| | 69975 [nemo hellotr] Object is a class, yes. But objects are not classes. Are you documenting
| | 69992 [hal9000 hype] Class.
| | + 70008 [nemo hellotr] Hmmmm. Well, I have always perceived some circularity
| | + 70009 [nemo hellotr] Hmmmm. Well, I have always perceived some circularity
| | + 70010 [nemo hellotr] Hmmmm. Well, I have always perceived some circularity
| | | 70022 [hal9000 hype] everyone
| | | 70026 [nemo hellotr] But as for arrow color: Is it not worthwhile distinguishing
| | | 70027 [hal9000 hype] this
| | | 70030 [nemo hellotr] True. I'm still inclined to distinguish on the
| | + 70012 [batsman.geo ] You need two kinds of relations so the directed graph becomes a semantic
| + 69976 [nemo hellotr] dave[Work/rubybook 1:59:09] irb
| 70005 [dave pragpro] irb(main):001:0> Object.class
| 70006 [nemo hellotr] FWIW, I understand that :)
+ 70004 [jweirich one] I had to fire up IRB to investigate this. Remember, there are different
^ L'immobilier au QuñÃec
69974 [quebec-immo ] This is a multi-part message in MIME format.
^ parsing large file into matrix
69977 [qubert austi] I work on a lot of flat files containing data with many columns
+ 69981 [vjoel PATH.B] How about this?
| 69994 [bob.news gmx] "Joel VanderWerf" <vjoel@PATH.Berkeley.EDU> schrieb im Newsbeitrag
+ 69996 [B.Candler po] x = File.open("file.txt").readlines.collect! do |line|
69999 [bob.news gmx] "Brian Candler" <B.Candler@pobox.com> schrieb im Newsbeitrag
70090 [jim freeze.o] /\t/ is faster
70106 [bob.news gmx] "Jim Freeze" <jim@freeze.org> schrieb im Newsbeitrag
70107 [jim freeze.o] Sorry, I don't understand. Are you trying to capture the comment
70117 [bob.news gmx] "Jim Freeze" <jim@freeze.org> schrieb im Newsbeitrag
70121 [jim freeze.o] Very clever. I did not catch that at first.
70128 [bob.news gmx] "Jim Freeze" <jim@freeze.org> schrieb im Newsbeitrag
^ Ruby mode for Emacs...
69998 [Stephan.Kaem] while I'm not new to Ruby, to Emacs I admit I am.
70001 [nobu.nokada ] These are all warnings, not errors.
70053 [Stephan.Kaem] 8< Lines of questions and advice snipped...
70120 [drejewic wsi] Yes, I love Emacs too.
70184 [gordonhartle] Even better, rather than counting the lines, set mark on the first
70253 [ jimm io.com] I have been using Emacs for twenty years, and learn something new all the
^ Using objects persistence
70000 [spectra debi] Have anybody used any objects persistence mechanism in Ruby? Something like
70003 [bob.news gmx] robert
70023 [pablo luca.c] Hm... fine links, but not quite what I am interested in...
^ Error in ruby extension
70002 [stevehart be] Question related to extending ruby
+ 70013 [batsman.geo ] You are completely right, Ruby isn't thread-safe and there's not much
| 70290 [stevehart be] Thanks for the confirmation Mauricio - I can work around.
| 70330 [batsman.geo ] The upcoming new Ruby (bytecode) interpreter.
+ 70014 [stevehart be] In answer to my own question and in hope of confirmation, it would appear
^ How to call an object instance's method?
70015 [pooh cs.tu-b] Dear Ruby Experts,
+ 70016 [bob.news gmx] "Rene Tschirley" <pooh@cs.tu-berlin.de> schrieb im Newsbeitrag
| 70019 [pooh cs.tu-b] Oh, shit. I knew, it would be something really stupid. :-)
| 70021 [dblack super] Well, the language has changed in this area, and the book (assuming
| 70028 [B.Candler po] Thanks for that explanation. FWIW I think it's really a bad idea for
| + 70038 [michael_s_ca] I agree, and not just because I highly respect Mr. Candler's
| + 70044 [matz ruby-la] Don't. And if you don't, you will be happy.
| + 70048 [nemo hellotr] "puts (a+b).abs" as "(puts(a+b)).abs" really made me mad.
| | + 70050 [matz ruby-la] True for my eyes. Perhaps my eys are influenced too much by Ruby.
| | + 70052 [dave pragpro] But then again there's
| | + 70072 [nemo hellotr] But then again there's
| | | 70123 [michael_s_ca] Uh-oh... isn't this what...Python does? Ick. I agree that this
| | | 70124 [B.Candler po] I think it's that it doesn't Do The Right Thing[TM], i.e. in this case you
| | | + 70125 [tim bates.id] I think it would break bucketloads of old code, and make the language look a
| | | + 70126 [dblack super] I don't like the latter (the disallowing of parens), partly because it
| | | | 70127 [B.Candler po] I think clarity is certainly the problem here. Are parens just part of the
| | | + 70129 [michael_s_ca] Anything that *requires* poetry mode I'm against, as I'm against
| | | | 70131 [B.Candler po] You mean you would prefer
| | | | 70138 [michael_s_ca] Between that and not *ALLOWING* ()'s for method/function calls? Absolutely.
| | | + 70132 [nemo hellotr] - the 1.6.8 behaviour is better, or
| | | 70137 [B.Candler po] That means: all method calls must have parentheses around their arguments.
| | + 70104 [bob.news gmx] "Dave Thomas" <dave@pragprog.com> schrieb im Newsbeitrag
| + 70055 [B.Candler po] Yes, that I can sympathise with. It upsets poetry mode if the first
| 70082 [nobu.nokada ] You can use begin..end instead, always no ambiguities :).
| 70100 [B.Candler po] Hmm, that's new to me... but I don't think that's argument grouping, as it
+ 70020 [B.Candler po] That's not what you've done; you have filled aList with the *class* A. Try
70049 [pooh cs.tu-b] Now, as I think about that, that opens a new dimension of what's possible
70051 [B.Candler po] I found the Pickaxe the only book I needed. However the web version is not
^ MathN
70017 [dave pragpro] I'm trying to get to grips with the 'mathn' library. I can see what it
+ 70264 [unet rexx.co] In math, 7 is an integer. It is also a rational
| 70266 [jim freeze.o] The above seems very interesting, but it is not clear to me
| 70571 [unet rexx.co] Sure. I am making a class Pnom of polynomials in
| + 70582 [unet rexx.co] That was pretty slick, wasn't it? Such slickness
| | 70588 [michael_s_ca] How'd you find the bug (or rather, that there WAS a bug)? Unit tests?
| | 70591 [unet rexx.co] Yep, unit tests. The new Test::Unit in the Ruby 1.8 preview
| + 70944 [jim freeze.o] Thanks for the explanation. This actually looks like
| 71079 [unet rexx.co] Hmmm...interesting idea. I'm not sure what the
+ 70568 [unet rexx.co] Let me try again, since the usenet gremlins seem to have intercepted
70569 [dave pragpro] That's an excellent set of examples. If you don't mind, I might borrow
70579 [unet rexx.co] I'd be an honored piggy. After all, you and Andy are the ones
^ [ANN] FXRuby-1.0.22 Now Available
70018 [lyle knology] All,
^ Design By Contract.
70025 [kenosis attb] Several months ago, I made a posting regarding a possible enhancement to
+ 70031 [stef chronoz] Several months ago, I made a posting regarding a possible enhancement to
| 70092 [mailinglists] have you ever done "Design by contract". I'm working with eiffel 8
+ 70105 [bob.news gmx] "Ken Hilton" <kenosis@attbi.com> schrieb im Newsbeitrag
| + 70109 [mike wyer.or] I always saw DBC as the combination of pre-, post-, and loop variable-
| | 70115 [bob.news gmx] "Mike Wyer" <mike@wyer.org> schrieb im Newsbeitrag
| + 70114 [ndrsbngtssn ] Static types and contracts are almost orthogonal, since contracts are
+ 70118 [feldt ce.cha] On a somewhat related note I wanna mention my thesis which
+ 70142 [Stephan.Kaem] Dave did some work on it. You'll find it @
^ (none)
70032 [orion2480 ho] # summary
^ [OT] Re: grep and regular expressions in ruby
70033 [ahoward fsl.] it it interesting - i've filed it in my 'interesting' folder ;-)
^ block.call vs. yield
70034 [orion2480 ho] I noticed that the use of block/yield differs slightly when a "break" is
70046 [matz ruby-la] You've found something unnatural. Let me examine.
+ 70047 [orion2480 ho] Let me specify the version numbers I have tested this on, in case it makes a
+ 70087 [matz ruby-la] As a conclusion, you will have compatible behavior when you use
+ 70089 [nemo hellotr] As a conclusion, you will have compatible behavior when you use
| 70091 [dave pragpro] It's documented in the new ri (basically parameter passing conventions)
| 70195 [nemo hellotr] different
| 70198 [decoux moulo] Because there are 2 differences between #call and #yield : one affect
| 70209 [nemo hellotr] * eval.c (proc_invoke): Proc#call gives avaules, whereas
| 70239 [decoux moulo] You'll find in ruby mrhs, mlhs, massign for 'a, b, c = d, e, f' and
+ 70113 [dblack super] 'yield' as a method name for blocks strikes me as awkward. In the
+ 70170 [matz ruby-la] Sorry I don't understand. Do you mean you don't want a method with
| + 70171 [james_b neur] What I got from David's comment, and what the word 'yield' suggests to me,
| | 70172 [hal9000 hype] because
| + 70176 [ptkwt shell1] That's OK. Sometimes we wish we were born in a Japanese speaking country
| + 70178 [dblack super] The follow-ups captured most of my meaning, but I'll follow up myself
| + 70181 [matz ruby-la] Hmm, understandable. It's not obscure for me at all though.
| | + 70185 [dave pragpro] vocating, of course; it's just that
| | | 70186 [decoux moulo] If someone read the source he'll have problems to understand what do ruby
| | | 70187 [matz ruby-la] ;-) In that case, I will rename those functions.
| | + 70188 [JohnFeezell ] Here are a few ideas about names. They maybe all wrong since I may have
| + 70296 [gsinclair so] Two arguments for accepting Proc#yield.
| 70300 [dblack super] There's some precedent for receivers as "direct objects" of the verbs
| 70302 [gsinclair so] Hmmmm, I think you're right.
+ 70182 [hal9000 hype] I now see what David is saying. I had failed to
70189 [dblack super] I think that if the semantics of yield are to be generalized, they
+ 70190 [matz ruby-la] Iff you can name it a good name.
| 70321 [pbrannan atd] I'm curious why you feel we need a method to do this. Why is the yield
| 70328 [matz ruby-la] Some, for example dRuby, requires the method.
| 70332 [dblack super] I know there must be an obvious answer to this, but... what is an
| 70401 [matz ruby-la] Proc#yield cannot be implemented using Proc#call, and other way
+ 70219 [hal9000 hype] call_as_block perhaps?? or just call_block ?
| 70220 [dblack super] If Proc#call has method-like semantics, perhaps what's needed is a
+ 70293 [gsinclair so] The method name :yield was immediately intuitive to me, as was the
+ 70294 [B.Candler po] I am in that group. I have been caught out several times by writing
| 70295 [gsinclair so] And that's very ugly, IMO.
| 70297 [matz ruby-la] I know, but I have to solve them one at a time. FYI, I proposed
| 70352 [B.Candler po] I certainly agree there :-)
| 70357 [matz ruby-la] 'yield semantics' is assignment between block parameters and yield
| 70363 [B.Candler po] Ah, right. So if you were to change that, you'd probably also have to get
| 70389 [jbshaldane h] If we are keeping the yield and call argument handling different, then
| 70400 [matz ruby-la] I'm not sure call/yield difference belong to caller or callee. If it
+ 70298 [dblack super] I'm not seeing why that's the only choice. How about finding a
70301 [gsinclair so] blk.call_but_collapse_surplus_arguments_into_the_final_parameter_as_an_array
^ >-) DIGIT WORLD CONTEST HERALD # 1?=
70035 [johann-manet] (http://www.esclarmonde.org)
^ Regexp behavior with character class
70036 [jim freeze.o] Is this correct for 1.8.0?
^ Accessing Ruby class from C extention
70039 [ptkwt shell1] I know it's possible to write Ruby in C but is it possible to instantiate
70041 [nemo hellotr] Maybe I'm not understanding, but can't you just call `new' on the class you
+ 70043 [nemo hellotr] Maybe I'm not understanding, but can't you just call `new' on the class you
| 70054 [ptkwt shell1] Hmmmm.... but how does the C side 'know' where my Ruby class is defined?
| 70059 [ptkwt shell1] OK, I tried it and that is how it seems to work.
| + 70065 [gfb tonesoft] You can get the value of constant "Foo" (seems like rb_gv_get() will do the
| | 70066 [gfb tonesoft] yet
| + 70067 [nemo hellotr] It seems like to call the constructor of a Ruby class from C that you
+ 70045 [ptkwt shell1] I want to call 'new' on the class on the C side. The more I think about
+ 70056 [B.Candler po] Why? There's nothing particularly special about calling the 'new' method of
+ 70061 [0bz63fz3m1qt] Its possible, I do it myself all the time.
+ 70069 [ptkwt shell1] Thanks. There's also a third way using rb_eval_string. Now I see how you
+ 70084 [nobu.nokada ] "Test";
70086 [0bz63fz3m1qt] agree
70559 [namille2 vt.] Is your tutorial online? I did a quick google search for it, but could find
70610 [0bz63fz3m1qt] I will :-)
70669 [botp delmont] or mozilla (the text bleeds outside the boxes).
70686 [0bz63fz3m1qt] OK.. For the code-pieces I have converted
70687 [botp delmont] nope, same bad result for opera and mozilla.. but the boxes fit on ie :-)
70689 [0bz63fz3m1qt] I have an old Mozilla-1.2b + konquorer-3.0.5 and it looks ok.
70690 [botp delmont] you are right :-)
^ asynchronous ruby
70042 [student_vien] I have a big dll which is working with sockets and
70057 [B.Candler po] If you don't like the answer you got first time round, simply asking the
+ 70060 [offstuff aon] hm,...
| 70073 [matz ruby-la] Pretty interesting. I'd like to hear about how other languages solve
| 70102 [student_vien] some text about tcl and manage events...
| 70111 [B.Candler po] Ruby handles signals in the same way. If it's in the middle of doing
| 70122 [offstuff aon] afaik, ruby is not thread-safe.
+ 70063 [aredridel nb] Wouldn't having a ruby-interface thread do the job? Just have the
^ test unit problem
70062 [jbshaldane h] Is it me, or is this a Test::Unit bug?
+ 70070 [ptkwt shell1] I'm seeing something similar with ruby 1.8 whereas it worked fine with
| 70071 [sdate everes] Same errors on : ruby 1.6.8 (2002-12-24) [i586-mswin32]
+ 70077 [nathaniel NO] <snip error>
70093 [jbshaldane h] Ok, sorry for being too hasty, I wasn't sure if the email address was
^ Hashes and Enumerable#each_with_index
70064 [rpav nwlink.] OK, looking at the archives I know this was discussed a few years ago,
+ 70068 [dblack super] One problem I see is: how could you implement this, in Enumerable, in
| 70094 [rpav nwlink.] I don't see why there must exist a default implementation in
| 70110 [dblack super] If it applies to "any given Enumerable", then presumably it's defined
+ 70074 [matz ruby-la] No. Index in each_with_index means offset of the values. It might be
| 70095 [rpav nwlink.] I actually don't really care here... new name (the each_with_key
| 70096 [matz ruby-la] I'm positive. But describe what you want more precisely. The
| + 70097 [rpav nwlink.] David Black (iirc) had a good suggestion on #ruby-lang, and that was
| | 70108 [dblack super] It was flgr -- not sure who that is though.
| + 70098 [dave pragpro] Or, have each class that wants to support this protocol define a method
| 70141 [rpav nwlink.] This is perhaps an OK default, but it would be nice to see a O(1)
+ 70076 [djberge qwes] This operation seems most sensical, to me, when used with ordered
| 70085 [hal9000 hype] Hmm, not a good idea in general, I think.
+ 70099 [B.Candler po] Or indeed just 'h.each' (if you replace |o,i| with |i,o|)
+ 70199 [sroberts uni] This function already exists, for a Hash its called Hash#each.
70202 [dblack super] Not exactly: Hash#each returns [k,v] pairs, not [v,k] pairs. The
threads.html
top