Comments on Refutable Patterns proposal

Axel Rauschmayer axel at
Wed Mar 20 16:04:25 PDT 2013

- Would love to see examples for arrays. Especially if there are more element patterns (lhs) than array elements (rhs).

- Possible future extensions: Make pattern after "..." optional, allow "..." in the middle of an array. Examples:
    let [...front, last] = someArray;
    let [..., last] = someArray;
    let [first, ...] = someArray;

- Missing parameter in third-last line?
Match(ElementPatterns, value, index, soft) =
   assert IsObject(value)
   case ElementPatterns of
      ElementPattern =>
         Match(ElementPattern, value, index, soft)
      ElementPattern "," ElementPatterns =>
         if Match(ElementPattern, value, index, soft) = SUCCESS then
            Match(ElementPatterns, value, soft)   (* Missing? index+1 *)

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list