Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
A different perspective on Ruby.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 47 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ES  
View profile  
 More options May 25 2005, 11:46 pm
Newsgroups: comp.lang.ruby
From: ES <ruby...@magical-cat.org>
Date: Thu, 26 May 2005 12:46:49 +0900
Local: Wed, May 25 2005 11:46 pm
Subject: [BLOG] A different perspective on Ruby.

This has perhaps been aired here already, if so, apologies.

Someone did not like Ruby; I find it refreshing to read
these takes as well since the actually bring up some
(fairly) valid points, this one moreso than usual.

http://www.ericw.org/rants/showrant.psp?rant=ruby

E

--
template<typename duck>
void quack(duck& d) { d.quack(); }


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Britt  
View profile  
 More options May 26 2005, 12:18 am
Newsgroups: comp.lang.ruby
From: James Britt <jame...@neurogami.com>
Date: Thu, 26 May 2005 13:18:50 +0900
Local: Thurs, May 26 2005 12:18 am
Subject: Re: [BLOG] A different perspective on Ruby.

ES wrote:
> This has perhaps been aired here already, if so, apologies.

> Someone did not like Ruby; I find it refreshing to read
> these takes as well since the actually bring up some
> (fairly) valid points, this one moreso than usual.

> http://www.ericw.org/rants/showrant.psp?rant=ruby

First, an OT question: Is there a Firefox extension that lets me
*quickly* disable/enable page colors?  I know I can do this via the Web
dev tool bar stuff, but it's too many clicks, and sites with white text
on a dark background (hip as that may be) are so painful to look at I
get retina burn before I can finish all that clicking.

About the log entry.  I have a rule of thumb.  If someone is using the
words "shit"  or "fuck" three or four times on page, they quickly lose
all credibility.   (Certain words should be treated like global
variables: saved for special cases and for specific effect.)

I like reading critiques (or criticism, even) of Ruby, but most of what
was mentioned there were straw man arguments.  Certainly POLS is a known
subjective aspect and an easy target.  I expect everyone reading
ruby-talk could  assemble a list of cases where Ruby violates their own
sense of POLS.

James Britt

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com  - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com  - Playing with Better Toys


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin DeMello  
View profile  
 More options May 26 2005, 1:36 am
Newsgroups: comp.lang.ruby
From: Martin DeMello <martindeme...@yahoo.com>
Date: Thu, 26 May 2005 05:36:18 GMT
Local: Thurs, May 26 2005 1:36 am
Subject: Re: [BLOG] A different perspective on Ruby.

James Britt <jame...@neurogami.com> wrote:

> First, an OT question: Is there a Firefox extension that lets me
> *quickly* disable/enable page colors?  I know I can do this via the Web
> dev tool bar stuff, but it's too many clicks, and sites with white text
> on a dark background (hip as that may be) are so painful to look at I
> get retina burn before I can finish all that clicking.

I use a bookmarklet in my bookmarks toolbar for this.

http://www.squarefree.com/bookmarklets/zap.html

martin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luc Heinrich  
View profile  
 More options May 26 2005, 3:51 am
Newsgroups: comp.lang.ruby
From: Luc Heinrich <luc...@mac.com>
Date: Thu, 26 May 2005 16:51:56 +0900
Local: Thurs, May 26 2005 3:51 am
Subject: Re: [BLOG] A different perspective on Ruby.
On 26 mai 05, at 05:46, ES wrote:

> Someone did not like Ruby; I find it refreshing to read
> these takes as well since the actually bring up some
> (fairly) valid points, this one moreso than usual.

Some valid points ? I think this guy does not know what he's talking  
about, or simply did not read the documentation correctly, or is  
simply blinded by something he should unlearn first, or simply likes  
making straw man arguments for the sake of it, or simply likes to  
rant (that I can understand, I like it too :) ).

And calling the language creator(s) "fucktard(s)" really doesn't help  
making a point, really.

--
Luc Heinrich - luc...@mac.com - http://www.honk-honk.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dennis Roberts  
View profile  
 More options May 26 2005, 4:15 am
