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


Groups > comp.lang.forth > #33756

Re: Can every Forth do this?

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Can every Forth do this?
Date 2014-10-08 13:17 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2014Oct8.151705@mips.complang.tuwien.ac.at> (permalink)
References <9b988010-d503-43f9-bb61-5407e919ac8a@googlegroups.com> <54342e10$0$15842$e4fe514c@dreader35.news.xs4all.nl> <be3f890b-694f-45d5-b93c-73a5bc20d925@googlegroups.com> <YPudnUS6_47k5KnJnZ2dnUU7-cOdnZ2d@supernews.com>

Show all headers | View raw


"Elizabeth D. Rather" <erather@forth.com> writes:
>On 10/7/14 11:27 AM, Mark Wills wrote:
>> The parent is the word that creates the child.
>>
>> : constant create , does> @ ;
>> 9 constant nine
>>
>> Constant is the parent of nine.
>>
>
>So, if the question is whether you can *always* get to CONSTANT from 
>nine, the answer is no.

No, that was not the question.  The two questions are about an
identifier for a does>, called n in the original posting; in an
implementation this could be the address of the code after the DOES>.
The first question is whether you could get at this identifier from
the child of a CREATE...DOES> word.  The second question was whether
you could get at it from the CREATE...DOES> word itself.

>In some implementations you could get to nine's 
>parent from its xt, but some implementations of CONSTANT compile 
>literals in place or do other things, so there is no xt.

This is not about some implementations of CONSTANT, this is about
CREATE...DOES> words, with one example being

: constant create , does> @ ;

You cannot get at this CONSTANT from NINE, but you can get at the
address of the code after the DOES>, because otherwise EXECUTE would
not work.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2014: http://www.euroforth.org/ef14/

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


Thread

Can every Forth do this? JennyB <jennybrien@googlemail.com> - 2014-10-07 07:33 -0700
  Re: Can every Forth do this? Roger Levy <roger.levy@gmail.com> - 2014-10-07 08:58 -0700
  Re: Can every Forth do this? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-10-07 16:16 +0000
    Re: Can every Forth do this? november.nihal@gmail.com - 2014-10-08 06:17 -0700
      Re: Can every Forth do this? Mark Wills <markwills1970@gmail.com> - 2014-10-08 09:55 -0700
      Re: Can every Forth do this? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-10-09 15:26 +0000
        Re: Can every Forth do this? Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-10-09 19:42 +0100
  Re: Can every Forth do this? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-07 18:16 +0000
    Re: Can every Forth do this? Jason Damisch <jasondamisch@yahoo.com> - 2014-10-07 11:32 -0700
    Re: Can every Forth do this? Mark Wills <markwills1970@gmail.com> - 2014-10-07 14:27 -0700
      Re: Can every Forth do this? "Elizabeth D. Rather" <erather@forth.com> - 2014-10-07 13:38 -1000
        Re: Can every Forth do this? Mark Wills <markwills1970@gmail.com> - 2014-10-07 20:21 -0700
        Re: Can every Forth do this? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-08 11:33 +0000
          Re: Can every Forth do this? JennyB <jennybrien@googlemail.com> - 2014-10-08 06:25 -0700
            Re: Can every Forth do this? november.nihal@gmail.com - 2014-10-08 08:14 -0700
              Re: Can every Forth do this? Mark Wills <markwills1970@gmail.com> - 2014-10-08 10:10 -0700
                Re: Can every Forth do this? JennyB <jennybrien@googlemail.com> - 2014-10-08 11:42 -0700
                Re: Can every Forth do this? Roger Levy <roger.levy@gmail.com> - 2014-10-08 12:31 -0700
                Re: Can every Forth do this? JennyB <jennybrien@googlemail.com> - 2014-10-09 07:03 -0700
                Re: Can every Forth do this? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-08 19:33 +0000
                Re: Can every Forth do this? november.nihal@gmail.com - 2014-10-08 16:39 -0700
                Re: Can every Forth do this? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-08 23:45 +0000
          Re: Can every Forth do this? Harold <hzrabbie@gmail.com> - 2014-10-08 14:23 -0700
            Re: Can every Forth do this? "Elizabeth D. Rather" <erather@forth.com> - 2014-10-08 12:48 -1000
            Re: Can every Forth do this? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-08 23:39 +0000
        Re: Can every Forth do this? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-10-08 13:17 +0000
        Re: Can every Forth do this? Roger Levy <roger.levy@gmail.com> - 2014-10-08 07:33 -0700
          Re: Can every Forth do this? Roger Levy <roger.levy@gmail.com> - 2014-10-08 07:33 -0700
  Re: Can every Forth do this? Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-10-07 20:23 +0100

csiph-web