From bd2a8e3afbf72936b59d9aae32168b1b5a22bc23 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Mon, 1 Apr 2013 11:39:02 -0400 Subject: [PATCH] Docs: note about postfix precedence on Tasks page --- src/sphinx/Detailed-Topics/Tasks.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sphinx/Detailed-Topics/Tasks.rst b/src/sphinx/Detailed-Topics/Tasks.rst index 95b96d884..b5533550b 100644 --- a/src/sphinx/Detailed-Topics/Tasks.rst +++ b/src/sphinx/Detailed-Topics/Tasks.rst @@ -148,7 +148,7 @@ following example, ``test:sampleTask`` uses the result of On precedence ~~~~~~~~~~~~~ -As a reminder, method precedence is by the name of the method. +As a reminder, infix method precedence is by the name of the method and postfix methods have lower precedence than infix methods. 1. Assignment methods have the lowest precedence. These are methods with names ending in ``=``, except for ``!=``, ``<=``, ``>=``, and names @@ -165,6 +165,15 @@ Therefore, the the previous example is equivalent to the following: (sampleTask in Test).:=( (intTask in Compile).value * 3 ) +Additionally, the braces in the following are necessary: + +:: + + helloTask := { "echo Hello" ! } + +Without them, Scala interprets the line as ``( helloTask.:=("echo Hello") ).!`` +instead of the desired ``helloTask.:=( "echo Hello".! )``. + Separating implementations --------------------------