Re: compiler directive dynamic/1
Ludovic Langevine <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Message-ID | <[email protected]> |
[email protected] a écrit : > Hi! > > The top-level-loop reckognizes "dynamic" but when > working with consulted code (byte-compiled), it seems > to think that dynamic/1 is a user predicate (...) > dynamic( [have/1, here/1, turned_off/1, turned_on/1, location/2] ). > Hi! You should write: :- dynamic(...). in your source file, since dynamic/1 is a compiler directive. That's the same for all the directives, e.g. 'op/3' (you change the way the code is compiled). So, just add ":-" at the beginning of the line: :- dynamic( [have/1, here/1, turned_off/1, turned_on/1, location/2] ). and it should work. Bests, Ludovic ps: I would be very interested in your Prolog tutorial... and I am not the only one, I think. If you need some feedback on a preliminary version, do not hesitate to ask for some help on this list or on comp.lang.prolog -- Ludovic Langevine <[email protected]> Tel: (+33) 1 39635708 INRIA Rocquencourt - Projet CONTRAINTES Fax: (+33) 1 39635469 Domaine de Voluceau, Rocquencourt, BP 105 78153 LE CHESNAY CEDEX - FRANCE http://contraintes.inria.fr/~langevin