[#3006] mismatched quotation — "stevan apter" <apter@...>

ruby documentation uses a punctuation convention i've never seen

13 messages 2000/05/27

[ruby-talk:02953] Re: Things I am wondering...

From: matz@... (Yukihiro Matsumoto)
Date: 2000-05-23 15:56:38 UTC
List: ruby-talk #2953
Hi,

In message "[ruby-talk:02948] Things I am wondering..."
    on 00/05/23, h.fulton@att.net <h.fulton@att.net> writes:

|Just some more random questions. These are some
|things I have been wondering about, and I thought
|I might ask them all at once.  :)
|
|1. Why is Dir::foreach not named Dir::each? 

`each' is reserved for default enumeration.

|2. Why are these control structures and not methods?
|&& || ! and or not

&&, ||, and, or are shurtcut operators, which cannot be accomplished
by methods.  !, not can be implemented by methods.  They are control
structure mostly for performance reason.

|3. Why are TrueClass and FalseClass separate classes?
|In a way, I see the logic of it. But my instinct would
|have been a single class called Boolean.

I don't think true and false ever share the implementation, thus
there's little reason to have common single boolean class.  Having
Boolean class as common ancestor of True and False may be helpful to
classify boolean values.

|4. Why was the keyword "yield" chosen? Is this a legacy
|from another language? It is not intuitive to me.

Yes, it's from CLU.

|5. Like many other languages, Ruby does short-circuiting
|of Boolean expressions. Other than efficiency, what is
|the rationale for this? Was the other way (full 
|evaluation) ever considered?

They are designed so because I was C tainted programmer.  They are
effective too.  I haven't considered other way; I dislike Pascal.

							matz.

In This Thread

Prev Next