j: Next unread message
k: Previous unread message
j a: Jump to all threads
j l: Jump to MailingList overview
Forth word "begin-package" takes three strings as input
begin-package ( arg-str arg-len reg-str reg-len dev-str dev-len -- )
With the current implementation, arg-str will be overwritten. So I think number of pockets should be increased to three.
-----Original Message----- From: Stefan Reinauer [mailto:firstname.lastname@example.org] Sent: Thursday, May 12, 2005 1:12 PM To: email@example.com Subject: Re: [OpenBIOS] problem with strings
* firstname.lastname@example.org email@example.com [050512 09:10]:
0 > ok 0 > " hi" " hello" " bye" " welcome" ok 8 > .s <8> 4005810c 2 4005800c 5 4005810c 3 4005800c 7 ok 8 >
Above the strings " hi" and " bye" are stored at the same address(0x4005810c) and also " hello" and " welcome" are stored at
same address(0x4005800c).This means that the first two strings " hi"
" hello" are overwritten and therefore lost. Strings defined using '
' also show the same behavior.
The words reading strings from the interpreter into memory are using a "pockets" implementation with two alternating string buffers. This means if you want to put more than two strings on the stack without touching them in between you need to create a copy of those strings. Think of it as a temporary string buffer.
Is this an intended behavior? Please verify the same.Q
It is indeed intended, since many forth engines do this the same way. If it is not sufficient, you can raise the number of pockets in forth/bootstrap/bootstrap.fs. Go look for: \ pockets implementation for 126.96.36.199
If you have some reasonable sample code that needs more pockets rather than becoming overly complex, we can raise the number of pockets in the official tree.
The information contained in this e-mail message and in any annexure is confidential to the recipient and may contain privileged information. If you are not the intended recipient, please notify the sender and delete the message along with any annexure. You should not disclose, copy or otherwise use the information contained in the message or any annexure. Any views expressed in this e-mail are those of the individual sender except where the sender specifically states them to be the views of SoCrates Software India Pvt Ltd., Bangalore.