Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #20671

Re: Quotations revisited

Newsgroups comp.lang.forth
Subject Re: Quotations revisited
References (1 earlier) <50040282.189860346@192.168.0.50> <771c3aa0-0b95-48af-b0fb-c6ae6269a266@googlegroups.com> <khpp9q$2r0$1@online.de> <85ip4ue5aw.fsf@junk.nocrew.org> <d1134367-4776-4894-8682-a9effaeb455f@c6g2000yqh.googlegroups.com>
From Lars Brinkhoff <lars.spam@nocrew.org>
Organization nocrew
Date 2013-03-14 19:41 +0100
Message-ID <85ehfhesdn.fsf@junk.nocrew.org> (permalink)

Show all headers | View raw


Sieur de Bienville <morrimichael@gmail.com> 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.

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Quotations revisited Michael L Gassanenko <m_l_g3@yahoo.com> - 2013-03-13 01:54 -0700
  Re: Quotations revisited Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-03-13 04:21 -0500
    Re: Quotations revisited Michael L Gassanenko <m_l_g3@yahoo.com> - 2013-03-13 03:36 -0700
      Re: Quotations revisited Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-03-13 07:14 -0500
    Re: Quotations revisited anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-03-13 11:55 +0000
      Re: Quotations revisited Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-03-13 07:20 -0500
        Re: Quotations revisited anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-03-13 14:36 +0000
      Re: Quotations revisited albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-03-13 13:01 +0000
        Re: Quotations revisited anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-03-13 14:21 +0000
  Re: Quotations revisited David Kuehling <dvdkhlng@gmx.de> - 2013-03-13 10:33 +0100
    Re: Quotations revisited Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-03-13 04:41 -0500
      Re: Quotations revisited David Kuehling <dvdkhlng@gmx.de> - 2013-03-13 11:44 +0100
  Re: Quotations revisited Lars Brinkhoff <lars.spam@nocrew.org> - 2013-03-13 11:23 +0100
  Re: Quotations revisited Bernd Paysan <bernd.paysan@gmx.de> - 2013-03-13 12:52 +0100
    Re: Quotations revisited Lars Brinkhoff <lars.spam@nocrew.org> - 2013-03-14 09:47 +0100
      Re: Quotations revisited Sieur de Bienville <morrimichael@gmail.com> - 2013-03-14 10:45 -0700
        Re: Quotations revisited Lars Brinkhoff <lars.spam@nocrew.org> - 2013-03-14 19:41 +0100
          Re: Quotations revisited Sieur de Bienville <morrimichael@gmail.com> - 2013-03-14 12:58 -0700
    Re: Quotations revisited Michael L Gassanenko <m_l_g3@yahoo.com> - 2013-03-14 23:09 -0700

csiph-web