Forum: Ruby ruby suggestion feedback

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2007-07-07 01:26
Hmm. I realize these have been discussed before, but... (terrible way to
start a post, I know).
I for one, being the terrible newbie I am, would like to suggest the
following change to Ruby (like RCR it).
Variable parameter assignment in function calls. (sorry)
i.e. the following:
function_x(3,4,failure=true,options=false)

(by default, not using hashes).  This allows for more understandable
code than
function_x(3,4,true,true,1,true,false) # does anyone after 3 months
remember what each of those MEANT? [note the true,false at the
end--those were my "failure" and "options," from the first example].
I'm not saying Ruby is bad, just that this would be better.

Any thoughts?  Should I RCR it?

Thanks!
-Roger
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2007-07-07 03:08
(Received via mailing list)
Hi --

On Sat, 7 Jul 2007, Roger Pack wrote:

> function_x(3,4,true,true,1,true,false) # does anyone after 3 months
> remember what each of those MEANT? [note the true,false at the
> end--those were my "failure" and "options," from the first example].
> I'm not saying Ruby is bad, just that this would be better.
>
> Any thoughts?  Should I RCR it?

All this stuff (argument syntax and semantics, keyword arguments,
etc.) is very much on the radar already.  I don't think there's
anything to be gained by submitting an RCR for one particular version
of it.  In 1.9 you've got hash shortcuts and possibly other things
already coming:

   x(failure: true, options: false, ...)

(May not be a working example but that's the kind of thing.)


David
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2007-07-18 21:21
Here's another thought.  Who would vote for this?
"rescue => detail" catching Exception by default


unknown wrote:
> Hi --
>
> On Sat, 7 Jul 2007, Roger Pack wrote:
>
>> function_x(3,4,true,true,1,true,false) # does anyone after 3 months
>> remember what each of those MEANT? [note the true,false at the
>> end--those were my "failure" and "options," from the first example].
>> I'm not saying Ruby is bad, just that this would be better.
>>
>> Any thoughts?  Should I RCR it?
>
> All this stuff (argument syntax and semantics, keyword arguments,
> etc.) is very much on the radar already.  I don't think there's
> anything to be gained by submitting an RCR for one particular version
> of it.  In 1.9 you've got hash shortcuts and possibly other things
> already coming:
>
>    x(failure: true, options: false, ...)
>
> (May not be a working example but that's the kind of thing.)
>
>
> David
Cf7cd97cdc8ed7d4ae92965b24f0dfad?d=identicon&s=25 Stefan Rusterholz (apeiros)
on 2007-07-18 21:31
Roger Pack wrote:
> Here's another thought.  Who would vote for this?
> "rescue => detail" catching Exception by default

I wouldn't. The current behaviour is good.
Sadly though there are some library writers out there inheriting from
Exception instead of StandardError for non-fatal stuff.

Regards
Stefan
703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2007-07-18 21:51
(Received via mailing list)
On 7/18/07, Roger Pack <rogerpack2005@gmail.com> wrote:
> Here's another thought.  Who would vote for this?
> "rescue => detail" catching Exception by default
Oh no, it might be a good feature I dunno, but it would be terribly
abused...
I do not see any obvious advantage that would justify that risk.

For what concerns your first suggestion it is a good one, Bravo for a
newbie ( you might come from Python ;) but David is right, this is
about to be addressed already....

Cheers
Robert
851acbab08553d1f7aa3eecad17f6aa9?d=identicon&s=25 Ken Bloom (Guest)
on 2007-07-18 22:42
(Received via mailing list)
On Thu, 19 Jul 2007 04:31:33 +0900, Stefan Rusterholz wrote:

> Roger Pack wrote:
>> Here's another thought.  Who would vote for this? "rescue => detail"
>> catching Exception by default
>
> I wouldn't. The current behaviour is good. Sadly though there are some
> library writers out there inheriting from Exception instead of
> StandardError for non-fatal stuff.

Probably under the influence of Java.

--Ken
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2007-08-03 18:58
Stefan Rusterholz wrote:
> Roger Pack wrote:
>> Here's another thought.  Who would vote for this?
>> "rescue => detail" catching Exception by default
>
> I wouldn't. The current behaviour is good.
> Sadly though there are some library writers out there inheriting from
> Exception instead of StandardError for non-fatal stuff.
>
> Regards
> Stefan

Yeah it just gets me that things like Timeout::Error does not inherit
from StandardError.  I agree.
This topic is locked and can not be replied to.