New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement request - add r@ word #9
Comments
r@ is like rp@ @ ? |
Yes just grabbing the value on the top of the return stack without popping
it off. I coded it this way but I thought a primitive function would be
better.
…On Mon, Jan 2, 2017 at 2:17 PM, Attila Magyar ***@***.***> wrote:
r@ is like rp@ @ ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEM6-EDNbIic6dk8YyEwWkVnc_WraK90ks5rOWlqgaJpZM4LZMfY>
.
--
Craig Lindley / Heather Hubbard
495's Recordings: craigandheather.net/495spage.html
New Recordings: craigandheather.net/cnmpage.html
Latest rock CD: craigandheather.net/oneinarow.html
Latest non-rock CD: craigandheather.net/craigdoesfingerstyle.html
Personal Website: craigandheather.net
Phone: (719) 495-1873
Cell: (719) 502-7925
If you’re one in a million, there are now seven thousand people exactly
like you.
|
Ok. Do you need it for convenience or performance reasons? Currently we have about 35 essential primitives and I'd like to keep this number as low as possible because of portability reasons. An other reason I wouldn't implement this as a primitive because a future plan is to add some treeshaking or dead code elimination tool which would remove all the words from the uber.forth which are not used. And a primitive cannot be removed by this technique because they are compiled into the binary. The heap size on the esp is 24k and it's quite a limiting factor, you can quickly fill it up by loading 3-4 modules and defining some new words. Implenting this as a word is doable (there will be already a return address on the rstack and the real value is below that) but it would be slower. |
It is for convenience as all of the other forths I have used have had the
set of return stack operators: >r, r@ r>. If it doesn't fit into your
architecture that's OK I have coded it like this and it works.
: r@ ( -- n )
r> r> dup >r swap >r ;
…On Mon, Jan 2, 2017 at 2:43 PM, Attila Magyar ***@***.***> wrote:
Ok. Do you need it for convenience or performance reasons? Currently we
have about 35 essential primitives and I'd like to keep this number as low
as possible because of portability reasons. An other reason I wouldn't
implement this as a primitive because a future plan is to add some
treeshaking or dead code elimination tool which would remove all the words
from the uber.forth which are not used. And a primitive cannot be removed
by this technique because they are compiled into the binary. The heap size
on the esp is 24k and it's quite a limiting factor, you can quickly fill it
up by loading 3-4 modules and defining some new words.
Implenting this as a word is doable (there will be already a return
address on the rstack and the real value is below that) but it would be
slower.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEM6-KLovEAxkk-SFtHuFrOlvQZGQGhvks5rOW9lgaJpZM4LZMfY>
.
--
Craig Lindley / Heather Hubbard
495's Recordings: craigandheather.net/495spage.html
New Recordings: craigandheather.net/cnmpage.html
Latest rock CD: craigandheather.net/oneinarow.html
Latest non-rock CD: craigandheather.net/craigdoesfingerstyle.html
Personal Website: craigandheather.net
Phone: (719) 495-1873
Cell: (719) 502-7925
If you’re one in a million, there are now seven thousand people exactly
like you.
|
I added r@ to ext.S. This contains the nonessential primitives and some extra words. I realized this doesn't effects the size of the usable dictionary space. |
I seem to use this word often
The text was updated successfully, but these errors were encountered: