Giter Site home page Giter Site logo

Comments (4)

michaelhkay avatar michaelhkay commented on June 16, 2024

I'm finding all the new stuff with keyword arguments pretty over-complex already, once you start working out all the detailed rules and test cases, and my instinct is that we've already gone overboard in the design, I would prefer to rein it back a bit rather than going even further.

Is this really needed so often that the existing solution of function($y, $x){math:pow($x, $y)} isn't good enough?

from qtspecs.

rhdunn avatar rhdunn commented on June 16, 2024

That makes sense. This possibility came up when I was implementing parser support for KeywordArgument.

from qtspecs.

rhdunn avatar rhdunn commented on June 16, 2024

While writing things like function($y, $x){math:pow($x, $y)} is possible, I was thinking of possible use cases around bounded variadic functions -- that is where I could see this having more value. That is, instead of writing something like:

f(?, (), (), ?)

or:

->($a, $b) { f($a, collation: $b) }

you could express it more cleanly as:

f(?, collation: ?)

Here, it is clear that you are setting the collation as the second parameter, and can avoid issues where you have the wrong number of defaulted parameters and end up setting the wrong parameter.

from qtspecs.

michaelhkay avatar michaelhkay commented on June 16, 2024

The current specification implements this feature so I am closing the issue.

from qtspecs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.