Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
RfD: Structures (v2)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter Knaggs  
View profile  
 More options Mar 17 2010, 7:16 am
Newsgroups: comp.lang.forth
From: "Peter Knaggs" <p...@bcs.org.uk>
Date: Wed, 17 Mar 2010 11:16:45 -0000
Local: Wed, Mar 17 2010 7:16 am
Subject: RfD: Structures (v2)
RfD: Structures
===============

2010-03-17  Revised after clf discussions.
2010-02-24  Drafting of RfD
2009-09-03  Original wordsmithing of solution during 200x meeting.

Problem
=======

The X:structures extension defines FIELD: as:

   10.6.2.xxxx FIELD:          "field-colon"              FACILITY EXT
               ( -- )                                     X:structures

     The semantics of FIELD: are identical to the execution semantics
     of the phrase:

         ALIGNED 1 CELLS +FIELD

   See: 10.6.2.---- +FIELD, 10.6.2.---- BEGIN-STRUCTURE and
        10.6.2.---- END-STRUCTURE.

While this is a very concise definition, there are a few difficulties
with it:

1) The stack description is incorrect, it should be:
    ( n1 "<spaces>name" -- n2 )

2) It defines a child word which is not described.  Normally this is
    described in a "name Execution" clause.

3) There is no actual description of the word, simply what amounts
    to a reference implementation.

This applies to CFIELD:, DFFIELD:, FFIELD: and SFFIELD: as well.

Solution
========

Replace the definition of FIELD: and friends with:

   10.6.2.xxxx FIELD:          "field-colon"              FACILITY EXT
               ( n1 "<spaces>name" -- n2 )                X:structures

     Skip leading space delimiters.  Parse /name/ delimited by a space.
     Create a definition for /name/ with the execution semantics
     defined below.  n1 is the /offset/ from the start of a data
     structure to place the new field.  If n1 is not a cell aligned
     offset it should be modified to be so.  n2 is the next available
     offset after reserving sufficient space for a single cell in the
     data structure.

     FIELD: creates a single cell field in a data structure.  The
     execution semantics are identical to:

         ALIGNED 1 CELLS +FIELD

   name Execution: ( a-addr1 -- a-addr2 )
     Add the /offset/ calculated during the compile time action to
     a-addr1 giving the cell aligned address a-addr2.

   See: 10.6.2.---- +FIELD, 10.6.2.---- BEGIN-STRUCTURE,
        10.6.2.---- END-STRUCTURE, A.10.6.---- BEGIN-STRUCTURE.

Proposal
========

Modify the definition of the following words in accordance with the
text given in the Solution, above, with the modification of the
alignment as follows:

FIELD:      cell aligned
CFIELD:     character aligned
FFIELD:     float aligned
SFFIELD:    single-float aligned
DFFIELD:    double-float aligned

Author
======
Peter Knaggs <p...@bcs.org.uk>
School of Engineering, Mathematics and Physical Sciences,
University of Exeter, Exeter, Devon EX4 7QF, England


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »