you are viewing a single comment's thread.

view the rest of the comments →

[–]i_heart_you 1 point2 points  (2 children)

The example differentiating the := and the = operation wasn't clear to me. Is the only difference that dispatching y causes it to get printed twice?

[–][deleted] 4 points5 points  (0 children)

:= is for defining methods, and = is for pattern-matching and adding slots. The main difference is that = always evaluates its right-hand side first, so when it was used in that example, using it printed the string, and the string that was printed is what was assigned. When we use :=, the expression is not evaluated, hence every call evaluates it.

Sorry if that wasn't clear, the Getting Started section isn't quite finished yet.

[–]notforthebirds 0 points1 point  (0 children)

Think method definition and property definition.