Newsgroups: comp.lang.ruby
From: Dennis Roberts <denro...@gmail.com>
Date: Thu, 26 May 2005 17:15:36 +0900
Local: Thurs, May 26 2005 4:15 am
Subject: Re: [BLOG] A different perspective on Ruby.
He is 18 and just out of high school and thinks he knows everything.
I think everyone goes through that phase.

On 5/26/05, Luc Heinrich <luc...@mac.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gabriele renzi  
View profile  
 More options May 26 2005, 5:31 am
Newsgroups: comp.lang.ruby
From: gabriele renzi <surrender...@remove-yahoo.it>
Date: Thu, 26 May 2005 09:31:59 GMT
Local: Thurs, May 26 2005 5:31 am
Subject: Re: [BLOG] A different perspective on Ruby.
Martin DeMello ha scritto:

> I use a bookmarklet in my bookmarks toolbar for this.

for *just a second* I've been thinking you used a toolbar to collect
places where ruby-talk shows that POLS relates to Matz' least surprise.
How lovely.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Walrond  
View profile  
 More options May 26 2005, 5:36 am
Newsgroups: comp.lang.ruby
From: Andrew Walrond <and...@walrond.org>
Date: Thu, 26 May 2005 18:36:01 +0900
Local: Thurs, May 26 2005 5:36 am
Subject: Re: [BLOG] A different perspective on Ruby.
On Thursday 26 May 2005 04:46, ES wrote:

> This has perhaps been aired here already, if so, apologies.

> Someone did not like Ruby; I find it refreshing to read
> these takes as well since the actually bring up some
> (fairly) valid points, this one moreso than usual.

> http://www.ericw.org/rants/showrant.psp?rant=ruby

Despite the fucking swearing, he did come up with a list of almost everything
that has confused or annoyed me since I started using ruby.

What he neglected to mention is that Ruby is without doubt the closest attempt
yet at a perfect scripting language. Sure, it has some wrinkles, but I have
high hopes of those being sorted in the next iteration, whether by Matz or by
somebody else standing on his (and other giants) shoulders.

Despite the colourful language, an insightful critique and worth a quick
browse.

Andrew Walrond

PS The lack of documentation regarding method thrown exceptions is perhaps my
favourite criticism. Not at all core, but frustrating as hell when writing
OO /exception driven programs.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gabriele renzi  
View profile  
 More options May 26 2005, 5:37 am
Newsgroups: comp.lang.ruby
From: gabriele renzi <surrender...@remove-yahoo.it>
Date: Thu, 26 May 2005 09:37:05 GMT
Local: Thurs, May 26 2005 5:37 am
Subject: Re: [BLOG] A different perspective on Ruby.
Luc Heinrich ha scritto:

> On 26 mai 05, at 05:46, ES wrote:

>> Someone did not like Ruby; I find it refreshing to read
>> these takes as well since the actually bring up some
>> (fairly) valid points, this one moreso than usual.

> Some valid points ? I think this guy does not know what he's talking  
> about, or simply did not read the documentation correctly, or is  simply
> blinded by something he should unlearn first, or simply likes  making
> straw man arguments for the sake of it, or simply likes to  rant (that I
> can understand, I like it too :) ).

I think this is a bad written rant, but I agree that I'd like implicit
namespace creation a-la python and that it's refreshing to see some ruby
critiques.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Austin Ziegler  
View profile  
 More options May 26 2005, 7:12 am
Newsgroups: comp.lang.ruby
From: Austin Ziegler <halosta...@gmail.com>
Date: Thu, 26 May 2005 20:12:29 +0900
Local: Thurs, May 26 2005 7:12 am
Subject: Re: [BLOG] A different perspective on Ruby.
On 5/25/05, ES <ruby...@magical-cat.org> wrote:

> This has perhaps been aired here already, if so, apologies.

> Someone did not like Ruby; I find it refreshing to read
> these takes as well since the actually bring up some
> (fairly) valid points, this one moreso than usual.

> http://www.ericw.org/rants/showrant.psp?rant=ruby

