Re: [Factor-talk] Escapable each
Thank you for your quick response, John. Leave the code using while instead of nfind until the corresponding code is included in the release build. -- KUSUMOTO Norio > 2019/10/05 10:20、John Benediktsson のメール: > > This works in the non-optimizing compiler (for example, the Listener): > > 3 [ f ] times > > But not in the optimizing compiler. I pushed a quick fix that makes your > word work: > > https://github.com/factor/factor/commit/e17b9119293783728e193b29856d81ba5862c8eb > > ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Escapable each
This works in the non-optimizing compiler (for example, the Listener): 3 [ f ] times But not in the optimizing compiler. I pushed a quick fix that makes your word work: https://github.com/factor/factor/commit/e17b9119293783728e193b29856d81ba5862c8eb On Fri, Oct 4, 2019 at 5:29 PM KUSUMOTO Norio wrote: > I would like to use nfind as an escapable 2each, but I'm in trouble. > I simplified the problem as follows: > > In scratchpad, when I input: > > USE: sequences.generalizations > { 1 2 3 4 5 } { 5 4 3 2 1 } [ > ] 2 nfind > > get: > > --- Data stack: > 3 > 4 > 2 > > And I define nfind-test and use it: > > : nfind-test ( x y -- i/f elt1 elt2 ) [ > ] 2 nfind ; > { 1 2 3 4 5 } { 5 4 3 2 1 } nfind-test > > But I receive an error: > > The word nfind-test cannot be executed because it failed to compile > > The input quotation to “times” doesn't match its expected effect > Input Expected Got > [ f ] ( ... -- ... ) ( -- x ) > > > What am I wrong? > > > -- > KUSUMOTO Norio > > > > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk > ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Escapable each
I would like to use nfind as an escapable 2each, but I'm in trouble. I simplified the problem as follows: In scratchpad, when I input: USE: sequences.generalizations { 1 2 3 4 5 } { 5 4 3 2 1 } [ > ] 2 nfind get: --- Data stack: 3 4 2 And I define nfind-test and use it: : nfind-test ( x y -- i/f elt1 elt2 ) [ > ] 2 nfind ; { 1 2 3 4 5 } { 5 4 3 2 1 } nfind-test But I receive an error: The word nfind-test cannot be executed because it failed to compile The input quotation to “times” doesn't match its expected effect Input Expected Got [ f ] ( ... -- ... ) ( -- x ) What am I wrong? -- KUSUMOTO Norio ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk