Changeset [72a21eb5cb201615ffc64a7d5ef7dadf511544e0] by Douglas Creager
Revision 72a21eb5cb201615ffc64a7d5ef7dadf511544e0,
committed by Douglas Creager
· November 19th, 2008 @ 08:33 AM
Patterns on left-hand sides of top-level definitions
This patch allows arbitrary patterns to occur on the left-hand side of a top-level definition. Evaluation of the pattern match is deferred until the usual evaluation phase. This required a new kind of Expression: a “pattern match extraction”. This expression evaluates the pattern match, and if it succeeds, extracts the value of the specified identifier from the list of bindings. Old-style definitions, with a single identifier on the left-hand side, are now special cases of a pattern definition. http://github.com/hst/hst/commit...
10 changed files
-
M
cspm/src/HST/CSPM/Bind.hs -
M
cspm/src/HST/CSPM/Definitions.lhs -
M
cspm/src/HST/CSPM/Evaluate.hs -
M
cspm/src/HST/CSPM/Lexer.lhs -
M
cspm/src/HST/CSPM/Parser.hs -
M
cspm/src/HST/CSPM/Parser.ly -
M
cspm/src/HST/CSPM/Patterns.lhs -
M
cspm/src/HST/CSPM/Types.hs -
M
cspm/tests/expressions/test-patterns.sh -
M
cspm/tests/run-tests.sh