Anton Ertl wrote:
<snipped>
Proposal
RfD: Structures - Version 4
6 February 2007, Stephen Pelc
Ballot for systems
If you maintain several systems, please mention the systems separately
in the ballot. Insert the system name or version between the brackets.
Multiple hits for the same system are possible (if they do not conflict).
[WIN32FORTH V4 V6] conforms to ANS Forth.
[ ] already implements the proposal in full since release [ ].
[WIN32FORTH] implements the proposal in full in a development version.
[WIN32FORTH] will implement the proposal in full in release [ V7 ].
[ ] will implement the proposal in full in some future release.
There are no plans to implement the proposal in full in [ ].
[ ] will never implement the proposal in full.
If you want to provide information on partial implementation, please do
so informally, and I will aggregate this information in some way.
Ballot for programmers
Just mark the statements that are correct for you (e.g., by putting an
"x" between the brackets). If some statements are true for some of your
programs, but not others, please mark the statements for the dominating
class of programs you write.
[x] I have used (parts of) this proposal in my programs.
[ ] I would use (parts of) this proposal in my programs if the systems
I am interested in implemented it.
[ ] I would use (parts of) this proposal in my programs if this
proposal was in the Forth standard.
[ ] I would not use (parts of) this proposal in my programs.
Notes:
Parts of Win32Forth use an alternative "based" structure.
: FLD ( basevar offset len -<name>- -- basevar offset+len ) \
definer for fields
create
3dup + 2>R \ n1 n2 n3 r: n1 n2+n3
drop \ n1 n2 r: n1 n2+n3
, , 2R> \ build n2 n1
DOES> ( -- baseaddr )
dup @ \ fetch n2
swap cell+ @ @ + ; \ fetch n1 value, add
: FLDBASE ( -<name>- ) \ set field base name (starts field)
CREATE here 0 , 0 ; \ base of record
Example:
FLDBASE BASE-IID
4 FLD IID-RVA-ILT \ import lookup table
4 FLD IID-TIMEDATE \ time date of binding
4 FLD IID-FORWARDER \ forwarder index
4 FLD IID-RVA-NAME \ RVA to name
4 FLD IID-RVA-IAT \ import address table
CONSTANT LEN-IID DROP
Usage:
<value> BASE-IID ! \ set base of IID
<value> IID-RVA-NAME ! \ i.e. BASE-IID+12
--
Regards
Alex McDonald