: (map) ( a n - a a') cells over + swap ; : map[ postpone (map) postpone ?do postpone I postpone @ ; immediate : ]map 1 cells postpone literal postpone +loop ; immediate create array 1000 cells allot : init 1000 0 DO I array I cells + ! LOOP ; init : step 0 array 1000 map[ + ]map drop ; : bench 100000 0 DO step LOOP ; bench \ Article: 127789 of comp.lang.forth \ Path: tunews.univie.ac.at!aconews-feed.univie.ac.at!newsfeed.wu-wien.ac.at!newsfeed.utanet.at!feeder06.uucp-net.de!news.uucp.at!news.karotte.org!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!feeder.news-service.com!feeder2.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!138.199.65.86.MISMATCH!sn-xt-ams-06!sn-xt-ams-04!sn-ams!sn-feed-ams-03!sn-post-ams-02!sn-post-sjc-01!supernews.com!news.supernews.com!not-for-mail \ From: Andrew Haley \ Newsgroups: comp.lang.forth \ Subject: Re: Factor, Postscript, and Forth: A case study \ Date: Sat, 05 May 2007 10:39:10 -0000 \ Message-ID: <133onme7og5eq06@news.supernews.com> \ References: <133m9nohdhdje47@news.supernews.com> <38823519183560@frunobulax.edu> \ User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (Linux/2.6.18-1.2798.fc6 (x86_64)) \ X-Complaints-To: abuse@supernews.com \ Lines: 16 \ Xref: tunews.univie.ac.at comp.lang.forth:127789 \ \ Marcel Hendrix wrote: \ > Andrew Haley writes Re: Factor, Postscript, and Forth: A case study \ > [..] \ >> The classic Forth way to do this would be with compiling words, not by \ >> passing an xt: \ \ >> : (map) ( a n - a a') cells over + swap ; \ >> : map[ postpone (map) postpone ?do ; immediate \ > [..] \ \ > I assume you meant \ > : map[ postpone (map) postpone ?do postpone I postpone @ ; immediate \ \ Sorry, yes. \ \ Andrew.