50580-51355

50319-51748 subjects 50673-53702

How best to use exceptions?
50580 [tarasis@bt p] tags. I figured the best way to learn was to rubyfying a playlist
50588 [pbrannan@at ] If you are using your exceptions to generate error messages that the
50591 [tarasis@bt p] Thanks for that Paul.
50592 [pbrannan@at ] One source is the source itself.

[FXRuby] Scintilla-test (was: Re: Qt vs. FOX vs. ?)
50584 [probertm@no ] Also the same behaviour for 1.7.2-1 Windows under Win2k
50585 [probertm@no ] [FXRuby] Scintilla-test (was: Re: Qt vs. FOX vs. ?)

signed hex conversion
50586 [akolarik@so ] ...
50590 [dossy@pa op ] [0xFFFFFFC4].pack("l").unpack("l")[0]   # => -60
50597 [akolarik@so ] ...
50601 [dossy@pa op ] The pack takes a Fixnum and converts it to a String of 4 bytes which

signed hex conversion?
50587 [akolarik@so ] ...

(none)
50596 [djones@no s.] subscribe Dave Jones

Possible bug with handling of default values for a method
50598 [roberge@qw s] ...
+ 50618 [alan@di ik t] If you pass nil into the first parameter, it will be nil. The defaults only get
+ 50619 [pbrannan@at ] Ruby doesn't fill in default values whenever you pass in nil; it fills

self-loading scripts (at Ruby's startup time)
50600 [NOSPAM_jazz_] Do they exist? I'm afraid they don't, or at least I couldnt' find any
50632 [nobu.nokada@] None.
50703 [NOSPAM_jazz_] nobu.nokada@softhome.net says...
+ 50717 [vjoel@PA H. ] What would the standard be for how installed ruby libraries insert code
| 50725 [NOSPAM_jazz_] BEGIN {} in library code would init the library for sure, but how would
| 50746 [comp.lang.ru] - - GACK! Yet another reason why "Python is not for me". This is an
+ 50735 [matz@ru y- a] I think this should be an application issue.  Since Ruby is a general
  51005 [NOSPAM_jazz_] mmm... after reading your message, I decided to definitely put aside my

Semi-OT: Web issues
50602 [hal9000@hy e] There's a disturbing absence of Ruby code
+ 50603 [chrismo@cl b] aspx is ASP.NET -- I'm a little familiar with it. It's possible you stripped
| 50605 [hal9000@hy e] stripped
| 50610 [james@ja es ] Please delete that code! :)
| 50613 [hal9000@hy e] that
| 50615 [alan@di ik t] The site does set a session cookie, ASP_NET.Session_id or somesuch.
| 50620 [hal9000@hy e] When I try my stripped HTML in the browser,
+ 50623 [james@ja es ] 1) The aspx pages are using session cookies. I tried uploading an image from
| + 50625 [james@ja es ] If it were found to be the case.  I was just guessing here.  Cookies look
| + 50626 [hal9000@hy e] (snippage)
+ 50624 [dossy@pa op ] If this isn't the most pathetic guilt trip I'd ever heard!  :-)
  50627 [hal9000@hy e] <hal9000@hypermetrics.com>
  50628 [dossy@pa op ] No, unfortunately.

FAQ for comp.lang.ruby
50604 [hal9000@hy e] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2002-9-18)

Python the new Lisp, what about Ruby then?
50606 [web2ed@ya oo] I've been reading that Python is the new lisp.
+ 50614 [transami@tr ] come on! python the new lisp? what's that suppose to mean? nothing
| 50629 [michael_s_ca] I don't use Python, but I'd hardly call it _that_.  It is quite popular, and
| 50630 [transami@tr ] well, i exagerate. but you get my meaning. i'm sure python dosen't have
| + 50633 [comp.lang.ru] - - Lisp started around 1956 and has been widely used since 1960
| | + 50635 [transami@tr ] who's bashing? just stating an opinion.
| | | 50997 [billtj@z. lu] As I don't have a computer science background, my dream is a
| | | + 51007 [comp.lang.ru] - - The ideas behind Ruby are not that new. They were around 30
| | | + 51052 [alwagner@tc ] Booker is right.  There is a very thin line between flexibility and chaos.
| | + 50674 [michael_s_ca] Foo really is awful though.  =)
| |   50677 [David.Stagne] Ruby is the new Perl. :}
| |   + 50681 [app1tam@up .] I am an old LISPer (I only hack emacs code now) and I try to avoid waxing
| |   + 50730 [fokke_wulf@h] No, Perl6 is the new Perl. Only, it's not here quite yet.
| + 50648 [jacekpodkans] Choosing Ruby I made comparison to other languages, mostly python, Python
| + 50715 [vjoel@PA H. ] If we ever find intelligent creatures somewhere else in the universe,
|   50716 [transami@tr ] well said!
+ 50644 [ysantoso@je ] I'm a lisper and I'm laughing my ass out hearing that python is
+ 50704 [leikind@mo a] Of course Ruby is closer to Lisp than Python.
+ 50747 [jcb@it ri .c] Strange this should be posted today.
  + 50752 [dblack@ca dl] Recent improvements to the language [Python] have outstripped
  + 50756 [hal9000@hy e] This was discussed at length when he made these comments
  + 51004 [usenet@on in] I would add Dolphin Smalltalk to that list. Beautiful environment, and

