Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Wordlists #5

wants to merge 12 commits into from

Conversation

vuokko
Copy link
Contributor

@vuokko vuokko commented Apr 12, 2015

Preliminary word list support. should work, but there must be some issues.

vuokko added 12 commits March 9, 2015 00:28
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
dictionary file creation [X] works
wordlists in dictionary files [X] works

Warranty was woid because SEAL was broken. SEAL fixed.

WORDS, FORGET and MARKER needs still still fixing.
forget and words working
First version which should work. More testing however required.
Marker and forget aren't thoroughly tested
@vuokko
Copy link
Contributor Author

vuokko commented Jun 5, 2015

Works on static dictionary, test cases OK. Build system done only for Unix.

Please review.

@philburk
Copy link
Owner

I'm sorry this has not been reviewed for so long.
But there is some value here and I hate to lose it.
Was this based on the ANS standard?

Copy link
Owner

@philburk philburk left a 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 */
Copy link
Owner

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;

Copy link
Owner

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,
Copy link
Owner

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 )
Copy link
Owner

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]
Copy link
Owner

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;
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants