Singleton Classes & thread safety

yes, it was a merely syntactic (phonetic?) question; what
does the line sound like.

I don’t understand what is behind the original question. Why do you
want to know? Isn’t this close to “If I could copy the patterns of
activation in your brain when you see the colour red, and if I put them
in my brain, would I see red as well?”? This seems to be related to the
idea of “qualia” which, as they relate to the question “what is
consciousness?”, are interesting. But I don’t know what use you can
possibly make of the answers.

Therefore, since people don’t generally ask useless questions in public
lists, I infer that I must have missed the real issues you are grappling
with here. Another possibility is that you don’t know what the issues
are either, and are using the question to find out why your hunch tells
you this has importance, i.e. to clarify things in your own mind.

I often confuse myself, however.

I expect I’ve confused somebody with the above, as well.

    Hugh
···

On Fri, 26 Jul 2002, Michael Campbell wrote:

Strictly curiosity.

···

— Hugh Sasse Staff Elec Eng hgs@dmu.ac.uk wrote:

On Fri, 26 Jul 2002, Michael Campbell wrote:

yes, it was a merely syntactic (phonetic?) question;
what
does the line sound like.

I don’t understand what is behind the original question.

=====

Use your computer to help find a cure for cancer: http://members.ud.com/projects/cancer/

Yahoo IM: michael_s_campbell


Do You Yahoo!?
Yahoo! Health - Feel better, live better

I am reminded of the question, “If Helen Keller
fell over in the forest, would she make a sound?”

:slight_smile:

Actually, I hate to admit it, but I understood his question
(I think) and it’s rather the kind I would ask.

Although I’m a very visual thinker, sometimes I do translate
code into English phrases in my head. Sometimes I even “speak”
in code, as when I’m explaining something to another
programmer.

For my part, a.each {|x| p x} sounds something like:
Given a, for each x in it, do p(x)

And I have to admit that there is always the ghost of a
distant, small voice in my head saying “x such that…”
because of the old mathematical notation which I learned
as a child (for describing sets):
{|x| x>5 }
read as: “the set of all numbers x such that x > 5”

Although, of course, this doesn’t relate to Ruby.

Hal

···

----- Original Message -----
From: “Hugh Sasse Staff Elec Eng” hgs@dmu.ac.uk
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Friday, July 26, 2002 10:49 AM
Subject: Re: How do you think of…

On Fri, 26 Jul 2002, Michael Campbell wrote:

yes, it was a merely syntactic (phonetic?) question; what
does the line sound like.

I don’t understand what is behind the original question. Why do you
want to know? Isn’t this close to “If I could copy the patterns of
activation in your brain when you see the colour red, and if I put them
in my brain, would I see red as well?”? This seems to be related to the
idea of “qualia” which, as they relate to the question “what is
consciousness?”, are interesting. But I don’t know what use you can
possibly make of the answers.

Since I only got back from vacation, I’m replying to this thread
late. To avoid clutter, I’m replying to 5 messages all in this
one email. Skip what you want:

a.each {|x| p x } # ← this line

How do you read the “this line” line?

I read it like it were Ruby code:

for x in a; p x; end

If I had to read it out loud over the phone, I might read:

for each x in a, p x.

When I read your code, before I got to the ‘How do you read the
“this line” line?’ I definitely (in my head) read the code as:

on each x from a, p x.

However, that’s because when I see .each, I skip over to the
block and look at it. If the block weren’t a one-liner, I
would read it as:

on each element from a,
using |...|
do {...}

Sorry, typo:
for each x in a do p(x)

that has the same meaning but might be confused with the actual use of
the for statement.

Remove the “each” and “do” and add some semicolons and an “end” and
it is an actual use of the “for” statement.

I would call Albert’s version a “verbose, human-readable version”
of the use of the “for” statement.

yes, it was a merely syntactic (phonetic?) question; what
does the line sound like.

What is the sound of one line of code clapping?

I am reminded of the question, “If Helen Keller
fell over in the forest, would she make a sound?”

:slight_smile:

Damn, you beat me to it. :wink:

For my part, a.each {|x| p x} sounds something like:
Given a, for each x in it, do p(x)

“Do p() using x to each element in a.”

This is what happens when you’re Japanese and learn to read
from right-to-left. My guess is this is how a native Japanese
reader would read the line of Ruby code and IMHO it’s quite
intuitive.

···

On 2002.07.26, Michael Campbell michael_s_campbell@yahoo.com wrote:
On 2002.07.26, Tom Sawyer transami@transami.net wrote:

On Thu, 2002-07-25 at 17:41, Albert Wagner wrote:
On 2002.07.26, Michael Campbell michael_s_campbell@yahoo.com wrote:
On 2002.07.31, Hal E. Fulton hal9000@hypermetrics.com wrote:

On 2002.07.26, yct yuchingtien@yahoo.com wrote:

a for each of your x do this…

“All your ‘x’ are belong to ‘a’.”

Sorry, couldn’t resist.

– Dossy


Dossy Shiobara mail: dossy@panoptic.com
Panoptic Computer Network web: http://www.panoptic.com/
“He realized the fastest way to change is to laugh at your own
folly – then you can let go and quickly move on.” (p. 70)