I haven't seen it, and I see very little valid on that page.

-austin
--
Austin Ziegler * halosta...@gmail.com
               * Alternate: aus...@halostatue.ca


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gsinclair@gmail.com  
View profile  
 More options May 26 2005, 8:32 am
Newsgroups: comp.lang.ruby
From: "gsincl...@gmail.com" <gsincl...@gmail.com>
Date: 26 May 2005 05:32:44 -0700
Local: Thurs, May 26 2005 8:32 am
Subject: Re: A different perspective on Ruby.

"It's 5.abs for absolute value, but Math.sqrt(5) for square root."

Good point.  That bugs me too.  abs is a *function*, not logically a
method.

A few other good points, too.  Shame about the presentation.

Gavin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Schröder  
View profile  
 More options May 26 2005, 8:38 am
Newsgroups: comp.lang.ruby
From: Brian Schröder <ruby.br...@gmail.com>
Date: Thu, 26 May 2005 21:38:34 +0900
Local: Thurs, May 26 2005 8:38 am
Subject: Re: A different perspective on Ruby.
On 26/05/05, gsincl...@gmail.com <gsincl...@gmail.com> wrote:

> ES wrote:

> > http://www.ericw.org/rants/showrant.psp?rant=ruby

> "It's 5.abs for absolute value, but Math.sqrt(5) for square root."

> Good point.  That bugs me too.  abs is a *function*, not logically a
> method.

Why not 5.sqrt instead. Better to ask the object to do something, that
to do something with the object. That allows to use duck typing and
special casing to be done in the "special cased" object. I prefer
"string".length a lot over length(string)

regards,

Brian

> Gavin

--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Florian Frank  
View profile  
 More options May 26 2005, 8:42 am
Newsgroups: comp.lang.ruby
From: "Florian Frank" <fl...@nixe.ping.de>
Date: Thu, 26 May 2005 21:42:58 +0900
Local: Thurs, May 26 2005 8:42 am
Subject: Re: A different perspective on Ruby.

gsincl...@gmail.com wrote:
>Good point.  That bugs me too.  abs is a *function*, not logically a
>method.

What about 5.-@ ?

--
Florian Frank


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin DeMello  
View profile  
 More options May 26 2005, 8:43 am
Newsgroups: comp.lang.ruby
From: Martin DeMello <martindeme...@yahoo.com>
Date: Thu, 26 May 2005 12:43:50 GMT
Local: Thurs, May 26 2005 8:43 am
Subject: Re: A different perspective on Ruby.

gsincl...@gmail.com <gsincl...@gmail.com> wrote:
> ES wrote:

> > http://www.ericw.org/rants/showrant.psp?rant=ruby

> "It's 5.abs for absolute value, but Math.sqrt(5) for square root."

> Good point.  That bugs me too.  abs is a *function*, not logically a
> method.

I'd say conceptually abs belongs with floor, ceil, round and truncate.

martin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cameron McBride  
View profile  
 More options May 26 2005, 8:53 am
Newsgroups: comp.lang.ruby
From: Cameron McBride <cameron.mcbr...@gmail.com>
Date: Thu, 26 May 2005 21:53:47 +0900
Local: Thurs, May 26 2005 8:53 am
Subject: Re: A different perspective on Ruby.
On 5/26/05, Brian Schröder <ruby.br...@gmail.com> wrote:

> On 26/05/05, gsincl...@gmail.com <gsincl...@gmail.com> wrote:
> > ES wrote:

> > > http://www.ericw.org/rants/showrant.psp?rant=ruby

> > "It's 5.abs for absolute value, but Math.sqrt(5) for square root."

> > Good point.  That bugs me too.  abs is a *function*, not logically a
> > method.

> Why not 5.sqrt instead. Better to ask the object to do something, that
> to do something with the object.

I would also agree.  This did make me ponder when I initially found
it.  If they have to be in a module, wouldn't it make sense to have it
be default includeable?

Cameron


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Freeze  
View profile  
 More options May 26 2005, 8:56 am
