Comments (4)
Although this seems not too-meaningful for folds and scans (and I have the expressed opinion by @adamretter saying "I agree that fn:fold-left and fn:fold-right functions should not have index arguments.) ", I would not object to this if the additional argument is in a separate overload. Thus, if we have two separate overloads, the first one as is now - with the $action
argument being a function of 2 arguments, and the second one with the $action argument being a function of 3 arguments.
Combining these two overloads into a single one is not only formally problematic, but also requires unnecessary mental gymnastics for the reader to clearly understand the specification, when this issue would completely be non-existent if we had two separate overloads.
from qtspecs.
Consistency is very hard to achieve in a language designed by committee, but it's not acceptable to have two different functions do the same thing in different ways just because they were put forward by different people. If we make a change to the way this is done, it needs to be done across the board, not just in one function.
from qtspecs.
Consistency is very hard to achieve in a language designed by committee, but it's not acceptable to have two different functions do the same thing in different ways just because they were put forward by different people. If we make a change to the way this is done, it needs to be done across the board, not just in one function.
Microsoft is a good example of producing a language that is not designed by committee, and yet they decided not to add an overload where the $action argument is a function that has the position in the collection as an added new argument.
Why Microsoft didn't do this in the specification of Enumerable.Aggregate method ?
Not because they missed something (we are at ver. 8 of .NET, and LINQ was introduced almost 20 years ago - in ver.3, so they have had plenty of time to notice and correct any omissions), but because they decided (as both @adamretter and I concur) that this has little meaning, if any at all.
from qtspecs.
In addition, we should add array:scan-left
and array:scan-right
. My suggestion would be to be less paternalistic and align the result types of fn:scan-(left|right)
with fn:for-each
, and to use the array functions for structured results. Of course, nothing prevents a user from creating structured results with fn:scan-(left|right)
as well.
from qtspecs.
Related Issues (20)
- Almost all functions in FO that must process multiple string items, can have as a parameter only a single collation HOT 21
- For symmetry, add functions array:scan-left and array:scan-right HOT 1
- fn:apply argument names
- Dangling else syntax ambiguity HOT 9
- add fn:match-groups() function HOT 7
- Tokenization and element constructors HOT 6
- Productions missing ws:explicit
- Ambiguity in XPath EBNF - Lookup with TypeQualifier vs DynamicFunctionCall HOT 9
- 12 div-3 HOT 5
- XPath: type declarations in quantified expressions
- Record Test Subtype Relationship HOT 3
- Function Coercion: Drop Record Tests? HOT 3
- Specification Documents: Editors and Contributors
- fn:parse-uri: Observations HOT 1
- Leading lone slash
- fn:collation-available (editorial)
- Function parameters names: $uri vs. $href HOT 6
- Executable specifications HOT 1
- Variadic System Functions: Principles? HOT 3
- Misleading summary for concat() - "string value"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtspecs.