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


Groups > comp.lang.forth > #1043

Re: Immediate definitions

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Subject Re: Immediate definitions
Newsgroups comp.lang.forth
References <inkj3u$enh$1@dont-email.me>
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Date 2011-04-07 15:54 +0000
Message-ID <2011Apr7.175441@mips.complang.tuwien.ac.at> (permalink)

Show all headers | View raw


Gerry Jackson <gerry@jackson9000.fsnet.co.uk> writes:
>I've just hit a portability problem to do with immediate VALUEs in that 
>two respected ANS Forth systems don't seem to work correctly.
>
>Does the ANS Forth standard permit such definitions as
>123 constant x immediate
>variable y immediate
>123 value v immediate

Yes.

>Superficially yes, as the specifications for CONSTANT VARIABLE and VALUE 
>say that these create definitions, and the spec for IMMEDIATE says it 
>makes the most recent definition immediate.

Correct.

>However the answer to RFI 7 waffles on leaving me confused

Why?  It just clarifies that a system cannot implement, e.g.,
non-immediate constants, as immediate stats-smart words (which some
system implementors (in particular Wonyong Koh, the requester) see as
a shortcut for implementing optimizations).

> and the 
>definition of 'definition' talks about Forth execution procedures (which 
>sound like colon definitions to me).

I think what is meant by this includes the run-time semantics of
constants, variables etc.

In general I would not put too much weight in the definitions of terms
section.  They seem to be there more to establish the terms rather
than to be clear-cut specifications.  If CONSTANT says that it creates
a definition, why would you give more weight to a definition of the
term "definition" that does not even exclude constants directly or
indirectly.

> The question has been asked before 
>on comp.lang.forth without a clear answer. Also the Hayes core test 
>program doesn't test these - but it doesn't test everything anyway.

Right.  No test of a Turing-complete language can test everything.

- 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 2010: http://www.euroforth.org/ef10/

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


Thread

Immediate definitions Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2011-04-07 15:52 +0100
  Re: Immediate definitions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-07 15:54 +0000
  Re: Immediate definitions Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-04-07 11:25 -0500
  Re: Immediate definitions StephenPelc <stephen@mpeforth.com> - 2011-04-08 02:11 -0700

csiph-web