aboutsummaryrefslogtreecommitdiffstats
path: root/core/value.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-02-29 13:35:42 +0000
committers-ol <s-ol@users.noreply.github.com>2020-02-29 16:27:34 +0000
commit79aa35d237395cc98c39986b211c57c77b7750e2 (patch)
treec930670dd82bea41a39717a2da906b7f38e326bb /core/value.moon
parentdoc and tag spec (diff)
downloadalive-79aa35d237395cc98c39986b211c57c77b7750e2.tar.gz
alive-79aa35d237395cc98c39986b211c57c77b7750e2.zip
add type-pattern matching language
Diffstat (limited to 'core/value.moon')
-rw-r--r--core/value.moon2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/value.moon b/core/value.moon
index 6fbda65..5379921 100644
--- a/core/value.moon
+++ b/core/value.moon
@@ -37,6 +37,8 @@ class Result
for d in *@op.impulses
@all_impulses[d] = true
+ is_const: => not next @all_impulses
+
-- asserts value-constness and returns the value
const: (msg) =>
assert not (next @all_impulses), msg or "eval-time const expected"