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


Groups > comp.lang.forth > #40492

Re: local variable

From "Alex McDonald" <blog@rivadpm.com>
Newsgroups comp.lang.forth
Subject Re: local variable
Date 2015-07-10 13:55 +0100
Organization A noiseless patient Spider
Message-ID <mnof8f$tst$1@dont-email.me> (permalink)
References (11 earlier) <mnd9hc$ojn$1@dont-email.me> <b0eb4f4b-7cbc-4e10-815c-de4ac366452f@googlegroups.com> <mnfv4a$tkp$1@dont-email.me> <830fadec-a923-4d6e-8125-4a4a274258ac@googlegroups.com> <b46d0efe-b8ac-4bfa-8246-a6459e5ebb76@googlegroups.com>

Show all headers | View raw


on 10/07/2015 09:41:36, Raimond Dragomir wrote:
> vineri, 10 iulie 2015, 10:35:43 UTC+3, Michael Barry a scris:
>> On Tuesday, July 7, 2015 at 12:30:40 AM UTC-7, Alex McDonald wrote:
>> > ...
>> > Ummm... what didn't I understand about the original words "It is
>> > illegal to execute the xt of a quotation after the parent function
>> > has gone out of scope?" This looks like a slam dunk to me.
>> >
>>
>> I read Hugh's document carefully at least once, and it's a bit too
>>   advanced for me to understand it completely, but my impression is
>>   that you are correct.  If an orphaned quotation is called, it
>>   would happily execute, but would likely corrupt the stack.  Is
>>   this some kind of catastrophic failure in the design, or just an
>>   implementation decision that needs to be carefully followed?
>>
>> > ...
>> > I couldn't get your code to work. I imagine most other people didn't
>> > try.
>> >
>>
>> I was waiting for him to share his simulator with me before I tried
>>   his code.  Did you use his document to whip up your own simulator,
>>   or are you executing it by hand (or in your head)?  I know that
>>   you're a pretty sharp cookie, but it puzzles me that you would
>>   bother to expend the effort.  I know that Hugh isn't interested in
>>   your opinion, but I am.  Could you share a few thoughts about what
>>   you feel may be the merits and/or faults of his design?  I, for
>>   one, thought that it was kind of neat, and I don't feel eccentric
>>   or ignorant enough to be the only one here who thought so.
>>
>> Mike B.
> 
> Hi Mike,
> 
> Hugh's design is not faulty. The problem is that his saying is taken
> out of context by Alex.

Here's what Anton Ertl said re quotations.

|> Concerning quotations, the problem is not whether you can define them
|> inside (ok, there is a bit of implementation effort required to
|> support that), but whether locals defined outside are visible inside,
|> and you already have that with a single local definition at the
|> outermost level in combination with quotations.  For now the locals
|> from outside are not visible inside in Gforth; making them visible
|> there in general requires garbage collection of the activation
|> records.  There have been discussions on ways to support something
|> like this in a more limited way, but these ideas are still at the
|> conceptual stage.

Here's what Hugh claimed in response.

|I have real quotations here:
|http://www.forth.org/FMITE.txt

|I mean, not the Payson-faked quotations that are just 
|:NONAME with syntactic sugar --- real quotations that 
|have access to the parent function's local variables.


> Indeed is not possible to run a quotation when its parent is not
> running, because the paren't locals are out of scope.

But that was Anton's point to which Hugh was responding.  

> But This is only the case when the quotation is using a parent local.
> In all other cases it's definitely possible to run the quotation.
> So a parent can 'return' a quotation xt on the stack
> and this xt can be executed everywhere and anytime, as long as the
> quotation is not using parent locals. If it uses parent locals it can
> be executed only inside the parent.
> That's what is Hugh saying. 

Hugh was claiming much more and delivering a lot less. In fact, the
gyrations he proposes in section 16 of http://www.forth.org/FMITE.txt are
to avoid the dreaded "maybe/maybe not" ambguities that Hugh finds hard to
handle in the ANS Forth spec. Hugh isn't proposing to prevent quotations
that refer to out of scope locals at compile time, btw, but at run time
in what looks like a compute heavy process. Having read through it
briefly, I'm not even sure it's feasible, since it depends on a hidden
local on the return stack with the address of the parent, and it would
probably invalidate quotations inside quotations.

> Alex took an afirmation out of context and
> wants to proove something. It is totally unfair, not to say that he
> gave a non- working example (in any system).

Of course it's non-working, since it requires garbage collection as Anton
notes.

: foo {: myloc :} [: myloc 1+ ;] ;
10 foo execute 

Because that was Anton's point, which Hugh missed.

> I made the point at that time, giving the correct example (that works
> in my system (and Hugh's also, I'm sure).
> Hugh's may have a simulator (a cross-compiler for the FMITE but FMITE
> is not a real processor yet) but I have a working system on which I
> can test for real. So I'm not talking here "in theory".
> 

"It is illegal to execute the xt of a quotation after the parent function
has gone out of scope (done its EXIT)." Please show me where I've taken
Hugh out of context.

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


Thread

local variable grobibi <tristanhennequin@free.fr> - 2015-03-15 00:43 +0100
  Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-03-14 15:01 -1000
    Re: local variable grobibi <tristanhennequin@free.fr> - 2015-03-15 02:50 +0100
      Re: local variable Gerard Sontag <gerardsontag@gmail.com> - 2015-07-11 09:49 -0700
        Re: local variable Coos Haak <chforth@hccnet.nl> - 2015-07-11 22:50 +0200
          Re: local variable Gerard Sontag <gerardsontag@gmail.com> - 2015-07-12 01:03 -0700
            Re: local variable Coos Haak <chforth@hccnet.nl> - 2015-07-12 17:18 +0200
    Re: local variable albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-15 03:02 +0000
  Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-15 02:53 +0100
    Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-17 22:29 +0000
      Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2016-02-08 14:45 +0000
  Re: local variable hughaguilar96@gmail.com - 2015-03-14 20:45 -0700
    Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-15 10:53 +0000
      Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-15 22:54 +0100
      Re: local variable hughaguilar96@gmail.com - 2015-03-15 19:45 -0700
        Re: local variable hughaguilar96@gmail.com - 2015-03-15 20:15 -0700
          Re: local variable grobibi <tristanhennequin@free.fr> - 2015-03-16 08:42 +0100
        Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-16 07:51 +0000
          Re: local variable hughaguilar96@gmail.com - 2015-03-16 09:59 -0700
            Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-16 20:31 +0000
            Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-18 08:59 +0000
      Re: local variable "HAA" <someone@microsoft.com> - 2015-03-17 13:47 +1100
        Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-17 10:59 +0000
          Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 18:55 +0100
            Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-17 18:43 +0000
          Re: local variable "HAA" <someone@microsoft.com> - 2015-03-18 13:25 +1100
            Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-03-17 16:43 -1000
              Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-18 04:09 +0100
                Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-03-17 17:55 -1000
                Re: local variable "HAA" <someone@microsoft.com> - 2015-03-20 22:28 +1100
                Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-20 15:43 +0100
                Identifying self interest (was Re: local variable) "Alex McDonald" <blog@rivadpm.com> - 2015-03-20 15:20 +0000
            Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-18 08:48 +0000
              Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-09-16 18:55 +0000
                Re: local variable hughaguilar96@gmail.com - 2015-09-16 22:03 -0700
        Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-17 14:18 +0000
          Re: local variable albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-17 16:24 +0000
            Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-17 16:34 +0000
            Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-18 14:32 +0000
          Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 20:08 +0100
            Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-18 15:21 +0000
  Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-16 15:36 +0000
    Re: local variable hughaguilar96@gmail.com - 2015-03-16 10:09 -0700
      Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-16 20:24 +0000
        Re: local variable "Rod Pemberton" <buzz@notnotnontnooatno.cmm> - 2015-03-16 19:00 -0400
          Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-17 12:06 +0000
            Re: local variable stephen@mpeforth.com (Stephen Pelc) - 2015-03-17 14:37 +0000
            Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 18:58 +0100
          Re: local variable Doug Hoffman <glidedog@gmail.com> - 2015-03-17 08:55 -0400
          Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-17 14:15 +0000
      Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-17 16:54 +0000
        Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-17 17:45 +0000
          Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 20:14 +0100
          Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-20 15:06 +0000
            Re: local variable hughaguilar96@gmail.com - 2015-03-20 16:14 -0700
              Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-03-21 09:47 +0000
            Re: local variable hughaguilar96@gmail.com - 2015-07-04 19:52 -0700
              Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-05 07:24 +0100
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 02:04 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-05 10:36 +0100
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 03:25 -0700
                Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-07-05 15:28 +0200
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 08:11 -0700
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 08:21 -0700
                Re: local variable Bernd Paysan <bernd.paysan@gmx.de> - 2015-07-05 23:53 +0200
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 20:31 -0700
                Re: local variable hughaguilar96@gmail.com - 2015-07-05 19:56 -0700
                Re: local variable hughaguilar96@gmail.com - 2015-07-05 19:57 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-06 08:09 +0100
                Re: local variable hughaguilar96@gmail.com - 2015-07-06 19:59 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-07 08:30 +0100
                Re: local variable Michael Barry <barrym95838@yahoo.com> - 2015-07-10 00:35 -0700
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-10 01:41 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-10 13:55 +0100
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-10 07:13 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-10 16:29 +0100
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-10 08:57 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-10 17:48 +0100
                Re: local variable Paul Rubin <no.email@nospam.invalid> - 2015-07-10 10:02 -0700
                Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-09-16 17:30 +0000
                Re: local variable Mark Wills <markwills1970@gmail.com> - 2015-07-10 10:28 -0700
                Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-07-10 08:00 -1000
                Re: local variable hughaguilar96@gmail.com - 2015-07-10 21:31 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-10 19:13 +0100
                Re: local variable "Elizabeth D. Rather" <erather@forth.com> - 2015-07-10 09:06 -1000
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-11 14:10 +0000
                Re: local variable humptydumpty <ouatubi@gmail.com> - 2015-07-11 10:14 -0700
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-12 15:56 +0000
                Re: local variable humptydumpty <ouatubi@gmail.com> - 2015-07-12 11:48 -0700
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-10 21:21 -0700
                Re: local variable hughaguilar96@gmail.com - 2015-07-10 21:56 -0700
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-11 23:51 +0100
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-11 13:42 +0000
                Re: local variable franck.bensusan@gmail.com - 2015-07-12 02:17 -0700
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-12 15:12 +0000
                Re: local variable franck.bensusan@gmail.com - 2015-07-13 02:37 -0700
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-13 16:13 +0000
                Re: local variable franck.bensusan@gmail.com - 2015-07-13 14:48 -0700
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-14 06:41 +0000
                Re: local variable franck.bensusan@gmail.com - 2015-07-14 01:44 -0700
                Re: local variable Bernd Linsel <bl1@gmx.com> - 2015-07-11 11:03 +0200
                Re: local variable Bernd Linsel <bl1@gmx.com> - 2015-07-11 11:11 +0200
                Re: local variable hughaguilar96@gmail.com - 2015-07-12 16:43 -0700
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-11 15:14 +0000
                Re: local variable Julian Fondren <julian.fondren@gmail.com> - 2015-07-11 17:57 -0700
                Re: local variable anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-12 15:32 +0000
                Re: local variable "Alex McDonald" <blog@rivadpm.com> - 2015-07-10 13:13 +0100
                Re: local variable hughaguilar96@gmail.com - 2015-07-10 21:48 -0700
                Re: local variable franck.bensusan@gmail.com - 2015-07-05 03:47 -0700
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 04:15 -0700
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 04:27 -0700
                Re: local variable Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-05 04:39 -0700
                Re: local variable franck.bensusan@gmail.com - 2015-07-05 07:08 -0700
  Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2015-03-18 05:04 +0000
    Re: local variable "WJ" <w_a_x_man@yahoo.com> - 2016-02-08 16:09 +0000
  Ignore the standard Stefan Mauerhofer <smauerhofer@androsoft.ch> - 2015-03-18 04:09 -0700
    Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-18 07:26 -0400
      Re: Ignore the standard "WJ" <w_a_x_man@yahoo.com> - 2015-03-20 17:31 +0000
        Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-20 17:41 -0400
          Re: Ignore the standard "Elizabeth D. Rather" <erather@forth.com> - 2015-03-20 14:26 -1000
            Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-21 06:00 -0400
              Re: Ignore the standard hughaguilar96@gmail.com - 2015-03-21 15:11 -0700
          Re: Ignore the standard Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-21 02:49 +0100
            Re: Ignore the standard Doug Hoffman <glidedog@gmail.com> - 2015-03-21 06:04 -0400
    Re: Ignore the standard "Alex McDonald" <blog@rivadpm.com> - 2015-03-18 16:05 +0000
    Re: Ignore the standard "WJ" <w_a_x_man@yahoo.com> - 2015-03-20 17:13 +0000
  Re: local variable foxaudioresearch@gmail.com - 2015-07-05 08:44 -0700

csiph-web