From 16979b1345cc55b3fa07b34f143c57773e921383 Mon Sep 17 00:00:00 2001 From: Henry Rich Date: Sun, 3 Nov 2024 10:04:08 -0500 Subject: [PATCH] Expunge eva/evc --- jsrc/ai.c | 9 ++++++--- jsrc/am.c | 2 +- jsrc/j.h | 4 ++-- jsrc/ja.h | 6 +++--- jsrc/je.h | 4 ++-- jsrc/px.c | 7 ++++--- jsrc/v0.c | 3 ++- 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/jsrc/ai.c b/jsrc/ai.c index 1737b44de..08703ecdf 100644 --- a/jsrc/ai.c +++ b/jsrc/ai.c @@ -137,7 +137,8 @@ A jtinvamp(J jt, A f, A g, A fampg){A ff,h,x,y;B nf,ng;C c,d,*yv;I n;V*u,*v; R amp(sc(-(1^(-n))),h); case CCANT: ASSERT(nf!=0,EVDOMAIN); - R obverse(eva(x,"] |:~ u C.^:_1 i.@#@$"),fampg?fampg:amp(f,g)); +// obsolete R obverse(eva(x,"] |:~ u C.^:_1 i.@#@$"),fampg?fampg:amp(f,g)); + R obverse(ev12(x,0,"(]: C.^:_1 i.@#@$) |: ]"),fampg?fampg:amp(f,g)); case CPCO: if(nf){ RE(n=i0(x)); @@ -174,11 +175,13 @@ A jtinvamp(J jt, A f, A g, A fampg){A ff,h,x,y;B nf,ng;C c,d,*yv;I n;V*u,*v; case CBASE: if(!nf)break; R AR(x) ? amp(x,ds(CABASE)) : - obverse(evc(x,mag(x),"$&u@>:@(v&(<.@^.))@(1&>.)@(>./)@:|@, #: ]"),fampg?fampg:amp(f,g)); +// obsolete obverse(evc(x,mag(x),"$&u@>:@(v&(<.@^.))@(1&>.)@(>./)@:|@, #: ]"),fampg?fampg:amp(f,g)); + obverse(ev12(x,0,"($&]:@>:@<. ([.@((^.~|)&].)))@(1&>.)@(>./)@:|@, #: ]"),fampg?fampg:amp(f,g)); case CATOMIC: if(!nf){ASSERT(equ(x,nub(x)),EVDOMAIN); R obverse(atop(f,amp(x,ds(CIOTA))),fampg?fampg:amp(f,g));} // fall through to common obverse (?) case CCYCLE: - if(nf&&AR(x)<=(c==CCYCLE))R obverse(eva(fampg?fampg:amp(f,g),"/:@u@(i.@#) { ]"),fampg?fampg:amp(f,g)); break; +// obsolete if(nf&&AR(x)<=(c==CCYCLE))R obverse(eva(fampg?fampg:amp(f,g),"/:@u@(i.@#) { ]"),fampg?fampg:amp(f,g)); break; + if(nf&&AR(x)<=(c==CCYCLE))R obverse(ev12(fampg?fampg:amp(f,g),0,"/:@]:@(i.@#) { ]"),fampg?fampg:amp(f,g)); break; case CDROP: if(!(nf&&1>=AR(x)))break; RZ(x=cvt(INT,x)); diff --git a/jsrc/am.c b/jsrc/am.c index a3edb3c5a..9714a1335 100644 --- a/jsrc/am.c +++ b/jsrc/am.c @@ -889,7 +889,7 @@ static A jtgadv(J jt,A w){A hs;I n; // The derived verb is ASGSAFE if all the components are; it has gerund left-operand; and it supports inplace operation on the dyad I alr=atoplr(AAV(hs)[0]); // Also set the LSB flags to indicate whether v0 is u@[ or u@] I flag=VASGSAFE; // where we will build verb flags, inited as if wn<3 - if(wn==3){if(FAV(AAV(hs)[2])->id==CRIGHT)AS(hs)[0]=2; else flag=FAV(AAV(hs)[2])->flag;} // 3 is scaf if v2=], remove it from gerund count in shape (leave in AN for free); if 3 gerunds, init from v2 + if(wn==3){if(FAV(AAV(hs)[2])->id==CRIGHT)AS(hs)[0]=2; else flag=FAV(AAV(hs)[2])->flag;} // if v2=], remove it from gerund count in shape (leave in AN for free); if 3 gerunds, init from v2 flag=(flag&FAV(AAV(hs)[0])->flag&FAV(AAV(hs)[1])->flag&VASGSAFE)+(VGERL|VJTFLGOK2)+(alr-2>0?alr-2:alr); // wn may be 2 or 3 R fdef(0,CRBRACE,VERB, jtgav1,jtgav2, w,0L,hs,flag, RMAX,RMAX,RMAX); // create the derived verb } diff --git a/jsrc/j.h b/jsrc/j.h index 97a398e9b..a41f9b546 100644 --- a/jsrc/j.h +++ b/jsrc/j.h @@ -607,7 +607,7 @@ struct jtimespec jmtfclk(void); //'fast clock'; maybe less inaccurate; intended // The named-call stack is used only when there is a locative, EXCEPT that after a call to 18!:4 it is used until the function calling 18!:4 returns. // Since startup calls 18!:4 without a name, we have to allow for the possibility of deep recursion in the name stack. Normally only a little of the stack is used -#if defined(CSTACKSIZE) +#if defined(CSTACKSIZE) // some builds explicitly override the stacksize #if !defined(CSTACKRESERVE) #error CSTACKSIZE and CSTACKRESERVE must be defined together #endif @@ -621,9 +621,9 @@ struct jtimespec jmtfclk(void); //'fast clock'; maybe less inaccurate; intended #define CSTACKSIZE (SY_64?7946240:1015808) // OS default stack size 8MB, aligned to 16k system page size #endif #endif -#define CSTACKDEBUGRESERVE (SY_64?100000:50000) // amount to allow for debugger #define CSTACKRESERVE (SY_64?200000:10000) // amount we allow for slop before we sample the stackpointer, and after the last check #endif +#define CSTACKDEBUGRESERVE (CSTACKRESERVE>>1) // minimum to allow for debugger //The named-function stack is intelligent // and stacks only when there is a locale change or deletion; it almost never limits unless locatives are used to an extreme degree. // The depth of the C stack will normally limit stack use. diff --git a/jsrc/ja.h b/jsrc/ja.h index 3cbf3726d..e585c7b87 100644 --- a/jsrc/ja.h +++ b/jsrc/ja.h @@ -239,7 +239,7 @@ #define detxm(x,y) jtdetxm(jt,(x),(y)) #define detz(x) jtdetz(jt,(x)) #define df1(r,x,y) (r=((r=(y))?(FAV(r)->valencefns[0])((J)((I)jt|(AT(r)&(ADV|CONJ)?JTXDEFMODIFIER:0)),(x),r,r):r)) // y is self; if not 0, execute (x,self,self). Put result into r, set r 0 if self=0. - // r must not = x. self is evaluated only once. If we call a modifier, set that flag scaf should replace with df[mv][12] forms + // r must not = x. self is evaluated only once. If we call a modifier, set that flag #define dfv1(r,x,y) (r=((r=(y))?(FAV(r)->valencefns[0])(jt,(x),r,r):r)) // z is self, always a verb // r must not = x. self is evaluated only once. If we call a modifier, set that flag #define dfv2(r,x,y,z) (r=((r=(z))?(FAV(r)->valencefns[1])(jt,(x),(y),r):r)) // z is self, always a verb Put result into r, set r 0 if self=0. r must not = x or y. self is evaluated only once @@ -325,9 +325,9 @@ #define etc(x) jtetc(jt,(x)) #define ev12(x,y,z) jtev12(jt,(x),(y),(z)) // obsolete #define ev2(x,y,z) jtev2(jt,(x),(y),(z)) -#define eva(x,y) jteva(jt,(x),(y)) +// obsolete #define eva(x,y) jteva(jt,(x),(y)) #define eval(x) jteval(jt,(x)) -#define evc(x,y,z) jtevc(jt,(x),(y),(z)) +// obsolete #define evc(x,y,z) jtevc(jt,(x),(y),(z)) #define even(x,y) jteven(jt,(x),(y)) #define every(x,y) jtevery(jt,(x),(y)) #define every2(x0,x1,x2) jtevery2(jt,(x0),(x1),(x2)) diff --git a/jsrc/je.h b/jsrc/je.h index 278a4ed35..79b5c96c6 100644 --- a/jsrc/je.h +++ b/jsrc/je.h @@ -744,9 +744,9 @@ extern B jtequ0(J,A,A); extern void jterasenl(J,I); // obsolete extern A jtev1(J,A,C*); extern A jtev12(J,A,A,C*); -extern A jteva(J,A,C*); +// obsolete extern A jteva(J,A,C*); extern A jteval(J,C*); -extern A jtevc(J,A,A,C*); +// obsolete extern A jtevc(J,A,A,C*); extern DF1(jtevery); extern DF2(jtevery2); extern DF1(jteveryself); diff --git a/jsrc/px.c b/jsrc/px.c index f03546600..fb3076751 100644 --- a/jsrc/px.c +++ b/jsrc/px.c @@ -23,9 +23,10 @@ A jteval(J jt,C*s){R PARSERVALUE(parseforexec(tokens(cstr(s),1+!!EXPLICITRUNNING // obsolete A jtev1(J jt, A w,C*s){A z; R df1(z, w,eval(s));} // parse *s and apply to w // // obsolete A jtev2(J jt,A a,A w,C*s){A z; R df2(z,a,w,eval(s));} // parse *s and apply to a and w. If w is 0, use monad -A jtev12(J jt,A a,A w,C*s){A z; A fs; I dyad=w!=0; RZ(fs=eval(s)); R (FAV(fs)->valencefns[dyad])(jt,a,dyad?w:fs,fs);} // parse *s to verb, and apply to a and w. If w is 0, use monad -A jteva(J jt, A w,C*s){A z; R df1(z, w,colon(num(1), cstr(s)));} // parse to adverb -A jtevc(J jt,A a,A w,C*s){A z; R df2(z,a,w,colon(num(2),cstr(s)));} // parse to conjunction +// parse string s, producing an ACV, and apply the ACV as either a monad or a dyad. w=0 if monad. Result can be anything; use only when you control a, w, and s +A jtev12(J jt,A a,A w,C*s){A z; A fs; RZ(fs=eval(s)); R (FAV(fs)->valencefns[!!w])((J)((I)jt+(AT(fs)&VERB?0:JTXDEFMODIFIER)),a,w?w:fs,fs);} // if modifier, so flag (for unquote & xdefn, so not needed) +// obsolete A jteva(J jt, A w,C*s){A z; R df1(z, w,colon(num(1), cstr(s)));} // parse to adverb +// obsolete A jtevc(J jt,A a,A w,C*s){A z; R df2(z,a,w,colon(num(2),cstr(s)));} // parse to conjunction // ". y DF1(jtexec1){A z; diff --git a/jsrc/v0.c b/jsrc/v0.c index f42b40db8..498e84725 100644 --- a/jsrc/v0.c +++ b/jsrc/v0.c @@ -257,7 +257,8 @@ DF1(jtpoly1){A c,e,x; RZ(IRS1(x,0L,1L,jthead,c)); // c = {."1>y = list of coefficients RZ(IRS1(x,0L,1L,jttail,e)); // e = {:"1>y = list of exponents ASSERT(equ(e,floor1(e))&&all1(le(num(0),e)),EVDOMAIN); // insist on nonnegative integral exponents - R evc(c,e,"u v}(1+>./v)$0"); // evaluate c 2 : 'u v}(1+>./v)$0' e +// obsolete R evc(c,e,"u v}(1+>./v)$0"); // evaluate c 2 : 'u v}(1+>./v)$0' e + R ev12(c,e,"[`]`(0 $~ >:@(>./)@])}"); // evaluate c 2 : 'u v}(1+>./v)$0' e }