[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:01961] Re: no Fixnum#new ?

From: matz@... (Yukihiro Matsumoto)
Date: 2000-03-17 09:39:20 UTC
List: ruby-talk #1961
Hi,

In message "[ruby-talk:01942] no Fixnum#new ?"
    on 00/03/16, Quinn Dunkan <quinn@envy.ugcs.caltech.edu> writes:

|But how could I make a class Myint that derives Integer?  If I derive Integer
|and do Myint.new, what I get is not so useful since Integer is an abstract
|base.  But if I derive Fixnum, I now have no way to create Myints since
|Fixnums and Bignums don't have new constructors...

Fixnums are immediate data, so that you can't inherit from it.
Bignums can have constructor, but I haven't prepared for consistency
with Fixnums.

|Also, is it considered good ruby form to modify existing classes?  It seems
|scary to me because it's like modifying global values: all the sudden, the
|order you import modules becomes important, and all the other nastiness that
|mutable globals bring to the table...

I do NOT recommend it for serious projects.  It is real easy to abuse.
But it's handy sometimes as long as you take your own risk.

							matz.

In This Thread