Skip to content

New \() wording could be clearer about usage in pipe #246

@MichaelChirico

Description

@MichaelChirico

Avoid using `\()` in a pipe, and remember to use informative argument names.

One interpretation of the current wording is that this is discouraged:

x |>
  lapply(\(xi) xi$sum()) |>
  ...

I think what's intended is that only using it as the "piped" function is discouraged:

x |>
  (\(y) sum(y))()

In fact, I would guess using "longhand" function() is also discouraged as the LHS:

x |>
  (function(y) sum(y))()

Should we just say "only pipe to a named function" instead? perhaps dropping this sentence and adding that note to the section on pipes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions