cforth icon indicating copy to clipboard operation
cforth copied to clipboard

In order.fth, replace some uses of @/! with token@/token!

Open ellerh opened this issue 8 years ago • 2 comments

I'm proposing some changes to order.fth. I don't claim to understand the code but with the changes my test program goes a little bit further; even with the changes there are still problems with wordlists.

ellerh avatar Dec 02 '16 21:12 ellerh

I just pushed a couple of commits that incorporate your fixes with a slightly different factoring. Let me know if it works for you.

MitchBradley avatar Dec 06 '16 22:12 MitchBradley

I just pushed a couple of commits that incorporate your fixes with a slightly different factoring.

Yes, this is nicer.

Let me know if it works for you.

I think some of the @/! -> token@/token! replacements are needed because the following examples don't work:

shell> cforth
C Forth  Copyright (c) 2008 FirmWorks
ok wordlist set-current order
context: forth forth root     current: Address exception
shell> cforth
C Forth  Copyright (c) 2008 FirmWorks
ok get-order swap drop wordlist swap set-order
ok order
Address exception

In the following example get-order should only return 3 items instead of 10:

shell> cforth
C Forth  Copyright (c) 2008 FirmWorks
ok order
context: forth forth root     current: forth 
ok get-order .s
7f47271ff6f0 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f8010 7f47271f86e0 7f47271f86e0 10 
ok 

ellerh avatar Dec 07 '16 07:12 ellerh