Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Alexander Skobelev Newsgroups: comp.lang.forth Subject: Re: FORTH on the Advanced Placement Computer Science ! Date: Mon, 12 Jan 2015 08:53:42 +0300 Organization: A noiseless patient Spider Lines: 31 Message-ID: References: <2014Dec27.111715@mips.complang.tuwien.ac.at> <878uhs4zxk.fsf@jester.gateway.sonic.net> <871tnd9dg0.fsf@jester.gateway.pace.com> <87387q5hi8.fsf@jester.gateway.sonic.net> <43c6114f-8d41-4005-9131-fe93ec3d3696@googlegroups.com> <54b2507a$0$21111$703f8584@textnews.kpn.nl> <85533a26-5eab-497f-b39e-153777ec4fda@googlegroups.com> <54b28fa5$0$21179$703f8584@textnews.kpn.nl> <8348e6df-653d-417f-b3e5-f00aae2e8d9d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="b120e5c8b4f216b4cd7561d02d477618"; logging-data="31654"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KuPZy5e95pcQJMpexCqry" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) Cancel-Lock: sha1:7ku2f8esbmcQlIpDeMMSNqhD3ao= sha1:J0+WBY/AsoZlCjGFE/iUAeQTqn4= Xref: csiph.com comp.lang.forth:35737 Julian Fondren writes: > On Sunday, January 11, 2015 at 7:56:54 AM UTC-6, Alexander Skobelev wrote: >> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod >> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim >> veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea >> commodo consequat. Duis aute irure dolor in reprehenderit in voluptate >> velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint >> occaecat cupidatat non proident, sunt in culpa qui officia deserunt >> mollit anim id est laborum." >> >> What is the right way to put this text in a program on Forth? > > Suppose it had a lot double quotes in it. Then you couldn't use S" > anyway, and if you used S\" or the like, it would work but it would > be pointlessly ugly. Just define a parsing word that does precisely > what you want. > > : | ( n "text" -- n' ) > dup if bl c, 1+ then 0 parse tuck here swap dup allot move +; > > here 0 > | blah blah blah > | blah blah blah > | blah blah blah > type \ output: blah blah blah blah blah blah blah blah blah ok > > […] So, the right way is to not use the standard words but write your own parser for that. :)