blob: a1d34f41c92666eb1aec583f5bf50a551902d359 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
* Stop comparing strings all the time
* Stop copying the entire goal stack into every choicepoint
* Modules (I try to do something like SWI prolog for now, but I know there is also an iso standard)
The following builtins:
'='/2 needs to do something about the occurs check
unify_with_occurs_check/2: not implemented
'\\='/2: handle occurs check
* Handle overflow and uderflow in arithmetic
* Variables should be compared and printed in a way that makes sense. Right now, their number is changed when a clause is used,
but their name remains the same, so prints will be bad.
* Write a loader in prolog, that calls builtins to activate the C functions needed. This means we can do some syntax transformations
and handle directives in prolog code, instead of C. The "bootstrap" modules will have to be written in a way the original C loader
understands, but everything after that can use the full feature set.
Steps:
1) Change the lexer and parser so they carry around their state instead of global variables.
2) Make it possible to evaluate a query using 'evalquery' even when another query is running. This
means no more global variables there either.
3) Create a "loading context" which is indexed by a prolog term and consists of:
* Lexer + parser state
* module loading state
4) Loading then becomes:
1) Create loading context
2) Open file
3) Repeatedly read terms using read_term
4) Inspect the term (clause or directive?) and act on it, using builtints and reference to context
5) Close the file and context
|