Hello everyone...
I'm trying to create persistant objects in logtalk. Assertions and retractions should update a file.
I need multiple objects to be stored in the persistent database.
I am trying to use the persistency library in SWI-prolog, is this possible?
If so, how should the 'persistent' directive be used in a logtalk file?
if not, what is the best to integrate swipl persistency and logtalk?
Thanks in advance.
Persistent Objects
Moderator: Paulo Moura
-
- Logtalk developer
- Posts: 477
- Joined: Sat May 05, 2007 8:35 am
- Location: Portugal
- Contact:
Re: Persistent Objects
The SWI-Prolog "persistency" library assumes and requires that the calls to the persistent predicates be made from within modules. Thus, it cannot be used as-is with Logtalk objects. The library code can be ported, however, if necessary. A simpler solution is possible, however, if it would be enough to load the files holding the persistent databases when the Logtalk objects are loaded and to dump the updated databases when terminating the session.
Paulo Moura
Logtalk developer
Logtalk developer
-
- Logtalk developer
- Posts: 477
- Joined: Sat May 05, 2007 8:35 am
- Location: Portugal
- Contact:
Re: Persistent Objects
Added a simple implementation of a persistent object database (using the includes/1 directive) to the current Logtalk git version:
https://github.com/LogtalkDotOrg/logtal ... s/includes
https://github.com/LogtalkDotOrg/logtal ... s/includes
Paulo Moura
Logtalk developer
Logtalk developer
Re: Persistent Objects
Thank you for your answer and for creating logtalk 

Who is online
Users browsing this forum: No registered users and 0 guests