Violation of Principle of Least Surprise

I’m writing this to report a bug as related to Ruby’s principle of
least surprise regarding nested string interpolation. I was happily
coding along and accidently constructed something equivalent to the
following:

list = %w{yes it can}
puts %Q! Nested string interpolation
cannot be done in ruby…
#{
list.map {
>elem>
"… #{elem} …" # weird nest
}
}
!

I was so certain this wouldn’t work that I barely bothered to test it.
Imagine my surprise at seeing the following:

Nested string interpolation
cannot be done in ruby…
… yes … it … can …

So, the bug is that Ruby is “too slick”, and I demand that this bug be
"patched" to insure fair competition with other languages. Am I correct
in assuming that parse.y would be the proper place to start tracking down
this “problem”?

Sincerely,
Travis Whitton whitton@atlantic.net

p.s., yes this is a joke :wink:

I’m writing this to report a bug as related to Ruby’s principle of
least surprise regarding nested string interpolation. I was happily
coding along and accidently constructed something equivalent to the
following:

list = %w{yes it can}
puts %Q! Nested string interpolation
cannot be done in ruby…
#{
list.map {
>elem>
“… #{elem} …” # weird nest
}
}
!

I was so certain this wouldn’t work that I barely bothered to test it.
Imagine my surprise at seeing the following:

Nested string interpolation
cannot be done in ruby…
… yes … it … can …

So, the bug is that Ruby is “too slick”, and I demand that this bug be

IMO Ruby’s design is broken with regard to slickness. Furthermore, it
seems that matz won’t ever even consider to fix this bug. It probably
could only be solved if he were hit by a bus.

IMNSHO Rubyists who — justifiedly — view this as a bug should
seriously consider to move to Basic, which arguably provides the
ultimate brain-dead-language experience.

“patched” to insure fair competition with other languages. Am I correct
in assuming that parse.y would be the proper place to start tracking down
this “problem”?

I think the best way to cope with Ruby’s excessive slickness is, ahem,
doing something about matz. You understand what I mean.

Sincerely,
Travis Whitton whitton@atlantic.net

p.s., yes this is a joke :wink:

And a good one :slight_smile: better than by baroque humor.

···

On Fri, Oct 04, 2002 at 04:26:28AM +0900, Travis Whitton wrote:


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

  • gb notes that fdisk thinks his cdrom can store one terabyte
    – Seen on #Linux

I’ve been thinking on this for some time and I’m now convinced that Ruby
is fundamentally flawed, for its very existence violates the POLS.

Who wasn’t surprised first when he discovered Ruby is so cool?

···

On Fri, Oct 04, 2002 at 04:59:24PM +0900, Mauricio Fernández wrote:

On Fri, Oct 04, 2002 at 04:26:28AM +0900, Travis Whitton wrote:

I’m writing this to report a bug as related to Ruby’s principle of
least surprise regarding nested string interpolation.


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

No, that’s wrong too. Now there’s a race condition between the rm and
the mv. Hmm, I need more coffee.
– Guy Maor on Debian Bug#25228

Hi,

···

In message “Re: Violation of Principle of Least Surprise” on 02/10/04, Mauricio Fernández batsman.geo@yahoo.com writes:

I think the best way to cope with Ruby’s excessive slickness is, ahem,
doing something about matz. You understand what I mean.

That’s exactly why I usually hide in an island in the far east.

						matz.