Skip to content

Commit

Permalink
rename localPorts to locals
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 7, 2023
1 parent 13b7f51 commit dbd26ac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
12 changes: 10 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ rename `Net` to `Env`

rename `Env.ports` to `Env.stack`

rename `Env.localPorts` to `Env.local`

merge `Ctx` to `Env`

the stack can take other types of values -- not only port
Expand Down Expand Up @@ -72,3 +70,13 @@ understand proof-nets for all connectives
# example

use inet to encode lambda calculus

# monoid

[maybe] change project name to `monoid` -- `.mono` as file extension

update the syntax of "Type System as Homomorphism between Monoids"

copy example from "Type System as Homomorphism between Monoids"

copy example from study/adventure/jojo
6 changes: 3 additions & 3 deletions src/lang/compose/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export function compose(
): void {
switch (word.kind) {
case "Call": {
const found = net.localPorts.get(word.name)
const found = net.locals.get(word.name)
if (found !== undefined) {
net.ports.push(found)
net.localPorts.delete(word.name)
net.locals.delete(word.name)
return
} else {
const definition = lookupDefinitionOrFail(mod, word.name)
Expand All @@ -40,7 +40,7 @@ export function compose(
)
}

net.localPorts.set(word.name, port)
net.locals.set(word.name, port)
return
}

Expand Down
2 changes: 1 addition & 1 deletion src/lang/net/Net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export type Net = {
edges: Array<Edge>
activeEdges: Array<ActiveEdge>
ports: Array<Port>
localPorts: Map<string, Port>
locals: Map<string, Port>
wires: Array<Edge>
}
2 changes: 1 addition & 1 deletion src/lang/net/createNet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function createNet(mod: Mod): Net {
edges: [],
activeEdges: [],
ports: [],
localPorts: new Map(),
locals: new Map(),
wires: [],
}
}

0 comments on commit dbd26ac

Please sign in to comment.