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:35:41 -0600 From: Chris Hinsley Newsgroups: comp.lang.forth Date: Wed, 7 Nov 2012 15:35:41 +0000 Message-ID: <2012110715354130272-chrishinsley@gmailcom> References: <2012110713421835115-chrishinsley@gmailcom> <2012Nov7.145519@mips.complang.tuwien.ac.at> <2012110715293194415-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: 52 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-Pja+FmTGOdpZBlw2SisB5vnL998dV3Syv/MG/PVtUCPj7VkcvAV57Fuv+XkjjzvKA3hcXJ+tuYJWnxD!Gq9m9mcfke3J/BAuVBbCy20Ktb+SSvRDLp59iLg5XYNcVpf9uIE/VMxYgRMVMWtvNeGvMJE= 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: 3034 Xref: csiph.com comp.lang.forth:17123 On 2012-11-07 15:29:31 +0000, Chris Hinsley said: > 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. > > Yes, I know, which is why I asked the question in the first place ! I > didn't see any easier way to marshall paramaters for the callback. But > I was unhappy, hence my question about style and wanting to get the > beards involved ;) > > Chris Plus you guys like nothing better than some young upstart asking a 'dork' question (maybe I'm just widing you up !) that you can then argue the toss over for several days. Oh yes, and Hugh can then wade in and insult anybody he thinks deserves a kicking, then you can all slag him off, then he mentions Nazi's and you all sit back and mark another win on your bedpost's ;) Chris