"assign" pattern #231

Closed
opened 2020-02-20 23:16:46 +09:00 by zxq9 · 0 comments
zxq9 commented 2020-02-20 23:16:46 +09:00 (Migrated from gitlab.com)

Created by: radrow

Like in Erlang or Haskell, ability to assign a variable to a pattern while matching

function f(x) = switch(x)
  h1::(t = h2::_) => (h1 + h2)::t  // same as `h1::h2::k => (h1 + h2)::h2::k`
  _ => x
*Created by: radrow* Like in Erlang or Haskell, ability to assign a variable to a pattern while matching ``` function f(x) = switch(x) h1::(t = h2::_) => (h1 + h2)::t // same as `h1::h2::k => (h1 + h2)::h2::k` _ => x ```
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/sophia#231
No description provided.