aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/ir-utils.stanza
diff options
context:
space:
mode:
authorazidar2016-01-15 14:34:18 -0800
committerazidar2016-01-16 14:28:18 -0800
commita5c850beb0568c09b581f925aa5ca3bf561ac974 (patch)
tree53c6d3902021f1ce9bb2c9fb302e9198cea691b9 /src/main/stanza/ir-utils.stanza
parent03cf32b5e17eb306e8fe681ef245b5f528306e61 (diff)
Added hashed on get flip
Diffstat (limited to 'src/main/stanza/ir-utils.stanza')
-rw-r--r--src/main/stanza/ir-utils.stanza6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza
index 14383977..7a9cff31 100644
--- a/src/main/stanza/ir-utils.stanza
+++ b/src/main/stanza/ir-utils.stanza
@@ -142,6 +142,12 @@ public defn exp-hash (e:Expression) -> Int :
public defn type-hash (t:Type) -> Int :
symbol-hash(to-symbol(to-string(t)))
+public defn list-hash (l:List) -> Int :
+ turn-off-debug(false)
+ val i = symbol-hash(to-symbol(string-join(map(to-string,l))))
+ turn-on-debug(false)
+ i
+
;============= Useful functions ==============
public defn create-mask (n:Symbol,dt:Type) -> Field :
Field{n,DEFAULT,_} $ match(dt) :