Replies: 2 comments 3 replies
-
Yes, the current rule is "function starts with If you start extending leftward, you don't know how far to go. (Potentially, you could go arbitrarily far.) Then the feeling is maybe you really need an arrow wrapper to specify where. But there are some interesting exceptions, proposed in #480, where we don't already have a meaning. I guess |
Beta Was this translation helpful? Give feedback.
-
#1070, which has been mostly implemented, provides a reasonable solution to this question, I believe. And there's even a reasonable definition of how high things lift. |
Beta Was this translation helpful? Give feedback.
-
I don't feel like the cheatsheet quite makes clear what expressions in which
&
occurs qualify as single-argument function (shorthand) expressions (SAFEs ;-).Experimenting, the following are all SAFEs:
&.prop
,&.method(a).chained
,!&
,-&
,&+3
,-&*2,
& > 3`as well as
whereas none of the following are
So the rule seems to be something like "the leftmost identifier-or-number is
&
". Does that sound about right? Is there a technical reason that only the leftmost thing (not counting prefix unary operators) being&
can trigger this? Or could it work that3 - &
would be SAFE? (etc., etc.) And if so, would it be a good idea?Beta Was this translation helpful? Give feedback.
All reactions