Skip to content

Commit

Permalink
toCon arguments, stub toCon_resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
stylehouse committed May 11, 2023
1 parent 5e54e1d commit 4535955
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 22 deletions.
68 changes: 52 additions & 16 deletions src/lib/Co.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
import {ex,C_,i_,o_,VA_ip,detect_type} from '$lib/St'
//#region toCon a dumper for the A** tree
export function toCon (s,d) {
export function toCon (d) {
if (d.t == null) d.t = 'toCon'
// d/d (Con//Con) emerge, then are
d.resolving = []
// producing C** for recursive dumper instructions: (-Con/(-Cont|-Conz))**
let C = toCon_newCon(s,d)
toCon_newCon(d)
let C = d.C

// < all C.c.ip for getContext-ing
// < comparing to D from last time
// < producing versioned C** to interpret for minimal newsup

// try to know s
toCon_newCont(s,d)
// and s/* beyond, recursing back to toCon in here
toCon_newConz(s,d)
toCon_newCont(d)

// a list of all -Con
if (!d.up) {
// < to "resolve $n" sets of Con//Con here, as an elegant A-ism
// < how async+await might help this flow control schism?
// allow the upper Con//Con to assign ressurrecta with C&Cont
if (d.up) {
d.up.resolving.push(d)
return
}
else {
// start resolving the first Con//Con
toCon_resolve(d)

// a list of all -Con
C.c.visit = d.visit
// give them all an incrementing version
// < individuated by changes
Expand All @@ -24,10 +35,32 @@ export function toCon (s,d) {
for (let Co of d.visit) {
Co.c.version = version
}

}

return C
}
function toCon_resolve (d) {
// and s/* beyond, each recursing -> toCon
toCon_newConz(d)
// then they, just before doing that themselves, are here:

if (d.resolving.length) {
let names = d.resolving.map(
d => d.t + (d.C.c.Cont && d.C.c.Cont.sc.Ct ? ':'+d.C.c.Cont.sc.Ct : '')
)
console.log("seen "+d.t+": "+names.join("\t"))


}



// now we have d.resolving[d+]
for (let dd of d.resolving) {
toCon_resolve(dd)
}
}
// defines an adder of d.C or its C.c.$pi=C/*
function DCpartor (nodepi) {
// arrow functions don't provide their own this binding
Expand Down Expand Up @@ -99,14 +132,15 @@ function DCpartor (nodepi) {
}
}
// producing new C** -Con
function toCon_newCon (s,d) {
function toCon_newCon (d) {
let s = d.s
// handles creating C** once told the scheme
d.partor ||= DCpartor('Con')
let C = d.partor(d.t,'Con',{s})
return C
d.partor(d.t,'Con',{s})
}
// new -Con/-Cont detailing s
function toCon_newCont (s,d) {
function toCon_newCont (d) {
let s = d.s
let Con = d.C
let Cont = d.partor('Cont')

Expand All @@ -123,14 +157,15 @@ function toCon_newCont (s,d) {

let say
if (typ.num || typ.str || typ.bool) {
say = s
say = ''+s
if (typ.str) say = '"' + say + '"'
}

ex(Cont.sc,{t,sym,Ct,say})
}
// new -Con/-Conz listing s/*
function toCon_newConz (s,d) {
function toCon_newConz (d) {
let s = d.s
let Con = d.C
let typ = d.typ
// mix up an esteem for more
Expand All @@ -150,7 +185,7 @@ function toCon_newConz (s,d) {
for (let [t,s] of Object.entries(N)) {
let dd = ex(ex({},d),{up:d,upC:Conz,t,s})
// they put -Conz/-Con*
toCon(s,dd)
toCon(dd)
}
}
//#endregion
Expand Down Expand Up @@ -216,7 +251,9 @@ export class sip_dispatch {
added.push(sip)
}
if (added.length) {
console.log("sip sync + "+added.join(','))
let names = added.length > 6 ? "x"+added.length : added.join(',')
console.log("sip sync + "+names)

this.version ||= 0
this.version++
setContext("sipversion", this.version)
Expand All @@ -227,7 +264,6 @@ export class sip_dispatch {
o (sip) {
let Con = this.sip_C[sip]
if (!Con) throw "!sip: "+sip
console.log("Vass"+Con.c.version)
// send it a replacement C
this.sip_wire[sip].set(Con)
}
Expand Down
9 changes: 3 additions & 6 deletions src/routes/Code.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
// scan into (-Con/(-Cont|-Conz))**
function tocon(dat) {
con = toCon(dat, {D:laCon})
con = toCon({s:dat,D:laCon})
laCon = con
// set up stores to update them all (con.c.visit[Con+])
sipd.addN(con.c.visit)
Expand All @@ -57,15 +57,15 @@
console.log('bloop! '+refresh)
}
$: moment, sipd.sync(), console.log('sync')
$: moment, sipd.sync()
function busybusy () {
sipd.o('1')
//sipd.o('1.2.1.2.2')
// < ping only the -Cont etc? only -Con subscribe so far
//sipd.o('1.2.1.2.2.1',refresh)
}
$: refresh && busybusy(), refresh && console.log('send')
$: refresh && busybusy()
let conver = 0
Expand All @@ -77,9 +77,6 @@
// lezer
let flub = "i thung/with/etc\n\no yeses/because\n"
sto.set(flub)
Expand Down

0 comments on commit 4535955

Please sign in to comment.