Tinkerer wrote:
> m_l_g3 <m_l_g3@[EMAIL PROTECTED]
> wrote:
>
>> Try
>>
>> SEE BUFFER:
>>
>> if it shows something like
>>
>> : buffer: create allot ;
>>
>> then it allocates a static buffer that you cannot resize later.
>
> I can't tell on my Open Firmware's built-in forth, but I will try some
> experiments to test if it is implemented llike that.
>
> My (admittedly very brief) experience is that the comma operator can't
> poke data into previously named storage, which would make it unsuitable
> for what I was hoping it would be useful for. At the moment I am
> barrelling full speed ahead trying to get something done. Hopefully I
> will be able to make use of the help I have received next time, or -
> heaven forbid - if I have to scrap my original approach and start again
> from scratch.
Ok, if you're using Open Firmware, then BUFFER: is definitely defined in
terms of CREATE ALLOT. If you want a truly temporary buffer, use
ALLOCATE (and FREE when you're done with it):
14.6.1.0707 ALLOCATE ( u -- a-addr ior )
Allocate u address units of contiguous data space. The data-space
pointer is unaffected by this operation. The initial content of the
allocated space is undefined.
If the allocation succeeds, a-addr is the aligned starting address of
the allocated space and ior is zero.
If the operation fails, a-addr does not represent a valid address and
ior is the implementationdefined I/O result code.
14.6.1.1605 FREE ( a-addr -- ior )
Return the contiguous region of data space indicated by a-addr to the
system for later allocation. a-addr shall indicate a region of data
space that was previously obtained by ALLOCATE or RESIZE. The data-space
pointer is unaffected by this operation.
If the operation succeeds, ior is zero. If the operation fails, ior is
the implementation-defined I/O result code.
The comma operator actually adds a value to the dictionary. If you want
to store something into an existing address, use ! (store).
Actually, if you could tell us what you're trying to do perhaps we could
be more helpful
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."
==================================================


|