Skip to content

Commit 36eaffc

Browse files
committed
compute stmt should not call formatValue
1 parent 63a39ab commit 36eaffc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
compute stmt should not call `formatValue`
21
`formatValue` should not call `readback` -- to be used in debug -- use `let` to print closure
32
debug `applyWithDelay` by log with `formatValue`
43

src/lang/load/handleEffect.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import dedent from "dedent"
22
import { emptyEnv } from "../env/index.ts"
33
import { equal } from "../equal/index.ts"
44
import { evaluate } from "../evaluate/index.ts"
5-
import { formatExp, formatValue } from "../format/index.ts"
5+
import { formatExp } from "../format/index.ts"
66
import type { Mod } from "../mod/index.ts"
7+
import { readback } from "../readback/index.ts"
78
import { same } from "../same/index.ts"
89
import type { Stmt } from "../stmt/index.ts"
910

@@ -78,7 +79,8 @@ export async function handleEffect(mod: Mod, stmt: Stmt): Promise<void> {
7879

7980
if (stmt.kind === "Compute") {
8081
const value = evaluate(mod, emptyEnv(), stmt.exp)
81-
console.log(formatValue(value))
82+
const exp = readback(value)
83+
console.log(formatExp(exp))
8284
return
8385
}
8486
}

0 commit comments

Comments
 (0)