Tinkerer wrote:
> Hello, I'm just starting forth..
> The word buffer: has me worried.
> The docs say its purpose is to allocate a temporary buffer
> How temporary? Is there some limitation to its use, or is it just
> another way of saying 'heap' as opposed to 'stack' ?
You do not say what version of Forth you're using, but in the
implementations I'm familiar with, BUFFER: is equivalent to the sequence
CREATE <name> <number of bytes> ALLOT
This actually creates a permanent allocation of data space, so there's
nothing temporary about it. And it is *data space*, neither "heap" nor
"stack".
I suppose someone may have defined it using ALLOCATE (which *is* a
temporary allocation), but if so, you then have an obligation to FREE
the space at some point. I've never seen such a version, though, so I
suspect that the word "temporary" in the documentation doesn't really
mean it. Forth rarely uses temporary allocations or garbage collection,
though some extensions to Forth do.
Cheers,
Elizabeth
--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com
"Forth-based products and Services for real-time
applications since 1973."
==================================================


|