Newsgroups: comp.lang.ruby
From: Jim Freeze <j...@freeze.org>
Date: Thu, 26 May 2005 21:56:42 +0900
Local: Thurs, May 26 2005 8:56 am
Subject: Re: A different perspective on Ruby.
* gsincl...@gmail.com <gsincl...@gmail.com> [2005-05-26 21:35:19 +0900]:

> "It's 5.abs for absolute value, but Math.sqrt(5) for square root."

> Good point.  That bugs me too.  abs is a *function*, not logically a
> method.

My take is that there are a few methods that apply to floats
and ints and bignums. These (like floor, ceil, abs) are commonly
known, accepted and used functions and it makes sense to make
them methods.

However, my f(x) is likely to be different than your f(x). In
fact, there are an infinite number f(x)'s in the world and
an infinite number of function names. If Ruby included them
into numeric, then I would feel like I was in Java swing. :)

Also, since 9/4 = 2, I'm not so sure that 5.sqrt wouldn't
be 2 or 0, depending upon how you slice it.

> A few other good points, too.  Shame about the presentation.

Nothing that hasn't been said before, but in a much more acceptable
way that promotes good discussion and real action.

Nothing new here people...  move along, move along.

--
Jim Freeze
Ruby: I can explain it to ya but I can't understand it fer ya.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yukihiro Matsumoto  
View profile  
 More options May 26 2005, 9:51 am
Newsgroups: comp.lang.ruby
From: Yukihiro Matsumoto <m...@ruby-lang.org>
Date: Thu, 26 May 2005 22:51:39 +0900
Local: Thurs, May 26 2005 9:51 am
Subject: Re: A different perspective on Ruby.
Hi,

In message "Re: A different perspective on Ruby."
    on Thu, 26 May 2005 21:35:19 +0900, "gsincl...@gmail.com" <gsincl...@gmail.com> writes:

|"It's 5.abs for absolute value, but Math.sqrt(5) for square root."
|
|Good point.  That bugs me too.  abs is a *function*, not logically a
|method.

The definition of abs is not questionable; it returns self, negated
when self is negative, for all numeric value.  On the other hand,
natural sqrt() may return float or integer, or something else.  That's
the reason for sqrt() being a function in Math module.  Note that the
name "Math" means math.h (collection of float value functions) in
Unix, not mathematics in general.

Besides that, he doesn't understand what POLS means.  Since someone
will surprise for any arbitrary choice, it is impossible to satisfy
"least surprise" in his sense.  The truth is two folds: a) when there
are two or more choices in the language design decision, I take the
one that makes _me_ surprise least.  b) as a result, you will have
less surprise in Ruby than other languages, once you have accustomed
to it.

But I'm tired of explaining POLS again and again.  I haven't even used
it first.  I hope no one will use the term "POLS" any more to sell
Ruby.  It's free after all.

                                                        matz.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay Levitt  
View profile  
 More options May 26 2005, 10:32 am
Newsgroups: comp.lang.ruby
From: Jay Levitt <jay+n...@jay.fm>
Date: Thu, 26 May 2005 10:32:36 -0400
Local: Thurs, May 26 2005 10:32 am
Subject: Re: A different perspective on Ruby.
In article <1117115503.104127.21363.nullmai...@x31.priv.netlab.jp>,
m...@ruby-lang.org says...

> Besides that, he doesn't understand what POLS means.  Since someone
> will surprise for any arbitrary choice, it is impossible to satisfy
> "least surprise" in his sense.  The truth is two folds: a) when there
> are two or more choices in the language design decision, I take the
> one that makes _me_ surprise least.  b) as a result, you will have
> less surprise in Ruby than other languages, once you have accustomed
> to it.

Nicely put.  I suggest we start referring to the POMLS - Principle of
Matz's Least Surprise.  That way, if anyone ever debates it, you can pop
in and say "I wasn't surprised at all," thus authoritatively refuting
the argument!

