NNTP-Posting-Date: Thu, 08 Nov 2012 07:23:57 -0600 From: Chris Hinsley Newsgroups: comp.lang.forth Date: Thu, 8 Nov 2012 13:23:57 +0000 Message-ID: <2012110813235763416-chrishinsley@gmailcom> References: <2012110713421835115-chrishinsley@gmailcom> <0185e315-1855-415d-b981-638e4a2dabe5@googlegroups.com> <2012110813141528599-chrishinsley@gmailcom> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: Genral advise and comments on callback style words User-Agent: Unison/2.1.9 Lines: 45 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-lQI9lAXTgKQJ5LxqQNqy5robsmPaJdtVQoXxye/MwI2a7KfgG67LJH0rdVE0gEfG2SSPkaWAaioaul/!hn4jAgN4v0Qz0Dyx3bxKPejzl7VMUUFjhaX0vaaSKgZe0KD6olBFMpqdnjP1fwytm5q9Ip8= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2388 Path: csiph.com!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail Xref: csiph.com comp.lang.forth:17150 On 2012-11-08 13:14:15 +0000, Chris Hinsley said: > On 2012-11-07 21:04:20 +0000, humptydumpty said: >> Building backward from EXECUTE and applying desired stack-effects, >> I've got: >> >> : HEAD ( lh -- ln ) ; >> : SUCC ( ln -- ln' ) ; >> >> >> \ xt ( u ln lh--R|0 ) >> : ENUMERATE ( u xt lh -- R|0 ) >> ( u xt lh ) swap >R >> ( u lh ) dup HEAD >> ( u lh ln ) >> BEGIN >> ( u lh ln ) dup SUCC dup 0= >> ( u lh ln ln' f ) IF RDROP 2drop 2drop 0 EXIT THEN >> ( u lh ln ln' ) swap 2over >> ( u lh ln' ln u lh ) rot swap R@ >> ( u lh ln' u ln lh xt ) EXECUTE dup >> ( u lh ln' R f=R ) IF RDROP nip nip nip EXIT THEN >> ( u lh ln' R ) drop >> ( u lh ln' ) AGAIN >> ; > > ?DUP after the EXECUTE ? Then avoid the drop after the THEN ? But then > your looking at a taken branch to an abolute jump ! > >> ( u lh ln' u ln lh xt ) EXECUTE ?dup >> ( u lh ln' R f=R ) IF RDROP nip nip nip EXIT THEN >> ( u lh ln' ) AGAIN >> ; > > Chris So better to do: EXECUTE ?DUP UNTIL RDROP NIP NIP NIP ; Chris