From symingz at foxmail.com Sat Apr 10 13:57:36 2010 From: symingz at foxmail.com (=?ISO-8859-1?B?c3ltaW5neg==?=) Date: Sat, 10 Apr 2010 19:57:36 +0800 Subject: [sbe-discussion] I think section 4.3 is problematic Message-ID: Hi there, I think section 4.3 (Message composition) of the book is problematic. The section presents the precedence of message types and the left association rule as the order in which messages are sent, but I think these are really just parsing rules. The correct way of determining message send order using these rules is like this. First, use the rules to find the fully parenthesized equivalent of a given expression, e.g. '1 + 2 + x a' should equals '(1 + 2) + (x a)', not '((1 + 2) + x) a' or '1 + (2 + (x a))'. Second, evaluate the fully parenthesized expression from left to right, from inside to outside. What the book says is different, though. For example, when '(1 + 2) + (x a)' is evaluated, '+ 2' is be sent before 'a', but if we follow the book, the reverse will be assumed. If '+' and 'a' are replaced with some selector with side effects, following the book will lead to error. From oscar at iam.unibe.ch Mon Apr 12 20:22:27 2010 From: oscar at iam.unibe.ch (Oscar Nierstrasz) Date: Mon, 12 Apr 2010 20:22:27 +0200 Subject: [sbe-discussion] Re: I think section 4.3 is problematic In-Reply-To: References: Message-ID: <0F0246B8-F85E-4892-91B9-54F18C25D541@iam.unibe.ch> Ouch! You are absolutely right. We need to fix this! - on On Apr 10, 2010, at 13:57, symingz wrote: > Hi there, I think section 4.3 (Message composition) of the book is problematic. > The section presents the precedence of message types and the left association > rule as the order in which messages are sent, but I think these are really just parsing > rules. > The correct way of determining message send order using these rules is like this. > First, use the rules to find the fully parenthesized equivalent of a given expression, > e.g. '1 + 2 + x a' should equals '(1 + 2) + (x a)', not '((1 + 2) + x) a' or '1 + (2 + (x a))'. > Second, evaluate the fully parenthesized expression from left to right, from inside to > outside. > What the book says is different, though. For example, when '(1 + 2) + (x a)' is > evaluated, '+ 2' is be sent before 'a', but if we follow the book, the reverse will be > assumed. If '+' and 'a' are replaced with some selector with side effects, following > the book will lead to error. > > _______________________________________________ > Sbe-discussion mailing list > Sbe-discussion at iam.unibe.ch > https://www.iam.unibe.ch/mailman/listinfo/sbe-discussion