#] #] ********************* #] "$d_Qtest"'arrays nested/arrays nested- develop.txt' - # www.BillHowell.ca 02Oct2021 initial # slc - "[all-full-but-[one or none]]" INDEX of an array # sub - is a sequence of items at the top level of an array, note that a sub can span [one, more, all] axis # not much use for a separate subSlc of an array - just use sub optrs # [remove, insert] - require slc of an array, often built from search for a subAry, # inset something in non-sub parts of slc # split - requires a hyper-plane index as a specific place to split ary # replace - just a sub required if [old, new] of same shape. If not, won't work in general # # current status of tests - see "$d_Qtest"'/test results/' 48************************************************48 24************************24 # Table of Contents, generated with : # $ grep "^#]" "$d_Qtest"'arrays nested/arrays nested- develop.txt' | sed 's/^#\]/ /' >"$d_Qtest"'arrays nested/arrays nested- develop TblOfContents.txt' # ********************* 24************************24 #] ToDos 06Apr2024 idxStr_to_idxIntL - issue of atomic idxIntL may come up!? 06Apr2024 idxStr_to_idxIntL - issue of atomic ints following last `, 08Apr2024 nry - still haven't implemented nryPhr!! 12Apr2024 test 3+D nrys nry_sub_get_ndx1stL - more complex versions like : (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) 12Apr2024 port ops from 'arrays atomic.ndf' to 'arrays nested.ndf' re-test all 'arrays atomic.ndf' (many don't have tests?) Array restructure [to,from] cart [atm, str, lst, ary] - check which work on nry ary_sub_get_ndxL - instead do sub_ndx_get_ndxL, assumes ndx are viable tbl - forget it for now can these be generalized, drop ary versions eventually? split[Separate,[At[Front,End]], ] : get [itm, slc, sub] insert [itm, slc, sub] replace [itm, slc, sub] forget for now pad with slc slice ops? - really only good for ary until I define slices in depth? (future work) [sort, cull] aryL - ouch, maybe leave for rainy day cull [itm, option] Tables, titles 18Apr2024 I added a comment input to 'QNial test optrs.ndf' >> this will have to added to other tstSpecial #] Lessons : 31Mar2024 it's much harder to get the tests to work than just the op! but i learn a lot 24************************24 archives of working files : specified in "$d_Qndfs"'QNial setup.ndf' Howell_saveWork := (link d_Qndfs 'types nested.ndf') (link d_Qtest 'arrays nested/arrays nested- develop.txt') (link d_Qndfs 'arrays nested.ndf') (link d_Qtest 'arrays nested/arrays nested- testOptrs.ndf') (link d_Qndfs 'arrays nested zByVal.ndf') (link d_Qtest 'arrays nested byVal/arrays nested- zByVal testOptrs.ndf') ; saveWork IS { EACH [write, pinn_backupDatedTo_zArchive] Howell_saveWork } EACH pinn_backupDatedTo_zArchive Howell_work_ndfs 24************************24 08********08 #] ??Apr2024 08********08 #] ??Apr2024 08********08 #] ??Apr2024 08********08 #] ??Apr2024 08********08 #] ??Apr2024 08********08 #] ??Apr2024 08********08 #] 20Apr2024 change : IF (= sub subLocal) THEN resFltL := link resFltL [idx1st] ; ENDIF ; to : IF (= sub subLocal) THEN resFltL := link resFltL [front idx1st] ; ENDIF ; "010_str_chr 'the bigg fat cow' [` ] ([[3]] [[8]] [[12]]) 'should be OK' nry_sub_get_ndx1stL 'the bigg fat cow' [` ] change : resFltL := link resFltL [front ndx1st] ; to : resFltL := link resFltL [ndxLocal] ; 08********08 #] 18Apr2024 continue: fix nry_itm_get_ndxL[, _recurse] for depth 15:09 "080_str_chrL 'the bigg fat cow' ` ([[3]] [[8]] [[12]]) 'OK - should work, each is solitary' nry_itm_get_ndxL 'the bigg fat cow' ` test : writeBreak (5 2 reshape 'nry = ' (1 2 3) 'idxLYes = ' "idxLYes 'ndxOutL = ' "ndxOutL 'idxLNot = ' "idxLNot 'ndxLNot = ' "ndxLNot ) >> OK 18:26 "310_intAL_intAL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) [[3] (0 2)] 'should be OK' nry_itm_get_ndxL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) wow, I don't even understand why this works I accidentally used 'ndxSub EACHRIGHT link' instead of '(ndxInn EACHRIGHT link' !!! ndxOutL := link ndxOutL (ndxSub EACHRIGHT link (nry_itm_ndxInn_get_ndxL_recurse nrySub itm (link ndxInn ndxSub))) ; I will have to meditate on this after I'm dead... qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple l nry_itm_get_ndxL_chk_testSimple 17 5 17 now try : nry_itm_get_ndxL_chk_testSpecial 18Apr2024 I added a comment input to 'QNial test optrs.ndf' >> this will have to added to other tstSpecial 3rd special test, stdL is wrong : stdL not in resL : +-------------------+-------------------+-------------------+-------------------+ |+-+---+---+---+---+|+-+---+---+---+---+|+-+---+---+---+---+|+-+---+---+---+---+| ||3|0 2|1 0|1 0|0 1|||3|0 2|1 0|1 0|1 0|||3|0 2|1 0|1 0|1 0|||3|0 2|1 0|1 0|1 2|| |+-+---+---+---+---+|+-+---+---+---+---+|+-+---+---+---+---+|+-+---+---+---+---+| +-------------------+-------------------+-------------------+-------------------+ remove [extra 1 0, double-response] : +---------------+---------------+---------------+ |+-+---+---+---+|+-+---+---+---+|+-+---+---+---+| ||3|0 2|1 0|0 1|||3|0 2|1 0|1 0|||3|0 2|1 0|1 2|| |+-+---+---+---+|+-+---+---+---+|+-+---+---+---+| +---------------+---------------+---------------+ >> OK Finally, after fixing each stdL, it ALL works!!! +-----+ olde code # 18Apr2024 removed for now IF (= null resFltL) THEN resFltL := fault '?aryItmGetNdxLNon' ; ENDIF ; 08********08 #] 17Apr2024 fix nry_itm_get_ndxL[, _recurse] for depth nry_itm_get_ndxL_chk_testSimple +--+---------------+---------------------+-----------------+ | l|304_intAL_intLL|+-+ |+-+ | | | ||3| ||3| | | | |+-+ |+-+ | +--+---------------+---------------------+-----------------+ | o|306_intAL_intLL|+-+-----+ |+---+ | | | ||3|+---+| ||0 2| | | | || ||0 2|| |+---+ | | | || |+---+| | | | | |+-+-----+ | | +--+---------------+---------------------+-----------------+ nry_sub_get_ndx1stL_chk_testSimple +--+---------------+---------------------+--------------------+ | o|064_intAL_intLL|+-+ | | | | ||3| | | | | |+-+ | | +--+---------------+---------------------+--------------------+ | o|066_intAL_intLL|+-+-----+ | | | | ||3|+---+| | | | | || ||0 2|| | | | | || |+---+| | | | | |+-+-----+ | | +--+---------------+---------------------+--------------------+ >> both of the above fail, so work 1st on nry_itm_get_ndxL change : IF (idx in idxLYes) THEN ndxOutL := append ndxOutL idxL ; ELSE idxLNot := append idxLNot idx ; ndxLNot := append ndxLNot idxL ; ENDIF ; IF (~= null nryItmNdxL) THEN IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; ndxNxt := link ndxInn (ndxInt_to_ndxStr idxL) ', ' ; nryItmNdxL := nryItmNdxL append (nryNotAtm itm ndxNxt) ; ENDIF ; to : IF (idx in idxLYes) THEN ndxOutL := link ndxOutL [idxL] ; ELSE idxLNot := link idxLNot [idx ] ; ndxLNot := link ndxLNot [idxL] ; ENDIF ; >> move some into FOR loop IF (~= null nryItmNdxL) THEN nryItmNdxL := link ndxInn nryItmNdxL ; ndxOutL := link ndxOutL (link EACH nry_itm_ndxInn_get_ndxL_recurse nryItmNdxL) ; ENDIF ; >> I still hadn't converted ndxByVal to ndxInt code! nulls in ndxOutL : change : IF (itm = nry) THEN ndxOutL := ndxInn ; to : IF (OR (null itm EACHLEFT = nry) THEN ndxOutL := ndxInn ; +-----+ 14:19 there are 3 current failures : "080_str_chrL 'the bigg fat cow' ` ([[3]] [[8]] [[12]]) 'OK - should work, each is solitary' "100_str_chr 'the bigg fat cow' `g ([[6]] [[7]]) 'should be OK' "240_intA_int (4 5 reshape (tell 30)) 4 [[0 4]] 'should be OK' flag_break each... +--+ change : IF (OR bolLNotAtm) THEN idxLNotAtm := bolLNotAtm subList idxLNot ; nryLNotAtm := idxLNotAtm choose nry ; FOR i WITH (tell (gage shape) idxLNotAtm) DO idx := idxLNotAtm@i ; IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; nryNotAtm := nryLNotAtm@i ; ndxNot := link ndxInn [idxL] ; ndxOutL := link ndxOutL (nry_itm_ndxInn_get_ndxL_recurse nryNotAtm itm ndxNot) ; ENDFOR ; ENDIF ; to : IF (OR bolLNotAtm) THEN ndxLNotAtm := bolLNotAtm subList ndxLNot ; nryLNotAtm := idxLNotAtm choose nry ; FOR i WITH (tell (gage shape) ndxLNotAtm) DO ndxNot := ndxLNotAtm@i ; ??? nryNot := nryLNotAtm@i ; ndxOutL := link ndxOutL (nry_itm_ndxInn_get_ndxL_recurse nryNot itm ndxNot) ; ENDFOR ; ENDIF ; >> many other [revamp, renameSym]s change : ndxOutL := link ndxOutL (nry_itm_ndxInn_get_ndxL_recurse nryNot itm ndxNot) ; to : ndxOutL := ndxOutL (nry_itm_ndxInn_get_ndxL_recurse nryNot itm ndxNot) ; >> NYET!!! qnial> tNow 17:49:56 current problems "305_intAL_intA (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (2 3 reshape 1 2 3 2 7 2) [[3] (0 2) (1 0)] 'should be OK' "310_intAL_intAL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) [[3] (0 2)] 'should be OK' qnial> nry_itm_get_ndxL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (2 3 reshape 1 2 3 2 7 2) getting closer, not there yet, I'm confused +-----+ olde code IF (~= null nryNotNdxL) THEN FOR i WITH (tell (gage shape) nryNotNdxL) DO nryNotNdx := nryNotNdxL@i ; ndxInn := ; ndxOutL := link ndxOutL [nry_itm_ndxInn_get_ndxL_recurse nryNotNdx itm ndxInn] ; ENDFOR ; ENDIF ; # 10Apr2024 removed faultL := link faultL (isLayNry itm) ; # debug code (actully, just use flag_break) : % write (5 2 reshape 'nry = ' nry 'idxLYes = ' idxLYes 'idxLNot = ' idxLNot 'ndxOutL = ' ndxOutL 'ndxLNot = ' ndxLNot ) ; % ; % write (6 2 reshape 'idx = ' idx 'nryNotAtm = ' nryNotAtm 'bolLNotAtm = ' bolLNotAtm 'idxLNotAtm = ' idxLNotAtm 'nryLNotAtm = ' nryLNotAtm 'nryNotNdx = ' nryNotNdx ) ; 08********08 #] 13Apr2024 nry_sub_get_ndx1stL expand examples using (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 8 1 13 >> all new examples failed -> null return? "062_intAL_intLL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) [[null]] 'should be OK' qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 8 1 13 try one test : qnial> nry_sub_get_ndx1stL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) +---+ |+-+| ||0|| |+-+| +---+ >> why 0? because it's the sub1st itm "064_intAL_intLL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) [[3]] 'should be OK' qnial> nry_sub_get_ndx1stL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) >> null shouldn't happen: OR[ndx1stL, faultL] flag_break ?.. Ndx1stl := nry_itm_get_ndxl Nry ( first Sub1 ) -->[nextv] +-+---+---+---+ |1|0 0|0 0|0 0| +-+---+---+---+ >> uh-oh, correct answer, but must be returned as [intLL]? problem is nry_itm_get_ndxL - augment with current tests with : (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple o nry_itm_get_ndxL_chk_testSimple 13 7 17 +--+---------------+---------------------+-----------------+ | o|300_intAL_intLL|+-+ |?aryItmGetNdxLNon| | | ||0| | | | | |+-+ | | +--+---------------+---------------------+-----------------+ | l|304_intAL_intLL|+-+ |+-+ | | | ||3| ||3| | | | |+-+ |+-+ | +--+---------------+---------------------+-----------------+ | o|306_intAL_intLL|+-+-----+ |+---+ | | | ||3|+---+| ||0 2| | | | || ||0 2|| |+---+ | | | || |+---+| | | | | |+-+-----+ | | +--+---------------+---------------------+-----------------+ | o|308_intAL_intLL|+-+-----+-----+ |+---+ | | | ||3|+---+|+---+| ||1 0| | | | || ||0 2|||1 0|| |+---+ | | | || |+---+|+---+| | | | | |+-+-----+-----+ | | +--+---------------+---------------------+-----------------+ | o|310_intAL_intLL|+-+-----+-----+-----+|?aryItmGetNdxLNon| | | ||3|+---+|+---+|+---+|| | | | || ||0 2|||1 0|||1 1||| | | | || |+---+|+---+|+---+|| | | | |+-+-----+-----+-----+| | +--+---------------+---------------------+-----------------+ >> only LAST [idx] is returned? how do I "package" each ndx in ndxL in [nry_itm_get_ndxL, nry_sub_get_ndx1stL], while still "descending into depth"? nry_itm_get_ndxL example does it : +--+---------------+---------------------+-----------------+ | l|080_str_chrL |+-+-+--+ |+-+-+--+ | | | ||3|8|12| ||3|8|12| | | | |+-+-+--+ |+-+-+--+ | +--+---------------+---------------------+-----------------+ nry_sub_get_ndx1stL example does it : +--+---------------+---------------------+--------------------+ | l|010_str_chr |+---+---+----+ |+---+---+----+ | | | ||+-+|+-+|+--+| ||+-+|+-+|+--+| | | | |||3|||8|||12|| |||3|||8|||12|| | | | ||+-+|+-+|+--+| ||+-+|+-+|+--+| | | | |+---+---+----+ |+---+---+----+ | +--+---------------+---------------------+--------------------+ ndx isTypIntLL, therefore ndxL isTypIntLLL 08********08 #] 12Apr2024 nry_sub_get_ndx1stL revist after fixing underlying ops qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 2 0 5 +--+-------------+--------------------+--------+ | o|030_intA_intL|+---+ | | | | ||0 2| | | | | |+---+ | | +--+-------------+--------------------+--------+ | o|040_intA_intA|+---+ | | | | ||1 0| | | | | |+---+ | | +--+-------------+--------------------+--------+ >> subArys not working... qnial> tNow 12:13:36 nap break "030_intA_intL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) [0 2] 'should be OK' qnial> nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) >> null is WRONG, should return OR[ndx1stL, faultL] look at : qnial> nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) >> null is wrong, nyet qnial> bolNdx1st := 2 4 reshape o o l l o l l l qnial> OR bolNdx1st l >> OK, fine fonn to trace nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) change : IF (NOR bolNdx1st) THEN ndx1stL := (OR bolNdx1st) subList ndx1stL ; ENDIF ; to : IF (NOR bolNdx1st) THEN ndx1stL := (NOT bolNdx1st) subList ndx1stL ; ENDIF ; ?.. Nrylocal Ndxlocal Idxlocal := nry_ndx_tolocal_nry_ndx_idx Nry Ndx1st -->[nextv] +-----+-+-+ |?path|0|2| +-----+-+-+ >> back to old problem, must fix nry_ndx_tolocal_nry_ndx_idx add current example to tests +-----+ nry_ndx_tolocal_nry_ndx_idx with 2 new tests - problem with ndx? qnial> nry_ndx_tolocal_nry_ndx_idx (4 5 reshape (tell 30)) [[0 2]] +--------------++-----+ | 0 1 2 3 4||+---+| | 5 6 7 8 9|||0 2|| |10 11 12 13 14||+---+| |15 16 17 18 19|| | +--------------++-----+ >> OK qnial> nry_ndx_tolocal_nry_ndx_idx (4 5 reshape (tell 30)) [[2 2]] +--------------++-----+ | 0 1 2 3 4||+---+| | 5 6 7 8 9|||2 2|| |10 11 12 13 14||+---+| |15 16 17 18 19|| | +--------------++-----+ >> OK qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 7 0 10 >> wrong still qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 7 0 10 >> wrong still qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 8 0 10 >> better, still not there qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple l nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 10 0 10 >> OK, all correct It will be problematic to induce correct ndx format +-----+ so nry_sub_get_ndx1stL change : idxLocalL := idxLocal EACHRIGHT + (tell subShp) ; to : idxLocalL := idxLocal EACHBoth + (tell subShp) ; qnial> nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 2 0 5 nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 4 reshape 5 6 7 8) change : IF bolNrySubNdxFit THEN nryLocal ndxLocal idxLocal := nry_ndx_toLocal_nry_ndx_idx nry ndx1st ; to : IF bolNrySubNdxFit THEN IF (atomic ndx1st) THEN ndx1st := [[ndx1st]] ; ELSEIF (isIntL ndx1st) THEN ndx1st := [ndx1st] ; ENDIF ; nryLocal ndxLocal idxLocal := nry_ndx_toLocal_nry_ndx_idx nry ndx1st ; qnial> nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 4 reshape 5 6 7 8) ?.. Idxlocall := Idxlocal EACHBOTH + ( tell Subshp ) -->[nextv] ?conform change : idxLocalL := idxLocal EACHBOTH + (tell subShp) ; to : idxLocalL := idxLocal EACHRIGHT + (tell subShp) ; qnial> nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 4 reshape 5 6 7 8) +-----+ |+---+| ||1 0|| |+---+| +-----+ >> OK!!! qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 0 0 5 qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 4 0 6 >> getting closer change : IF (~= null ndx1stL) THEN to : IF (NOT isfault ndx1stL) THEN add flag_break nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 2 reshape 4 5) change : IF (NOT isfault ndx1stL) THEN nryShp := gage shape nry ; subShp := gage shape sub ; FOR ndx1st WITH ndx1stL DO bolNrySubNdxFit := nryShp_subShp_idx1st_get_bolFit nryShp subShp ndx1st ; IF bolNrySubNdxFit THEN IF (atomic ndx1st) THEN ndx1st := [[ndx1st]] ; ELSEIF (= null (isTypIntL ndx1st)) THEN ndx1st := [ndx1st] ; ENDIF ; nryLocal ndxLocal idxLocal := nry_ndx_toLocal_nry_ndx_idx nry ndx1st ; idxLocalL := idxLocal EACHRIGHT + (tell subShp) ; subLocal := nryLocal#idxLocalL ; IF (= sub subLocal) THEN resFltL := link resFltL [ndx1st] ; ENDIF ; ENDIF ; ENDFOR ; ELSE resFltL := fault '?nrySubGetNdx1stLNon' ; ENDIF ; to : nryShp := gage shape nry ; subShp := gage shape sub ; FOR ndx1st WITH ndx1stL DO bolNrySubNdxFit := nryShp_subShp_idx1st_get_bolFit nryShp subShp ndx1st ; IF bolNrySubNdxFit THEN IF (atomic ndx1st) THEN ndx1st := [[ndx1st]] ; ELSEIF (= null (isTypIntL ndx1st)) THEN ndx1st := [ndx1st] ; ENDIF ; nryLocal ndxLocal idxLocal := nry_ndx_toLocal_nry_ndx_idx nry ndx1st ; idxLocalL := idxLocal EACHRIGHT + (tell subShp) ; subLocal := nryLocal#idxLocalL ; IF (= sub subLocal) THEN resFltL := link resFltL [ndx1st] ; ENDIF ; ELSE resFltL := fault '?nrySubGetNdx1stLNon' ; ENDIF ; ENDFOR ; qnial> nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 2 reshape 4 5) ?nrySubGetNdx1stLNon >> OK qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 5 1 6 a few more fixes of faultName, then : qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple l nry_sub_get_ndx1stL_chk_testSimple 6 1 6 >> great, all works!!!! add more tests to nry_sub_get_ndx1stL - 2 with vertical subs qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple l nry_sub_get_ndx1stL_chk_testSimple 8 1 8 08********08 #] 12Apr2024 double-check if nry_itm_get_ndxL_chk_testSpecial has been corrupted by changes was ALL correct qnial> nry_itm_get_ndxL_chk_testSpecial >> now isLayAry nry don't work!! qnial> nry_itm_get_ndxL_chk_testSimple >> all responses now correct 08********08 #] 12Apr2024 nry_ndx_toLocal_nry_ndx_idx [fix, test] iterate qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 0 0 5 >> most give fault ?isTypIntLLNot change : nry_ndx_chkAppOp IS OP nry ndx optrPhr { LOCAL resFltL ; resFltL := isLayNryNdx nry ndx ; IF (= null resFltL) THEN resFltL := apply optrPhr (nry ndx) ; ENDIF ; resFltL } isLayNryNdx IS OP nry ndx { LOCAL faultL idx nrySub ; % ; faultL := isLayNry nry ; faultL := link faultL (isTypNdxInt ndx) ; % ; IF (= null faultL) THEN nrySub := nry ; FOR idx WITH ndx DO nrySub := nrySub@idx ; IF (isFault nrySub) THEN faultL := fault '?isLayNryNdxNot' ; break 'error' ; ENDIF ; ENDFOR ; ENDIF ; % ; faultL } to : ???? "012_intAL_intLL (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) [[3]] ( (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) null [3] ) 'should be OK' isTypIntLL [[3]] qnial> nry_ndx_idx (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) [[3]] +-----------------------------++-+ |+-+-+-+-----------------+-+-+||3| ||0|1|2|+-+-+-----------+|4|5||| | || | | ||1|2|+-----+-+-+|| | ||| | || | | || | || 1|2|3||| | ||| | || | | || | |+-----+-+-+|| | ||| | || | | || | ||1 2 3|7|2||| | ||| | || | | || | ||2 7 2| | ||| | ||| | || | | || | |+-----+-+-+|| | ||| | || | | |+-+-+-----------+| | ||| | || | | ||2|7| 2|| | ||| | || | | |+-+-+-----------+| | ||| | |+-+-+-+-----------------+-+-+|| | +-----------------------------++-+ >> OK "020_intA (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (3 (0 2)) ( (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) [3] (0 2) ) 'should be OK' qnial> nry_ndx_toLocal_nry_ndx_idx (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (3 (0 2)) +-----------------+-+---+ |+-+-+-----------+|3|0 2| ||1|2|+-----+-+-+|| | | || | || 1|2|3||| | | || | |+-----+-+-+|| | | || | ||1 2 3|7|2||| | | || | ||2 7 2| | ||| | | || | |+-----+-+-+|| | | |+-+-+-----------+| | | ||2|7| 2|| | | |+-+-+-----------+| | | +-----------------+-+---+ >> OK qnial> nry_ndx_toLocal_nry_ndx_idx_chk (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) (3 (0 2)) ?isTypIntLLNot nry := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) ndx := (3 (0 2)) qnial> nry_ndx_toLocal_nry_ndx_idx nry ndx +-----------------+-+---+ |+-+-+-----------+|3|0 2| ||1|2|+-----+-+-+|| | | || | || 1|2|3||| | | || | |+-----+-+-+|| | | || | ||1 2 3|7|2||| | | || | ||2 7 2| | ||| | | || | |+-----+-+-+|| | | |+-+-+-----------+| | | ||2|7| 2|| | | |+-+-+-----------+| | | +-----------------+-+---+ qnial> nry_ndx_chkAppOp nry ndx "nry_ndx_toLocal_nry_ndx_idx ?isTypIntLLNot >> sigh... qnial> isTypNdxInt ndx ?isTypIntLLNot qnial> isTypIntLL ndx ?isTypIntLLNot >> neither form works qnial> ndx := ([3] (0 2)) +-+---+ |3|0 2| +-+---+ qnial> isTypNdxInt ndx qnial> isTypIntLL ndx >> null - OK I forgot that ndx must not have ints at "top level" : fix thesder (iterate) : qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 1 0 7 qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 3 0 7 qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 5 0 7 qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple l nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 7 0 7 >> all OK now, after MANY iterations >> difficult to guess fault [, non-]solitary, need to examine code more closely 08********08 #] 10Apr2024 nry_sub_get_ndx1stL reverse part of change 06-07Apr2024 ? (didn't find what was being referred to) uses a recursive op : nry_itm_ndxInn_get_ndxL_recurse nry_sub_get_ndx1stL [close look, changes] : qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 0 5 5 >> yuchh qnial> nry_itm_get_ndxL 'the bigg fat cow' [` ] ?aryItmGetNdxLNon qnial> nry_itm_get_ndxL 'the bigg fat cow' ` +-+-+--+ |3|8|12| +-+-+--+ >> OK fix resStdL qnial> nry_itm_get_ndxL (tell 10) 4 +-+ |4| +-+ >> OK qnial> (4 5 reshape (tell 30)) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 qnial> (1 3 reshape 2 3 4) 2 3 4 qnial> nry_itm_get_ndxL (4 5 reshape (tell 30)) 2 +---+ |0 2| +---+ nry_sub_get_ndx1stL 'the bigg fat cow' ` +-----+ #] nry_itm_get_ndxL problems "051_chrL_chrL [`g] [`g] [[0]] 'should be OK, with DOUBLE solitary!!??!!' nry_itm_get_ndxL [`g] [`g] change : nry_itm_get_ndxL IS OP nry itm { LOCAL resFltL ; resFltL := nry_itm_ndxInn_get_ndxL_recurse nry itm null ; IF (= null resFltL) THEN resFltL := fault '?aryItmGetNdxLNon' ; ENDIF ; resFltL } to : nry_itm_get_ndxL IS OP nry itm { nry_itm_ndxInn_get_ndxL_recurse nry itm null } >> OK, worked "080_str_chrL 'the bigg fat cow' ` ([3] [8] [12]) 'OK - should work, each is solitary' qnial> nry_itm_get_ndxL 'the bigg fat cow' ` >> null is WRONG qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple o nry_itm_get_ndxL_chk_testSimple 8 9 12 after many [fix, test] : qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple l nry_itm_get_ndxL_chk_testSimple 12 5 12 >> OK I learned a lot +-----+ back to nry_itm_get_ndxL qnial> tstOptr "nry_sub_get_ndx1stL_chk_testSimple o nry_sub_get_ndx1stL_chk_testSimple 0 5 5 >> ugghh! all are ?arySubGetNdx1stLNon change : ELSE nryLoc := nry#(front ndx1st) ; to : ELSE nryLoc := nry@@(front ndx1st) ; later to : ELSE nryLoc := nry@@(first ndx1st ; "030_intA_intL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) ((0 2) (0 3) (0 4)) 'should be OK' nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) ?.. Ndx1stl -->[nextv] +---+ |0 2| +---+ ?.. Nryloc := Nry @ @ Ndx1st -->[nextv] ?path nry_sub_get_ndx1stL (4 5 reshape (tell 30)) (1 3 reshape 2 3 4) >> null - wrong qnial> tstOptr "ndx_idx_localTo_ndx_chk_testSimple o ndx_idx_localTo_ndx_chk_testSimple 3 0 4 >> log file NOT saved!! oops "020_ary_intL (4 5 reshape (tell 30)) (0 2) [0 2] 'should be OK' qnial> ndx_idx_localTo_ndx (4 5 reshape (tell 30)) (0 2) +-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+---+ |0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|0 2| +-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+---+ qnial> ndx_idx_localTo_ndx (4 5 reshape (tell 30)) [0 2] +-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+-----+ |0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|+---+| | | | | | | | | | | | | | | | | | | | | ||0 2|| | | | | | | | | | | | | | | | | | | | | |+---+| +-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+-----+ >> garbage results, must revamp op change : ndx_idx_localTo_ndx IS OP ndxLocal idxLocal { append ndxLocal idxLocal } to : ndx_idx_localTo_ndx IS OP ndxLocal idxLocal { append ndxLocal idxLocal } change : nry_ndx_toLocal_nry_ndx_idx IS OP nry ndx { LOCAL idxLocal ndxLocal nryLocal ; % ; IF (= null ndx) THEN ndxLocal idxLocal := null [null] ; ELSE ndxLocal idxLocal := [front, last] ndx ; IF (atomic idxLocal) THEN idxLocal := [idxLocal] ; ENDIF ; ENDIF ; nryLocal := nry@@ndxLocal ; % ; nryLocal ndxLocal idxLocal } to : nry_ndx_toLocal_nry_ndx_idx IS OP nry ndx { LOCAL idxLocal ndxLocal nryLocal ; % ; % convert ndx to intLL (required form) ; IF (isInteger ndx) THEN ndx := [[ndx]] ; ELSEIF (isTypIntL ndx) THEN ndx := [ndx] ; ENDIF ; ndxLocal idxLocal := [front, last] ndx ; IF (atomic idxLocal) THEN idxLocal := [idxLocal] ; ENDIF ; % note that idxLocal cannot be null, or ndx is invalid? except it might be? ; nryLocal := nry@@ndxLocal ; % ; nryLocal ndxLocal idxLocal } >> ndxLocal MUST be an intL qnial> a := [front, last] [[4]] ++-+ ||4| ++-+ qnial> isInteger a@1 o qnial> a := [front, last] [4] ++-+ ||4| ++-+ qnial> isInteger a@1 l qnial> nry_ndx_toLocal_nry_ndx_idx (4 5 reshape (tell 30)) [0 2] +--------------++---+ | 0 1 2 3 4||0 2| | 5 6 7 8 9|| | |10 11 12 13 14|| | |15 16 17 18 19|| | +--------------++---+ qnial> nry := (4 5 reshape (tell 30)) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 qnial> ndx := [0 2] +---+ |0 2| +---+ qnial> nry@@null 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 qnial> nry@@[null] ?path >> OK - problem found qnial> tstOptr "ndx_idx_localTo_ndx_chk_testSimple o ndx_idx_localTo_ndx_chk_testSimple 3 0 4 +--+--------------+-------------------+-------------------------------------------------------+ | o|020_ary_intL |+---+ |+-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+---+| | | ||0 2| ||0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|0 2|| | | |+---+ |+-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+---+| +--+--------------+-------------------+-------------------------------------------------------+ >> WRONG isTypNdxInt fails! change : isTypNdxInt IS OP ndxInt { LOCAL resFltL ; resFltL := null ; FOR ndxInt WITH ndxInt DO IF (NOT isInteger ndxInt) THEN IF (NOT isTypIntL ndxInt) THEN resFltL := fault '?isTypNdxIntNot' ; break 'quit after 1st error' ; ENDIF ; ENDIF ; ENDFOR ; resFltL } to : isTypNdxInt IS OP ndxInt { isTypIntLL ndxInt } >> all have fault ?isLayLstLNot change : isLayLstL IS OP lstL { LOCAL faultL ; faultL := link (EACH isLayLst lstL) ; IF (~= null faultL) THEN faultL := fault '?isLayLstLNot' ; ENDIF ; faultL } to : isLayLstL IS OP lstL { link (EACH isLayLst lstL) } change : isTypIntLL IS OP intLL { LOCAL faultL ; faultL := isLayLstL intLL ; IF (= null faultL) THEN IF (~= null (link (EACH isTypIntL intLL))) THEN faultL := fault '?isTypIntLLNot' ; ENDIF ; ENDIF ; faultL } to : isTypIntLL IS OP intLL { LOCAL faultL ; IF (~= null (link (EACH isTypIntL intLL))) THEN faultL := fault '?isTypIntLLNot' ; ENDIF ; faultL } qnial> tstOptr "ndx_idx_localTo_ndx_chk_testSimple o ndx_idx_localTo_ndx_chk_testSimple 3 0 4 +--+--------------+-------------------+-------------------------------------------------------+ | o|020_ary_intL |+---+ |+-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+---+| | | ||0 2| ||0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|0 2|| | | |+---+ |+-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+---+| +--+--------------+-------------------+-------------------------------------------------------+ >> same problem - no fault qnial> ndx_idx_localTo_ndx (4 5 reshape (tell 30)) (0 2) +--------------+---+ | 0 1 2 3 4|0 2| | 5 6 7 8 9| | |10 11 12 13 14| | |15 16 17 18 19| | +--------------+---+ >> wrong ndx_idx_chkAppOp (4 5 reshape (tell 30)) (0 2) "ndx_idx_localTo_ndx "050_ary_intL (4 5 reshape (tell 30)) (0 2) (fault '?isTypIntLVal') 'should fail - ndx is ary' +-----+ back to : qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 0 0 5 take a break until tomorrow +-----+ olde & new code IF (atomic ndx1st) THEN nryLoc := nry ; ELSE nryLoc := nry@(front ndx1st) ; ENDIF ; IF (atomic ndx1st) THEN nryLoc := nry ; ELSE nryLoc := nry@@ndx1st ; ENDIF ; nryShp := (gage shape) nryLoc ; # olde code IF (NAND ary_to_atmL LEAF isInteger intL) THEN faultL := fault '?isTypIntLNot' ; ENDIF ; 08********08 #] 09Apr2024 ndxStr_to_ndxInt_chk_testSimple [test, fix] iterations qnial> tstOptr "ndxStr_to_ndxInt_chk_testSimple o ndxStr_to_ndxInt_chk_testSimple 3 4 7 isLayNdxStr IS OP ndxStr change : IF (~= null (isTypIntL intL)) THEN resFltL := fault '?isLayNdxStrNot' ; ENDIF ; to : IF (~= null (isTypIntLL intL)) THEN resFltL := fault '?isLayNdxStrNot' ; ENDIF ; qnial> tstOptr "ndxStr_to_ndxInt_chk_testSimple o ndxStr_to_ndxInt_chk_testSimple 0 7 7 >> now nothing works 'types atomic.ndf' : need to make isTypIntLL INCLUDE [int], intL- best? OR - use all lower levels? -maybe... OR - ensure no atomic int -WRONG, then EACH doesn't work qnial> tstOptr "ndxStr_to_ndxInt_chk_testSimple o ndxStr_to_ndxInt_chk_testSimple 1 9 9 change : IF (~= null (EACH isTypIntL intLL))) THEN to : IF (~= null (link (EACH isTypIntL intLL))) THEN OK working, maybe problems for tougher tests... 08********08 #] 06Apr2024 tests nry_ndx_toLocal_nry_ndx_idx etc (10 altogetgher) qnial> nry := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) +-+-+-+-----------------+-+-+ |0|1|2|+-+-+-----------+|4|5| | | | ||1|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+-+-+-----------+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----------+| | | +-+-+-+-----------------+-+-+ qnial> nry@@3 +-+-+-----------+ |1|2|+-----+-+-+| | | || 1|2|3|| | | |+-----+-+-+| | | ||1 2 3|7|2|| | | ||2 7 2| | || | | |+-----+-+-+| +-+-+-----------+ |2|7| 2| +-+-+-----------+ qnial> nry@@(3 (0 2) (1 0)) 1 2 3 2 7 2 07Apr2024 change idx to ndx nry_ndx_toLocal_nry_ndx_idx [fix, test] iterations qnial> tstSimple "nry_ndx_toLocal_nry_ndx_idx_testSimple o nry_ndx_toLocal_nry_ndx_idx_testSimple 0 4 6 after iterations of changes : qnial> tstSimple "nry_ndx_toLocal_nry_ndx_idx_testSimple l nry_ndx_toLocal_nry_ndx_idx_testSimple 5 0 5 >> may have to change [null, [null]] local results with applications? +-----+ ndx_idx_localTo_ndx[, _testSimple] qnial> tstSimple "ndx_idx_localTo_ndx_testSimple o ndx_idx_localTo_ndx_testSimple 0 0 3 >> change resStdL +-----+ I added _chk_test??? to several tests Now to do tests again [test, fix [op, test]s] qnial> tstSimple "ndxInt_to_ndxStr_chk_testSimple l ndxInt_to_ndxStr_chk_testSimple 9 0 9 qnial> tstSimple "ndxStr_to_ndxInt_chk_testSimple +-+-------------------------------+-+-++ |o|ndxStr_to_ndxInt_chk_testSimple|0|1|| +-+-------------------------------+-+-++ >> oops, wrong terminal output? >> test was NOT run! check isLayNdxStr, _chk_appOp qnial> ndxStr_to_ndxInt '@@[3 , 0 0 ]' +-+---+ |3|0 0| +-+---+ >> OK qnial> ndxStr_to_ndxInt '@@[2 ]' 2 >> OK but should be [2] ndxStr_to_ndxInt added : IF (atomic intL) THEN intL := [intL] ; ENDIF ; qnial> ndxStr_to_ndxInt '@@[3 , 0 2 , 1 0 , 0 1 ]' +-+---+---+---+ |3|0 2|1 0|0 1| +-+---+---+---+ >> OK so maybe its the isLayNdxStr or _chkAppOp qnial> isLayNdxStr '@@[3 , 0 2 , 1 0 , 0 1 ]' ?isLayNdxStrNot >> oops change to : IF (NAND (= '@@[' (3 take ndxStr)) (= `] (last ndxStr))) THEN qnial> ary_itmP_put_aryOut '3 , 0 2 , 1 0 , 0 1 ' (`, ` ) 3 0 2 1 0 0 1 >>> OK qnial> isLayNdxStr '@@[3 , 0 2 , 1 0 , 0 1 ]' >> OK qnial> tstSimple "ndxStr_to_ndxInt_chk_testSimple +-+-------------------------------+-+-++ |o|ndxStr_to_ndxInt_chk_testSimple|0|1|| +-+-------------------------------+-+-++ >> still wrong qnial> ndxStr_chkAppOp '@@[3 , 0 2 , 1 0 , 0 1 ]' "ndxStr_to_ndxInt +-+---+---+---+ |3|0 2|1 0|0 1| +-+---+---+---+ Hah! change : ndxStr_to_ndxInt_testSimple := to : ndxStr_to_ndxInt_chk_testSimple := ????? can't find the problem, go to : +------+ qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple o nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 1 4 5 change : isLayNryNdx IS OP nry ndx { LOCAL faultL ; faultL := isLayNry nry ; IF (NOT isTypIntL ndx) THEN faultL := link faultL (fault '?isLayNryNdxNotIntL') ; ENDIF ; IF (= null faultL) THEN IF ((valence nry) ~= (gage shape ndx)) THEN faultL := link faultL (fault '?isLayNryNdxValShp') ; ENDIF ; ENDIF ; faultL } to : isLayNryNdx IS OP nry ndx { LOCAL faultL ; faultL := isLayNry nry ; IF (NOT isTypIntL ndx) THEN faultL := link faultL (fault '?isLayNryNdxNotIntL') ; ENDIF ; faultL } qnial> tstOptr "nry_ndx_toLocal_nry_ndx_idx_chk_testSimple l nry_ndx_toLocal_nry_ndx_idx_chk_testSimple 5 0 5 >> OK +------+ qnial> tstOptr "ndx_idx_localTo_ndx_chk_testSimple o ndx_idx_localTo_ndx_chk_testSimple 0 0 3 change : link (front ndxLocal) idxLocal to: append ndxLocal idxLocal qnial> tstOptr "ndx_idx_localTo_ndx_chk_testSimple l ndx_idx_localTo_ndx_chk_testSimple 3 0 3 >> OK >> may later have a problem with (atomic ndx) +------+ qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple o nry_itm_get_ndxL_chk_testSimple 0 7 12 >> change nry_itm_get_ndxL to ndxInt basis this uses recursion! qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple o nry_itm_get_ndxL_chk_testSimple 3 7 12 change : ndxOutL := append ndxOutL (link ndxInn (ndxInt_to_ndxStr idxL) ']') ; ndxLNot := append ndxLNot (link ndxInn (ndxInt_to_ndxStr idxL) ' ') ; to : ndxOutL := append ndxOutL idxL ; ndxLNot := append ndxLNot idxL ; 07Apr2024 nry_itm_get_ndxL works with DOUBLE solitary for one-only ndxL!!??!! qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple l nry_itm_get_ndxL_chk_testSimple 12 7 12 >> OK +------+ qnial> nry_itm_get_ndxL_chk_testSpecial >> special test results are garbage... 07Apr2024 nry_itm_get_ndxL_chk_testSpecial - come back later +------+ qnial> tstOptr "nry_sub_get_ndx1stL_chk_testStd o nry_sub_get_ndx1stL_chk_testStd 0 20 27 I must add back code for '?isLayNrySubVlc'!!! qnial> tstOptr "nry_sub_get_ndx1stL_chk_testStd o nry_sub_get_ndx1stL_chk_testStd 6 20 27 qnial> tstOptr "nry_sub_get_ndx1stL_chk_testStd o nry_sub_get_ndx1stL_chk_testStd 12 20 27 >> still much work to do ... stop here for night 08********08 #] 06Apr2024 idxStr_to_idxIntL [fix, test] iterations idxStr_to_idxIntL '@@[2 ]' ?.. Idxsubstr := ary_itm_cut_subl Idxstr `, -->[nextv] ++ || ++ >> hmmm, cut returns null if itm notIn - should I change this? qnial> idxStr_to_idxIntL '@@[2 ]' 2 qnial> a := idxStr_to_idxIntL '@@[2 , 3 4 ]' +-+---+ |2|3 4| +-+---+ qnial> EACH isTypIntL a +++ ||| +++ >> OK qnial> tstSimple "idxStr_to_idxIntL_testSimple o idxStr_to_idxIntL_testSimple 5 0 8 qnial> tstSimple "idxStr_to_idxIntL_testSimple l idxStr_to_idxIntL_testSimple 7 0 7 >> finally, MANY iterations later 06Apr2024 idxStr_to_idxIntL - issue of atimic idxIntL may come up!? +-----+ olde code FOR subStr WITH idxSubStr DO intSubStr := ary_itm_cut_subL subStr ` ; % ignore str of spaces! ; % but the real problem is an unknown lst of ?[null, space, whatever]? ; IF (NAND (` EACHRIGHT = intSubStr)) THEN intL := execute intSubStr ; IF (= null (isTypIntL intL)) THEN resFlt := resFltL append intL ; ELSE resFltL := fault '?idxStrToIdxIntLNot' ; break 'error' ; ENDIF ; ENDIF ; ENDFOR ; 08********08 #] 06Apr2024 idxIntL_to_idxStr should be fixed to handle when initial idxIntL is a list!! must check if an idxIntSubL starts the idxIntL, if so, comma ONLY after all idxIntSubL idxIntL_to_idxStr (2 (3 4)) -->[nextv] idxInt 3 4 ?.. isinteger Idxint -->[nextv] o o ?.. ( istypintl Idxint ) -->[nextv] ?.. istypintl Idxint -->[nextv] ?L >> uh-oh, why the error? idxIntL_to_idxStr : change : ELSEIF (isTypIntL idxInt) THEN resFltL := link resFltL ']' ; to : ELSEIF (= null (isTypIntL idxInt)) THEN resFltL := link (3 dropright resFltL) ']' ; qnial> idxIntL_to_idxStr (2 (3 4)) @@[2 , 3 4 ] >> OK qnial> tstSimple "idxIntL_to_idxStr_chk_testSimple l idxIntL_to_idxStr_chk_testSimple 9 0 9 >> finally, after many iterations, it works 08********08 #] 05Apr2024 problem : I don't know the format of idxIntL deep indexing!! deepupdate P A B Put array B at path A in variable named by the string, phrase or cast P ; return deepplace (B P) A The operation deepplace returns an array the same as A except that the array at path P is replaced by B. It is the insertion operation corresponding to the selection operation reach and generalizes the operation place from addresses to paths. nry := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) idxIntL := 1 B := "test a := deepupdate 'nry' idxIntL B qnial> a := deepupdate 'nry' idxIntL B +-+----+-+-----------------+-+-+ |0|test|2|+-+-+-----------+|4|5| | | | ||1|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+-+-+-----------+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----------+| | | +-+----+-+-----------------+-+-+ >> OK idxIntL := 3 (0 0) qnial> a := deepupdate 'nry' idxIntL B +-+----+-+--------------------+-+-+ |0|test|2|+----+-+-----------+|4|5| | | | ||test|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+----+-+-----------+| | | | | | || 2|7| 2|| | | | | | |+----+-+-----------+| | | +-+----+-+--------------------+-+-+ >> OK idxIntL := 3 (0 2) (0 0) qnial> a := deepupdate 'nry' idxIntL B +-+----+-+--------------------+-+-+ |0|test|2|+----+-+-----------+|4|5| | | | ||test|2|+-----+-+-+|| | | | | | || | ||test |2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+----+-+-----------+| | | | | | || 2|7| 2|| | | | | | |+----+-+-----------+| | | +-+----+-+--------------------+-+-+ idxIntL := 3 (0 2) (1 0) (0 1) qnial> a := deepupdate 'nry' idxIntL B +-+----+-+-----------------------+-+-+ |0|test|2|+----+-+--------------+|4|5| | | | ||test|2|+--------+-+-+|| | | | | | || | ||test |2|3||| | | | | | || | |+--------+-+-+|| | | | | | || | ||1 test 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+--------+-+-+|| | | | | | |+----+-+--------------+| | | | | | || 2|7| 2|| | | | | | |+----+-+--------------+| | | +-+----+-+-----------------------+-+-+ >> OK qnial> tstSimple "idxIntL_to_idxStr_chk_testSimple o idxIntL_to_idxStr_chk_testSimple 3 7 8 idxIntL := 3 (0 2) (1 0) (0 1) NAND link LEAF isInteger idxIntL change : resFlt := link '@@[' (link link ((EACH string idxIntL) EACHLEFT link ' ')) ']' ; to : resFlt := link '@@[' (link link ((LEAF string idxIntL) EACHLEFT link ' ')) ']' ; qnial> tstSimple "idxIntL_to_idxStr_chk_testSimple o idxIntL_to_idxStr_chk_testSimple 8 0 9 >> OK, one error, but that is because initial idxIntL is a list, commas inserted 05Apr2024 idxIntL_to_idxStrshould be fixed to handle when initial idxIntL is a list!! 08********08 #] 04Apr2024 'arrays nested.ndf' [update, test] iterations qnial> tstSimple "idxIntL_to_idxPth_testSimple o idxIntL_to_idxPth_testSimple 0 4 4 >> all are fault '?not an operation' 14:58 tests : idxIntL_to_idxPth_chk_testSimple := "tstSimple 1 "d_nryTst ( "000_int 2 (fault '?isTypIdxIntLNot') 'should fail - intL not a lst' "005_int [2] '@@[2 ]' 'should be OK' "010_intL (2 3 4) ['@@[2 3 4 ]'] 'should be OK, is for a 3D ary' "020_intLL (2 (3 4)) (fault '?isTypIdxIntLNot') 'should be OK' ) ; idxIntL_to_idxPth [2] '@@[2 ]' CHANGE BACK to idxStr from idxPth : more clarity +-----+ tstSimple "idxIntL_to_idxStr_chk_testSimple >must link idxStr results idxIntL_to_idxStr change : resFlt := link '@@[' ((EACH string idxIntL) EACHLEFT link ' ') ']' ; to : resFlt := link '@@[' (link ((EACH string idxIntL) EACHLEFT link ' ')) ']' ; isTypIdxIntL is NOT a good test: must be more specific as to what is allowed for idxIntL!! +-----+ olde code 08********08 #] 04Apr2024 finish AND [nry, byVal] tests : [fix stdRes, test] iterate +-----+ nry_itm_byValGet_ndxL_chk_testSimple start time : 2Apr2024 15h46m23s +--+--------------+----------------------------------+----------------------------------+ | o|243_intLA_int |?aryItmGetNdxLNon |?aryItmByValGetNdxLNon | +--+--------------+----------------------------------+----------------------------------+ | o|260_intLA_intL|?aryItmGetNdxLNon |?aryItmByValGetNdxLNon | +--+--------------+----------------------------------+----------------------------------+ >> resStds are WRONG! change : ?aryItmGetNdxLNon to : ?aryItmByValGetNdxLNon rerun qnial> nry_itm_byValGet_ndxL_testSpecial >> OK, all resCalc are correct, I fixed "double-logfile" problem +-----+ qnial> tstOptr "nry_sub_byValGet_ndx1stL_chk_testSimple o nry_sub_byValGet_ndx1stL_chk_testSimple 0 0 5 >> haven't yet converted resStd from idxIntLL to idxStr +--+-------------+-------------------+-------+ | o|050_intA_intA| 0 1 2 3 4 |4 5 | | | | 5 6 7 8 9 | | | | |10 11 12 13 14 | | | | |15 16 17 18 19 | | +--+-------------+-----------------------+-----------------------+ | o|050_intA_intA|?spAllia1 |+--------+ | | | | ||@@[0 4 ]| | | | | |+--------+ | +--+-------------+-----------------------+-----------------------+ >> My guess is that resStd is correct, but must look at op idxLocalL := idxLocal EACHRIGHT + (tell subShp) ; subLocal := nryLocal#idxLocalL ; >> check this later... 08********08 #] 02Apr2024 DONE!! : post-"split files" [change ops, run tests] see "$d_Qndfs"'arrays nested zByVal.ndf' "$d_Qtest"'arrays nested byVal/arrays nested- zByVal testOptrs.ndf' +-----+ qnial> tstSimple "nry_ndx_byValToLocal_nry_ndx_idx_testSimple o nry_ndx_byValToLocal_nry_ndx_idx_testSimple 5 0 6 >> OK, known problem with one of tests answer looks right but is somehow wrong +-----+ qnial> tstSimple "ndx_idx_byValLocalTo_ndx_testSimple o ndx_idx_byValLocalTo_ndx_testSimple 0 0 3 >> works except extra spaces put into ndxL, MISSING `] +--+ "030_int ndx := '@@[3, 4 5 , 9 2 8 ]' idx := '4 ' std := '@@[3, 4 5 , 9 2 8 , 4 ]' res := ndx_idx_byValLocalTo_ndx ndx idx 'should be OK' >> seems OK, except extra spaces link (front ndx) ', ' idx ']' >> OK - fixed, works +-----+ qnial> nry_itm_byValGet_ndxL_testSpecial this calls : tstOptr "nry_itm_byValGet_ndxL_chk_testSimple >> runs perfectly! just set QNial "terminal prompt width" smaller 'QNial setup.ndf' : change : setwidth 110 ; % normal is 80 characters, can do much more on high-res ; to : setwidth 105 ; % normal is 80 characters, can do much more on high-res ; >> WRONG!! I need to change terminal display (it did), not file print width +-----+ qnial> tstOptr "nry_sub_byValGet_ndx1stL_chk_testStd o nry_sub_byValGet_ndx1stL_chk_testStd 0 20 27 >> all failed oops, have to change resStdL +-----+ tstOptr "nry_sub_byValGet_ndx1stL_chk_testSimple nry_sub_byValGet_ndx1stL ndx1stL := execute resFltL >> I fixed resStdL, then all was fine!! 08********08 #] 02Apr2024 ?undefined identifier: fault msg has comment line (as earlier examples) >>>>>> loading start : arrays nested/arrays nested- testOptrs.ndf ?undefined identifier: % first, fun testSimple ; ... and diff file ... >>> loading start : arrays nested byVal/arrays nested- zByVal testOptrs.ndf ?undefined identifier: % first, fun testSimple ; look for mis-spelled [op, var] : 'QNial setup.ndf' - should loaddef generic test op file BEFORE actual test-data files Howell_core_tests := ... (link d_Qtest 'QNial test optrs.ndf') >> OK, now works! loaddef missing after quick changes made to 'QNial setup.ndf' Howell_core_tests lst 08********08 #] 01Apr2024 [callBy [value, name], ndx[IntLL, Str]] versions of [ary, nry] ops? both [atomic, nested] ops, here focus is nested : +-----+ to (conversions) intL_to_idxStr IS OP intL - standard idxL format output, also convert int to intL nry_ndx_toLocal_nry_ndx_idx IS OP nry ndx - conversion ndx_idx_localTo_ndx IS OP ndxLocal idxLocal - conversion nryShp_subShp_idx1st_get_bolFit IS OP nryShp subShp idx1st - l (true) if shape fits, o (false) otherwise +-----+ ndx for itm ops : nry_ndx_get_itm IS OP nry ndx - returns itm at ndx nry_itm_get_ndxL IS OP nry itm - returns OR(ndxL, faultL) ndxL = all positions of itm in nry, makes use of recursive search nry_sub_get_ndx1stL IS OP nry sub - ndxL of 1st item of sub that "fits" in nested nry "current-depth-ONLY" version, uses ary_sub_get_idx1stL "across-depth-ONLY" version has not been created yet 29Mar2024 key thing is to save [time, compute] with large nry not necessary to pass [[ary, nry]*[, sub]] for many ops [, deep]*[update, ?value?] REQUIRE phrases, avoid copies maybe default should be Maybe cp [opVal, ndxStr]NamL above to versions called : opNamVal : eg: nryVal_subVal_get_ndx1stLStr IS OP nryVal subVal ndxStr : eg. nryVal_ndxStr_get_itm IS OP nryVal ndxStr adapt [op(Phr), ndx(IntLL)]NamL to [deep]*[update, ?value?] versions 1st made copies in 'arrays nested.ndf' qnial> tNow 10:35:02 now to change tests - create separate file? 08********08 #] 30Mar2024 create [ndx_toLocal_ndx_idx, ndx_idx_localTo_ndx, nry_sub_ndx_get_bolFit] see "$d_Qndfs"'arrays nested.ndf' nryLocal ndxLocal idxLocal := nry_ndx_toLocal_nry_ndx_idx nry ndx ; ndx := ndx_idx_localTo_ndx ndxLocal idxLocal ; bolNrySubNdxFit := nry_sub_ndx_get_bolFit nry sub ndx ; 31Mar2024 # tests create [intL_to_idxStr, nry_ndx_toLocal_nry_ndx_idx, ndx_idx_localTo_ndx]_testSimple see "$d_Qtest"'arrays nested/arrays nested- testOptrs.ndf' check files after screw-up, at laundromat : 10:41$ diff "$d_home"'Documents/arrays nested- testOptrs.ndf' "$d_Qtest"'arrays nested/arrays nested- testOptrs.ndf' --suppress-common-lines >> OK 10:41$ diff "$d_home"'Documents/QNial.html' "$d_Qroot"'QNial.html' --suppress-common-lines >> OK 10:41$ diff "$d_home"'Documents/types atomic.ndf' "$d_Qtest"'arrays nested/types atomic.ndf' --suppress-common-lines >> OK 10:41$ diff "$d_home"'Documents/types nested.ndf' "$d_Qndfs"'types nested.ndf' --suppress-common-lines >> OK ary_atm_in '@@[]' `, nry := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) ndx := '@@[3, 0 2 ]' nry_ndx_toLocal_nry_ndx_idx nry ndx ndxLocal := first (host_result (link 'echo ' chr_apo ndx chr_apo ' | sed "s|\(@@\[\)\(.*\)\,.*\]|@@\[\2\]|"' )) +-----+ after many fixes!! qnial> tstSimple "nry_ndx_toLocal_nry_ndx_idx_testSimple o nry_ndx_toLocal_nry_ndx_idx_testSimple 0 1 3 >> resStds are incorrect 31Mar2024 Tests are a great lesson for me: I was anticipating the wrong answers!! >> however, it's not what I want - nryLocal should be the subAry I am focussing on Or is it? I am getting the "host" subNry was the idxLocal provided as a str? YES!! >> is this an oops? it seems like it. I fixed it, now works better. change : idxLocal := intL_to_idxStr (execute (first host_result (link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[\(.*\)\]|\1|"' ))) ; to : idxLocal := (execute (first host_result (link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[\(.*\)\]|\1|"' ))) ; sometimes training spaces, sometimes not : 015_intA 023_intA @@[3, 0 2] 025_intA @@[3, 0 2, 1 0 ] what just happened? now instead of [fault '?intLToIdxStrNot'] I get null shouldn't idxLocal always be a list? 015_intA [3] is wrong, 3 accepted why? does EACH remove that? What is wrong with 015_intA? should '@@[ ]' have a [null]? idxLocal= OR[3, [3]]? neither seems to work (didn't try ndxLocal with a null) leave this for now, do other tests 08********08 #] 29Mar2024 nry_ndx_get_itm [adapt, fix, tst] bigger challenge qnial> nry := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) +-+-+-+-----------------+-+-+ |0|1|2|+-+-+-----------+|4|5| | | | ||1|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+-+-+-----------+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----------+| | | +-+-+-+-----------------+-+-+ qnial> sub := 2 3 reshape (1 2 3 2 7 2) 1 2 3 2 7 2 qnial> nry_sub_get_ndxL nry sub ?arySubGetNdxLNon qnial> nry_sub_get_ndxL nry (1 2) ?arySubGetNdxLNon >> darn! link (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|\(@@\[.*\)\,*.*\]|\1|" ')) ']' 30Mar2024 isLayNryNdx IS OP nry idx fix: wrong return for intL idx IF (NOT isTypIntL idx) THEN faultL := link faultL (fault '?isLayNryNdxNotIntL') ; ENDIF ; +-----+ olde code % convert ndx from @@pth to idx for Local subAry ; % I haven't checked the status of my old-style string ops, so I use bash here ; idxPoint := execute first host_result link 'echo ' chr_apo strAryPoint chr_apo ' | sed "s|.*\,\(.*\)\]|\1|"' ; idxLocal := ndx1st EACHRIGHT + (tell subShp) ; 08********08 #] 29Mar2024 nry_ndx_get_itm [adapt, fix, tst] iterations nry := 'the bigg fat cow' ndx := '@@[3 ]' >> works, but not a great example qnial> nry := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) +-+-+-+-----------------+-+-+ |0|1|2|+-+-+-----------+|4|5| | | | ||1|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+-+-+-----------+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----------+| | | +-+-+-+-----------------+-+-+ qnial> ndx := '@@[3, 0 2 , 1 0 ]' @@[3, 0 2 , 1 0 ] qnial> nryTmp := nry +-+-+-+-----------------+-+-+ |0|1|2|+-+-+-----------+|4|5| | | | ||1|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+-+-+-----------+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----------+| | | +-+-+-+-----------------+-+-+ qnial> resFlt := execute link 'nryTmp' ndx 1 2 3 2 7 2 >> perfect! 08********08 #] 29Mar2024 nry_sub_get_ndxL - merge with now-deleted nry_sub_get_ndx1stL, adapt quick test of just-completed 1st iteration of fixes : "010_str_chr 'the bigg fat cow' [` ] ([3] [8] [12]) 'should be OK' nry_sub_get_ndxL 'the bigg fat cow' [` ] >> nyet nry := 'the bigg fat cow' sub := [` ] qnial> ndx := '@@[3 ]' @@[3 ] qnial> host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@[.*[,]*\(.*\)\]|\1|"' +--+ |3 | +--+ % strange sedExpr '@@[.*' and NOT '@@\[.*' ??? ; qnial> idx := execute first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@[.*[\,]*\(.*\)\]|\1|"') 3 qnial> isInteger idx l new expression for no comma : qnial> execute (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[\(.*\)\]|\1|"' )) 3 qnial> := execute (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[\(.*\)\]|\1|"' )) 3 qnial> isInteger idx l >> OK new expression for comma : qnial> ndx := '@@[3 2, 4, 6 7 2, 5]' @@[3 2, 4, 6 7 2, 5] qnial> idx := execute (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[.*\,\(.*\)\]|\1|"')) 5 qnial> isInteger idx l >> OK Can I collapse tboth expressions for idx? qnial> ndx @@[3 2, 4, 6 7 2, 5] qnial> execute (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[.*[\,]\(.*\)\]|\1|"')) 5 >> seems OK? try it with multi-tests and see DIDN'T work!! go back to compund statement Also, qnial> nry_ndx_get_itm nry '@@[3 ]' ?nryNdxItmNot >> so this op isn't working nry_ndx_get_itm IS OP nry ndx { LOCAL resFltL ; resFlt := ndx pick nry ; IF (isFault resFlt) THEN fault '?nryNdxItmNot' ELSE resFlt ENDIF } >> hah!, bullshit, I never adapted this >> have to [adapt, fix, test] nry_ndx_get_itm +-----+ Try again nry := 'the bigg fat cow' sub := [` ] nry_sub_get_ndxL 'the bigg fat cow' [` ] ?.. IF Bolndxlfit THEN Sublocal := Nrylocal # Idxlocal ; (...) -->[nextv] ?.. Bolndxlfit -->[nextv] l ?L >> oops, what happened here? check nryLocal := 'the bigg fat cow' qnial> nryLocal#3 >> OK, but can't see what is happening +-----+ go back to : "010_str_chr 'the bigg fat cow' [` ] ([3] [8] [12]) 'should be OK' lq_nry qnial> nry := 'the bigg fat cow' the bigg fat cow qnial> sub := [` ] qnial> ndx := '@@[3 ]' @@[3 ] qnial> nry_sub_get_ndxL 'the bigg fat cow' [` ] ?.. Idx := execute ( first ( host_result link 'echo ' Chr_apo Ndx Chr_apo ' | sed "s|@@\[.*[\,]\(.*\)\]|\1|"' ) ) -->[nextv] ?tokens left: <***> @ @ [ ?.. % -->[nextv] ndx @@[3 ] idx := execute (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[.*[\,]\(.*\)\]|\1|"' )) remove : IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; qnial> nry_sub_get_ndxL 'the bigg fat cow' [` ] ?.. islayatm Sublocal -->[nextv] ?L >> many fixes later : qnial> nry_sub_get_ndxL 'the bigg fat cow' [` ] +------+------+-------+ |@@[3 ]|@@[8 ]|@@[12 ]| +------+------+-------+ >> perfect +-----+ bigger challenge qnial> nry := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) +-+-+-+-----------------+-+-+ |0|1|2|+-+-+-----------+|4|5| | | | ||1|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+-+-+-----------+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----------+| | | +-+-+-+-----------------+-+-+ qnial> sub := 2 3 reshape (1 2 3 2 7 2) 1 2 3 2 7 2 qnial> nry_sub_get_ndxL nry sub ?arySubGetNdxLNon qnial> nry_sub_get_ndxL nry (1 2) ?arySubGetNdxLNon >> darn! take a break, find&pay Collette +-----+ Also - fix long-standing loaddef problem (just distracting for now) : >>>>>> loading start : arrays atomic/arrays atomic- testOptrs.ndf ?undefined identifier: IDXSEQ { ARY_IDXSEQ_CHKAPPOP <***> ARY IDXSEQ "ary_idxSeq_to_slc <<<<<< loading ended : arrays atomic/arrays atomic- testOptrs.ndf >> done, clean startup loaddefs again +-----+ olde code IF (NOR (= null nry) (ary_hasFaults strLAryPoint)) THEN subTellShp := tell (gage shape sub) ; resFltL := null ; FOR strAryPoint WITH strLAryPoint DO % convert ndx from @@pth to idx for Local subAry ; % I haven't checked the status of my very old-style string ops, so I use bash here ; idxPoint := execute first host_result link 'echo ' chr_apo strAryPoint chr_apo ' | sed "s|.*\,\(.*\)\]|\1|"' ; % get the localNry that idxLocalA refers to ; ndxPoint := link (execute first host_result link 'echo ' chr_apo strAryPoint chr_apo ' | sed "s|.*[.*\,.*\)\]|\1|"' ) ']' ; ndxLocal := nry_ndx_get nry ndxPoint ; IF (NOT isFault ndxLocal) THEN idxLocalA := idxL EACHRIGHT + subTellShp ; subLocal := nryLocalA#idxLocalA ; % 29Mar2024 may have shape problem ? ; IF (= sub subLocal) THEN resFltL := link resFltL [ndxPoint] ; ENDIF ; ENDIF ; ENDFOR ; IF (= null resFltL) THEN resFltL := [fault '?nrySubGetNdxLNon'] ; ENDIF ; ndxPoint := link (execute first host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|.*[.*\,.*\)\]|\1|"' ) ']' ; IF flag_debug THEN write 'loading nry_sub_get_ndxL' ; ENDIF ; # nry_sub_get_ndxL IS OP nry sub - posnAL of sub within in nry, or faultL # sub must be valence >= 1 (not an atom), and must match nry valence # looking at 2D+ here, but confined to current level of ary # what about "match across nested depth"? !!!!!!!!!!!!!!!!!!!! # 15-27Mar2024 initial, [cp, adapt] from ary_sub_get_idxL in 'arrays atomic.ndf' # 28Mar2024 this version is for "current-level-ONLY", not across depth # IF flag_break THEN BREAK ; ENDIF ; nry_sub_get_ndxL IS OP nry sub { LOCAL aryPoint ndxA resFltL strAryPoint strLAryPoint sub subLocal subTellShp ; % ; IF flag_break THEN BREAK ; ENDIF ; % returns OR["legitimate fit" ndx1stL, fault] ; strLAryPoint := nry_sub_get_ndx1stL nry sub ; IF (= null resFltL) THEN resFltL := [fault '?nrySubGetNdxLNon'] ; ENDIF ; resFltL } # fault codes (can't have apos! use quotes) : nry_itm_get_ndxL faults sub not found #? nry_sub_get_ndxL ?nrySubGetNdxLNon (= null resFltL) ndxL not found % ; % get the nryLocal that idxLocal refers to ; idxLMax := ndx1stL EACHLEFT sum shapeSub ; fit1stSubItmndxAL := bolNdxLFit subList ndx1stL ; % view intermediates : ndx1stL idxLMax fit1stSubItmndxAL bolNdxLFit ; IF (= null fit1stSubItmndxAL) THEN resFltL := fault '?arySubGetNdx1st1' ; ELSEIF (ary_hasFaults fit1stSubItmndxAL) THEN resFltL := fault '?arySubGetNdx1st2' ; ELSE resFltL := fault '?arySubGetNdx1st2' ; ELSE fit1stSubItmndxAL := bolNdxLFit subList ndx1stL ; % view intermediates : ndx1stL idxLMax fit1stSubItmndxAL bolNdxLFit ; IF bolNdxLFit THEN mch1stSubItmndxAL := null ; FOR ndx WITH fit1stSubItmndxAL DO %ndxA := ndx + (tell shapeSub) ; ndxA := sub_ndxUL_to_ndxA sub ndx ; % 15Dec2022 works ONLY with a single ndx as solitary!! ; slicer := nry_ndxL_to_slc nry ndxA ; subt := execute link 'nry|' slicer ; IF (ary_hasFaults subt) THEN mch1stSubItmndxAL := fault '?arySubGetNdx1st3' ; ELSE IF (isLayAtm subt) THEN subt := [subt] ; ENDIF ; IF (= sub subt) THEN mch1stSubItmndxAL := append mch1stSubItmndxAL ndx ; ENDIF ; ENDIF ; ENDFOR ; resFltL := mch1stSubItmndxAL ; ENDIF ; IF (= null (ary_atm_in ndx `,)) THEN idx := execute (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[.*\,\(.*\)\]|\1|"' )) ; ELSE idx := execute (first (host_result link 'echo ' chr_apo ndx chr_apo ' | sed "s|@@\[\(.*\)\]|\1|"')) ; ENDIF ; 08********08 #] 28Mar2024 nry_sub_get_ndxL setup to start work cp tests for ary_sub_get_idxL from : "$d_Qtest"'arrays nested/arrays nested- testOptrs 240319 11h48m28s.ndf' '@@[0 0 , 0 2 ]' '@@[0 1 , 0 2 ]' '@@[1 0 , 0 2 ]' '@@[1 1 , 0 0 , 0 2 ]' '@@[1 1 , 0 1 , 0 2 ]' '@@[1 1 , 0 2 , 0 2 ]' '@@[1 1 , 1 0 , 0 2 ]' '@@[1 1 , 1 1 , 0 2 ]' '@@[1 1 , 1 2 , 0 2 ]' '@@[1 1 , 2 0 , 0 2 ]' '@@[1 1 , 2 1 , 0 2 ]' '@@[1 1 , 2 2 , 0 2 ]' '@@[2 0 , 0 2 ]' '@@[2 1 , 2 ]' '@@[2 2 , 0 2 ]' 18:26$ chr_apo="'" ~ 18:26$ echo "$chr_apo" ' 18:29$ aryPoint='@@[0 0 , 0 2 ]' ~ 18:30$ echo "$chr_apo$aryPoint$chr_apo" '@@[0 0 , 0 2 ]' ~ 18:30$ echo "$chr_apo$aryPoint$chr_apo" | sed "s|.*\,\(.*\)\]|\1|" 0 2 ' >> OK except trailing apo - where did it come from? 18:33$ echo "$aryPoint" | sed "s|.*\,\(.*\)\]|\1|" 0 2 >> OK qnial> a := execute ' 0 2 ' 0 2 qnial> first a 0 qnial> second a 2 >> OK qnial> strAryPoint := '@@[0 0 , 0 2 ]' @@[0 0 , 0 2 ] qnial> link 'echo ' chr_apo strAryPoint chr_apo ' | sed "s|.*\,\(.*\)\]|\1|"' echo '@@[0 0 , 0 2 ]' | sed "s|.*\,\(.*\)\]|\1|" qnial> host_result link 'echo ' chr_apo strAryPoint chr_apo ' | sed "s|.*\,\(.*\)\]|\1|"' +-----+ | 0 2 | +-----+ qnial> first host_result link 'echo ' chr_apo strAryPoint chr_apo ' | sed "s|.*\,\(.*\)\]|\1|"' 0 2 qnial> b := execute first host_result link 'echo ' chr_apo strAryPoint chr_apo ' | sed "s|.*\,\(.*\)\]|\1|"' 0 2 qnial> second b 2 +-----+ olde code % won't work with @@ndx ; % ndxA := aryPoint EACHRIGHT + subTellShp ; % 28Mar2024 limited to current "depth" of nry ; % atomic ary doesn't work - cannot have idxL ; IF (isLayAtm ndxLocal) THEN ndxLocal := fault '?nrySubGetNdxLNdxNot' ; ENDIF ; % ; % 05Mar2024 why doesn't this just use nry_itm_get ndxL nry (first sub) ??? ; % or is it a completely different functionality? ; 08********08 #] 27Mar2024 nry_itm_get_ndxL_chk_testSpecial add tests, standard output op done - it works +-----+ olde code % ; IF bolRes THEN fLog writefile '>> OK works : = stdL resL' ; ELSE flog writefile '>> FAILS!! : ~= stdL resL' ; flog writefile 'stdL for nry_itm_get_ndxL nryInn 2 : ' ; fLog writefile (picture stdL) ; ENDIF ; fLog writefile '' ; 08********08 #] 26Mar2024 run nry_itm_get_ndxL_chk_testSpecial, adjust resStd results in "$d_Qtest"'arrays nested/test results/nry_itm_get_ndxL_chk_testSimple log.txt' I had mistakes in resStdL - easy problem to make. still a failure with 2nd sepecial tests - but even geany serch shows the same? 08********08 #] 26Mar2024 nry_itm_get_ndxL: I'm still struggling: finally worked!! changes to 'arrays nested.ndf' ??? 11:54$ diff "$d_Qndfs"'arrays nested.ndf' "$d_Qndfs"'arrays nested 240325.ndf' --suppress-common-lines 3c3 < #] loaddefs link d_Qndfs 'arrays nested.ndf' - operators for nested arrays --- > #] loaddefs link d_Qndfs 'arrays nested.ndf' - optrs for nested arrays ~ >> OK, not an issue, don't care 12:49 -->[nextv] 0 = idx l >> OK, idx is an int -->[nextv] b := intL_to_str (0 1 2) 0 1 2 -->[nextv] isString b l -->[nextv] b := intL_to_str [0 1 2] ?intLToStrANotintL >> ahhhh - that's a clue -->[nextv] c := intL_to_str [2] 2 -->[nextv] isString c l change : FOR idx WITH idxA DO IF (idx in idxLYes) THEN ndxYesL := append ndxLYes (link ndxInn (intL_to_str [idx]) ']') ; ELSE idxLNot := link idxLNot idx ; ndxLNot := append ndxLNot (link ndxInn (intL_to_str [idx]) ' ') ; ENDIF ; ENDFOR ; to : FOR idx WITH idxA DO IF (isInteger idx) THEN idx := [idx] ; ENDIF ; IF (idx in idxLYes) THEN ndxYesL := append ndxLYes (link ndxInn (intL_to_str idx) ']') ; ELSE idxLNot := link idxLNot idx ; ndxLNot := append ndxLNot (link ndxInn (intL_to_str idx) ' ') ; ENDIF ; ENDFOR ; nry_itm_get_ndxL (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) 2 ?.. Idx in Idxlyes -->[nextv] o -->[nextv] idxLYes 2 -->[nextv] 2 in 2 l -->[nextv] 2 in [2] l +-----+ qnial> A := tell 10 0 1 2 3 4 5 6 7 8 9 qnial> a@@[] 0 1 2 3 4 5 6 7 8 9 >> so @@ apth OK for itm = nry change : nry_itm_get_ndxL IS OP nry itm { LOCAL resFltL ; IF (= nry itm) THEN resFltL := fault '?aryItmGetNdxLEqual' ; ELSE ndxInn := '@@[' ; resFltL := nry_itm_ndxInn_get_ndxL_recurse nry itm ndxInn ; ENDIF ; IF (= null resFltL) THEN resFltL := fault '?aryItmGetNdxLNon' ; ENDIF ; resFltL } to : nry_itm_get_ndxL IS OP nry itm { LOCAL resFltL ; ndxInn := '@@[' ; resFltL := nry_itm_ndxInn_get_ndxL_recurse nry itm ndxInn ; IF (= null resFltL) THEN resFltL := fault '?aryItmGetNdxLNon' ; ENDIF ; resFltL } remove : IF (~= null ndxLYes) THEN ndxOutL := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; ENDIF ; change: IF (idx in idxLYes) THEN ndxLYes := append ndxLYes (link ndxInn (intL_to_str idxL) ']') ; ELSE to : IF (idx in idxLYes) THEN ndxOutL := append ndxOutL (link ndxInn (intL_to_str idxL) ']') ; ELSE change : FOR idx WITH idxLNotAtm DO ndxNxt := link (string idx) ', ' ; to : FOR idx WITH (tell idxLNotAtm) DO ndxNxt := link ndxInn (intL_to_str idxL) ', ' ; qnial> nry_itm_get_ndxL (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) 2 +-------------+-------------------+ |idxLNotAtm = |3 | +-------------+-------------------+ |nryLNotAtm = |+-----+ | | ||1 2 3| | | ||6 7 8| | | |+-----+ | +-------------+-------------------+ |nryItmNdxL = |+-----------------+| | ||+-----+-+-------+|| | |||1 2 3|2|@@[3 , ||| | |||6 7 8| | ||| | ||+-----+-+-------+|| | |+-----------------+| +-------------+-------------------+ +------+------------+ |@@[2 ]|@@[3 , 0 1 ]| +------+------------+ >> perfect! +-----+ nry_itm_get_ndxL (0 1 2 (2 3 reshape 2) 4 5) 2 qnial> nry_itm_get_ndxL (0 1 2 (2 3 reshape 2) 4 5) 2 +-------------+-------------------+ |idxLNotAtm = |3 | +-------------+-------------------+ |nryLNotAtm = |+-----+ | | ||2 2 2| | | ||2 2 2| | | |+-----+ | +-------------+-------------------+ |nryItmNdxL = |+-----------------+| | ||+-----+-+-------+|| | |||2 2 2|2|@@[3 , ||| | |||2 2 2| | ||| | ||+-----+-+-------+|| | |+-----------------+| +-------------+-------------------+ +------+------------+------------+------------+------------+------------+------------+ |@@[2 ]|@@[3 , 0 0 ]|@@[3 , 0 1 ]|@@[3 , 0 2 ]|@@[3 , 1 0 ]|@@[3 , 1 1 ]|@@[3 , 1 2 ]| +------+------------+------------+------------+------------+------------+------------+ >> perfect again! +-----+ qnial> a := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 2 7 2) 2 7 2) 4 5) +-+-+-+-----------+-+-+ |0|1|2|+-+-+-----+|4|5| | | | ||1|2|1 2 3|| | | | | | || | |2 7 2|| | | | | | |+-+-+-----+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----+| | | +-+-+-+-----------+-+-+ qnial> nry_itm_get_ndxL a 2 +-------------+-------------------------+ |idxLNotAtm = |3 | +-------------+-------------------------+ |nryLNotAtm = |+-----------+ | | ||+-+-+-----+| | | |||1|2|1 2 3|| | | ||| | |2 7 2|| | | ||+-+-+-----+| | | |||2|7| 2|| | | ||+-+-+-----+| | | |+-----------+ | +-------------+-------------------------+ |nryItmNdxL = |+-----------------------+| | ||+-----------+-+-------+|| | |||+-+-+-----+|2|@@[3 , ||| | ||||1|2|1 2 3|| | ||| | |||| | |2 7 2|| | ||| | |||+-+-+-----+| | ||| | ||||2|7| 2|| | ||| | |||+-+-+-----+| | ||| | ||+-----------+-+-------+|| | |+-----------------------+| +-------------+-------------------------+ +------+------------+------------+------------+ |@@[2 ]|@@[3 , 0 1 ]|@@[3 , 1 0 ]|@@[3 , 1 2 ]| +------+------------+------------+------------+ >> NUTS!! didn't go down the extra depth maybe the nry at that level is nested? There is no stop at the flag_break of the 1st nested recurse, let alone a second. I suspect that these are not being don? ?.. Ndxoutl := link Ndxoutl ( link EACH nry_itm_ndxinn_get_ndxl_recurse Nryitmndxl ) -->[nextv] nryItmNdxL +-----------------------+ |+-----------+-+-------+| ||+-+-+-----+|2|@@[3 , || |||1|2|1 2 3|| | || ||| | |2 7 2|| | || ||+-+-+-----+| | || |||2|7| 2|| | || ||+-+-+-----+| | || |+-----------+-+-------+| +-----------------------+ >> Ah hah!, a solitaary as one would expect -->[nextv] resume +------+------------+------------+------------+ |@@[2 ]|@@[3 , 0 1 ]|@@[3 , 1 0 ]|@@[3 , 1 2 ]| +------+------------+------------+------------+ >> the second recurse isn't happening! Why? ELSE idxLNot := link idxLNot idx ; ndxLNot := append ndxLNot (link ndxInn (intL_to_str idxL) ' ') ; ENDIF ; >> this isn't happening for 2nd recurse? Hmmm : idxLNot = 0 0 0 2 1 1 >> these are NOT proper idxs maybe should be appended instead of linked change : IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; ndxNxt := link ndxInn (intL_to_str idxL) ', ' ; nryItmNdxL := nryItmNdxL append (nryNotAtm itm ndxNxt) ; to : IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; ndxNxt := append ndxInn (intL_to_str idxL) ', ' ; nryItmNdxL := nryItmNdxL append (nryNotAtm itm ndxNxt) ; >> oops : ?argument of append must be a pair, but at least the idxs are OK |idxLNot = |0 0 0 2 1 1 >> still not paired... >> I reversed change above change : idxLNotAtm := bolLNotAtm subList idxLNot ; nryLNotAtm := idxLNotAtm choose nry ; FOR i WITH (tell (gage shape) idxLNotAtm) DO idx := idxLNotAtm@i ; nryNotAtm := nryLNotAtm@i ; IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; ndxNxt := append ndxInn (intL_to_str idxL) ', ' ; nryItmNdxL := nryItmNdxL append (nryNotAtm itm ndxNxt) ; ENDFOR ; to : idxLNotAtm := bolLNotAtm subList idxLNot ; nryLNotAtm := idxLNotAtm choose nry ; FOR i WITH (tell (gage shape) idxLNotAtm) DO idx := idxLNotAtm@i ; nryNotAtm := nryLNotAtm@i ; IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; ndxNxt := append ndxInn (intL_to_str idxL) ', ' ; nryItmNdxL := nryItmNdxL append (nryNotAtm itm ndxNxt) ; ENDFOR ; >> same problem : idxLNot = |0 0 0 2 1 1 idxLNot assigned in : FOR idx WITH idxA DO % idx is returned as int[, L] - must convert int to intL ; IF (isInteger idx) THEN idxL := [idx] ; ELSE idxL := idx ; ENDIF ; IF (idx in idxLYes) THEN ndxOutL := append ndxOutL (link ndxInn (intL_to_str idxL) ']') ; ELSE idxLNot := link idxLNot idx ; ndxLNot := append ndxLNot (link ndxInn (intL_to_str idxL) ' ') ; ENDIF ; ENDFOR ; change : idxLNot := link idxLNot idx ; to : idxLNot := append idxLNot idx ; +----------+----------------------------------------------------------+ |nry = |1 2 3 | | |2 7 2 | +----------+----------------------------------------------------------+ |idxLYes = |+---+---+---+ | | ||0 1|1 0|1 2| | | |+---+---+---+ | +----------+----------------------------------------------------------+ |idxLNot = |+---+---+---+ | | ||0 0|0 2|1 1| | | |+---+---+---+ | +----------+----------------------------------------------------------+ |ndxOutL = |+------------------+------------------+------------------+| | ||@@[3 , 0 2 , 0 1 ]|@@[3 , 0 2 , 1 0 ]|@@[3 , 0 2 , 1 2 ]|| | |+------------------+------------------+------------------+| +----------+----------------------------------------------------------+ |ndxLNot = |+------------------+------------------+------------------+| | ||@@[3 , 0 2 , 0 0 |@@[3 , 0 2 , 0 2 |@@[3 , 0 2 , 1 1 || | |+------------------+------------------+------------------+| +----------+----------------------------------------------------------+ result : |@@[2 ]|@@[3 , 0 1 ]|@@[3 , 1 0 ]|@@[3 , 1 2 ]|@@[3 , 0 2 , 0 1 ]|@@[3 , 0 2 , 1 0 ]|@@[3 , 0 2 , 1 2 ]| >> BINGO!! that worked qnial> a@@[3 , 0 2 , 1 0 ] 2 >> Good! the @@path indexing works +-----+ even more diabolical test qnial> a := (0 1 2 (2 3 reshape 1 2 (2 3 reshape 1 2 3 (2 3 reshape 1 2 3 2 7 2) 7 2) 2 7 2) 4 5) +-+-+-+-----------------+-+-+ |0|1|2|+-+-+-----------+|4|5| | | | ||1|2|+-----+-+-+|| | | | | | || | || 1|2|3||| | | | | | || | |+-----+-+-+|| | | | | | || | ||1 2 3|7|2||| | | | | | || | ||2 7 2| | ||| | | | | | || | |+-----+-+-+|| | | | | | |+-+-+-----------+| | | | | | ||2|7| 2|| | | | | | |+-+-+-----------+| | | +-+-+-+-----------------+-+-+ qnial> nry_itm_get_ndxL a 2 +------+------------+------------+------------+------------------+------------------ |@@[2 ]|@@[3 , 0 1 ]|@@[3 , 1 0 ]|@@[3 , 1 2 ]|@@[3 , 0 2 , 0 1 ]|@@[3 , 0 2 , 1 2 ] +------+------------+------------+------------+------------------+------------------ +------------------------+------------------------+------------------------+ |@@[3 , 0 2 , 1 0 , 0 1 ]|@@[3 , 0 2 , 1 0 , 1 0 ]|@@[3 , 0 2 , 1 0 , 1 2 ]| +------------------------+------------------------+------------------------+ >> perfect!!! +-----+ need to test other itms itm := (2 3 reshape 1 2 3 2 7 2) qnial> nry_itm_get_ndxL a itm qnial> nry_itm_get_ndxL a itm +------------------+ |@@[3 , 0 2 , 1 0 ]| +------------------+ >> correct +-----+ olde code bolOutL := null EACHRIGHT (~=) ndxOutL ; IF (OR bolOutL) THEN ndxOutL := bolOutL subList ndxOutL ; ENDIF ; IF flag_break THEN BREAK ; ENDIF ; IF (~= null ndxLYes) THEN ndxOutL := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; ENDIF ; 08********08 #] 25Mar2024 nry_itm_get_ndxL: fails with arys "245_intLA_intA (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) 2 (['@@[2 ]'] ['@@[3, 0 1 ]']) 'fails? - should work' nry_itm_get_ndxL (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) 2 intLA_to_strA IS OP intLA - developed for robust idx processing # tests qnial> a := intLA_to_strA 5 5 qnial> isstring a l qnial> a := intLA_to_strA 5 6 7 +--+--+--+ |5 |6 |7 | +--+--+--+ qnial> intLA := (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) +-+-+-+-----+-+-+ |0|1|2|1 2 3|4|5| | | | |6 7 8| | | +-+-+-+-----+-+-+ qnial> isTypIntA intLA qnial> a := intLA_to_strA (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) +--+--+--+-----------------------------------------------+--+--+ |0 |1 |2 |?argument to string must be an atom or string |4 |5 | +--+--+--+-----------------------------------------------+--+--+ intLA := (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) isTypIntA intLA TWIG pass intLA a := intLA_to_strA intLA intLA := 2 3 reshape 1 2 3 6 7 8 a := intLA_to_strA intLA isTypIntA intLA intLA := tell 2 3 a := intLA_to_strA intLA qnial> intLA := 2 3 reshape 1 2 3 6 7 8 1 2 3 6 7 8 qnial> a := intLA_to_strA intLA +--+--+--+ |1 |2 |3 | +--+--+--+ |6 |7 |8 | +--+--+--+ qnial> isTypIntA intLA using resFltL := LEAF intLA_to_strA intLA qnial> intLA := tell 2 3 +---+---+---+ |0 0|0 1|0 2| +---+---+---+ |1 0|1 1|1 2| +---+---+---+ qnial> isTypIntA intLA qnial> a := intLA_to_strA intLA +-------+-------+-------+ |+--+--+|+--+--+|+--+--+| ||0 |0 |||0 |1 |||0 |2 || |+--+--+|+--+--+|+--+--+| +-------+-------+-------+ |+--+--+|+--+--+|+--+--+| ||1 |0 |||1 |1 |||1 |2 || |+--+--+|+--+--+|+--+--+| +-------+-------+-------+ >> this is WRONG! each cell should be a single str Problem is with a mix : must use recursion to lst level? intLA := 0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5 qnial> bolInt := EACH isInteger intLA llloll qnial> bolIntA := EACH isTypIntL intLA |?isLayAryAtm ?isLayLstVlc|?isLayAryAtm ?isLayLstVlc|?isLayAryAtm isLayLstVlc|?isLayLstVlc|?isLayAryAtm ?isLayLstVlc|?isLayAryAtm ?isLayLstVlc| qnial> bolIntA := EACH isTypIntA intLA +------------+------------+------------++------------+------------+ |?isLayAryAtm|?isLayAryAtm|?isLayAryAtm||?isLayAryAtm|?isLayAryAtm| +------------+------------+------------++------------+------------+ >> I also need isTypIntLA, or just recurse, which could be a template for other atmTyp eg qnial> intLA := 0 1 2 (tell 2 3) 4 5 +-+-+-+-------------+-+-+ |0|1|2|+---+---+---+|4|5| | | | ||0 0|0 1|0 2|| | | | | | |+---+---+---+| | | | | | ||1 0|1 1|1 2|| | | | | | |+---+---+---+| | | +-+-+-+-------------+-+-+ >> this is what idxs will give qnial> isTypIntLA intLA >> null, so OK qnial> bolIntLA := EACH isTypIntLA intLA +------------+------------+------------+--------------+------------+------------+ |?isLayAryAtm|?isLayAryAtm|?isLayAryAtm|?isTypIntLANot|?isLayAryAtm|?isLayAryAtm| +------------+------------+------------+--------------+------------+------------+ >> oops qnial> b := tell 2 3 +---+---+---+ |0 0|0 1|0 2| +---+---+---+ |1 0|1 1|1 2| +---+---+---+ qnial> c := isTypIntLA b ?isTypIntLANot qnial> d := EACH isTypIntL b ++++ |||| ++++ |||| ++++ qnial> d := link EACH isTypIntL b >> OK isLayLst change : IF (gage shape lst < 2) THEN to : IF (gage shape lst < 1) THEN change : IF (idx in idxLYes) THEN IF (isTypIntL idx) THEN ndxLYes := append ndxLYes (link ndxInn (string first idx) ' ') ; ELSEIF (isTypIntLL idx) THEN ndxLYes := append ndxLYes (link ndxInn (intL_to_str idx) ' ') ; ENDIF ; ELSE IF (isTypIntL idx) THEN ndxLNot := append ndxLNot (link ndxInn (string first idx) ' ') ; ELSEIF (isTypIntLL idx) THEN ndxLNot := append ndxLNot (link ndxInn (intL_to_str idx) ' ') ; ENDIF ; ENDIF ; to : IF (idx in idxLYes) THEN ndxLYes := append ndxLYes (link ndxInn (intL_to_str idx) ' ') ; ELSE ndxLNot := append ndxLNot (link ndxInn (intL_to_str idx) ' ') ; ENDIF ; +-----+ again try "245_intLA_intA (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) 2 (['@@[2 ]'] ['@@[3, 0 1 ]']) 'fails? - should work' qnial> nry_itm_get_ndxL (0 1 2 (2 3 reshape 1 2 3 6 7 8) 4 5) 2 nry = +-+-+-+-----+-+-+ |0|1|2|1 2 3|4|5| | | | |6 7 8| | | +-+-+-+-----+-+-+ idxLYes = 2 idxLNot = ndxLYes = @@[ ndxLNot = +-+-+-+------+------+------+------+------+------+ |@|@|[|@@[0 |@@[1 |@@[2 |@@[3 |@@[4 |@@[5 | +-+-+-+------+------+------+------+------+------+ +-----+-----+-----+ |@@[@]|@@[@]|@@[[]| +-----+-----+-----+ >> what a mess!... stop for the day +-----+ olde code %IF (isInteger idx) THEN idx := [idx] ; ENDIF ; IF (= 1 (gage shape idx)) THEN idx := first idx ; ENDIF ; write 'nry = ' ; write nry ; write 'idxLYes = ' ; write idxLYes ; write 'idxLNot = ' ; write idxLNot ; write 'ndxLYes = ' ; write ndxLYes ; write 'ndxLNot = ' ; write ndxLNot ; write '' ; 08********08 #] 24Mar2024 nry_itm_ndxInn_get_ndxL_recurse : incorrect indexing as lists rather than 2D nrys! Also, stdRes is WRONG for 270_intLA_intA change : FOR i WITH (tell (gage shape) idxA) DO IF (idxA@i (NOT in) idxLYes) THEN idxLNot := link idxLNot idxA@i ; ENDIF ; ENDFOR ; ... FOR i WITH (tell (gage shape) nryLNotAtm) DO ndxNxt := link ndxInn (string i) ', ' ; nryItmNdxL := nryItmNdxL append (nryLNotAtm@i itm ndxNxt) ; ENDFOR ; to : FOR idx WITH idxA DO IF (idx (NOT in) idxLYes) THEN idxLNot := link idxLNot idx ; ENDIF ; ENDFOR ; ... FOR idx WITH idxLNotAtm DO ndxNxt := link ndxInn (string idx) ', ' ; nryItmNdxL := nryItmNdxL append (nryLNotAtm@idx itm ndxNxt) ; ENDFOR ; >> will FOR work with nry idxA? change : IF (1 = (valence nry)) THEN % for isAtm each idxLYes, therefore isAtm aryShp, convert each to solitary ; ndxLYes := EACH string idxLYes ; ndxOutL := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; ELSE % for isAry ndxLYes, therefore isLst aryShp ; ndxLYes := null ; FOR idxYes WITH idxLYes DO ndxLYes := link ndxLYes (solitary link ((EACH string idxYes) EACHLEFT link ' ')) ; ENDFOR ; ndxOutL := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; ENDIF ; to : % for isAry ndxLYes, therefore isLst aryShp ; ndxLYes := null ; FOR idxYes WITH idxLYes DO ndxLYes := link ndxLYes (solitary link ((EACH string idxYes) EACHLEFT link ' ')) ; ENDFOR ; ndxOutL := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; >> fails : add a space after each last idx integer before square bracket including original nry_itm_get_ndxL_chk_testSimple fixed that, reran : +--+--------------+-------------------------------------+-------------------------------------+ | o|270_intLA_intA|+-------+-----------+ |+------+ | | | ||+-----+|@@[3, 0 1 ]| ||@@[3 ]| | | | |||@@[2]|| | |+------+ | | | ||+-----+| | | | | | |+-------+-----------+ | | +--+--------------+-------------------------------------+-------------------------------------+ >> last simple test fails, as expected change : ELSE idxLNot := idxA ; ENDIF ; % ; IF (~= null idxLNot) THEN % ignore all atms, which would already be in bolLYes if they matched itm ; nryLNot := idxLNot choose nry ; bolLNotAtm := null EACHRIGHT ~= (EACH isLayAtm nryLNot) ; to : % ; IF (~= null idxLNot) THEN % ignore all atms, which would already be in bolLYes if they matched itm ; nryLNot := idxLNot choose nry ; bolLNotAtm := null EACHRIGHT ~= (EACH isLayAtm nryLNot) ; ndxLNot := null ; FOR idx WITH idxA DO IF (idx (NOT in) idxLYes) DO ndxLNot := link ndxLNot (solitary link ((EACH string idx) EACHLEFT link ' ')) ; ENDFOR ; ENDFOR ; +-----+ olde code % idxLNot := (EACH OR (idxLYes EACHLEFT EACHRIGHT = idxA)) subList idxA ; % idxLNot := idxA#(idxLYes) ; % ary_writePictureTo_pout_pthTyp IS OP ary pout pthTyp ; % ary_writePictureTo_pout_pthTyp (picture tst_tbl) plog "padd ; 08********08 #] 24Mar2024 augment tests for : tstOptr "nry_itm_get_ndxL_chk_testSimple don't change testSimple - already too [flakey, unstable, work to change] Instead, run "nry_itm_get_ndxL_chk_testSimple from tests with much larger data that would result in ridiculous output tables. I had some for 'arrays atomic- testOptrs.ndf'? nyet - not there see "$d_Qtest"'arrays atomic/arrays atomic- develop.txt' : best 12Mar2024 ary_itm_get_idxL re-create, debug, test 10Mar2024 generalize findall to fetch nested idxL 09Mar2024 test ary_to_atmL after playing around setting up data and guessing at std results : qnial> tNow 15:04:42 qnial> nry_itm_get_ndxL_chk_testSpecial >> at least the program works well, but : +-----+ pLog : nry_itm_get_ndxL_chk_testSimple start time : 24Mar2024 15h01m54s simple tests : >> all OK (7 of them) 1st example : >> OK works : = ndxStdL ndxResL 2nd example : >> FAILS!! : ~= ndxStdL ndxResL I can't see difference between [ndxStdL, ndxResL] they match via geany txtEd find, so it must be "invisible diffs" like 'solitary", atm types etc ndxL are WRONG for nry : instead of 2D in-dpeth ndxL, they are indexed as lists!!?? Big issue is the incorrect indexing as lists rather than 2D nrys! Also, stdRes is WRONG for 270_intLA_intA 08********08 #] 23Mar2024 adapt 'arrays nested' ops faults.ndf : must create : nry_hasFaults 24Mar2024 change : IF (~= null idxLYes) THEN ndxLYes := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; ... ndxLYes := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; ndxOutL to : IF (~= null idxLYes) THEN ndxOutL := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; ... ndxOutL := (ndxInn EACHRIGHT link ndxLYes) EACHLEFT link ndxEnd ; bolOutL := null EACHRIGHT = ndxOutL ; IF (OR bolOutL) THEN ndxOutL := (NOT bolOutL) subList ndxOutL ; ENDIF ; ndxOutL # tests "160_str_str ('what goes' 'around' 'comes around') 'around' ['@@[1]'] 'OK - should work' nry_itm_get_ndxL ('what goes' 'around' 'comes around') 'around' qnial> tNow 11:53:41 qnial> nry_itm_get_ndxL ('what goes' 'around' 'comes around') 'around' +-----+ |@@[1]| +-----+ >> OK, retry tests qnial> tNow 11:55:31 qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple o nry_itm_get_ndxL_chk_testSimple 5 2 7 Two erroneous tests : +--+--------------+----------------------------+----------------------------------+ | o|230_intL_intL |+--------+--------+--------+|+----------+----------+----------+| | | ||@@[0, 4]|@@[1, 4]|@@[2, 0]|||+--------+|+--------+|+--------+|| | | |+--------+--------+--------+|||@@[, 04]|||@@[, 14]|||@@[, 20]||| | | | ||+--------+|+--------+|+--------+|| | | | |+----------+----------+----------+| +--+--------------+----------------------------+----------------------------------+ | o|240_intLA_int |+-------+ |+--------+ | | | ||@@[0 4]| ||@@[0 4 ]| | | | |+-------+ |+--------+ | +--+--------------+----------------------------+----------------------------------+ >> awesome learning experience 230 : missing ', ' shape of results 240 : end change : FOR i WITH (tell (gage shape) nryLNotAtm) DO ndxNxt := link ndxInn ', ' (string i) ; nryItmNdxL := nryItmNdxL append (nryLNotAtm@i itm ndxNxt) ; ENDFOR ; to : FOR i WITH (tell (gage shape) nryLNotAtm) DO ndxNxt := link ndxInn (string i) ', ' ; nryItmNdxL := nryItmNdxL append (nryLNotAtm@i itm ndxNxt) ; ENDFOR ; qnial> tNow 12:03:52 qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple o nry_itm_get_ndxL_chk_testSimple 6 2 7 +--+--------------+----------------------------+----------------------------------+ | o|230_intL_intL |+--------+--------+--------+|+----------+----------+----------+| | | ||@@[0, 4]|@@[1, 4]|@@[2, 0]|||+--------+|+--------+|+--------+|| | | |+--------+--------+--------+|||@@[0, 4]|||@@[1, 4]|||@@[2, 0]||| | | | ||+--------+|+--------+|+--------+|| | | | |+----------+----------+----------+| +--+--------------+----------------------------+----------------------------------+ >> OK, except I forgot shape issue : why each isSolitary? because results are for different invocations of recurse? qnial> tNow 12:09:08 qnial> tstOptr "nry_itm_get_ndxL_chk_testSimple l nry_itm_get_ndxL_chk_testSimple 7 2 7 +-----+ olde code ndxNulAtmEqu ndxLYes ndxLNot ndxEnd := null null null ']' ; IF (OR bolLNot) THEN aryLNot := EACH solitary nry#idxLNot ; % ignore all atms in ndxLYes (itms can't be atms) ; bolLAtm := null EACHRIGHT ~= (EACH isLayAtm aryLNot) ; IF (OR bolLAtm) THEN ndxLAtm := bolLAtm subList aryLNot ; ndxLAtm := EACH string ndxLAtm ; ndxLAtm := EACH solitary ((ndxInn EACHRIGHT link ndxLAtm) EACHLEFT link ', ' ) ; ndxLItm := (aryLNot EACHLEFT link itm) EACHBOTH link ndxLAtm ; ndxOutL := link ndxOutL (EACH nry_itm_ndxInn_get_ndxL_recurse ndxLItm) ; ENDIF ; ENDIF ; IF (~= null bolLYes) THEN ndxOutL := bolLYes subList ndxLYes ; ENDIF ; 08********08 #] 19Mar2024 create nonAry_tests - much simpler notation, [complete, reliable] basic tests must create separate 'types nested.ndf' - start with cp of 'types.ndf' 15:48 qnial> loaddefs link d_Qndfs 'types nested.ndf' >>> loading start : types nested.ndf .. <<< loading ended : types nested.ndf >> all loads OK, doesn't mean anything works qnial> tNow 15:49:27 qnial> loaddefs link d_Qndfs 'arrays nested.ndf' >>> loading start : arrays nested.ndf +-----+ ndx for itm ops : loading nry_ndx_get_itm loading nry_itm_get_ndxL_recurse loading nry_itm_get_ndxL <<< loading ended : arrays nested.ndf >> OK as a start... qnial> t 15:50:42 qnial> loaddefs link d_Qtest 'arrays nested/arrays nested- testOptrs.ndf' >>> loading start : arrays nested/arrays nested- testOptrs.ndf loading nonAry_tests ?undefined identifier: OPSTRL := ARY_ITM_SPLIT <***> ??? OPSTR `_ loading nryOpPhrL_test ?undefined identifier: % +-----+ ndx for itm ops : ; loading nry_itm_get_ndxL_chk_testSimple ?undefined identifier: ( EACH SOLITNRY <***> 5 6 7 <<< loading ended : arrays nested/arrays nested- testOptrs.ndf errors found: 3 >> I fixed these 23Mar2023 08:46 rename 'types.ndf' -> 'types atomic.ndf' +-----+ nonAry_tests "nry_ndx_get_itm develop this later ... +-----+ junk devCode (might need it later?) % ; IF ('idx' = arg2Str) THEN ary_idx_chkAppOp nonAryL idxSafe optrPhr ; ary_idx_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF ('idxL' = arg2Str) THEN ary_idxL_chkAppOp nonAryL idxLSafe optrPhr ; ary_idxL_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF ('idxA' = arg2Str) THEN ary_idxA_chkAppOp nonAryL idxASafe optrPhr ; ary_idxA_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF ('itm' = arg2Str) THEN ary_itm_chkAppOp nonAryL itmSafe optrPhr ; ary_itm_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF (AND ('nry' = nryStr) ('sub' = arg2Str)) THEN ary_itm_chkAppOp nonAryL subSafe optrPhr ; ary_itm_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF (AND ('nry' = nryStr) ('itm' = arg2Str)) THEN ary_itm_chkAppOp nonAryL itmSafe optrPhr ; ary_itm_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF (AND ('nry' = nryStr) ('itm' = arg2Str)) THEN ary_itm_chkAppOp nonAryL itmSafe optrPhr ; ary_itm_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF (AND ('nry' = nryStr) ('itm' = arg2Str)) THEN ary_itm_chkAppOp nonAryL itmSafe optrPhr ; ary_itm_chkAppOp nrySafe nonAryL optrPhr ; ELSEIF (AND ('nry' = nryStr) ('itm' = arg2Str)) THEN ary_itm_chkAppOp nonAryL itmSafe optrPhr ; ary_itm_chkAppOp nrySafe nonAryL optrPhr ; ELSE write 'nonAry_tests error: unrecognized OR[0, 1] arg' ; write link ' nryStr = ' nryStr ; write link ' arg2Str = ' arg2Str ; ENDIF ; 08********08 #] 18Mar2024 ary_sub_get_ndxL [fix, test] try : qnial> loaddefs link d_Qndfs 'arrays nested.ndf' >>> loading start : arrays nested.ndf ... ... <<< loading ended : arrays nested.ndf errors found: 12 >> not so bad? many overlap optrs with arrays.ndf... >> work on each one-by-one +-----+ loading nry_itm_get_slcNL ?undefined identifier: ( NOT NRY_HASFAULTS <***> RESFLTL ) THEN >> can ary_hasFaults work for nry? (see 'faults.ndf') # 09Nov2021 this will probably not work for nesting > 1 level down? # 20Apr2022 revamped with ary_to_atmL ary_hasFaults IS OP ary { OR EACH isfault ary_to_atmL ary } # ary_to_atmL_recurse IS OP ary - recursion to get working ary_to_atmL_recurse # 09Mar2024 initial used subList : no good for arrays, just lists 'arrays atomic.ndf' : ary_to_atmL_recurse IS OP ary { LOCAL atmL ; atmL := null ; IF (atomic ary) THEN atmL := ary ; ELSEIF (AND EACH atomic ary) THEN atmL := link list ary ; ELSE atmL := link EACH ary_to_atmL_recurse ary ; ENDIF ; atmL } >> This wight work with nry!!?!?? will have to test change : IF (NOT nry_hasFaults resFltL) THEN to : IF (NOT ary_hasFaults resFltL) THEN nry_idxSeq_to_slc also used in nry_itm_get_slcNL : ( NOT NRY_HASFAULTS <***> RESFLTL ) probably won't work if null=true!?!? -> not a problem as QNial isFault is used. leave it at the simple fix above nry_hasFaults -> ary_hasFaults repeat file-wide replacement we'll see during tests... +-----+ 11:46 Re-run loaddefs, as many errors may be resolved. qnial> loaddefs link d_Qndfs 'arrays nested.ndf' >>> loading start : arrays nested.ndf 11:46 12:15 y y loading nry_itm_get_slcNL ?undefined identifier: RESFLTL [ NRY_IDXSEQ_TO_SLC <***> ARY IDX ] y loading nry_slcN_invert ?undefined identifier: ALLAXSIDXS := NRY_ITM_GET_SLCNL <***> ARY ; ALLSLICES y y loading nry_slcNA_invert ?undefined identifier: POSNA ; NRY_SLCN_INVERT <***> ARY SLCNA } y y loading nry_sub_get_ndx1stL ?undefined identifier: NDXA := SUB_IDXUL_TO_NDXA <***> SUB IDX ; y y loading nry_sub_get_slcNL ?undefined identifier: ARY EACHRIGHT NRY_NDXSEQ_TO_SLC <***> SUBPOSNA ; ENDIF y y loading nry_itm_cut_subWithNullsL ?undefined identifier: ITM { BOLA_NRY_GET_SUBWITHNULLSL <***> ( NOT ( loading nry_getBetween_subP ?undefined identifier: GAGE SHAPE NRY_SUB_GET_IDX1STL <***> ARY LSTSTRT ) loading nry_sub_slcN_insert_aryOut ?undefined identifier: IDXEND := NRY_SLCN_GET_FRONTENDSLCP <***> ARY SLCN ; <<< loading ended : arrays nested.ndf errors found: 8 'arrays nested.ndf' check nry_idxSeq_to_slc : I haven't even defined what a nested slc is, but have ideas +----+ 12:15, 12:57 y y loading nry_slcN_invert ?undefined identifier: ALLSLICES := NRY_SUB_GET_NLCL <***> ARY ; ANTI_SLICES y loading nry_nlcA_invert ?undefined identifier: POSNA ; NRY_NLC_INVERT <***> ARY NLCA } y loading nry_sub_get_ndx1stL ?undefined identifier: NDXA := SUB_IDXUL_TO_NDXA <***> SUB IDX ; y loading nry_itm_cut_subWithNullsL ?undefined identifier: ITM { BOLA_NRY_GET_SUBWITHNULLSL <***> ( NOT ( y y loading nry_getBetween_subP ?undefined identifier: GAGE SHAPE NRY_SUB_GET_IDX1STL <***> ARY LSTSTRT ) y y loading nry_sub_nlc_insert_aryOut ?undefined identifier: IDXEND := NRY_NLC_GET_FRONTENDSLCP <***> ARY NLC ; +-----+ arrays.ndf section "split[Separate,[At[Front,End]], ] : " was not copied to 'arrays nested.ndf' PUT IT IN!! 14:44, 15:03 y y loading nry_nlc_splitSeparate_subL ?undefined identifier: BOLA := NRY_IDXA_CONVERTTO_BOLA <***> NRY NLC ; y loading nry_sub_splitSeparate_subL ?undefined identifier: RESFLTL := NRY_ITM_GET_IDXL <***> NRYTMP ( FIRST y loading nry_sub_splitSeparate_subL ?undefined identifier: ( NOT NRY_HASFAULTS <***> RESFLTL ) THEN y y loading nry_subL_splitSeparate_subLL ?undefined identifier: NRYA EACHRIGHT NRY_SUB_SPLITSEPARATE_SUBL <***> SUB ; ENDFOR y y loading nry_subP_splitSeparateTo_mididxs_subL ?undefined identifier: ( ( NRY_SUB_SPLITSEPARATE_SUBL <***> NRYAFT NRY ) y y loading nry_sub_splitAtFront_subL ?undefined identifier: NRYL := NRY_SUB_SPLITSEPARATE_SUBL <***> NRY SUB ; y loading nry_sub_splitAtFront_subLL ?undefined identifier: ) EACHLEFT NRY_SUB_SPLITATFRONT_SUBL <***> SUB ; ENDFOR y y loading nry_splitAtEnd_sub ?undefined identifier: NRYL := NRY_SUB_SPLITSEPARATE_SUBL <***> NRY SUB ; y y loading nry_sub_splitAtEnd_subLL ?undefined identifier: ) EACHLEFT NRY_SUB_SPLITATEND_SUBL <***> SUB ; ENDFOR y loading nry_subP_splitReplace_subL ?undefined identifier: LSTBLOCK := SOLITNRY <***> NRY ; IF y y loading nry_subP_splitLftRgtTo_mididxs_subL ?undefined identifier: ( ( NRY_NLC_SPLITSEPARATE_SUBL <***> NRY NRYLFT ) y y loading nry_itm_cut_subWithNullsL ?undefined identifier: ITM { BOLA_NRY_GET_SUBWITHNULLSL <***> ( NOT ( y loading nry_sub_nlc_put_aryOut ?undefined identifier: NDXEND := NRY_NLC_GET_FRONTENDSLCP <***> ARY NLC ; post-14:44 >> oops, needed to loaddef boolean.ndf first +--+ 'boolean.ndf' change : nry_idxA_convertTo_bolA to : nry_ndxA_convertTo_bolA >> but this hasn't even been conceptually thought about nry_ndxA_convertTo_bolA IS OP ary ndxA { LOCAL bolA ; write 'nry_ndxA_convertTo_bolA : not conceptually defined yet' } +--+ 'arrays nested.ndf' change : nry_itm_get_idxL to : nry_itm_get_ndxL change : nry_nlc_get_frontEndSlcP to: nry_nlc_get_frontEndNlcP 08********08 #] 15Mar2024 create 'arrays nested.ndf' from arrays.ndf, tests too see "$d_Qtest"'arrays/' : arrays- develop ops.txt arrays- develop tests.txt # 15Mar2024 geany regexpr changes from 'arrays atomic.ndf' : opNam changes : idx([LA]*) ndx\1 word only ary([LA]*) nry\1 word only slc([LA]*) slcN\1 word only ary([A-Za-z]*)_ nry\1_ _slc([LA_]*)_ _slcN\1_ _replace([A-Za-z0-9]*)_ _put\1_ (don't change insert) ... ary opNam changes in 'arrays atomic.ndf' : _replace([A-Za-z0-9]*)_ _put\1_ (don't change insert) "$d_Qtest"'arrays nested/' same geany regexpr as above : "$d_bin"'fileops run.sh' pOvrL : /home/bill/web/Qnial/code develop_test/arrays nested/arrays nested- data templates.ndf /home/bill/web/Qnial/code develop_test/arrays nested/arrays nested- testGroupsCluster.ndf /home/bill/web/Qnial/code develop_test/arrays nested/arrays nested- testOptrs.ndf pStrP : OK - go it to work # 08********08 #] fixed ToDos 19Mar2024 create nonAry_tests, eg "nry_ndx_get_itm 24Mar2024 adapt from atomic: "$d_Qtest"'types nested/types nested- develop.txt' 01Apr2024 arrays atomic : [callBy [value, name], ndx[IntLL, Str]] versions of [ary, nry] ops? 04Apr2024 nry_sub_byValGet_ndx1stL_chk_testSimple: my guess is that resStd is correct, but must look at op +--+-------------+-----------------------+-----------------------+ | o|050_intA_intA|?spAllia1 |+--------+ | | | | ||@@[0 4 ]| | | | | |+--------+ | +--+-------------+-----------------------+-----------------------+ 05Apr2024 isTypIdxIntL is NOT a good test: must be more specific as to what is allowed for idxIntL!! 05Apr2024 idxIntL_to_idxStrshould be fixed to handle when initial idxIntL is a list!! 07Apr2024 nry_itm_get_ndxL works with DOUBLE solitary for one-only ndxL!!??!! 07Apr2024 nry_itm_get_ndxL_chk_testSpecial - 08Apr2024 nry_sub_get_ndx1stL - need ?isLayNrySubVlc 08Apr2024 ndx[Int, Str] should BOTH be allowed for [most, all]? nry ops! # enddoc