Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Newsgroups: comp.lang.forth Subject: Re: Quotations revisited References: <00808889968435@frunobulax.edu> <50040282.189860346@192.168.0.50> <771c3aa0-0b95-48af-b0fb-c6ae6269a266@googlegroups.com> <85ip4ue5aw.fsf@junk.nocrew.org> From: Lars Brinkhoff Organization: nocrew Date: Thu, 14 Mar 2013 19:41:24 +0100 Message-ID: <85ehfhesdn.fsf@junk.nocrew.org> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:DrT4Ms04VA/7svgUL7lRJQaicTA= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 20 NNTP-Posting-Host: 85.229.87.73 X-Trace: news.sunsite.dk DXC=;l9Em2Vl8h8IE=Lc_\oXE4YSB=nbEKnk;`cb]\oW0IP>@ON7A^J=915:[KId_d;k;?ecS2QjHQi^7HL>PhDc7Db5FGi8bE[?=e9 X-Complaints-To: staff@sunsite.dk Xref: csiph.com comp.lang.forth:20671 Sieur de Bienville writes: > > : counter ( n -- xt ) ( xt: n1 -- n2 ) > > dup . [create , does> tuck +! @ ;] ." is enclosed" ; > > I can see using quotations to remove otherwise unnecessary do-stuff > words, but I'm not entirely sure how this example is different from: > > : counter dup . ." is enclosed" create , does> tuck +! @ ; ok Possibly my sample code wasn't a blinding success in showing off the supposed advantages. The main difference is just that the xt can be passed along without having to give it a name. This may not seem like much, and indeed you can do perfectly well without that feature. But sometime it can be convenient. One additional difference is that, as you probably noted, you were not able to do any computations after the does> part. Again, a minor inconvenience at most.