Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Bernd Paysan Newsgroups: comp.lang.forth Subject: Re: CASE mis-understanding? Date: Wed, 05 Mar 2014 14:09:32 +0100 Organization: 1&1 Internet AG Lines: 29 Message-ID: References: <52e54d17.461102185@news.demon.co.uk> <530f6242$0$25074$e4fe514c@dreader37.news.xs4all.nl> <7xtxbkmsh0.fsf@ruckus.brouhaha.com> <530fa561$0$24919$e4fe514c@dreader36.news.xs4all.nl> <2014Mar5.113533@mips.complang.tuwien.ac.at> NNTP-Posting-Host: p4fc5556d.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: online.de 1394024972 22419 79.197.85.109 (5 Mar 2014 13:09:32 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Wed, 5 Mar 2014 13:09:32 +0000 (UTC) User-Agent: KNode/4.11.5 Xref: csiph.com comp.lang.forth:28926 Anton Ertl wrote: > Bernd Paysan writes: >>The point here is probably that B < C in the clockwise case, and in the >>counter-clockwise case, it's B > C. However SWAP WITHIN is as good as >>WITHIN INVERT. > > Not in all cases: > > 3 3 3 swap within . 0 ok > 3 3 3 within invert . -1 ok Ok, to be more precise: For all a<>b, x a b within = x b a within invert (provable). : within ( x a b -- flag ) over - >r - r> u< ; As we use start len constructs quite often (e.g. strings) in Forth, something like : inside? ( x start len -- flag ) >r - r> u< ; would be a useful word, too. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/