Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: why is it c...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 13 Topic 3991 of 4065
Post > Topic >>

Re: why is it called a buffer

by m_l_g3 <m_l_g3@[EMAIL PROTECTED] > Apr 9, 2008 at 02:02 PM

On Apr 9, 9:37 pm, Elizabeth D Rather <erat...@[EMAIL PROTECTED]
> wrote:
> 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.

I would suggest, they wanted a buffer for temporary data and therefore
called the buffer temporary.

Try

SEE BUFFER:

if it shows something like

: buffer: create allot ;

then it allocates a static buffer that you cannot resize later.




 13 Posts in Topic:
why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-09 23:52:07 
Re: why is it called a buffer
Jerry Avins <jya@[EMAI  2008-04-09 11:13:32 
Re: why is it called a buffer
Elizabeth D Rather <er  2008-04-09 07:37:55 
Re: why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-10 23:04:19 
Re: why is it called a buffer
Clever Monkey <spamtra  2008-04-14 12:56:45 
Re: why is it called a buffer
m_l_g3 <m_l_g3@[EMAIL   2008-04-09 14:02:59 
Re: why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-10 23:04:19 
Re: why is it called a buffer
Elizabeth D Rather <er  2008-04-10 07:32:27 
Re: why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-15 02:05:03 
Re: why is it called a buffer
Albert van der Horst <  2008-04-17 02:27:04 
Re: why is it called a buffer
vandys@[EMAIL PROTECTED]   2008-04-17 02:33:44 
Re: why is it called a buffer
Bruce McFarling <agila  2008-04-10 09:58:19 
Re: why is it called a buffer
Jonah Thomas <jethomas  2008-04-14 13:31:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 4:41:13 CDT 2008.