Skip to content

Commit 829c15a

Browse files
committed
rename define to handleDefine
1 parent 50fcb73 commit 829c15a

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

TODO.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
> - if we can support mutually defined recursive function,
44
> we should also support circular imports.
55
6+
rename `execute` to `handleEffect`
7+
extract `handleImport` from `handleDefine`
68
`run` should be async
79
call `run` in `load`
8-
rename `define` to `handleDefine`
9-
extract `handleImport` from `handleDefine`
10-
rename `execute` to `handleEffect`
1110
rename `run/` to `load/`
1211

1312
# lazy evaluation

src/lang/run/define.ts renamed to src/lang/run/handleDefine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { ImportEntry, Stmt } from "../stmt/Stmt.ts"
66
import { globalLoadedMods } from "./globalLoadedMods.ts"
77
import { run } from "./run.ts"
88

9-
export function define(mod: Mod, stmt: Stmt): void {
9+
export function handleDefine(mod: Mod, stmt: Stmt): void {
1010
if (stmt.kind === "Define") {
1111
const value = evaluate(mod, emptyEnv(), stmt.exp)
1212
if (value.kind === "Lambda") {

src/lang/run/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { expFreeNames } from "../exp/expFreeNames.ts"
22
import { formatExp } from "../format/formatExp.ts"
33
import { modFind, modOwnDefs, type Def, type Mod } from "../mod/index.ts"
4-
import { define } from "./define.ts"
54
import { execute } from "./execute.ts"
5+
import { handleDefine } from "./handleDefine.ts"
66

77
export function run(mod: Mod): void {
88
if (mod.isFinished) return
99

10-
for (const stmt of mod.stmts) define(mod, stmt)
10+
for (const stmt of mod.stmts) handleDefine(mod, stmt)
1111

1212
for (const def of modOwnDefs(mod).values()) assertAllNamesDefined(mod, def)
1313

0 commit comments

Comments
 (0)