about dynamic/1 and file format
Jiun-Shiung Wu <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CALvsX_LG7nH4JpvCREa5RHvPh8jxtbqhn4X7rdodDXYZapPb8A@mail.gmail.com> |
Hi, SWI-Prolog users, I have two questions concerning dynamic/1 and saved file format. I am wondering if someone can help me. I used dynamic to declare that a predicate is dynamic. For example, I put :- dynamic(father/2) at the beginning of my file. I used listing(father/2) to list all instances of father/2. I found that the parentheses in dynamic is gone. That is, when I did listing(father/2), I got: dynamic father/2. When I used with_input_to to save all instances of father/2, I got :- dynamic father/2 at the beginning of the new file. The parentheses are missing. Is there a way not to remove the parentheses in this case? Secondly, how can I save a file using the UTF-8 with the header BOM? I have a knowledge base containing facts written in traditional Chinese (UTF-8). When I used with_input_to to save those facts into a new file, the BOM head seems to be gone and my Prolog program cannot read it. Though it is easy to restore the BOM head using Notepadd++, I am still wondering whether SWI-Prolog can save a file using UTF-8 with the BOM head. Thank you! Hunter Wu -------------- next part -------------- HTML attachment scrubbed and removed