Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
[ruby-trunk - Feature #7346][Open] object(...) as syntax sugar for object.call(...)
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
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
rosenfeld (Rodrigo Rosenfeld Rosas)  
View profile  
 More options Nov 13 2012, 6:50 am
From: "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.ro...@gmail.com>
Date: Tue, 13 Nov 2012 20:50:14 +0900
Local: Tues, Nov 13 2012 6:50 am
Subject: [ruby-core:49298] [ruby-trunk - Feature #7346][Open] object(...) as syntax sugar for object.call(...)

Issue #7346 has been reported by rosenfeld (Rodrigo Rosenfeld Rosas).

----------------------------------------
Feature #7346: object(...) as syntax sugar for object.call(...)
https://bugs.ruby-lang.org/issues/7346

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Open
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: Next Major

I propose for the parser to interpret "object(...)" as "object.call(...)". It should raise NoMethodError at runtime if object doesn't respond to "call".

This would read better than using "call":

double = -> n { n * 2 }

double(3) == 6

Sorry if this has already been proposed before (and rejected) but I couldn't find any references to something like this using Redmine's search interface.

--
http://bugs.ruby-lang.org/


 
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.
Discussion subject changed to "[ruby-trunk - Feature #7346][Rejected] object(...) as syntax sugar for object.call(...)" by matz (Yukihiro Matsumoto)
matz (Yukihiro Matsumoto)  
View profile  
 More options Nov 13 2012, 6:59 am
From: "matz (Yukihiro Matsumoto)" <m...@ruby-lang.org>
Date: Tue, 13 Nov 2012 20:59:33 +0900
Local: Tues, Nov 13 2012 6:59 am
Subject: [ruby-core:49299] [ruby-trunk - Feature #7346][Rejected] object(...) as syntax sugar for object.call(...)

Issue #7346 has been updated by matz (Yukihiro Matsumoto).

Status changed from Open to Rejected

I have once tried, but it caused serious incompatibility problem for example:

  p = Object.new
  p(15)

So compromise with object.() syntax introduced in 1.9.

Matz.

----------------------------------------
Feature #7346: object(...) as syntax sugar for object.call(...)
https://bugs.ruby-lang.org/issues/7346#change-32857

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Rejected
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: Next Major

I propose for the parser to interpret "object(...)" as "object.call(...)". It should raise NoMethodError at runtime if object doesn't respond to "call".

This would read better than using "call":

double = -> n { n * 2 }

double(3) == 6

Sorry if this has already been proposed before (and rejected) but I couldn't find any references to something like this using Redmine's search interface.

--
http://bugs.ruby-lang.org/


 
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.
Discussion subject changed to "[ruby-trunk - Feature #7346] object(...) as syntax sugar for object.call(...)" by rosenfeld (Rodrigo Rosenfeld Rosas)
rosenfeld (Rodrigo Rosenfeld Rosas)  
View profile  
 More options Nov 13 2012, 7:02 am
From: "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.ro...@gmail.com>
Date: Tue, 13 Nov 2012 21:02:11 +0900
Local: Tues, Nov 13 2012 7:02 am
Subject: [ruby-core:49300] [ruby-trunk - Feature #7346] object(...) as syntax sugar for object.call(...)

Issue #7346 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas).

Ah, ok, I didn't know about this syntax until now. What does the code above do?
----------------------------------------
Feature #7346: object(...) as syntax sugar for object.call(...)
https://bugs.ruby-lang.org/issues/7346#change-32858

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Rejected
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: Next Major

I propose for the parser to interpret "object(...)" as "object.call(...)". It should raise NoMethodError at runtime if object doesn't respond to "call".

This would read better than using "call":

double = -> n { n * 2 }

double(3) == 6

Sorry if this has already been proposed before (and rejected) but I couldn't find any references to something like this using Redmine's search interface.

--
http://bugs.ruby-lang.org/


 
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.
matz (Yukihiro Matsumoto)  
View profile  
 More options Nov 13 2012, 7:15 am
From: "matz (Yukihiro Matsumoto)" <m...@ruby-lang.org>
Date: Tue, 13 Nov 2012 21:15:20 +0900
Local: Tues, Nov 13 2012 7:15 am
Subject: [ruby-core:49301] [ruby-trunk - Feature #7346] object(...) as syntax sugar for object.call(...)

Issue #7346 has been updated by matz (Yukihiro Matsumoto).

We easily forget conflict between method names and variable names, in a language like Ruby, where methods and variables have separated name space.

We expect p(15) to print 15 even when we have a variable named p in the scope.

Matz.

----------------------------------------
Feature #7346: object(...) as syntax sugar for object.call(...)
https://bugs.ruby-lang.org/issues/7346#change-32859

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Rejected
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: Next Major

I propose for the parser to interpret "object(...)" as "object.call(...)". It should raise NoMethodError at runtime if object doesn't respond to "call".

This would read better than using "call":

double = -> n { n * 2 }

double(3) == 6

Sorry if this has already been proposed before (and rejected) but I couldn't find any references to something like this using Redmine's search interface.

--
http://bugs.ruby-lang.org/


 
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.
rosenfeld (Rodrigo Rosenfeld Rosas)  
View profile  
 More options Nov 13 2012, 8:02 am
From: "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.ro...@gmail.com>
Date: Tue, 13 Nov 2012 22:02:01 +0900
Local: Tues, Nov 13 2012 8:02 am
Subject: [ruby-core:49302] [ruby-trunk - Feature #7346] object(...) as syntax sugar for object.call(...)

Issue #7346 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas).

Ah, of course! :D I totally forgot about Kernel#p! :P

Yes, that makes total sense.
----------------------------------------
Feature #7346: object(...) as syntax sugar for object.call(...)
https://bugs.ruby-lang.org/issues/7346#change-32860

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Rejected
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: Next Major

I propose for the parser to interpret "object(...)" as "object.call(...)". It should raise NoMethodError at runtime if object doesn't respond to "call".

This would read better than using "call":

double = -> n { n * 2 }

double(3) == 6

Sorry if this has already been proposed before (and rejected) but I couldn't find any references to something like this using Redmine's search interface.

--
http://bugs.ruby-lang.org/


 
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.
Discussion subject changed to "[ruby-trunk - Feature #7346][Open] object(...) as syntax sugar for object.call(...)" by Nathan Broadbent
Nathan Broadbent  
View profile  
 More options Nov 13 2012, 2:13 pm
From: Nathan Broadbent <nathan....@gmail.com>
Date: Wed, 14 Nov 2012 04:13:44 +0900
Local: Tues, Nov 13 2012 2:13 pm
Subject: [ruby-core:49314] Re: [ruby-trunk - Feature #7346][Open] object(...) as syntax sugar for object.call(...)

@rosenfeld, I'll just mention that you can use Proc#[] in your example:

double = -> n { n * 2 }

double[3] == 6  #=> true

On Wednesday, 14 November 2012, rosenfeld (Rodrigo Rosenfeld Rosas) wrote:


 
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.
Discussion subject changed to "[ruby-trunk - Feature #7346] object(...) as syntax sugar for object.call(...)" by rosenfeld (Rodrigo Rosenfeld Rosas)
rosenfeld (Rodrigo Rosenfeld Rosas)  
View profile  
 More options Nov 13 2012, 2:57 pm
From: "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.ro...@gmail.com>
Date: Wed, 14 Nov 2012 04:57:44 +0900
Local: Tues, Nov 13 2012 2:57 pm
Subject: [ruby-core:49316] [ruby-trunk - Feature #7346] object(...) as syntax sugar for object.call(...)

Issue #7346 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas).

Yes, I know, it is just that I prefer to read object.call(arguments) than object[arguments]. This is just a personal opinion, I know and I can change my mind some day about this :)
----------------------------------------
Feature #7346: object(...) as syntax sugar for object.call(...)
https://bugs.ruby-lang.org/issues/7346#change-32875

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Rejected
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: Next Major

I propose for the parser to interpret "object(...)" as "object.call(...)". It should raise NoMethodError at runtime if object doesn't respond to "call".

This would read better than using "call":

double = -> n { n * 2 }

double(3) == 6

Sorry if this has already been proposed before (and rejected) but I couldn't find any references to something like this using Redmine's search interface.

--
http://bugs.ruby-lang.org/


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »