Skip to content

Deprecate >> in the PPX #387

Closed
Closed

Description

@aantron

See discussion.

We should probably have the PPX emit a warning each time >> is used.

cc @Richard-Degenne @dkim @Drup

Activity

  1. added this to the 3.1.0 milestone on Jun 1, 2017
  2. modified the milestones: 3.1.0, 3.2.0 on Jul 18, 2017
  3. raphael-proust commented on Sep 1, 2017

    @raphael-proust
    Collaborator

    I'm giving that a shot. First draft is raphael-proust@4048ec5

    Is there a standard way to emit warnings from ppxs? Currently it just uses prerr_string inline. I didn't find examples online.

  4. aantron commented on Sep 1, 2017

    @aantron
    CollaboratorAuthor

    Off the top of my head, I think you can insert [@[email protected]] annotations: see https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#sec247. I've never tried this.

    There are also some warning functions in one of the modules in the compiler's parsing directory. However, the PPX's version of that is coming from compiler-libs, and linked into the PPX, so I think it will end up printing to stderr – just with the same formatting as the compiler would use. ppwarning sounds like the better option.

  5. Drup commented on Sep 14, 2017

    @Drup
    Member

    Yes, warning should be done by adding some ocaml.ppwarning annotations in the emited OCaml code, using Ast_mapper.attribute_of_warning. Don't ever print yourself, it will break formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions