From: Renaud HEBERT Date: 2001-09-06T22:39:25+09:00 Subject: [ruby-talk:20959] Re: calling original method in overrided method? Yukihiro Matsumoto wrote: > > Hi, > > In message "[ruby-talk:20952] Re: calling original method in overrided method?" > on 01/09/06, Renaud HEBERT writes: > > |I'm curious: why is the default conversion act like that ? > > It's inherited from C and Perl. It's useful sometime. > > matz. While I do not deny that it may be useful sometimes, does it has to be the default ?? C have no exceptions, and Perl is mmmh not a reference for "proper conduct" IMHO. I agree that being compatible with well-know languages is interesting but I find that Ruby is a bit lax with errors: - This default behavior of String#to_i of returning zero for any string that contains no recognizable numbers. - there is no declaration of variable at all: Perl with "use strict" and the -w flag allow less error than Ruby.. if you do: myvariable = 1 if (true) then myvariablee = 2 #erroneous name end You may have quite a lot of difficulty finding that myvariable isn't correct.. Maybe some "lint-like" option which would find any unused variable could help finding some of these error. It would still be less reliable than variable declaration, but it may help sometimes (usually these lint-tool are too verbose to be truly usefull though). the Limbo language on Inferno has a really nice variable declaration syntax: variable1 := 5 ; declares variable1 of type int and assign it the value 5. variable2 := variable1; declares variable2 of the same type as variable1 (here int), and assign it the value of variable1. variable3 : int; declares variable1 of type int and initialise it with the default value of the corresponding type, for int it is 0. Nice, isn't-it? -- Renaud Hebert phone: (33) 01 30 77 59 92 mailto:renaud.hebert@alcatel.fr