Reece H. Dunn
Reece H. Dunn
You are right, it would make more sense to ignore unreferenced/unnamed keys for maps.
The benefit of this feature to me is in being able to make it clear what the intent is (i.e. I'm only interested in these components), can give meaningful names...
> > A destructuring declaration should be usable anywhere a variable binding can be defined. > > It should not be an error to use the same variable name twice....
> > Seems we just need to have a look at how destructuring is defined in other languages. I believe at least some (if not all) of them have a...
@ChristianGruen Note that there is nothing special about the use of `_` in my examples. You could just as easily write: ``` let $[unused, y, unused] := camera-angle() ``` I...
I'm advocating a "last one wins" approach -- i.e. all this proposal is is syntactic sugar for a multi-let assignment to parts of a sequence/array/map.
An alternate syntax discussed in #31 is: ``` let ($sin, $cos) := sincos(math:pi()) (: sequence :) let [$x, $y, $z] := camera-angle() (: array :) let {$r, $i} := complex(1,...
I'm going to attempt to write the specification for this over Easter. It shouldn't be too difficult, as it is effectively specifying the mapping from the destructuring syntax to a...
```xquery declare function fn:index-where( $input as item()*, $predicate as function( $item as item(), $position as xs:integer ) as xs:boolean ) as xs:integer* { for $it at $pos in $input where...
It would make sense for `fn:count#1`, etc. to keep the parameter names as part of the typed function test. -- This would allow the use of keyword arguments in that...