Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 4433 days ago | link | parent

Oh, I just decided, I'll use {} for object destructuring instead, so the "foo" function looks like this now:

  $def foo
    { %foo F } -> (F 10)
This lets you match multiple properties, and use splice:

  $def foo
    { %foo F %bar G @qux } -> (F 10)
The only problem is, now I don't know how to say "match an object that has only these properties". I guess I could add in an "only" pattern matcher...

  $def foo
    (only { %foo F }) -> (F 10)
I dunno, seems a bit... off.