Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Rosetta code reverse a string Date: Mon, 15 Feb 2016 15:14:06 -0800 Organization: A noiseless patient Spider Lines: 26 Message-ID: <87d1rx8t35.fsf@jester.gateway.pace.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="89fc4f87faf042e7e4d428a3639a51e3"; logging-data="31655"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MwYYyYOto6vLmt9SoNCVq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:tZQHzjbelNGGX4N+r769jupIGgg= sha1:GCILXcQ0S5dhKSDDPvuqu+TqauA= Xref: csiph.com comp.lang.forth:45554 foxaudioresearch@gmail.com writes: > I have been at it again. > By defining a string stack and NEXTWORD I could create SPLIT and REVERSE. > My system has PAD in free memory. I know this won't work with every system. > ... create buf 1000 chars allot buf value pp : tr ( caddr u -- ) dup >r pp swap cmove r> pp + to pp ; : collect begin parse-name dup while tuck pp >r tr r> swap repeat ; : >> buf to pp collect 2drop depth 2/ 0 ?do type bl emit loop cr ; >> ---------- Ice and Fire ------------ >> >> fire, in end will world the say Some >> ice. in say Some >> desire of tasted I've what From >> fire. favor who those with hold I >> >> ... elided paragraph last ... >> >> Frost Robert ----------------------- bye