-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Jan Wielemaker edited this page Mar 1, 2025
·
7 revisions
The WASM versions contains a virtual file system, i.e., a file system in memory. That contains the Prolog library and a directory /prolog where SWI-Tinker starts. Prolog can compile files from there as well as create files there. By default, these files do not persist. Files can be created and deleted using the menus above the editor. All entries that refer to files in /prolog are saved to your browser local store on page unload and restored when you return to the page.
- Use the 📥 button (bottom-right) to download the file as it currently appears in the editor.
- Use the 📤 button (bottom-right) to upload one or more files. First click opens a file input widget. After selecting the files, use 📤 again to upload the files. The uploaded files are places in the
/prologdirectory and visible in the file dropdown above the editor. That implies they persist!
In the REPL window (left), you can use commands such as ?- ls., ?- pwd. to examine the files and ?- [file]. to load (consult) them.
SWI-Tinker can compile files using use_module/1 or one of the other file loading predicates using their URL, e.g.
?- use_module('https://raw.githubusercontent.com/ridgeworks/clpBNR/refs/heads/master/prolog/clpBNR.pl').