--
Jay Levitt                |
Wellesley, MA             | I feel calm.  I feel ready.  I can only
Faster: jay at jay dot fm | conclude that's because I don't have a
http://www.jay.fm         | full grasp of the situation. - Mark Adler


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ES  
View profile  
 More options May 26 2005, 12:31 pm
Newsgroups: comp.lang.ruby
From: ES <ruby...@magical-cat.org>
Date: Fri, 27 May 2005 01:31:48 +0900
Local: Thurs, May 26 2005 12:31 pm
Subject: Re: [BLOG] A different perspective on Ruby.

Le 26/5/2005, "James Britt" <jame...@neurogami.com> a écrit:

Ah, yes. I forgot to append a disclaimer about the language.

>I like reading critiques (or criticism, even) of Ruby, but most of what
>was mentioned there were straw man arguments.  Certainly POLS is a known
>subjective aspect and an easy target.  I expect everyone reading
>ruby-talk could  assemble a list of cases where Ruby violates their own
>sense of POLS.

Sometimes it is good to know what the other people think is surprising;
not because it violates some imaginary principle but because it might
actually be a good idea to re-evaluate a given aspect to make it more
obvious.

>James Britt

E

--
template<typename duck>
void quack(duck& d) { d.quack(); }


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Freeze  
View profile  
 More options May 26 2005, 3:08 pm
Newsgroups: comp.lang.ruby
From: Jim Freeze <j...@freeze.org>
Date: Fri, 27 May 2005 04:08:14 +0900
Local: Thurs, May 26 2005 3:08 pm
Subject: Re: A different perspective on Ruby.
* Jay Levitt <jay+n...@jay.fm> [2005-05-26 23:35:18 +0900]:

> > Besides that, he doesn't understand what POLS means.  Since someone

> Nicely put.  I suggest we start referring to the POMLS - Principle of
> Matz's Least Surprise.  That way, if anyone ever debates it, you can pop
> in and say "I wasn't surprised at all," thus authoritatively refuting
> the argument!

I think if you read Matz' post carefully, you will see that he
is not the originator of POLS. So, I don't think he wants any
POLS attached to himself, even POMLS. This would be a repeat of
what happed with POLS.

Besides, if we drop the POLS thing, then we can spare the poor
misguided, uninformed (slack jawed, lazy eyed) individuals who
write long articles trying to sound intelligent and authoritate
on a subject that they know nothing about from making fools of
themselves.

--
Jim Freeze
Ruby: I can explain it to ya but I can't understand it fer ya.
It is best to keep your mouth shut and let others think you
an idiot than to open it and remove all doubt.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glenn Parker  
View profile  
 More options May 26 2005, 4:11 pm
Newsgroups: comp.lang.ruby
From: Glenn Parker <glenn.par...@comcast.net>
Date: Fri, 27 May 2005 05:11:24 +0900
Local: Thurs, May 26 2005 4:11 pm
Subject: Re: A different perspective on Ruby.

Brian Schröder wrote:
> On 26/05/05, gsincl...@gmail.com <gsincl...@gmail.com> wrote:
>>ES wrote:

>>>http://www.ericw.org/rants/showrant.psp?rant=ruby

>>"It's 5.abs for absolute value, but Math.sqrt(5) for square root."

>>Good point.  That bugs me too.  abs is a *function*, not logically a
>>method.

> Why not 5.sqrt instead.

Hmmm, prefix, postfix, or infix?  Functional or object-oriented?
These are bottomless questions.

One justification for sqrt(5) would be that "sqrt", works on more than
one class of objects (Fixnum, Bignum, Rational, etc).  So does "abs" for
that matter, and I'm not crazy about 5.abs.  As a method, sqrt would
have to be defined in every applicable class, either with new code or as
an included module.  This spreads the definition out, which complicates
maintainence.

Another reason is that the prefix style, sqrt(5), is somewhat closer to
the typical mathematical notation.  I can't think of any unary
mathematical operations that are naturally postfix, unless you count
C++'s post-decrement and post-increment.

This is all just criticism of library design, which is very much a
matter of style and taste.  The "standard" library could stand some
attention to smooth out these style bumps, possibly by allowing either
prefix or postfix styles whenever possible.  Then questions of style
would be forwarded to the programmer.

