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


Groups > comp.lang.forth > #47855

Re: Quotations

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: Quotations
Date Sun, 05 Jun 2016 21:20:59 -0700
Organization A noiseless patient Spider
Lines 27
Message-ID <87shwraqxg.fsf@jester.gateway.pace.com> (permalink)
References <94c723eb-affc-4c0b-a17c-cd761faa8ebb@googlegroups.com> <f71bfb01-4b8e-49d6-abd5-12bda6dbfcd2@googlegroups.com> <ff4d8da2-a722-4990-b9a8-5540bd67ab70@googlegroups.com> <691a9a5f-5318-4dcb-83fe-85e09c8d7f80@googlegroups.com> <511607a1-a5ea-49fc-94df-aaa200d31c4d@googlegroups.com> <2016May30.172423@mips.complang.tuwien.ac.at> <58c4638d-3015-4b2a-bfc1-b7abb368dbd3@googlegroups.com> <2016Jun1.162929@mips.complang.tuwien.ac.at> <nio6hb$fd6$1@gioia.aioe.org> <X4Odnd2-vbnwYtLKnZ2dnUU7-bPNnZ2d@supernews.com> <c75df337-769e-4e18-aa91-28d2bf7b6d8f@googlegroups.com> <wbGdnR_TJd5Mx83KnZ2dnUU7-d_NnZ2d@supernews.com> <87zir3czkc.fsf@jester.gateway.pace.com> <ktWdncyfpJbiqszKnZ2dnUU7-UHNnZ2d@supernews.com> <87d1nxcx3s.fsf@jester.gateway.pace.com> <RfidnZOFsujPPM_KnZ2dnUU7-QOdnZ2d@supernews.com> <87wpm3awv0.fsf@jester.gateway.pace.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="a4ba9f006d4fba7a97cec7431fc63985"; logging-data="22241"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18g6luu9Ww4ypEifu2vRjWv"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:o/tbNzlogxZSPOhlsYj1uaxf0c4= sha1:VOOWUVMhEVSllplOqcL497M7aw0=
Xref csiph.com comp.lang.forth:47855

Show key headers only | View raw


Paul Rubin <no.email@nospam.invalid> writes:
> Hmm, so maybe it's ok to call the closure after the parent has returned,
> if there are no captured reference args.

I just tried modifying a captured-by-value variable inside a C++ lambda
and got a compile time error saying I'd tried to change a read-only
variable.  Also, it looks like the value is copied to the closure at the
time the closure is made (changes between calls aren't reflected in the
later calls).  So I guess that explains.  The code I tested:

    #include <iostream>

    main() {
      int n = 7;
      auto clo = [n]() {
        std::cout << "n: " << n << "\n";
        return 1;
      };
      clo();
      n++;
      clo();
    }

It prints "n: 7" twice.

I think this is more complicated behaviour than one would expect to find
in Forth.

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


