CORE - Altering Behaviour of "each do" (default param "item")

On 05.06.2011 16:00, Ilias L. wrote:

Or stay calm and focus on the technical stuff.

Providing help is a personal matter for many people. You won’t get
friends here as long as you snub everyone who is questioning your
approach or
motivation. This is help as well and demands proper handling on the
personal level from your side, too.

Still, this is ruby-talk primarily, even if you are using it over a
Usenet gateway. You are free to open up mailing lists named ruby-request
or
ruby-support. Let’s see how many people want to subscribe those and
focus on your topics in the way and with the level of focus you want.

On 4 Ιούν, 17:50, James G. [email protected] wrote:

end

#Question: How can I alter the behaviour of “each” in the following
way:
names.each do
print item # “item” is used by default
end

Is this possible, without going to C-level?

Since
[…] - (off topic)

def each(&iterator)
if iterator.arity.zero?

http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_method.html#Method.arity

  sane_each do |item|
    Item.new(item).instance_eval(&iterator)

Creating an object for each iteration.
Can this be avoided somehow?

puts name
end

names.each do
puts item
end

END

This looks very good, and seems to work as expected.

The most important thing to learn
[…] - (off-topic, crossing the line)

http://www.nationmaster.com/encyclopedia/Ilias-Lazaridis

Have you checked the validity of this information? It was copied from
a wikipedia “article” (the original article was deleted, due to
violation of the wikipedia policies).

The most important thing to learn is:

when is it “expressing negative feelings” and when is it “defamation
of character”:

http://www.lawinfo.com/fuseaction/Client.lawarea/categoryid/1162

See, I’m looking in parallel for a contract within the ruby domain (as
I’ve chosen ruby for my own projects and thus I like to avoid to work
in another languages).

If you (people) continue to attack me on a professional level, I’ll
have to react at some point.

So, please, set a filter, don’t read or go get a dog.

Or stay calm and focus on the technical stuff.

.

On 5 Ιούν, 17:19, Matthias Wächter [email protected] wrote:

On 05.06.2011 16:00, Ilias L. wrote:

Or stay calm and focus on the technical stuff.

Providing help is a personal matter for many people. You won’t get friends here
as long as you snub everyone who is questioning your approach or
motivation. This is help as well and demands proper handling on the personal
level from your side, too.

Still, this is ruby-talk primarily, even if you are using it over a Usenet
gateway. You are free to open up mailing lists named ruby-request or
ruby-support. Let’s see how many people want to subscribe those and focus on
your topics in the way and with the level of focus you want.

I am free to use this resource to post topics subjecting the ruby
language.

You are not free to bombard those topics with off-topic comments.

You are free to setup a filter, thus you don’t see my messages/
topics anymore.

It’s as easy as that.

And please: refrain from further off-topic messages.

It’s really enough.

.

On 05.06.2011 16:40, Ilias L. wrote:

I am free to use this resource to post topics subjecting the ruby
language.

You are not free to bombard those topics with off-topic comments.

It depends solely on what you define »the topic«. You seem to have
talent in making yourself the topic and not taking notice of that.
That’s your
fault, not the other’s. So if you want to avoid being called rude, just
try to keep your wording easy and indicate thankfulness. (There is a
well-meant advice in it and I expect thankfulness for that as well).

You are free to setup a filter, thus you don’t see my messages/
topics anymore.

So are you.

Let’s just ignore him, shall we?
He already abused our time, patience and kindness. Let’s follow JEG’s
advice.

Michaël Sokol

On Sun, Jun 5, 2011 at 9:00 AM, Ilias L. [email protected]
wrote:

I’ve chosen ruby for my own projects and thus I like to avoid to work
in another languages

Curious, based on your questions it looks like you chose some other
language.

On 5 Ιούν, 18:04, Matthias Wächter [email protected] wrote:

On 05.06.2011 16:40, Ilias L. wrote:

I am free to use this resource to post topics subjecting the ruby
language.

You are not free to bombard those topics with off-topic comments.

It depends
[…] - (twisted views of in-topic and forced thankfulness)

You are free to setup a filter, thus you don’t see my messages/
topics anymore.

So are you.

I can filter you.

But your off-topic-babbling is archived.

.

On 05.06.2011 16:37, Ilias L. wrote:

You are not free to bombard those topics with off-topic comments.

Actually, this assessment is wrong.

robert

Hi,

In message “Re: CORE - Altering Behaviour of “each do” (default param
“item”)”
on Sat, 4 Jun 2011 20:50:25 +0900, Ilias L.
[email protected] writes:

|#Question: How can I alter the behaviour of “each” in the following
|way:
|names.each do
| print item # “item” is used by default
|end
|
|Is this possible, without going to C-level?

It’s possible but you have to redefine the each method. That reminds
me Groovy’s it. Currently I have no plan to change the core like that.

          matz.

On Sunday, June 05, 2011 11:55:29 AM Ilias L. wrote:

For a solution which works exactly in the given context (Array#each),
see message from “James G.” below (you can ignore all following
messages, they are off-topic).

Off the topic of what, exactly?

http://www.ruby-lang.org/en/community/mailing-lists/

“Ruby-Talk
This is the most popular mailing-list and deals with general topics
about
Ruby. Ruby-Talk is mirrored by the comp.lang.ruby newsgroup and Ruby-
Forum.com.”

http://rubyhacker.com/clrFAQ.html

"Examples of relevant postings include, but are not limited
to, the following subjects:

    - Bug reports
    - Announcements of software written with Ruby
    - Examples of Ruby code
    - Suggestions for Ruby developers
    - Requests for help from new Ruby programmers"

When people offer you a suggestion, Ilias, that’s not offtopic. It’s
exactly
the opposite of offtopic – “Suggestions for Ruby developers” is in the
official comp.lang.ruby charter as a relevant topic.

On 4 , 21:02, Robert K. [email protected] wrote:
[…]

There is another approach which does not suffer from the side effect of
[…]

Note to readers:

This approach is not usable in the given context (Altering Behaviours
of “each do”).

The code can possibly altered, thus it works on Array#each.

For a solution which works exactly in the given context (Array#each),
see message from “James G.” below (you can ignore all following
messages, they are off-topic).

.

2011/6/5 Ilias L. [email protected]

The code can possibly altered, thus it works on Array#each.

For a solution which works exactly in the given context (Array#each),
see message from “James G.” below (you can ignore all following
messages, they are off-topic).

If you look close enough you will notice that both approaches work
(or don’t) the same way with regard to #each - for the same reason!

robert

On 6 , 02:12, David M. [email protected] wrote:

“Ruby-Talk
- Announcements of software written with Ruby
- Examples of Ruby code
- Suggestions for Ruby developers
- Requests for help from new Ruby programmers”

When people offer you a suggestion, Ilias, that’s not offtopic. It’s exactly
the opposite of offtopic – “Suggestions for Ruby developers” is in the
official comp.lang.ruby charter as a relevant topic.

You like quoting.

Still, your message is 100% off-topic.

But I’ll back off, before people start to suggest cook-recipes or new
techniques of how to go pee.

Really unbelievable all this.

.

On Sunday, June 05, 2011 09:00:31 AM Ilias L. wrote:

http://www.nationmaster.com/encyclopedia/Ilias-Lazaridis

Have you checked the validity of this information? It was copied from
a wikipedia “article” (the original article was deleted, due to
violation of the wikipedia policies).

Probably this page:

http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Ilias_Lazaridis

It doesn’t seem that “violation” was the primary concern, so much as
that
there wasn’t enough reliable information to back it up. If that wasn’t
the
case, I have to imagine that “notability” would’ve kicked in.

The most important thing to learn is:

when is it “expressing negative feelings” and when is it “defamation
of character”:

Legal threats again? Is this the only way you can get anyone to take you
seriously?

Alright, I’ll use your source this time:

http://www.lawinfo.com/fuseaction/Client.lawarea/categoryid/1162

“Defamation is false and unprivileged spoken words or written
publication,
which exposes any living person to hatred, contempt, ridicule, or which
causes
him/her to be shunned or avoided, or which has a tendency to injure
him/her in
his/her trade or occupation.”

So, for you to show that this has occurred, you need to demonstrate that
not
only are these things false, but that they actually cause you to be
shunned,
avoided, hated, ridiculed, etc. I don’t think anything anyone else has
said
about you so far has done more damage to your reputation than you have,
yourself, in very nearly every exchange.

In particular:

“a false statement of fact;
that is understood as
being of and concerning the plaintiff; and
tending to harm the reputation of plaintiff.”

Is anyone here making any false statements of fact about you?

Now, let’s look at possible defenses, if you actually sued one of us:

"What defenses may be available to someone who is sued for defamation?
There are ordinarily 6 possible defenses available to a defendant who is
sued
for libel (published defamatory communication.)

  1. Truth. This is a complete defense, but may be difficult to prove."

While it may be difficult to show that you’re a troll, many of the other
statements about you should be relatively easy to prove, especially when
everything you say has been archived.

" 2. Fair comment on a matter of public interest. This defense applies
to
“opinion” only, as compared to a statement of fact. The defendant
usually
needs to prove that the opinion is honestly held and the comments were
not
motivated by actual “malice.” (Malice means knowledge of falsity or
reckless
disregard for the truth of falsity of the defamatory statement.)"

Most of the statements which seem to bother you so much are also
statements of
opinion – for instance, “It’s not worth our time to respond to Ilias
anymore.”

" 6. Plaintiff’s poor reputation. Defendant can mitigate (lessen)
damages for
a defamatory statement by proving that the plaintiff did not have a good
reputation to begin with. Defendant ordinarily can prove plaintiff’s
poor
reputation by calling witnesses with knowledge of the plaintiff’s prior
reputation relating to the defamatory content."

And there are all kinds of witnesses here.

If you (people) continue to attack me on a professional level, I’ll
have to react at some point.

Please do.

If you do end up suing for defamation, while it’s going to suck for
whoever
ends up defending, it’s also likely to make your reputation that much
worse,
and more widespread. It would be incredibly self-defeating, and all
kinds of
fun to watch.

If you instead react by trying to learn why it is that you’re getting
these
comments – you could start by actually reading them, instead of writing
them
off as “off-topic” or “personal” – then your reputation would likely
improve
dramatically, as would your productivity and your contributions to the
community. People would want to help you, instead of wanting you to go
away.

So, please, set a filter, don’t read or go get a dog.

It’s clear that you’ve already either filtered me or chosen to ignore
everything I have to say. Ah, well. Hopefully this exchange is useful to
someone else, and it will satisfy my curiosity as to whether there’s
anyone
who actually agrees you here.

Or stay calm and focus on the technical stuff.

Gladly, on the condition that you will do the same. That means being
willing
to discuss some context, what problem you’re actually trying to solve,
and
where your “requirements” are coming from.

On 6 , 01:11, Yukihiro M. [email protected] wrote:

|
|Is this possible, without going to C-level?

It’s possible but you have to redefine the each method.

ok

That reminds me Groovy’s it.

I don’t know “Groovy”, but I dislike the “it”, as it cannot be spoken
like “each item” or “each value”.

I’ve just noticed repetitions within code like that:

names.each { |name| puts name} # 3 times “name(s)”

names.each { puts item }

names.each { puts e) # e = entry

Currently I have no plan to change the core like that.

So this would be a low-priority issue?

Would a thoroughly worked out patch be accepted?

.

On 6 Ιούν, 10:14, Robert K. [email protected] wrote:

The code can possibly altered, thus it works on Array#each.

For a solution which works exactly in the given context (Array#each),
see message from “James G.” below (you can ignore all following
messages, they are off-topic).

If you look close enough you will notice that both approaches work
(or don’t) the same way with regard to #each - for the same reason!

I don’t have to “look close enough”

This was the original context (specification):

names = [“Jane”, “Michele”, “Isabella”]

current behaviour

names.each do |name|
print name
end
#Question: How can I alter the behaviour of “each” in the following
way:
names.each do
print item # “item” is used by default
end

The specification is very simple.

Your solution does not work in this context.

The solution from Gray works 100%.

If you like, you can still modify your solution to pass the
specification.

If not, feel free to setup a new context (specification), but please
use a new topic.

.

2011/6/6 Ilias L. [email protected]:

|end
like “each item” or “each value”.

So this would be a low-priority issue?

Would a thoroughly worked out patch be accepted?

I vote against because I prefer explicit function arguments (block
parameters) over implicit ones. The approach with the predefined name
only works well for cases where there is a single argument but will
become ugly soon if you need multiple arguments. Either you need to
use array access (which is worse than using explicit argument names
because those names will make code more readable) or allow mixed mode
(explicit arguments where desired, implicit as default). I do not
believe that this makes code easier to read and less prone to errors.

Btw, what you call “specification” is just an example of a single use
case. For a language change the behavior would need to be uniform
across the board, otherwise it is plain obfuscation. As I hope you
are aware there are multiple implementations of #each - and the number
can and will actually change at runtime. So any change would have to
be applied to all of them - and there is no automatism that could do
it unless you are willing to have a new #each with a different name.

It seems to me that you are suggesting language changes without an
idea of the consequences. Please do a bit more reasoning before you
come up with such suggestions.

robert

On 6 , 01:11, Yukihiro M. [email protected] wrote:

|
|Is this possible, without going to C-level?

It’s possible but you have to redefine the each method.

ok

That reminds me Groovy’s it.

I don’t know “Groovy”, but I dislike the “it”, as it cannot be spoken
like “each item” or “each value”.

I’ve just noticed repetitions within code like that:

names.each { |name| puts name} # 3 times “name(s)”

names.each { puts item }

names.each { puts e) # e = entry

Currently I have no plan to change the core like that.

So this would be a low-priority issue?

Would a thoroughly worked out patch be accepted?

.

Hi,

In message “Re: CORE - Altering Behaviour of “each do” (default param
“item”)”
on Mon, 6 Jun 2011 18:15:32 +0900, Ilias L.
[email protected] writes:

|> That reminds me Groovy’s it.
|
|I don’t know “Groovy”, but I dislike the “it”, as it cannot be spoken
|like “each item” or “each value”.

So being “speakable” is important from your point of view, is it?

|> Currently I have no plan to change the core like that.
|
|So this would be a low-priority issue?
|Would a thoroughly worked out patch be accepted?

I am concerned about compatibility for corner-case behavior and
performance loss, both of which does not seem to be in your interest.

          matz.

On 6 Ιούν, 11:45, Robert K. [email protected] wrote:

2011/6/6 Ilias L. [email protected]:

On 6 Éïýí, 01:11, Yukihiro M. [email protected] wrote:
[…]

Currently I have no plan to change the core like that.

So this would be a low-priority issue?

Would a thoroughly worked out patch be accepted?

I vote against
[…] - (going into details, talking like we’re on a “language-
committee-list” , referring other sub-thread)

This is a user list, not a language committee - would you please
relax a little?

I’ve asked Mr. Matsumoto directly, in a very general way and in
response to his statement “I have currently no plan”.

You may have the decency to await his answer before you continue.

.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs