home .. forth .. colorforth mail list archive ..

Re: [colorforth] DOES> How is colorForth different from other Forths?


On Sunday 14 December 2003 07:58 pm, Mark Slicker wrote:
> Is a structure not simply a contiguous collection of named fields?

Pretty much, that's all a structure is.

> I've done something similar to this in colorForth, except I've found
> it beneficial in my case to integrate both the allocation and
> computation of a table of structures. Also I did not need
> reassignment, so the named fields can actually fetch the element.

In working with FS/Forth, I'm forced to use structures to represent the 
records found inside an ELF file.  I've found that using allocation via 
, and C, works wonders.  No need for malloc/free and the memory is 
effectively perfectly garbage collected, since after I'm done using the 
memory, I just EMPTY it and start anew.

There are limitations to this approach however.  For example, I cannot 
use , and C, to implement the string section while concurrently building 
an ELF section header.  Thus, I must pre-allocate a small chunk of 
memory for use as a string section, and hope that it's big enough.  :)

--
Samuel A. Falvo II


---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com