Extractors for destructing assignment and pattern matching

# BelleveInvis (12 years ago)

I am wondering that whether the current draft have something similar to Scala's extractors, which could be used in pattern matching. For example, this pattern: Email(username, host) = ooxx is defined as { let results = Email.unapply(ooxx, 2) if(results !== undefined) [username, host] = results else throw new MisMatchError }