Git Product home page Git Product logo

Comments (2)

soutaro avatar soutaro commented on May 27, 2024

Thanks for pointing out this and starting the discussion.

1 concern is I dont know what it means to me.

It doesn't mean anything for keyword arguments. The parameter names for positional arguments make some sense I think. It can be used for documentation. We often want to refer to the arguments in the documentation.

Your concern makes sense because keyword arguments can be referred safely by their keyword names.

2 concern is code drift.

There is no one-to-one correspondence between the parameter names in method definitions and the names in RBS. We can give more precise/better definitions in RBS, like the following example.

# def foo: (foo: String, bar: Integer) -> void
#        | (baz: String) -> String
#        | (**String others) -> untyped
def foo(**opts)
end

3 concern is correctness.

They are the same.


I'm thinking of just removing var names from keyword arguments. I don't think it causes serious problems, but agree that we haven't found good usage yet.

from rbs.

sbeckeriv avatar sbeckeriv commented on May 27, 2024

Hello @soutaro,

Thank you for your response. I think the biggest question I had was why and that was answer. The main reason is for documentation. The name of the variable can be documented but it has no impact on the code or signature. This would help in a a code hinting system where the comments would not need to be parsed. Your example of def foo is a very informative as well.

Should I leave this issue open to track removing keyword argument var names?

Thank you once again for your time,
Dictated but not reviewed,
Becker

from rbs.

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.