summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-23 16:53:41 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-23 16:53:41 +0000
commit1b5dce5a4e7e202f00ddc8bc82ae644ca119106d (patch)
treec7de133562839f75481b2cf02a2f90b25cab3464 /NEWS
parent4daa1cf730acbf2838dcd69210f4beafabe83843 (diff)
* NEWS: [DOC] In the new safe call syntax, arguments are evaluated
only if a call is made. * doc/syntax/calling_methods.rdoc: Fix a typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS5
1 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 6be8737..1433dee 100644
--- a/NEWS
+++ b/NEWS
@@ -22,10 +22,13 @@ with all sufficient information, see the ChangeLog file.
* new method call syntax, `object.?foo', method #foo is called on
`object' if it is not nil.
- this is similar to `try!' in Active Support, except for:
+ this is similar to `try!' in Active Support, except:
* method name is syntactically required
obj.try! {} # valid
obj.? {} # syntax error
+ * arguments are evaluated only if a call is made:
+ obj.try!(:foo, bar()) # bar() is always evaluated
+ obj.?foo(bar()) # bar() is conditionally evaluated
* attribute assignment is valid
obj.?attr += 1