-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$sequence-of-maps ? info() #1240
Comments
While I’m generally in favor of sequence processing, I feel this could be over the top. It would make |
This doesn't feel to me like a very strong argument. |
I’d like to add that the new proposal reminds me of another one that got rejected a while ago… #707 (comment) Personally, I would certainly use the new syntax (let’s see what others say). When I occassionally present the new features to potential future users, my impression is that 4.0 evolves more and more into an expert language, and we won’t deter this target group anyway. As far as I can judge, the most popular features of 4.0 will be the map constructor without the |
I'm getting more into the habit of using expressions like It's tempting to try I'm also starting to realise that such expressions lead to a requirement for deduplication if two items have the same parent. I'll park that issue for the moment until I understand it better. |
We're increasingly using the design pattern where maps contain entries that are function items. If
$map
is a map and it has an entryinfo
that is a zero-arity function, then$map ? info()
invokes the function. This looks appealingly as if it's a method application applying the methodinfo()
on the object$map
, but that's not actually what's really going on underneath. What is really happening is that we evaluate($map ? info)
which yields a function item, and then we dynamically call this function.Now what if
$maps
is a sequence of maps each of which has aninfo
field? This parses as($maps ? info)()
.$maps ? info
returns a sequence of function items, and a dynamic function call can't be applied to a sequence of functions items. Instead you have to write($maps ? info)!.()
which feels fairly bizarre.Should we allow the LHS of a dynamic function call to be a sequence? On the whole, I don't tend to like operations to do implicit mapping over one of the arguments, but I feel like this might warrant an exception. The justification is that a dynamic function call is a postfix expression, and all the other postfix expressions accept a sequence on the LHS. Thoughts please.
The text was updated successfully, but these errors were encountered: