users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: garbage collection


From: Gregory Bourassa
Subject: Re: garbage collection
Date: Wed, 18 Feb 2004 14:45:18 -0500 (EST)

Mike,

How the heap is used differs from implementation to implementation of Prolog.  
You are 
correct in assuming that it usually has a relationship with compound terms.

The code you propose is exactly what will keep the heap clean during reading.

Make sure the semantics of readln/1 is to bind its argument with eof, in the 
Prolog you 
decide to use.   If it fails on eof then your code will not terminate.

Regards.

Gregory Bourassa



> run :-
>     repeat,
>     readline(Wordform),
>     process(Wordform),
>     fail.
> 
> process(eof) :-
>     halt.
> process(Wordform) :-
>     parse(Wordform, Parses),
>     display(Parses).
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]