--
Glenn Parker | glenn.parker-AT-comcast.net | <http://www.tetrafoil.com/>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
why the lucky stiff  
View profile  
 More options May 26 2005, 4:25 pm
Newsgroups: comp.lang.ruby
From: why the lucky stiff <ruby-t...@whytheluckystiff.net>
Date: Fri, 27 May 2005 05:25:05 +0900
Local: Thurs, May 26 2005 4:25 pm
Subject: Re: A different perspective on Ruby.

Martin DeMello wrote:
> I'd say conceptually abs belongs with floor, ceil, round and truncate.

And where do you stand in regard to .succ?

_why


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe Van Dyk  
View profile  
 More options May 26 2005, 4:26 pm
Newsgroups: comp.lang.ruby
From: Joe Van Dyk <joevan...@gmail.com>
Date: Fri, 27 May 2005 05:26:39 +0900
Local: Thurs, May 26 2005 4:26 pm
Subject: Re: A different perspective on Ruby.
On 5/26/05, Glenn Parker <glenn.par...@comcast.net> wrote:

I think the guy's point was "omg, they said everything was an object!
"hi".length == 2 and stuff!  But not sqrt(5)!  Like, omg you farking
farktards are farking dumb! So much for POLS!!!1"

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josh  
View profile  
 More options May 26 2005, 5:07 pm
Newsgroups: comp.lang.ruby
From: Josh <huber+n...@alum.wpi.edu>
Date: Thu, 26 May 2005 17:07:59 -0400
Local: Thurs, May 26 2005 5:07 pm
Subject: Re: A different perspective on Ruby.
Joe Van Dyk <joevan...@gmail.com> writes:

> I think the guy's point was "omg, they said everything was an
> object!  "hi".length == 2 and stuff!  But not sqrt(5)!  Like,
> omg you farking farktards are farking dumb! So much for
> POLS!!!1"

Looks like a nice summary of his whole rant. ;)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
johng  
View profile  
 More options May 26 2005, 8:10 pm
Newsgroups: comp.lang.ruby
From: "johng" <jgoa...@gmail.com>
Date: 26 May 2005 17:10:51 -0700
Local: Thurs, May 26 2005 8:10 pm
Subject: Re: A different perspective on Ruby.
|"It's 5.abs for absolute value, but Math.sqrt(5) for square root."
|
|Good point.  That bugs me too.  abs is a *function*, not logically a
|method.

> The definition of abs is not questionable; it returns self, negated
> when self is negative, for all numeric value.  On the other hand,
> natural sqrt() may return float or integer, or something else.  That's
> the reason for sqrt() being a function in Math module.

I may be missing something, but why does it matter what the return
type is?

What is wrong with always returning a float just like Math.sqrt does?

-alternatively, although I prefer the first option-

Why couldn't the implementation of sqrt "cast" the result to an
instance
of the current self's type? So, if you ask an integer to sqrt, you get
an
integer back?

Like I said, maybe I am missing something, but it seems that
sqrt is a verb applied to numbers.

John.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ES  
View profile  
 More options May 26 2005, 8:42 pm
Newsgroups: comp.lang.ruby
From: ES <ruby...@magical-cat.org>
Date: Fri, 27 May 2005 09:42:35 +0900
Local: Thurs, May 26 2005 8:42 pm
Subject: Re: A different perspective on Ruby.

Le 27/5/2005, "johng" <jgoa...@gmail.com> a écrit:

Well, essentially this is all that is required:

irb(main):018:0> class Fixnum
irb(main):019:1>   def method_missing(sym, *args, &block)
irb(main):020:2>     return Math.send sym, self, *args, &block
irb(main):021:2>   end
irb(main):022:1> end
=> nil
irb(main):023:0> 100.sqrt
=> 10.0
irb(main):024:0>

It is obviously not very robust but it took about eight seconds
to implement.

>John.

E

--
template<typename duck>
void quack(duck& d) { d.quack(); }


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 47   Newer >
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google