[#407] New feature for Ruby? — Clemens.Hintze@...
Hi all,
27 messages
1999/07/01
[#413] Re: New feature for Ruby?
— matz@... (Yukihiro Matsumoto)
1999/07/01
Hi Clemens,
[#416] Re: New feature for Ruby?
— Clemens Hintze <c.hintze@...>
1999/07/01
On Thu, 01 Jul 1999, Yukihiro Matsumoto wrote:
[#418] Re: New feature for Ruby?
— gotoken@... (GOTO Kentaro)
1999/07/01
Hi
[#426] Re: New feature for Ruby?
— gotoken@... (GOTO Kentaro)
1999/07/02
Hi,
[#427] Re: New feature for Ruby?
— Clemens Hintze <c.hintze@...>
1999/07/02
On Fri, 02 Jul 1999, you wrote:
[#428] Re: New feature for Ruby?
— gotoken@... (GOTO Kentaro)
1999/07/03
Hi,
[#429] Re: New feature for Ruby?
— Clemens Hintze <c.hintze@...>
1999/07/03
On Sat, 03 Jul 1999, you wrote:
[#430] Re: New feature for Ruby?
— gotoken@... (GOTO Kentaro)
1999/07/05
Hi,
[#431] Re: New feature for Ruby?
— Clemens Hintze <c.hintze@...>
1999/07/07
On Mon, 05 Jul 1999, you wrote:
[#440] Now another totally different ;-) — Clemens Hintze <c.hintze@...>
Hi,
21 messages
1999/07/09
[#441] Re: Now another totally different ;-)
— matz@... (Yukihiro Matsumoto)
1999/07/09
Hi,
[#442] Re: Now another totally different ;-)
— Clemens Hintze <c.hintze@...>
1999/07/09
On Fri, 09 Jul 1999, you wrote:
[#452] Re: Now another totally different ;-)
— gotoken@... (GOTO Kentaro)
1999/07/11
Hi,
[#462] Re: Now another totally different ;-)
— matz@... (Yukihiro Matsumoto)
1999/07/12
Hello, there.
[#464] Re: Now another totally different ;-)
— Clemens Hintze <c.hintze@...>
1999/07/12
On Mon, 12 Jul 1999, you wrote:
[#467] Re: Now another totally different ;-)
— matz@... (Yukihiro Matsumoto)
1999/07/12
Hi,
[#468] Re: Now another totally different ;-)
— gotoken@... (GOTO Kentaro)
1999/07/12
In message "[ruby-talk:00467] Re: Now another totally different ;-)"
[#443] — Michael Hohn <hohn@...>
Hello,
26 messages
1999/07/09
[#444] interactive ruby, debugger
— gotoken@... (GOTO Kentaro)
1999/07/09
Hi Michael,
[#448] Re: interactive ruby, debugger
— "NAKAMURA, Hiroshi" <nakahiro@...>
1999/07/10
Hi,
[#450] Re: interactive ruby, debugger
— Clemens Hintze <c.hintze@...>
1999/07/10
On Sat, 10 Jul 1999, you wrote:
[#490] Some questions concerning GC in Ruby extensions — Clemens Hintze <c.hintze@...>
Hi matz,
6 messages
1999/07/14
[#501] Ruby 1.3.5 — Yukihiro Matsumoto <matz@...>
Ruby 1.3.5 is out, check out:
1 message
1999/07/15
[#519] CGI.rb — "Michael Neumann" <neumann@...>
Hi...
7 messages
1999/07/24
[#526] Another way for this? And a new proposal! — Clemens Hintze <c.hintze@...>
Hi,
6 messages
1999/07/25
[ruby-talk:00511] Re: One question about classes written in C.
From:
c.hintze@...
Date:
1999-07-20 19:50:11 UTC
List:
ruby-talk #511
On 20 Jul, GOTO Kentaro wrote:
> Hi Cle,
>
> In message "[ruby-talk:00506] Re: One question about classes written in C."
> on 99/07/19, Yukihiro Matsumoto <matz@netlab.co.jp> writes:
>
[...}
> I often use `coerce technic' for the default action:
>
[...]
>
> It's an idiomatic phrase. Indeed, we have only the three concrete
> classes as the numeric.
Ahem! I feel I had not made very clear my opinions (once again ;-)
I understand and use that coerce technic. But here in my example I
cannot use it IMHO! My addition method is defined as:
class Point
def + (other)
if other.is_a?(Point)
return Point.new(@x + other.x, @y + other.y)
else
return Point.new(@x + other, @y + other)
end
end
end
I think there is no way, I could use coercion technic, is there?
Furthermore there is an `Object#is_a?' method, and I can really not
understand, why matz doesn't want to adopt that macro. There are
checkers like `CLASS_OF' and `Check_Type'. But `IS_A' is not good? :-/
If I follow his statement, I should also not use `Object#is_a?', should
I?
>
> # I'll add SingleFloat and DoubleFloat in the near future.
May I ask, for what it would be good for?
>
> But you can use IS_A() macro if you need. I would NOT like to stop
> that :-)
I will not stopping to use it :-) I will also mention it in my tutorial.
;-)
[...]
> I don't think it's nice because one doesn't have to set instance
> variables in order to customize the class but she can use private
> methods.
Ahem, yes. Okay, I have not thought so. Only that we would have a
possibility to check or correct the values of an instance var. But if I
think more about it, I feel, that this is for what the accessor methods
was made for.
So please forget about that feature on Ruby level! But on C level it
would makes sense, wouldn't it?
>
> >From the other point of view, customizing by instance variables seems
> easy to cause bugs which are not easy to be found if the class is
> implemented in C, i.e. in the situation where one can't see how an
> instance variable is used inside of the object.
Perhaps I have got you wrong! Does that mean it is okay for C level, or
not?
Until yet, I have to decide, whether I want to use C internal
structures instead instance variables, or vice versa. A class `Point3D'
derived from a Ruby-coded class `Point' could use its instance
variables `@x' and `@y'. If the class `Point', however, is coded in C
and the coordinates are hold in a C struct, the class `Point3D' have to
use accessor methods to work with the internal data of the parent class
`Point'!
I am not very happy with that difference. So I think if we would be
able to connect such a C struct member with a instance variable, class
`Point3D' could use the instance variables, and another class e.g.
`Rectangle' coded in C could use the struct members. Use what is most
comfortable in a certain situation! That is Ruby's strength, I feel :-)
>
> -- gotoken
>
> # It is holiday `the sea day' in Japan but I don't know the meaning of
> # today..
Interesting, but I also don't know! ;-)
\cle