Giter Site home page Giter Site logo

Comments (6)

gasche avatar gasche commented on June 8, 2024 1

The Common module looks like this:

  module Common = struct
    let _absname = set Clflags.absname
    let _alert = Warnings.parse_alert_option
    let _alias_deps = clear transparent_modules
  end

Here the _foo variables are not named with a leading underscore to be ignored, but because they may conflict with keyword names -- there is _open down below.

An important difference between these two use-cases is that _a in your example is unused, while _alert (or others) above are used. This suggests a new heuristic that is not among your list:

  • check ignored-partial-application for all unused variables, even those that start with an underscore

(If we decide to go for this, we should probably extend the logic in #12094 as well for the case match e with _a -> ....)

from ocaml.

nojb avatar nojb commented on June 8, 2024 1

Apologies for the delay.

Should I interpret the silence as this is something folks don't want?

No, just that there is limited reviewing capacity in the team :) In general we are quite happy to have suggestions and proposals from users (especially so when such proposals come with offers to help with the implementation).

I think the suggestion by @gasche makes sense:

  • check ignored-partial-application for all unused variables, even those that start with an underscore

This is a mostly backwards-compatible change that should also address your use-case; do you agree? I didn't look in detail, but I think it shouldn't be very hard to extend the existing logic when typechecking let expressions to implement this check. If this works out, there is a similar logic when typing match expressions that should be extended similarly.

If you agree, would you like to give it a try?

from ocaml.

gasche avatar gasche commented on June 8, 2024

(cc @nojb, our expert on ignoring partial applications.)

from ocaml.

madgen avatar madgen commented on June 8, 2024

Should I interpret the silence as this is something folks don't want?

from ocaml.

madgen avatar madgen commented on June 8, 2024

No, just that there is limited reviewing capacity in the team :)

Of course, no problem!

This is a mostly backwards-compatible change that should also address your use-case; do you agree?

I think it does, yes.

If you agree, would you like to give it a try?

Yes, I would love to.

I'll have a look at the implementation, try to come up with a plan this week, and post it here for feedback before I go ahead with coding (unless it is trivial).

from ocaml.

nojb avatar nojb commented on June 8, 2024

I got bitten by this today; now am looking forward to this patch :)

from ocaml.

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.