Thread

Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 22:35 -0700
  Re: Quotations humptydumpty <ouatubi@gmail.com> - 2015-07-05 23:03 -0700
    Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 23:21 -0700
    Re: Quotations humptydumpty <ouatubi@gmail.com> - 2015-07-06 00:00 -0700
  Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-06 00:10 -0700
  Re: Quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-07-06 09:39 +0100
    Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-06 05:28 -0700
      Re: Quotations franck.bensusan@gmail.com - 2015-07-06 15:02 -0700
        Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-06 22:43 -0700
          Re: Quotations Stefan Mauerhofer <smauerhofer@androsoft.ch> - 2015-07-06 23:06 -0700
            Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-07 01:27 -0700
              Re: Quotations Stefan Mauerhofer <smauerhofer@androsoft.ch> - 2015-07-07 03:40 -0700
          Re: Quotations franck.bensusan@gmail.com - 2015-07-07 04:08 -0700
      Re: Quotations humptydumpty <ouatubi@gmail.com> - 2015-07-10 02:34 -0700
        Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-14 11:30 -0700
          Re: Quotations franck.bensusan@gmail.com - 2015-07-16 03:28 -0700
            Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-16 09:11 -0700
    Re: Quotations Paul Rubin <no.email@nospam.invalid> - 2015-07-08 12:04 -0700
  Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-28 13:06 -0700
  Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-29 02:22 -0700
    Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-29 10:41 -0700
      Re: Quotations franck.bensusan@gmail.com - 2016-05-29 12:38 -0700
        Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-29 23:03 -0700
          Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 00:34 -0700
            Re: Quotations franck.bensusan@gmail.com - 2016-05-30 03:04 -0700
              Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 03:41 -0700
                Re: Quotations franck.bensusan@gmail.com - 2016-05-30 08:26 -0700
                Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 08:46 -0700
            Re: Quotations Cecil Bayona <cbayona@cbayona.com> - 2016-05-30 10:01 -0500
              Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 08:33 -0700
          Re: Quotations franck.bensusan@gmail.com - 2016-05-30 00:44 -0700
            Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 01:03 -0700
            Re: Quotations hughaguilar96@gmail.com - 2016-06-02 22:07 -0700
              Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-06-02 23:11 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-03 05:18 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-03 05:28 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-03 05:56 -0700
          Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-30 15:24 +0000
            Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 11:33 -0700
              Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-01 14:23 +0000
            Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 11:46 -0700
              Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-01 14:27 +0000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-01 07:53 -0700
            Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 12:43 -0700
              Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-31 13:25 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-05-31 16:57 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-05-31 19:33 -0700
                Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-06-01 03:20 -0700
                Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-06-01 03:15 -0700
              Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-01 14:29 +0000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-01 08:20 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-01 18:59 -0700
                Re: Quotations "WJ" <w_a_x_man@yahoo.com> - 2016-06-02 06:05 +0000
                Re: Quotations alex@rivadpm.com - 2016-06-09 09:59 -0700
                Re: Quotations "WJ" <w_a_x_man@yahoo.com> - 2016-06-09 17:47 +0000
                Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-06-01 09:12 -0700
                Re: Quotations "HAA" <someone@microsoft.com> - 2016-06-02 12:45 +1000
                Re: Quotations Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-02 04:42 -0500
                Re: Quotations Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-06-02 05:08 -0700
                Re: Quotations Paul Rubin <no.email@nospam.invalid> - 2016-06-02 06:53 -0700
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-02 13:54 +0000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-02 13:09 -0700
                Re: Quotations "HAA" <someone@microsoft.com> - 2016-06-04 12:45 +1000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-03 20:52 -0700
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-04 15:05 +0000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-06 01:41 -0700
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-06 13:12 +0000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-06 08:29 -0700
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-07 06:06 +0000
                Re: Quotations mhx@iae.nl - 2016-06-06 10:51 -0700
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-07 06:36 +0000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-07 00:44 -0700
                Re: Quotations mhx@iae.nl - 2016-06-07 11:35 -0700
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-08 07:14 +0000
                Re: Quotations hughaguilar96@gmail.com - 2016-06-09 00:58 -0700
                Re: Quotations "WJ" <w_a_x_man@yahoo.com> - 2016-06-09 11:37 +0000
                Re: Quotations Paul Rubin <no.email@nospam.invalid> - 2016-06-07 12:37 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-07 19:03 -0700
                Re: Quotations Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-02 11:12 -0500
                Re: Quotations Paul Rubin <no.email@nospam.invalid> - 2016-06-02 09:42 -0700
                Re: Quotations Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-03 02:53 -0500
                Re: Quotations Paul Rubin <no.email@nospam.invalid> - 2016-06-03 23:00 -0700
                Re: Quotations Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-04 04:37 -0500
                Re: Quotations Paul Rubin <no.email@nospam.invalid> - 2016-06-05 19:12 -0700
                Re: Quotations Paul Rubin <no.email@nospam.invalid> - 2016-06-05 21:20 -0700
                Re: Quotations franck.bensusan@gmail.com - 2016-06-09 02:55 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-09 19:20 -0700
                Re: Quotations franck.bensusan@gmail.com - 2016-06-10 07:00 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-10 10:00 -0700
                Re: Quotations franck.bensusan@gmail.com - 2016-06-10 10:56 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-10 17:56 -0700
                Re: Quotations Mark Wills <markwills1970@gmail.com> - 2016-06-14 05:18 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-26 16:12 -0700
                Re: Quotations hughaguilar96@gmail.com - 2016-06-02 12:41 -0700
                Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-06-02 13:03 -0700
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-02 13:37 +0000
                Re: Quotations Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-08 04:33 -0500
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-08 09:39 +0000
                Re: Quotations Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-08 05:53 -0500
                Re: Quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-08 11:30 +0000
                Re: Quotations Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-08 08:11 -0500
                Re: Quotations hughaguilar96@gmail.com - 2016-06-09 01:09 -0700
      Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-30 08:54 -0700
    Re: Quotations hughaguilar96@gmail.com - 2016-05-31 12:06 -0700
      Re: Quotations humptydumpty <ouatubi@gmail.com> - 2016-05-31 13:41 -0700
      Re: Quotations "WJ" <w_a_x_man@yahoo.com> - 2016-05-31 21:09 +0000
  Lambdas (closures) "WJ" <w_a_x_man@yahoo.com> - 2016-06-09 17:18 +0000

csiph-web