From: Seebs on
On 2009-11-09, Tony Arcieri <tony(a)medioh.com> wrote:
> The only reasons it's impossible are cultural, not technical. If you think
> there's a valid technical reason why it's "impossible" to implement perhaps
> you'd care to state it.

It's impossible to implement as a method. You could introduce it as
syntactic sugar, but it's not so clear that this would be worth the
trouble. In particular, incrementing is inefficient in Ruby because
it would involve creating many new objects to iterate.

-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: Aldric Giacomoni on
Tony Arcieri wrote:
> The only reasons it's impossible are cultural, not technical. If you
> think
> there's a valid technical reason why it's "impossible" to implement
> perhaps
> you'd care to state it.

Tony, as I said: I am merely a fledgling Ruby enthusiast. I'm reading
"Best Practices in Ruby" and had to tape my jaw to my skull so it would
stop falling off.
This being said, YOU are welcome to implement the '++' operator and let
us know how it works. I can tell you're vastly more knowledgeable than I
am (yet! I will catch up to you! mwa ha ha!), so please show us.
--
Posted via http://www.ruby-forum.com/.

From: David A. Black on
Hi --

On Tue, 10 Nov 2009, Aldric Giacomoni wrote:

> Marnen Laibow-Koser wrote:
>> Aldric Giacomoni wrote:
>>> Marnen Laibow-Koser wrote:
>>>
>>>> Would you? Or would you rather see
>>>> count = blahblahblah.count do |args|
>>>> lots_of_stuff
>>>> condition
>>>> end
>
> a = [1,2,3,4]
> b = 0
> # 'nip' is undefined outside the block
> irb(main):393:0> b = a.size do |nip|
> irb(main):394:1* puts nip * 2
> irb(main):395:1> nip > 6
> irb(main):396:1> end
> => 4
> irb(main):397:0> b = a.size do |nip|
> irb(main):398:1* puts nip * 2
> irb(main):399:1> nip < 6
> irb(main):400:1> end
> => 4
>
> I don't understand this block.
> Aussi, si je puis me permettre - le Francais est une langue, et Ruby est
> un langage (de programmation). Yet another one of those french
> subtleties!

http://dablog.rubypal.com/2007/4/17/the-l-in-dsl-langue-ou-langage

:-) (Not the same topic obviously but your comment made me think of
it.)


David

--
The Ruby training with D. Black, G. Brown, J.McAnally
Compleat Jan 22-23, 2010, Tampa, FL
Rubyist http://www.thecompleatrubyist.com

David A. Black/Ruby Power and Light, LLC (http://www.rubypal.com)

From: Aldric Giacomoni on
David A. Black wrote:
> Hi --
>
> On Tue, 10 Nov 2009, Aldric Giacomoni wrote:
>> Aussi, si je puis me permettre - le Francais est une langue, et Ruby est
>> un langage (de programmation). Yet another one of those french
>> subtleties!
>
> http://dablog.rubypal.com/2007/4/17/the-l-in-dsl-langue-ou-langage
>
> :-) (Not the same topic obviously but your comment made me think of
> it.)

Actually, David, I believe that you are right on the mark with that
reference :)
--
Posted via http://www.ruby-forum.com/.

From: TonyMc on
Tony Arcieri <tony(a)medioh.com> writes:

> I still find this most appropriate:

OK, that gets you killfiled. Getting ruby wrong is not so bad, you just
need to learn from the other posts in this thread. Getting real life
wrong is another, and much more serious.

Tony