Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 07 Nov 2012 09:32:23 -0600 From: Chris Hinsley Newsgroups: comp.lang.forth Date: Wed, 7 Nov 2012 15:32:23 +0000 Message-ID: <2012110715322313218-chrishinsley@gmailcom> References: <2012110713421835115-chrishinsley@gmailcom> <2012Nov7.145519@mips.complang.tuwien.ac.at> 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: 41 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-jVC/iscdybwYhFWZYiacVPLw7RWgm4YLvxKV/42QqaS8G48OohICFxpEy4iaLxw/JQF3PGIjHZv9Yi0!RSMhusgpj6BY5ReGQTMxHKNyxd8UTH5qXtn7VkUr0Kkw5/jUgl4gj+QVAwHW6p71plU/o38= 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: 2503 Xref: csiph.com comp.lang.forth:17122 On 2012-11-07 13:55:19 +0000, Anton Ertl said: > Chris Hinsley writes: >> Folks I have implamented an Amiga style double linked list words set a >> few days back and I have an emueration word as follows: >> >> \ ( u xt lh -- ln | 0) >> \ xt api is ( u ln lh -- ln | 0 ) >> : LISTHEAD-ENUMERATE-FORWARDS >> 0 >R >> DUP LISTHEAD-GET-HEAD DUP >> BEGIN >> NIP DUP LISTNODE-GET-SUCC >> DUP >> WHILE >> 4 PICK 2 PICK 4 PICK >> 6 PICK EXECUTE DUP R! >> UNTIL THEN >> 2DROP 2DROP DROP >> R> >> ; >> >> This scans down the list until either it hits the end, or the callback >> for each node returns a value other than 0, that value is returned and >> the scan stops if it isn't 0 ! >> >> I'd like comments and advice on techniuqe, paticularly for things like >> the PICK stuff that gathers paramaters for each callback, and the use >> of the return stack for the returned value. Or if you just plain think >> I could code this a better way ! > > Someone could probably code this in a better way. "6 PICK" is gross. > And having no lower case does not help readability. I'm having issues with the whole case stuff in Forth. I really don't like the idea of a case sensative Forth, but feel compeled to write in a single case ! Upper case so far, but I could easily swap if the powers that be say I should. ;) Chris