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
Wordlists #5
base: master
Are you sure you want to change the base?
Wordlists #5
Conversation
Search order done with custom functions. First copies addresses forth->C and those are used in creating and finding. Another C function to implement search wordlist. To enable wordlist support Macro PF_SUPPORT_WORDLIST must be defined. To set wordlist count fth/search.fth and constant WORDLISTS is to place to look. This commit currently breaks all words which use latest and context. For example WORDS display current compilation word list. Also FORGET might be also broken.
Renamed variables and commented more.
Static dictionary UNTESTED FORGET breaks MARKER breaks
forget and words working
First version which should work. More testing however required. Marker and forget aren't thoroughly tested
Works on static dictionary, test cases OK. Build system done only for Unix. Please review. |
I'm sorry this has not been reviewed for so long. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not do an in-depth review of the code because I am not sure if you are still interested. Let me know if you are.
} | ||
} | ||
|
||
/* This should be written in forth */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be written in Forth? Is something in pForth preventing that?
@@ -35,11 +35,11 @@ | |||
void pfReportError( const char *FunctionName, Err ErrCode ) | |||
{ | |||
const char *s; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These white space errors have all been fixed.
So the code would need to be rebased and all tabs converted to 4 spaces.
\ Author: Hannu Vuolasaho | ||
\ Copyright 2015 3DO, Phil Burk, Larry Polansky, Devid Rosenboom | ||
\ | ||
\ The pForth software code is dedicated to the public domain, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License was changed to 0BSD
1f99f95
wl.order.first ! | ||
; | ||
|
||
: wordlist ( -- wid , Create a new empty word list ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In pForth, definitions are generally in UPPER CASE.
forth-wordlist set-current | ||
: hello ." Hello forth" cr ; | ||
|
||
[then] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs end-of-line char.
/* Insert your functions here. */ | ||
|
||
#ifdef PF_SUPPORT_WORDLIST | ||
CustomFunctionTable[NUM_CUSTOM_FUNCTIONS + 0] = ffInitWordLists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom functions are for others to extend pForth. These words would be part of pForth and should have IDs like the other kernel words.
Preliminary word list support. should work, but there must be some issues.