18289-19573

18092-18667 subjects 18378-19183

FIX2LONG, NUM2INT
18289 [aleksei.guze] What is the difference between FIX and NUM?
18290 [decoux@mo lo] FIXNUM <= 1073741823
18291 [decoux@mo lo] More precisely

NUM2LONG problem :)
18293 [aleksei.guze] Just now I met a funny problem with NUM2LONG macro.
18294 [Dave@Pr gm t] Just call rb_num2long(fn(x)) directly.
18298 [green@Fr eB ] The definition should be trivially fixed, nonetheless... the rules
18302 [Dave@Pr gm t] which would rule out 'MIN' and 'MAX' in the standard headers.
18304 [green@Fr eB ] Yeah, macros which are not dependent on any specific type or "class" of

Unicode filenames and Ruby porting
18295 [ned@wh db y.] If someone were to port Ruby to Windows/CE, they would have a little
+ 18297 [aleksei.guze] Next versions will support multibyte coding. I hope...
| 18303 [ned@wh db y.] I don't see any references to UNICODE in the Ruby sources that I just got
+ 18309 [matz@ru y- a] Hmm, I'd like to try CE port, if time/budget allows.  Any information,
+ 18366 [ned@wh db y.] I'd love to see a CE port (especially for HPC/Pro 2.11 versions!) Some info
| 18405 [matz@ru y- a] <snip all useful information>
+ 18480 [li-te_cheng@] Matz, there may be some people ready to work for you...
| 18501 [matz@ru y- a] Wow.  It's good to hear about people working on Ruby.
+ 18530 [li-te_cheng@] Sure.  Do you prefer doing this on cvs.ruby-lang.org or

