Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Allow methods to be used in pipes foo | some.Method(42) | foo.Bar() #791

Open

Description

@KyleSanderson
map(filter(Imp.GetTorrents(nil), .Name contains `The.Simpsons`), .Hash) | Imp.RemoveTags(`yamz`)","error":"unexpected token Operator(\".\") (1:78)\n | map(filter(Imp.GetTorrents(nil), .Name contains `The.Clam`), .Hash) | Imp.RemoveTags(`yamz`)
{"level":"trace","program":"test-program","query":"map(filter(Imp.GetTorrents(nil), .Name contains `The.Clam`), .Hash) | Imp.RemoveTags(`yamz`)","error":"unexpected token Operator(\".\") (1:78)\n | map(filter(Imp.GetTorrents(nil), .Name contains `The.Simpsons`), .Hash) | Imp.RemoveTags(`yamz`)\n | .............................................................................^","time":1747350352,"message":"expr completed: <nil>"}

vs

let egg = Imp.RemoveTags; map(filter(Imp.GetTorrents(nil), .Name contains `The.Clam`), .Hash) | egg(`yamz`)
{"level":"trace","program":"test-program","query":"let egg = Imp.RemoveTags; map(filter(Imp.GetTorrents(nil), .Name contains `The.Clam`), .Hash) | egg(`yamz`)","time":1747350503,"message":"expr completed: <nil>"}

Activity

  1. antonmedv commented on Sep 18, 2025

    @antonmedv
    Member

    This is a kind of decision on language design. Now for pipes only function allowed. Methods are not.

    1. Should we allow methods to be used in pipes?
    2. What is the use case?
    3. Does it make expressions more readable?
  2. changed the title [-]. Functions calls do not work with pipes[/-] [+]Allow methods to be used in pipes `foo | some.Method(42) | foo.Bar()`[/+] on Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions