DMD 0.148 release

Charles Hixson charleshixsn at earthlink.net
Mon Feb 27 21:59:15 PST 2006


Ivan Senji wrote:

> ...
> One more thing. I heared from a Ruby user that in Ruby 0 means true.
> To that user while(1) is pefectly obvious it is a block of code executed
> exactly once. No problems in understanding that for a Ruby user.
> ...

Yes.  IIRC in Ruby everything except Null and False is handled as if it were
true.  There's some justification that I can't remember...probably "That's
the way Perl does it", but that's just a guess.

OTOH, Ruby doesn't even TRY to be type safe.  I like Ruby a lot, but that's
not the way I think things should be handled.  And I'm all in favor of
Boolean being a type of size 1 that, if it implements + and *, implements
them as "or" and "and"...and NEVER automatically converts to or from any
arithmetic form.  That seems to me to be much more reasonable.  (Yes, C
didn't do it that way.  C didn't even HAVE a boolean type.  [Well, the
first C compilers I used didn't...bool was implemented via a macro
substitution for int.]  So I don't find that a very powerful argument for
what D should do.)

Still, no language is perfect, and as warts go, this is a small one.




More information about the Digitalmars-d-announce mailing list