3207-4066 subjects 3635-4024
^ Exercice: Translate into Ruby :-)
3410 [jilanik tin.] I need a translation of this C++ code to understand how Ruby classes
+ 3412 [matz netlab.] Is this what you want?
+ 3426 [nahi keynaut] More C++ style(?) code I think is in inline...
^ Download song
3418 [oyubot tin.i] Download song
^ Modules for namespace management
3419 [hal9000 hype] Someone recently made a suggestion that I found
+ 3420 [aleksi.nieme] I think at least Dave has touched the subject at
+ 3421 [Dave thomase] 'twas I.
^ There is no "main" function in Ruby (?)
3422 [jilanik tin.] ...Yes it is. Thank you.
+ 3423 [aleksi.nieme] When you execute the interpreter by saying something like
+ 3431 [Dave thomase] Ruby has an execution model which will seem strange coming from C++.
3432 [nahi keynaut] This looks good. Can I show another soultion?
^ Re: Embedding RubyUnit
3433 [Dave thomase] Absolutely. (We should say that $DEBUG is set to true by the -d
3436 [nahi keynaut] Ah, I should say so... Thank you.
3476 [CQN02273 nif] Maybe I think "ru" syntax is associated with RubyUnit. So,
3477 [nahi keynaut] Kon'nichiha Suketa-san,
+ 3478 [Dave thomase] ;-)
+ 3491 [CQN02273 nif] Kon'nichiwa NaHi-san,
3497 [schneiker ju] Would you all be willing to consider a somewhat less cryptic and somewhat
3555 [nakahiro sar] Yes. Too cryptic to confuse myself in the future...
3617 [schneiker ju] somewhat
3648 [CQN02273 nif] % rbtest myfile.rb # Too criptic to confuse?
3651 [schneik aust] I think that is OK too, since every new Ruby user soon learns that ".rb"
^ "What's New" on Ruby home page WRT comp.lang.ruby
3434 [schneik aust] Under "What's New" on the Ruby home page, it says, "Vote for
3447 [matz netlab.] Oops...
^ Static Typing( Was: Waffling between Python and Ruby)
3437 [olczyk inter] First in defense of static typing.
+ 3440 [Dave thomase] One of the joys of Ruby is it's uncluttered syntax and simple
+ 3441 [schneik aust] Well, that sounds like some pretty strong stereoTYPING of the people that
| + 3444 [olczyk inter] And if you were to ask an Eiffel adherent, most would reply that
| | 3446 [schneik aust] Maybe you were exaggerating for effect, but one expects that at least a few
| | 3451 [olczyk inter] Any more then passing the wrong type in an untyped variable?
| | 3453 [andy Toolshe] Okay, first of all, please note that when I started this off
| | + 3456 [schneik aust] Well, some people don't think static typing is a joke. ... Oh, you meant your
| | | + 3457 [Dave thomase] The most compelling argument to me is "is it ain't broke, don't fix
| | | + 3459 [matz netlab.] I'm watching you, brother. And Ruby 9000 may have OPTIONAL static
| | + 3467 [quinn pyro.u] Right... dylan does this, with its concept of "specialization". I haven't
| | + 3472 [olczyk inter] Come on. You know. Everyone knows.
| | + 3473 [olczyk inter] The reason I say that static typing is a part of DBC is because it is
| | + 3482 [Friedrich.Do] DBC is not bound to static typing, and I think non static typed
| | | 3498 [schneiker ju] <Lots of stuff snipped.>
| | | + 3509 [andy Toolshe] I don't think personal attacks are appropriate, nor do I
| | | + 3512 [Friedrich.Do] Now even it the charta allows lenghty messages, it's IMHO unpolite to
| | + 3483 [Patrick.Scho] I agree with Andy here. IMHO DBC and typing are two different things. We
| | | + 3487 [frankm bayar] Agreed. Dynamic typing is very useful for rapid development, and for
| | | + 3568 [janneck NOSP] i agree with you completely on the value of dbc and static typing, but my
| | + 3485 [frankm bayar] <firstname.lastname@example.org>...
| | | 3517 [vp.nousiaine] Static vs. Dynamic typing <> Strong vs. Weak typing vs. no types
| | | 3570 [alwagner tca] Exactly what does DBC mean in the context of this thread?
| | | + 3574 [Dave Thomase] I'm not sure if this is a straightforward question or a profound one
| | | | 3576 [frankm bayar] Hmm ... isn't the whole point of Design By Contract to "fail fast"?
| | | | + 3577 [hgs dmu.ac.u] I'm not sure how one would solve this one. It seems to me that the
| | | | + 3579 [Dave Thomase] I don't believe that's the _emphasis_ of Dbc. My reading of Meyer, and
| | | | | 3581 [frankm bayar] Maybe I was misunderstanding the original poster, but he seemed to be
| | | | | 3583 [Dave Thomase] Not always (there are issues with polymorphism) but in general.
| | | | | 3584 [olczyk inter] There are no issues with polymorphism. This is what polymorphism
| | | | | 3590 [Dave Thomase] OK - I understand.
| | | | + 3593 [joachim.durc] Frank Mitchell <email@example.com>
| | | + 3575 [c.hintze gmx] Design By Contract
| | + 3592 [joachim.durc] I agree that contracts between a routine and a caller can be applied to
| | | 3646 [rainer.joswi] Yes. But this can be inherited in a dynamically typed language
| | | 3673 [joachim.durc] Ah, I didn't of think that. Thanks.
| | + 4100 [SPAMBGONEmbk] Well, static type constraints (a better phrase than static typing) on
| + 3463 [charleshixsn] This is a multi-part message in MIME format.
+ 3443 [embed NOSPAM] Yes. This is highly unlikely to ever happen with Python, or Smalltalk, and
^ Array of structs in Ruby
3448 [jilanik tin.] How to translate this C code in Ruby.
3450 [matz netlab.] class Person
3452 [jilanik tin.] Thanks a lot matz ;-)
3458 [matz netlab.] persons = 
3465 [aleksi.nieme] While Matz's answer is quite good one to one translation of the original
^ a Delphi/Pascal variant - Why not?
3449 [jilanik tin.] Wonderful! I think you can start from Free Pascal. It is already free and open
^ chomp, strings
3454 [matju CAM.OR] btw, perl does copy-on-write, which eliminates most of the overhead of
^ Errors missing in Library reference?
3461 [feldt ce.cha] I can't seem to find the errors (StandardError and it's subclasses) in the
3462 [andy Toolshe] They're in a section in another part of the book. The system errors
^ Array of objects
3466 [aleksi.nieme] how about adding a new Array.new version
^ [Ron Jeffries <firstname.lastname@example.org>] Re: [XP] What's wrong with strict typing?
3468 [Dave thomase] Folks - the following message was posted by Ron Jeffries on the
3471 [charleshixsn] That's one of the bottom lines. Static typing
^ Installing Ruby using Windows 98
3484 [wforbes thir] I haven't had any luck getting Ruby up and running using Windows 98.
3488 [aleksi.nieme] You're probably just providing all the information what exactly you've tried
+ 3490 [wforbes thir] Thanks for the information. All I have tried is the automatic setup ruby140.exe
+ 3510 [wforbes thir] Thanks again. I have installed rbdj144. I works sometimes, and sometimes
^ Re: Python 3000 -> No, but there's 'Ruby'
3486 [aahz netcom.] [x-posted to comp.lang.ruby, followups to comp.lang.ruby]
^ Ruby to call commands, e.g. "find , perl scripts , nmap , and others" is thispossible?
3493 [jovecka dall] Dear list,
3494 [Dave thomase] You have several options.
3504 [jovecka dall] I am trying to use nmap to test my own network and automate the process.
3506 [Dave thomase] I don't want to get into a Ruby vs. Perl discussion, but I can offer
^ RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!
3496 [schneiker ju] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!
^ Re: Nominally frozen classes (was Static Typing (was ...))
3499 [schneiker ju] "Frank Mitchell" writes,
3501 [Dave thomase] But ho could that work in practice? My code uses your code. One day,
^ Re: Python 3000 -> No, but there's 'R***'
3500 [schneiker ju] Likewise.
+ 3505 [aahz netcom.] [posting this just to comp.lang.ruby; it's really not relevant to
| 3507 [aleksi.nieme] I appreciate a lot what Conrad has been doing but I have to say the subject
| 3514 [c.hintze gmx] very nice article, indeed. I wholeheartly agree with you on all its
+ 3508 [schneiker ju] "Shae Erisson" writes
^ [1.5] Class variable
3503 [decoux moulo] 1) I can modify a class variable (with $SAFE >= 4) but not an instance
3511 [matz netlab.] 1) No. It's a bug. I should have add check for class variable
^ Security Problems
3513 [jilanik tin.] I have written a little web application with Ruby; I have put HTML files
^ Options database (was: Define & Include?)
3515 [claird starb] It's worse than that--all we've seen in *any* of the books
3535 [schneik aust] (Cameron: Thanks for the info.)
3567 [claird starb] You're welcome.
^ Deep copy?
3516 [hgs dmu.ac.u] Given that I cannot overload =, how should I go about ensuring a deep
+ 3518 [gotoken math] I think there isn't general way. The meaning of deep copy depends on
| + 3520 [hgs dmu.ac.u] OK. I can live with that I suppose.
| | 3523 [Dave thomase] Or objects such as descendants of IO that hold external resources that
| + 3521 [gotoken math] Appologies for my Engurish :-(
+ 3519 [Dave Thomase] Would marshaling do what you need?
| 3522 [hgs dmu.ac.u] Probably, but it would be slow. I think it is interesting that deep copy
| 3524 [gotoken math] A serious problem is the meaning of copy. More precisely, we don't
| 3528 [charleshixsn] This is a multi-part message in MIME format.
| 3551 [hgs dmu.ac.u] Thank you for all the input on this. Yes, open files and other hardware
+ 3525 [schneik aust] For the general education of other readers (e.g. myself), could someone
| 3527 [Dave Thomase] The Smalltalk implementation is typical. We assume a protocol (in the
+ 3534 [matz netlab.] There's no independent way to copy deeply. Only way I can think of
^ $: is broken
3526 [Dave thomase] On 1.36, line 569 of configure.in was changed from
^ ANNOUNCE: depends
3529 [hipster xs4a] `depends' shows forward/reverse package dependencies on a Debian
^ Ruby users in Japan
3530 [Dave thomase] We have heard the rumor that more people use Ruby than Python in
+ 3533 [gotoken math] Sorry, I don't know how we can measure that. ruby-list is really more
| 3539 [maki inac.co] In DDJ Japanese edition, there was a serialization about Python.
+ 3540 [maki inac.co] In FreeBSD-users-ja Mailing list, `FreeBSD ports national census'
^ Ruby classes and inheritance
3531 [hal9000 hype] Pardon me for referring to other languages
3537 [matz netlab.] Since Ruby is a dynamic typed language, you don't NEED pure virtual
3538 [Dave thomase] I agree that you probably don't need it--in fact, overcoming the
3556 [nakahiro sar] It is very fun. I used to consider how can I show the interface of
3562 [matz netlab.] You seem to use 1.4.x, right?
3572 [nahi keynaut] I checked if that script works on both 1.4.4(2000-04-14) and
3573 [matz netlab.] It works. It's fine. But it's not REQUIRED for 1.5 or later,
^ Extension in C++?
3532 [feldt ce.cha] Extending Ruby in C is simple and pretty straightforward. I'm considering
3536 [matz netlab.] There's no difference between C and C++ in writing extension, except
+ 3558 [feldt ce.cha] When I make the file below gcc won't compile it since ANSI C++ does not
| 3560 [ttate jaist.] How about casting the type of the function
+ 3559 [decoux moulo] pigeon% cat tt.cc
3563 [feldt ce.cha] Thanks a lot.
^ function objects?
3541 [johann physi] I know very little about Ruby, so forgive me if I'm asking something
+ 3542 [matz netlab.] Yes, it's true. Instead, Ruby has Procs (aka closure) and
+ 3543 [Dave Thomase] Yes and no. A method is not an object per se, but it's easy to make a
| 3545 [johann physi] First off, I appreciate the quick reply, both from you and matz.
| + 3546 [matz netlab.] Because I choose `obj.method' as alias of `obj.method()'.
| | 3564 [johann physi] Ah, thanks. That makes sense.
| | 3571 [matz netlab.] That's simple story. The languages return method object with `obj.m',
| + 3548 [Dave thomase] Yes - you can invoke both using .call
| + 3550 [decoux moulo] In some case, you need `()' to distinguish a kDO2 from a kDO, for example
+ 3554 [gotoken math] This message is off topic, perhaps. Consider as FYI :-)
^ A small quiz
3544 [Dave thomase] Andy and I were surprised by a Ruby feature. If you'd like, answer the
+ 3547 [matz netlab.] You mean `"hi"[2,1]', right?
| + 3549 [Dave thomase] Thanks for not giving it away ;-)
| + 3585 [hal9000 hype] I am somewhat mystified by why this should be considered
| 3587 [Dave Thomase] Yup - we actually came across this while writing the unit tests to
| 3611 [matz netlab.] (a) gain and loss are clarified.
| 3613 [Dave thomase] Well, the PLS would suggest that str[n] should return nil when
+ 3552 [hgs dmu.ac.u] I did not expect that result. I was more surprised when I used
+ 3553 [hgs dmu.ac.u] a = "hi"
+ 3557 [embed NOSPAM] Uh, it's the difference between p a and p a[0,1] that surprises me.
^ RE: Selling Rubies by the Carat with magnifying glass
3561 [aleksi.nieme] I don't want to spoil all the fun but I think this is essential part of the
^ www.ruby-lang.org/en/links.html, etc.
3565 [schneik aust] Communications
3566 [gotoken math] I've done. Those changes will be reflected after the next cron execution.
^ There's a problem with dev.rubycentral.com
3569 [Dave thomase] Just to let you all know that there seems to be a problem with
3580 [Dave thomase] dev.rubycentral.com appears to be back.
^ Interface polymorphism
3588 [hal9000 hype] Another question, guys.
+ 3589 [aleksi.nieme] My guess is that saying
+ 3591 [Dave thomase] Whenever you include a module, Ruby effectively inserts that module as
| 3600 [hal9000 hype] Thanks, Aleksi, and thanks, Dave.
| + 3601 [aleksi.nieme] I've given some thought to this too and my conclusion, so far, has been to
| + 3603 [Dave thomase] To be honest with you, I only really started to understood it after I
| 3604 [aleksi.nieme] Or maybe he should suggest :). What do you guys think, would it be step to
| 3605 [Dave thomase] My personal vote is 'no', or at least not right now.
+ 3608 [matz netlab.] Well, Mix-in is not a "interface polymorphism", it's a variation of
+ 3614 [nahi keynaut] I have been surprised with this behavior. I did not know well
| 3615 [nahi keynaut] Are you defining the interface which IMPLEMENTs another interface?
+ 3641 [hal9000 hype] Thank you, Matz... see below.
3642 [matz netlab.] Well, if you like, you can say that Ruby has restricted MI. But I'd
^ Another small quiz
3594 [thucdat hotm] def fact(n)
+ 3595 [aleksi.nieme] I can't see any problem here. We're calculating factorial in a normal
+ 3596 [gotoken math] Is needed a test for negative number?
| 3597 [thucdat hotm] Nothing is wrong.
| + 3598 [aleksi.nieme] It gets slower naturally, and should exhibit linear decease of performance,
| + 3599 [gotoken math] The avobe fails fact(0) and fact(1) ;-)
| | 3602 [thucdat hotm] Really?
| | 3606 [gotoken math] You are right. Maybe, I tried other code :-(
| + 3666 [matju CAM.OR] It is usually assumed that an addition is O(1) time and a multiplication
+ 3665 [matju CAM.OR] The function is defined on natural numbers (0 and its successors). If this
^ Is there a statistician in the house?
3607 [Dave thomase] I'm looking for a couple of unit tests for Ruby's random number
3609 [decoux moulo] ruby use the generator of the system (rand48() or rand()), these
+ 3610 [Dave thomase] I know, but... I still need to test that it's manipulating the results
+ 3612 [decoux moulo] It's useless to test when the generator is bad (i.e. I hate
^ Re: A small quiz -- str[n] vs str[n,1] nearing resolution?
3616 [schneiker ju] That is good news.
3618 [matz netlab.] OK, checked in. Let's see how it goes.
^ Re: Is there a statistician in the house? -- There's always a chance in the mansion of Ruby....
3619 [schneiker ju] I think that brand of vodka is good enough for most practical purposes. :-)
3620 [decoux moulo] pigeon% cat b.rb
3873 [andy Toolshe] I'll bite. I've been thinking about writing a better automatic-DJ for
^ Information -- Please --
3621 [jilanik tin.] I have been playing with Ruby this last month, and I am impressed by its
3628 [matz netlab.] Here I am.
3630 [jilanik tin.] All right. I stay with Ruby. Thank you indeed.
^ Manual patchlet.
3622 [hgs dmu.ac.u] May I suggest the following tiny patch, on the basis that it is more
3627 [matz netlab.] Well, thank you.
^ Problem running cvs.
3623 [schneik aust] Per instructions in the ruby-1.4.4/README, I've tried doing the
+ 3624 [decoux moulo] No, it work with 1.9.29
+ 3629 [matz netlab.] I don't think so. Mine is 1.10.8. Routing problem?
^ Ruby/Tk build problem on AIX solved (was Re: Options database (was: Define & Include?))
3625 [schneik aust] The problem is that the ld command line shown below lacks the "-brtl" option.
^ Ruby/tk problem in Windows
3626 [josesanch me] I'm use Ruby 1.4.4 for windows and i get a error when i tray to use Tk module.
^ Ruby 1.4.5
3631 [matz ev.netl] md5sum is
^ Ruby 1.4.5
3632 [matz netlab.] md5sum is
+ 3633 [jilanik tin.] Sure matz! But what are the fixes and adds?
| 3634 [fit0298 fite] Many fixes and adds(?) are written in "ChangeLog".
| 3636 [thucdat hotm] What are my troubles?
| + 3638 [matz netlab.] 1) Time#local does not generate localtime.
| + 3639 [schneik aust] <rest of output snipped>
| + 3640 [schneik aust] And with the xlC compiler on AIX 4.3, everything ultimately worked fine too.
| + 3643 [matz netlab.] Thank you for the success report.
| 3644 [schneik us.i] # In message "[ruby-talk:03639] Re: Ruby 1.4.5"
+ 3637 [matz netlab.] Sorry, several non trivial bugs are found. I'll fix them and release