LAST CHANCE FOR BIODEFENSE CONFERENCE ADVANCE RATES
50612 [brent@bi -d ] ADVANCE RATES END MONDAY. SIGN UP NOW AT 1 877 796-4362 OR ONLINE AT WWW.BIO-DEFENSE.ORG.
50616 [john.carter@] Where you will learn all about Anthrax as the Final Solution to all your

If Statement Help
50634 [Graeme.Matth] Im currently learning ruby and its going well. I have been looking at a
+ 50637 [rking@pa op ] That's just a part of the method name.  Run "irb" and paste this
+ 50638 [james@ja es ] Methods that end with a question mark should return a Boolean value.  This

[ANN] RubyInline 1.0.6 Released
50636 [ryand@ze sp ] RubyInline 1.0.6 has been released!
+ 50793 [ADATE@kc rr ] Very neat !
| 50818 [ryand@ze sp ] + embed \n in a double quoted (or other form of interpreted) string.
| 50843 [ADATE@kc rr ] Yes, that was a natural extension of my earlier attempt and I tried that.
+ 50957 [batsman.geo@] Patch below for better error messages if the inline code fails to

If Statement Help and param passing
50639 [Graeme.Matth] Thanks Ryan, no wonder I couldnt find any doco :-) doh ! , one more for the
+ 50641 [rking@pa op ] This is the price we pay for using funny syntax here and there.  =)
+ 50643 [kentda@st d.] It unpacks an Array, passing each element as a separate argument to the

Business Objects
50640 [Graeme.Matth] I have been searching the www for some examples on how programmers have
+ 50642 [alan@di ik t] Most libraries I've seen have a top level "load-it-all" file and sub-files for
+ 50736 [ysantoso@je ] This is Off Topic, but what's a business object? Can someone describe
  + 50738 [alwagner@tc ] I would say: any idea, artifact, person, etc. that exists in a business
  | 50739 [Graeme.Matth] A business object is a Class that is unique to a business entity. For
  | 50743 [mikkelfj-ant] is
  | 50749 [Graeme.Matth] Point taken on having containers of objects within an object. There are
  + 50755 [mikkelfj-ant] It's a buzzword.

exerb problem
50647 [coma_killen@] I'm trying to use exerb with library files and having some problems.
50650 [nobu.nokada@] It's been fixed in CVS head version, and next release 2.1.0.
50656 [coma_killen@] Thank you, that helped.
+ 50669 [lyle@us rs s] This is a known problem for the mswin32 build of Ruby 1.6.7 (which exerb
+ 50671 [nobu.nokada@] Hmmm, I don't know about detail of exerb and PE format, so

Is better to subclass or to add methods to an existing class?
50652 [vinfoley@iq ] I was discussing with a (Python) friend last night.  I told him that one
+ 50653 [dblack@ca dl] I tend to go for the adding methods approach, but there's always the
+ 50654 [jim@fr ez .o] I can't speak of it being a bad idea, but a related feature of Ruby that
| 50655 [Mark.Volkman] ...
+ 50657 [dossy@pa op ] print "foo"
+ 50659 [x@ic im nk .] [example modification of existing class snipped]
+ 50661 [jim@fr ez .o] [snippage]
| + 50666 [dblack@ca dl] Clearly this is a serious problem, though at the same time I think the
| + 50686 [billtj@z. lu] Actually, because in Ruby a class definition is never closed, don't we
|   50691 [pbrannan@at ] module MyProject
|   50721 [chr_news@gm ] Anonymous subclasses are pain to work with btw.
|   50727 [pbrannan@at ] Beast = self
|   50731 [chr_news@gm ] (In 1.7 one can also use Class.new super_class  { .. }  )
|   50759 [pbrannan@at ] This must have changed from 1.6 to 1.7.
+ 50663 [pbrannan@at ] 1) He is right that adding methods to an already-defined class is
| + 50707 [usenet@on in] You're right, there are some objects you can't do it with though
| + 50723 [chr_news@gm ] Well I generally try to avoid this too - but I don't believe that there
+ 50664 [airboss@no e] Subclassing is, I think, the thing to do if you need to extend the
+ 50672 [jason@jv eg ] [snipped example]
| 50682 [app1tam@up .] I say FOO-ey on your friend. :-)  Tacking on a new method is muy cool and
+ 50790 [akr@m1 n. rg] Currently it is not great idea because name crash in method names.
| + 50802 [chr_news@gm ] This is a  rather interesting collection of languages
| | 50804 [decoux@mo lo] Well expect that you forget that
| | + 50805 [chr_news@gm ] Well you would (better finally could) get ride of
| | | 50809 [decoux@mo lo] In this case, just change the name of the language :-)
| | | 50814 [chr_news@gm ] I grant you that overloading might change the language
| | + 50815 [chr_news@gm ] Maybe this is also a good time to mention that the ``problems''
| |   50816 [decoux@mo lo] No, no. I've just added modules to kill it :-)
| |   50821 [chr_news@gm ] I would bet on an A object.  This behavior is somewhat problematic
| |   50822 [decoux@mo lo] If you add overloading, you add implicitely a new rule : to resolve a call
| |   50826 [chr_news@gm ] I was not writing about my own preferences, just expectations,
| + 50922 [qrczak@kn .o] It seems logical to me. If methods are standalone objects, it's
+ 51025 [timsuth@ih g] In Python 2.2 (I'm not sure how long Python has been able to do this) you

How should I print the http request?
50660 [mhale@ro em ] I am trying to implement a simple http server for debugging purposes.
50662 [nobu.nokada@] session.close_write
50665 [Peter.Booth@] On a side note, Webrick is a quick way to add a HTP server to a some code

select and select
50667 [dblack@ca dl] I'd like to suggest (again, but the first time it was buried in
+ 50668 [matz@ru y- a] Not yet, until 1.8.0 comes out.  (don't ask me when it will be.)
| + 50675 [dblack@ca dl] Maybe it would seem a better fit if the two were combined?
| | 50679 [matz@ru y- a] Hmm, from this combination,
| | + 50684 [hal9000@hy e] It seems less natural for hashes.
| | | 50713 [tsiivola@cc ] How about?
| | + 50702 [dblack@ca dl] Good question.  I guess the arguments to select defaults to *(0...size),
| |   + 50708 [julian@be a4] Just to throw in my two cents... Using at() definitely feels better to
| |   + 50710 [billtj@y. lu] I do not like that the Array "at" method is overloaded.  I think currently
| |   + 50860 [list@NO PA c] What about just a[x,y,z]?
| |     + 50864 [pbrannan@at ] a[x,y,z] => [a[x], a[y], a[z]]
| |     + 50865 [decoux@mo lo] a[x,y] is already defined
| + 50714 [billtj@y. lu] I like the name suggested by Nikodemus Siivola: "items", and I'm
|   50718 [transami@tr ] "elements" would probably be "proper". but "items" works well too. i'll
|   50720 [vjoel@PA H. ] Hm, "items", "elements", and "entries" all seem to fit in the same box
|   + 50740 [hal9000@hy e] Actually, I like this a lot.
|   + 50750 [matz@ru y- a] We want to have a new method to replace "indices", because of
|     + 50787 [vjoel@PA H. ] I have to agree, that's the right behavior. So we will have
|     | + 50901 [gotoken@no w] Can I put another?
|     | + 50911 [matz@ru y- a] I like "pick".  How do others feel (especially English speaking ones)?
|     | | + 50912 [dblack@ca dl] ar = %w{ one two three four }
|     | | | 50913 [rich@li hi o] I really like the feel of 'pick' with arrays.
|     | | | + 50914 [Dave@Pr gm t] Perhaps pick_using_xxxx, with straight 'pick' as an alias for
|     | | | | + 50915 [dblack@ca dl] Or maybe _by_ instead of _using_ ?  (for brevity, also to my ear it's
|     | | | | | 50927 [rich@li hi o] What if the 'pick' method took an array as the first parameter, and a string
|     | | | | + 50917 [matz@ru y- a] pick_by_key(s)?
|     | | | |   50918 [dblack@ca dl] I would put it in the plural.  Presumably h.pick_by_keys(:akey) would
|     | | | + 50920 [hal9000@hy e] Don't forget 'pickAxe'.
|     | | | + 51168 [gsinclair@so] Hashes and arrays map keys to values.  The method we are looking for returns
|     | | |   51184 [dblack@ca dl] I think I mentioned the following idea before, but I don't remember
|     | | |   51196 [gsinclair@so] Your reasons are good, but I don't like it :->
|     | | |   51199 [dblack@ca dl] We've reached the "agree-to-disagree" point, but I find it interesting
|     | | |   51202 [gsinclair@so] Fair enough.  Although the human mind soon resolves the issue by determining
|     | | |   51203 [matz@ru y- a] Probably Dave will set up vote on rubygarden.org.
|     | | |   + 51211 [joe@vp p. et] get_at
|     | | |   + 51212 [tom@li ux ri] * sample
|     | | |   + 51213 [billtj@y. lu] items, elements, entries?
|     | | |   | 51247 [hal9000@hy e] I'd vote for "sample" which is noun-verb neutral.
|     | | |   | + 51250 [dblack@ca dl] To me "sample" has connotations of randomness or representativeness or
|     | | |   | | 51255 [x@ic im nk .] Unfortunate that Enumerable#select already has the meaning that I would
|     | | |   | | 51256 [matz@ru y- a] Currently it does.  Try
|     | | |   | + 51295 [billtj@y. lu] "Americans verb their nouns far too much".  Now, that is really a great
|     | | |   + 51236 [gordonhartle] I actually liked choose the most which I think was discussed
|     | | |   + 51239 [gsinclair@so] not
|     | | |   | 51263 [harryo@zi .c] Since we're nit-picking ... don't get me wrong, there's absolutely nothing
|     | | |   | + 51267 [gsinclair@so] I myself am a pedant, and always appreciate advice from other pedants.  I would
|     | | |   | | 51288 [bilotta78@ho] With the famous plaque "What the heck are you looking at? Shouldn't
|     | | |   | + 51289 [hal9000@hy e] not a
|     | | |   | | + 51298 [hgs@dm .a .u] Don't know why that happened.  I hope I have not done it again.
|     | | |   | | | + 51307 [gsinclair@so] Interesting dissertation, Hugh.  "lookout" and "pickup" can hardly be argued to
|     | | |   | | | + 51339 [harryo@zi .c] Yes, paraphrasing what you say further down, the concept of a "lookup" has
|     | | |   | | |   51352 [hal9000@hy e] case,
|     | | |   | | + 51304 [gsinclair@so] My pet peeve is the uniquely American way of including punctuation in quotation
|     | | |   | + 51305 [dblack@ca dl] My pedant credentials are pretty good (I get paid to do it :-) but I
|     | | |   |   51340 [harryo@zi .c] That's my main issue with it.  As you say, there's no verb that could easily
|     | | |   |   51355 [hal9000@hy e] Inside the quotes inside the US;
|     | | |   + 51243 [alan@di ik t] sift?
|     | | + 50916 [transami@tr ] pick is short and too the point.
|     | | + 50919 [tsiivola@cc ] Not a native speaker, but it's short, clear and makes sence for both hashes
|     | | + 50921 [hal9000@hy e] It's OK, but I think not ideal...
|     | | | + 50923 [matz@ru y- a] Yeah, UNIX tradition (see index(3)) which I and Ruby have been
|     | | | + 51016 [comp.lang.ru] - - I like it as well as anything I've seen so far, I like
|     | | |   51031 [kentda@st d.] "cull" reminds me of "culling", which makes me think of 3D backface
|     | | + 50929 [tom@li ux ri] It's okay. But why not overload "values"?
|     | |   50932 [matz@ru y- a] It sounds nice but it doesn't satisfy the second requirement in
|     | + 50998 [comp.lang.ru] - - How about "axiom_of_choice[1]" ? That's really what you're
|     |   51049 [vjoel@PA H. ] Actually it's more like the axiom of restriction (the one that got
|     + 50791 [hal9000@hy e] The latter makes that other proposal inappropriate,
|     + 50903 [flori@ni e. ] Would it be possible to change Array#fetch and Hash#fetch
|     | 50905 [matz@ru y- a] Hash#fetch already has optional second argument.  Besides,
|     | 50910 [flori@ni e. ] What a pity! I have overlooked that.
|     + 51022 [martindemell] Has anyone suggested 'values'? array.values(1,2,3) sounds reasonably
|       51047 [gotoken@no w] See http://ruby-talk.org/50932
|       51170 [martindemell] oops - yes, anything with a plural noun would fail requirement 2,
+ 51173 [gsinclair@so] [We all know the context!]
  + 51174 [tom@li ux ri] 'sample'?
  + 51182 [dblack@ca dl] Yes, I think that's the consensus.  It's sort of too bad to have
  | 51264 [bulatz@in eg] a=[10,11,12]
  | 51269 [matz@ru y- a] Unfortunately, Hash key can be an array.
  | 51274 [g_ogata@op u] subimage
  + 51191 [tsiivola@cc ] Hmm. grab makes me think: why not extend the semantics of grep?
    51193 [decoux@mo lo] pigeon% ruby -e 'p [1,3,3].grep(3)'
threads.html
top