Skip to content

idea: simplified destructuring call syntax #79

@samrushing

Description

@samrushing

This kind of thing is quite common:

(match (some-fun x) with 
  (thing:t (:tuple y z)) -> (use-y-z ...)
  )

i.e., there's only one pattern in the match, of a fixed type/structure.
It might be nice to have a syntax for doing this more compactly/cleanly.

Ideas:

(match (some-fun x) (thing:t (:tuple y z)) (use-y-z ...))
(some-fun x) -> (thing:t (:tuple y z)) -> (use-y-z ...)
(-> (some-fun x) -> (thing:t (:tuple y z)) (use-y-z ...))

I especially like the idea of chaining, but how useful in practice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurefeature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions