[gforth] [IF] .. [ELSE] .. [THEN] implementation question

2010-03-08 Thread Josh Grams
In kernel/toolsext.fs, is there a reason why the definition of [ELSE] in [struct]-voc (at line 40) is not immediate? All the others are... --Josh

Re: [gforth] [IF] .. [ELSE] .. [THEN] implementation question

2010-03-09 Thread Josh Grams
Anton Ertl wrote: On Mon, Mar 08, 2010 at 05:11:10PM -0500, Josh Grams wrote: In kernel/toolsext.fs, is there a reason why the definition of [ELSE] in [struct]-voc (at line 40) is not immediate? All the others are... There appears to be, because if I make it immediate, too, Gforth breaks

[gforth] ans-report.fs trashes the top of the search order

2010-08-17 Thread Josh Grams
ans-report.fs replaces the top element of the search order. I *think* it just needs an `also` before the first use of `ans-report-words`. It doesn't look like there's any place to put a `previous` at the end... --Josh

Re: [gforth] ans-report.fs trashes the top of the search order

2010-08-17 Thread Josh Grams
It doesn't look like there's any place to put a `previous` at the end... Ack. I take that back, there is a place to put a `previous`. And it also trashes the current wordlist. So...I suggest the following patch. --Josh --- a/ans-report.fs 2010-08-17 19:11:14.0 -0400 +++

Re: [gforth] ORDER bug

2011-11-12 Thread Josh Grams
Ah, ok, with some more digging around, I'm guessing it's a false positive in `head?`. Though it happens with VOCABULARY also (that's how I ran into the problem). Is it a bit dodgy in that case also? --Josh

Re: [gforth] ORDER bug

2011-11-13 Thread Josh Grams
OK, I get it now. There's junk in unALLOTted memory up to a certain point; after that it's all zeroes. So after that point, then if you have a wordlist at the end of the dictionary, `head?` thinks it's is followed by a header even though it isn't, and then that causes trouble. So compiling

[gforth] A couple typos

2011-11-14 Thread Josh Grams
I did a cvs up to see if Bernd had patched `head?`, and noticed I had a couple typo fixes in my source tree... --Josh Index: doc/gforth.ds === RCS file: /nfs/unsafe/cvs-repository/src-master/gforth/doc/gforth.ds,v retrieving revision

[gforth] Must have Forth in search-order?

2013-04-25 Thread Josh Grams
If you pass code or a file on the command-line which produces a search order which does not contain FORTH-WORDLIST, recent CVS versions seem to crash before running bootmessage and accepting keyboard input. gforth -e 'wordlist 1 set-order' 0.7.0 was fine...so this is new at some point... --Josh

Re: [gforth] If then else in interpreted mode

2013-05-01 Thread Josh Grams
On 2013-05-02 12:57AM, Marcos Cruz wrote: On 2013-05-01 23:15, John Allsup wrote : : jif 0 = if 0 else 1 then ; A simpler alternative: : jyf 0 abs ; Yikes! How about: : jif 0 1 and ; Usually in Forth a calculation can be used instead of a condition. Well, that's true in

Re: [gforth] char translation with 'everychar' causes word completion error

2013-06-21 Thread Josh Grams
On 2013-06-21 12:14AM, Marcos Cruz wrote: : (everychar) ( key -- key ) dup bl and ; ' (everychar) is everychar You're *removing* the existing functionality of everychar -- I'd guess that's what's screwing it up. Try this: : (everychar) defers everychar dup bl and ; Works for me,

Re: [gforth] char translation with 'everychar' causes word completion error

2013-06-21 Thread Josh Grams
On 2013-06-21 02:04PM, Marcos Cruz wrote: I supposed 'everychar' was a mere hook for the programmer, but not used by Gforth itself -- and I didn't check it. Now I see it's vectored to 'kill-prefix'. Yeah... Most of the hooks in gforth that I have come across seem to be there because they're used

Re: [gforth] common file paths for Linux and Windows?

2013-07-09 Thread Josh Grams
On 2013-07-09 05:28PM, Marcos Cruz wrote: Well, I have searched and grepped the Gforth's sources and manual, but I've found no reference to configurable separators in path files, except the word 'pathsep?' in cross.fs. I've tried backslashes and they fail. Forward slashes should work everywhere.

Re: [gforth] Question about catch when using objects.fs

2015-01-20 Thread Josh Grams
On 2015-01-20 02:50PM, Philip Smith wrote: m: this ['] foo1 catch ;m method foo2 fooy foo2 .s cr 2 -1230974988 -2700 Yeah, you have to watch out for the stack depth when CATCH returns through THROW. It restores it to the original depth (minus the XT that you executed). So you still have space on

Re: [gforth] Inclusion of minimal-forth code in gforth

2018-04-27 Thread Josh Grams
On 2018-04-27 09:04PM, Carsten Strotmann wrote: >The idea is to have this code that creates a minimal forth wordlist >inside gforth shipped with the gforth code, so that it is immediately >usable for Forth beginners. Ulli Hoffman's code goes out of its way to try and work on any ANS-94 system.

Re: [gforth] NOT

2019-02-15 Thread Josh Grams
On 2019-02-15 04:21PM, J. David Boyd wrote: > >Any idea how to implement the word NOT in gforth to create a 1s complement? >I can find an assembler definition in SwiftForth, but no other luck anywhere. The standard Forth word is called INVERT. --Josh

Re: Cross compiling

2021-03-01 Thread Josh Grams
On 2021-03-01 07:32PM, Ethan Gardener wrote: >jonesforth.f is shorter than jonesforth.S, but so much of both files are >comments, it's hard to compare the code sizes. But they're not the same thing, are they? They're two parts of the same system. jonesforth.S is the core engine that is written

Re: Gforth BLOCK 0

2022-08-06 Thread Josh Grams
IIRC 0 isn't a valid block number: for instance, http://forth.sourceforge.net/standard/dpans/dpans7.htm#7.6.1.1790 LOAD says "An ambiguous condition exists if u is zero or is not a valid block number." I believe in some systems blocks were actually the raw disk, so the bootloader would be