Ruby as opposed to Python?
18306 [mnenadov@st ] However, I have not found any major feature that puts it enough above Python.
+ 18310 [alwagner@tc ] What attracted me to Ruby from Python was the fact that it was pure OOP, not
| 18311 [ljz@as as .c] I'm virtually certain that Guido designed Python to be O-O from day
| 18322 [matz@ru y- a] I know the first release of Python had OO capability, but if he really
| + 18333 [ljz@as as .c] These features (class-type/object-instance separation) indeed
| | + 18334 [fdeturck@in ] never heard of CLOS, Dylan, generic functions, multiple dispatch?
| | + 18337 [uu9r@rz un -] C++ is called a "hybrid", because it implements both paradigms,
| | | 18446 [paulp@Ac iv ] In perhaps this one feature Python is like C++ but that doesn't mean
| | + 18347 [glen@en bl d] One could argue that Java has the same shortcomings in that it has
| | + 18370 [mikkelj-anti] Definitely not, but it is interesting to notice how close you can get to OO
| |   + 18372 [toddg@li ux ] Of course you can.  C is a portable assembler.  And of course Ruby is
| |   + 18375 [pbrannan@at ] Actually, GTK+ has a very interesting way of doing single inheritance
| |   + 18376 [uu9r@rz un -] Abstract datatypes is one important aspect of OO.
| |     18392 [mikkelj-anti] Actually it does work for multiple inheritance in the sense that this is
| |     + 18394 [jjenning@st ] the reason the gtk people chose C (it's on their site somewhere) is so that GTK+ would be more portable. Sane implementations of C exist on more platforms than C++, C++ has no ABI (fixed in gcc 3.0, but not in any ISO standards or anything), and i think they had in mind people wrapping it in their favorite languages. and most extensible languages are more easily extensible in C. or something.
| |     + 18434 [web2ed@ya oo] Ditto.  I beleive GTK would have been better implemented in C++ or
| |       18478 [fgp@ph o. rg] "Sure the framework is more portable". !!!
| + 18451 [paulp@Ac iv ] I think it is accurate to say that Python was always had OO but it was
|   + 18452 [thucdat@ho m] Observe the attitude of Lance Armstrong in the Tour de France. He wants to
|   | 18463 [Dave@Pr gm t] Nice post!
|   | + 18477 [fgp@ph o. rg] If ruby "wins the race" (if there is a race...), we all win
|   | + 18521 [pdcawley@it ] Oh yeah. I've still not sat down and programmed anything serious in
|   |   18532 [matz@ru y- a] For me, Ruby has the Quality Without A Name in heart.  I feel warm
|   |   + 18533 [dblack@ca dl] That's a gem of a pun -- a diamond, I'd have to say.  (Don't club me!)
|   |   + 18562 [pdcawley@it ] You do realise that spades outrank hearts don't you. But probably only
|   + 18490 [avdi@av i. r] At the risk of making a fool of myself, I'd like to say a few things
|     18717 [paulp@Ac iv ] The only real massive code-breaking change is the division fix that will
|     18725 [Dave@Pr gm t] This is one of the reasons I'm trying to get Rubicon working reliably
+ 18312 [toddg@li ux ] It would behoove you to read the second half of Paul Graham's recent
| + 18313 [toddg@li ux ] I'm pretty sure this will be taken as demeaning and pedantic by some
| + 18421 [harryo@zi wo] That's an interesting article.  I hope Paul doesn't strain his neck
| | + 18426 [mikkelj-anti] Yes absolutely - but very much pro-Lisp and the conclusions may not be
| | | 18441 [robb@Ne vo s] hmmm. seems like every time there is a python/ruby thread here the
| | + 18459 [toddg@li ux ] You are a Blub programmer and I claim my 2 dollars.
| | | + 18472 [avi@be a4 co] The exception here is Dylan, which manages to have a hygenic, easy to use,
| | | + 18523 [mikkelj-anti] Exactly - he's argument is that only the programmer of the most powerful
| | |   18549 [toddg@li ux ] I haven't seen rhetoric that convoluted and pointless since college.
| | + 18601 [Roberto@lu i] "An example of the power of LISP macros is the Common LISP Object System
| + 18448 [paulp@Ac iv ] More fully OO I will buy. functions/methods etc. I don't really.
+ 18314 [mnenadov@st ] To the best of my knowledge Python was designed originally with OOP in mind (not
| + 18447 [paulp@Ac iv ] Python exposes the "self" argument as a parameter to the method. Many
| + 18489 [linden@wi .t] Fixnum objects have immediate value. This means that when they
|   18712 [paulp@Ac iv ] For those who don't know, the Python world is currently engaged in a
|   + 18718 [joe@vp p. et] That is correct. I wish there was a way to specify whether a change to
|   + 18720 [elderburn@mi] Sorry, but I don't see the 'problem' here. Both Ruby (1.63) and Python (1.52)
|   | + 18723 [jweirich@on ] Depends upon your definition of 'correct'.  I've somewhat followed
|   | + 18731 [jmichel@bo e] I think both behaviours are incorrect. One should have
|   + 18742 [matz@ru y- a] Even though it's easy to change the behavior of "/" in Ruby, and some
|     18759 [paulp@Ac iv ] Python may adopt rationals one day also, but the change to having 5/2
|     18774 [fgp@ph o. rg] If you write a function, which depends on 1/2 being 0.5, why don't you just
|     + 18779 [matju@sy pa ] Well, if a programmer never-ever declares anything, he gets a result that
|     | + 18780 [spwhite@ch r] I ran into a similar bottleneck while looking at writing a code editor.
|     | + 18811 [paulp@Ac iv ] This style is possible in both Python and Ruby but it hasn't caught on
|     |   19573 [matju@sy pa ] It is a conceptual problem indeed;
|     + 18781 [paulp@Ac iv ] Yes, that's a workaround.
|       + 18782 [matz@ru y- a] I don't understand what you mean by "fully substitutable".  You mean
|       | 18785 [pdcawley@it ] That's substituting floats for integers. Somehow I doubt that that
|       | 18819 [matz@ru y- a] Hmm, I understand.
|       + 18792 [fgp@ph o. rg] Or just stating what the programmer _really_ wants....
|         + 18796 [nat.pryce@b1] just
|         | + 18825 [paulp@Ac iv ] So would you advocate "2.0/1" => exception? After all it is magically
|         | | 18885 [nat.pryce@b1] If integers are a subtype of float, then the "/" operator does not require
|         | + 18836 [mikkelj-anti] It certainly is consistent with no conversion to string exception you get
|         + 18799 [jweirich@on ] Most of the time, the choice of truncating vs non-truncating behavior
+ 18315 [mnenadov@st ] I know I already replied to your last message, but I have one more
| + 18316 [avi@be a4 co] I may regret replying to this thread; bottom line is, if Python works for
| + 18318 [boognish23@y] I consider Smalltalk to be "pure" OO.  You have objects and you have
|   + 18326 [anany@ec .v ] When you are calling a function on an object, you have fallen out of OOP.
|   | 18449 [paulp@Ac iv ] I don't think that is true -- especially in dyamically typed languages.
|   + 18398 [krystianson@] What's up with all this talk about purity?  Maybe you guys should be
+ 18353 [xoltar1@ho e] them.
| 18417 [schneiker@ju] among
+ 18367 [mikkelj-anti] I guess this is difficult to put in words. It is a kind of spiritual thing.
+ 18368 [cosgood@rs s] Python.
| + 18369 [mikkelj-anti] Thanks. Because that was exactly my question to the earlier text.
| + 18450 [paulp@Ac iv ] I deal with XML constantly but hardly ever with regular expressions.
| + 18486 [mrchameleon@] Snip ...
| + 18543 [cosgood@rs s] Well, the XML module or FTP module (I guess) use regular expressions in
|   18545 [ned@wh db y.] I don't see what the problem is here; just use async I/O and avoid blocking
|   18713 [paulp@Ac iv ] Just opening a file can cause a long pause if the file is on the other
|   + 18714 [ned@bi e- om] A common idiom in the Smalltalk world (like with VisualWorks) is to use a
|   + 18735 [nat.pryce@b1] Perhaps Ruby could learn from Tcl/Tk and define a standard event-loop with a
|   + 18740 [mikkelj-anti] calls.
+ 18442 [web2ed@ya oo] First let me put on my flame-retardant suit I'm certain this post will
+ 18553 [peterhi@sh k] As a Perl programmer by trade I must say that Perl is powerful when it is
  + 18555 [toddg@li ux ] Speed of execution is vitally important for server-side code, desktop
  | 18715 [toddg@li ux ] Oh ghod, how I wish it were so.  The smarter groups in the industry do
  | + 18719 [toddg@li ux ] scratch that, it's an Algol child.
  | + 18872 [zach@za hb k] Sure, but those two are also creating complete game engines that they
  |   18888 [toddg@li ux ] That would be entirely correct if it weren't for the small problem that
  |   18945 [zach@za hb k] Details are vague, but not the big picture, not to the degree where you'd
  + 19039 [dnm@po ox co] Apologies for resurrecting possibly dead threads, I'm catching up on

Ruby Book
18317 [tom@hu st in] From what I have been told, Programming Ruby is an excellent book on Ruby.
+ 18319 [anany@ec .v ] Tom,
+ 18320 [Dave@Pr gm t] Mark Slagell seems to be working on just what you want (although
| + 18321 [tom@hu st in] Chris,
| + 18323 [tom@hu st in] Thanks a lot Mr. Thomas! I want to strongly emphasize that I did not mean to
| | 18324 [Dave@Pr gm t] Absolutely none taken.
| | 18328 [toddg@li ux ] Well, if you're new to programming, and intend to be here for a while,
| | 18373 [tom@hu st in] Todd,
| | 18377 [jjenning@st ] Design Patterns, by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
| | 18382 [hipster@xs a] check
| | 18384 [toddg@li ux ] Umm.. it might be good to season yourself in algorithm design and CS
| + 18336 [ms@ia ta e. ] It *is* hard to keep things under one's hat around here. :-)
+ 18341 [uu9r@rz un -] Ruby Developer's Guide is one further book coming this year.
  18352 [hal9000@hy e] sr=1-4/ref=sc_b_4/104-8355535-9623161
  18365 [mikkelj-anti] Ruby.

capitalizing a string
18325 [jjenning@st ] Say I've got a string p = 'fooBarPoit'.
+ 18327 [matz@ru y- a] p = 'fooBarPoit'
| 18329 [phasis@ha an] How about
+ 18332 [spwhite@ch r] p[0,1].upcase << p[1..-1]

Ruby, Python and Objects philosophy
18330 [joe@ai bj ct] Wasn't there a big /. discussion about this a week or so ago?  If I may
18335 [ljz@as as .c] I have decided to take your "read" option, which has turned out to be
+ 18338 [uu9r@rz un -] and see the example of use.
+ 18340 [hipster@xs a] Logging example using Aspect Oriented Programming (get aspectr from
  18363 [mikkelj-anti] That was a darn long text - and I must admit I didn't carefully read

FXRuby problem with FXList
18342 [jjthrash@po ] It seems that when I add an FXListitem to an FXList, ruby dumps its
18350 [ljohnson@re ] <... remainder snipped ...>

mod_ruby - persistent variables?
18343 [uu9r@rz un -] Is it possible to share variables over multiple request, as this
18364 [sean-ruby-ta] Good question: depends.  I believe you can share data for the
18408 [shugo@ru y- ] You can't share variables because Apache creates multiple
+ 18410 [waisun.chia@] POSIX shared memory with locks/mutex?
+ 18418 [domingo@da -] Why not try use the apache shared memory module, I'm looking for that
  + 18419 [uu9r@rz un -] Thanks for the clarification. I heard it once before anywhere but
  | 18420 [sean-ruby-ta] Take this with a grain of salt because there are a few
  + 18926 [someone@ho e] All of this may be a moot point very soon.  Although Apache 1.X uses

Newbie question: Data structures in Ruby.
18344 [recon_nospam] I just started implementing some tools in Ruby, however I am having
+ 18345 [Pierre-Charl] Ruby makes attributes hidden ('private') by default. You need to
+ 18346 [Dave@Pr gm t] You could use the wonderful new PerlValue package (available on the
| 18348 [ian.mcgillow] How do i unsubscribe to this
+ 18357 [recon_nospam] Okay, so now I have
| + 18371 [ugly-daemon@] You need to use attr_accesor instead of attr_writer because attr_writer only
| + 18415 [recon_nospam] Yes, that did the job. Thanks a lot for your help.
+ 18358 [recon_nospam] Thank you for your help, but do I really need a module to do something simple
+ 19000 [recon_nospam] Thank you for your help, but do I really need a module to do something simple
  + 18360 [Dave@Pr gm t] No.
  + 19001 [Dave@Pr gm t] No, but if you want to write code in this style, and as PerlValue

RE: Digest Articles 18282-18332 (1/4) (ruby-talk ML)
18349 [leafyoung@ch] [mailto:ruby-talk-admin@ruby-lang.org]

RCR: String./ to concatenate paths
18351 [mike@le to .] prefix = '/usr'/'local'
18407 [matz@ru y- a] Although it appears attracrive, I don't think it's a good idea to tie
18431 [pbrannan@at ] I think I would be inclined to agree.  However, if some easy way of
+ 18432 [dblack@ca dl] irb(main):012:0> foo = "dir"
+ 18443 [mike@le to .] tie

Announcement: MPI Ruby
18354 [onge@mc .a l] Announcing MPI Ruby!
18387 [john.carter@] Sometimes one is so close to the forest, that one assumes everyone else
18388 [emilong@mi w] Indeed, you are correct, sir.  Sorry about that.  MPI stands for Message

Still can't get Ruby to compile...
18356 [matt@gr en i] So, I'm trying to compile Ruby 1.6.4 under $HOME. It's not working.
18359 [Dave@Pr gm t] I suspect you've got some problem with either -x or with your shell
18361 [matt@gr en i] I'm going to install it, but I don't think it's my shell. I've tried it with sh, csh, tcsh, bash, esh, ksh, and zsh. (I tried everything in /etc/shells...) An interesting thing to note is that if I leave out -z="555", I get nil from all the shells. It looks like some sort of ARGV issue. Maybe it's freebsd's fault. Maybe not. I had suspected as much by the -v making it work, but didn't think to test it.
18362 [Dave@Pr gm t] I wish I had access to a FreeBSD system so I could try this.

OO question
18374 [tom@to -m lo] Someone please tell me if this is an inappropriate question for this list -
+ 18379 [sean-ruby-ta] is
| + 18390 [WillC@we mi ] Over the weekend, I put together my first real Perl project. Perl, of
| | + 18391 [avi@be a4 co] ... and when you realize that static methods, which are the closest thing
| | | 18429 [ugly-daemon@] May I ask what metaclasses are?? Are they classes for instatiating classes??
| | + 18428 [spwhite@ch r] There's one exception to this... methods that are split between classes
| | | 18433 [dblack@ca dl] But if (say) Array#join => aString is a problem, then what about
| | | + 18438 [   ml@sp .d ] Also las ich bei Chris Moline [mailto:ugly-daemon@home.com]
| | | | + 18439 [pulsar@qk .c] list -
| | | | | + 18481 [macdonaldrj@] that
| | | | | + 18932 [macdonaldrj@] that
| | | | |   + 18482 [pulsar@qk .c] which
| | | | |   + 18525 [pbrannan@at ] Being able to modify primitives is NOT necessarily a good thing.  For
| | | | |     + 18526 [dblack@ca dl] s/Being able to modify/Modifying/  # :-)
| | | | |     + 18527 [avdi@av i. r] I think it goes without saying that any reasonbly powerful and flexible
| | | | |     | 18529 [Stephan.Kaem] Sorry but...
| | | | |     | 18534 [dblack@ca dl] (I'm assuming you mean that 'Y' to be a 'y'.)
| | | | |     + 18535 [chris@at es ] In C++ you can only overload operators when at least one of the
| | | | + 18453 [ugly-daemon@] So a metaclass is a class about a class. If ruby didn't have class variables I
| | | + 18483 [spwhite@ch r] I agree, these things are very useful. :)
| | |   + 18484 [dblack@ca dl] The pickaxe does this :-)
| | |   + 18496 [Dave@Pr gm t] I think this is an excellent thought. Logically, if not in actual
| | |     + 18499 [avdi@av i. r] Very interesting idea; it sounds like something I've been ruminating on
| | |     + 18508 [avi@be a4 co] Smalltalk always did this with categories - you can ask a browser,
| | |     | 18520 [dblack@ca dl] A question, based on ignorance of Smalltalk (and therefore uncertainty
| | |     + 18716 [paulp@Ac iv ] David Simmons also mentioned it, but offhand.
| | |       18722 [Dave@Pr gm t] Not really. AOP is aimed at injecting functionality orthogonally into
| | |       18808 [   ml@sp .d ] Also las ich bei Chris Moline [mailto:ugly-daemon@home.com]
| | + 18445 [pdcawley@it ] grep {$_ eq 'target_string'} @list
| + 18444 [pdcawley@it ] But, playing Devil's Advocate here, how is that an improvement over
|   18454 [sean-ruby-ta] I knew someone would call me on that as soon as I read my
+ 18406 [matz@ru y- a] It's easy for my mind.  I hope it's easy for yours too.
+ 18422 [alunapr@ap l] Okay, I'll have a bash. Sorry if this is a bit meandering.
threads.html
top