HaxeFoundation / haxe-evolution

Repository for maintaining proposal for changes to the Haxe programming language
111 stars 58 forks source link

Matcher: setting variables and guard as expression in a pattern #80

Closed vonagam closed 2 years ago

vonagam commented 3 years ago

pattern.set for setting variables without capturing involved:

case Some(int) | None.set(int = 0):

pattern.where for guards:

case Left(int).where(int < 0) | Right(int).where(int > 0):

Render.

This is already implemented on this branch.

A possible alternative name for set - vars, for where - with.

Simn commented 2 years ago

lean-reject: questionable benefit