mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-24 15:48:47 +00:00
Switching off invalid hashconsing
This commit is contained in:
parent
f953814c76
commit
69c0b89e3c
6 changed files with 91 additions and 29 deletions
|
|
@ -9,6 +9,7 @@ import Collection;
|
|||
import Ref;
|
||||
import Fun;
|
||||
import Matcher;
|
||||
import Data;
|
||||
|
||||
var tab, hct, restab, log = false;
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ public fun initOstap () {
|
|||
}
|
||||
|
||||
public fun memo (f) {
|
||||
f := lookupMemo (hct, f);
|
||||
-- f := lookupMemo (hct, f);
|
||||
|
||||
if log then printf ("Memoizing %x=%s\n", f, f.string) fi;
|
||||
|
||||
|
|
@ -135,6 +136,21 @@ public infix @ at * (a, f) {
|
|||
}
|
||||
}
|
||||
|
||||
public infix @@ at * ([name, a], f) {
|
||||
fun (k) {
|
||||
fun (s) {
|
||||
var aa =
|
||||
a (fun (x) {k (case x of
|
||||
Succ (x, s) -> Succ (f (x), s)
|
||||
| _ -> x
|
||||
esac)});
|
||||
-- printf ("aa=%s\n", aa.string);
|
||||
-- printf ("@@: %s\n", name);
|
||||
aa (s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public fun lift (f) {
|
||||
fun (x) {f}
|
||||
}
|
||||
|
|
@ -294,7 +310,7 @@ public fun expr (ops, opnd) {
|
|||
{} -> fun (c) {opnd @ c}
|
||||
| level : tl ->
|
||||
var lops = altl (level),
|
||||
next = inner (tl);
|
||||
next = inner (tl);
|
||||
|
||||
case level.fst of
|
||||
Nona ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue