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


Groups > comp.lang.forth > #42863

Re: How to solve this problem in FORTH?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.forth
Subject Re: How to solve this problem in FORTH?
Date Mon, 26 Oct 2015 21:58:21 -0700
Organization A noiseless patient Spider
Lines 20
Message-ID <87y4eovrf6.fsf@jester.gateway.sonic.net> (permalink)
References <f195a1a1-8609-4319-9df9-d8cbb2a11fdb@googlegroups.com> <ed5ecb8e-cb01-4acb-9e4c-0a20b12f290b@googlegroups.com> <87fv0yvz6f.fsf@jester.gateway.sonic.net> <c790e466-39c8-44e9-9109-9e2524aacab2@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="1a9f5856d25720e42c135b990c70bebb"; logging-data="23059"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19U3b67CVKbBB/S8uBgBNTs"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:GKUfolFQWauLZBgeZs3sQ9xTsHs= sha1:2DlWd6cM4Z7sN8gQFnyD0snVzUM=
Xref csiph.com comp.lang.forth:42863

Show key headers only | View raw


Raimond Dragomir <raimond.dragomir@gmail.com> writes:
> Why would you need a nested function for such a trivial problem?

Of course it's not needed-- it just allows a little more factoring,
which can be nice depending on your tastes.

> : vadd2
>   local{ v1 v2 v3 | vadd }
>   { >r v1 @ r@ th @  v2 @ r@ th @  v3 @ r> th ! } vadd !
>   0 vadd @ execute
>   1 vadd @ execute
>   2 vadd @ execute
> ;

That is nice.  Note that there was a big discussion a few months ago
about whether the Forth 200x standard's quotations should allow
accessing the parent's locals like that, and I think the result was that
it was considered to potentially complicate implementations too much to
be worthwhile.  If you've got a simple implementation you might want to
comment.

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


Thread

How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-26 00:02 -0700
  Re: How to solve this problem in FORTH? Paul Rubin <no.email@nospam.invalid> - 2015-10-26 00:58 -0700
    Re: How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-26 02:36 -0700
      Re: How to solve this problem in FORTH? Paul Rubin <no.email@nospam.invalid> - 2015-10-26 21:56 -0700
    Re: How to solve this problem in FORTH? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-10-26 03:09 -0700
      Re: How to solve this problem in FORTH? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-10-26 03:14 -0700
        Re: How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-26 04:55 -0700
          Re: How to solve this problem in FORTH? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-10-26 05:11 -0700
            Re: How to solve this problem in FORTH? humptydumpty <ouatubi@gmail.com> - 2015-10-26 06:35 -0700
              Re: How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-26 12:25 -0700
                Re: How to solve this problem in FORTH? humptydumpty <ouatubi@gmail.com> - 2015-10-27 00:47 -0700
                Re: How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-27 08:06 -0700
                Re: How to solve this problem in FORTH? humptydumpty <ouatubi@gmail.com> - 2015-10-27 23:43 -0700
                Re: How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-28 01:30 -0700
                Re: How to solve this problem in FORTH? humptydumpty <ouatubi@gmail.com> - 2015-10-28 01:58 -0700
                Re: How to solve this problem in FORTH? franck.bensusan@gmail.com - 2015-10-28 02:56 -0700
                Re: How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-28 03:36 -0700
                Re: How to solve this problem in FORTH? Hans Bezemer <the.beez.speaks@gmail.com> - 2015-10-28 15:31 +0100
      Re: How to solve this problem in FORTH? Paul Rubin <no.email@nospam.invalid> - 2015-10-26 21:58 -0700
        Re: How to solve this problem in FORTH? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-10-26 23:38 -0700
        Re: How to solve this problem in FORTH? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-27 09:24 +0000
          Re: How to solve this problem in FORTH? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-10-27 02:54 -0700
    Re: How to solve this problem in FORTH? mhx@iae.nl - 2015-10-26 11:31 -0700
  Re: How to solve this problem in FORTH? "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-10-26 04:54 -0400
    Re: How to solve this problem in FORTH? Paul Rubin <no.email@nospam.invalid> - 2015-10-26 02:09 -0700
      Re: How to solve this problem in FORTH? Ron Aaron <rambamist@gmail.com> - 2015-10-26 11:16 +0200
      Re: How to solve this problem in FORTH? Lars Brinkhoff <lars.spam@nocrew.org> - 2015-10-26 10:49 +0100
      Re: How to solve this problem in FORTH? Hans Bezemer <the.beez.speaks@gmail.com> - 2015-10-28 11:22 +0100
        Re: How to solve this problem in FORTH? Howerd <howerdo@yahoo.co.uk> - 2015-10-28 04:09 -0700
        Re: How to solve this problem in FORTH? hughaguilar96@gmail.com - 2015-10-29 19:52 -0700
        Re: How to solve this problem in FORTH? "WJ" <w_a_x_man@yahoo.com> - 2015-10-30 09:00 +0000
    Re: How to solve this problem in FORTH? lehs <skydda.barnen@gmail.com> - 2015-10-26 02:44 -0700

csiph-web