users-prolog
[Top][All Lists]
Advanced

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

consult/1 at the top of a file


From: Adam Russell
Subject: consult/1 at the top of a file
Date: Thu, 22 Jul 2021 17:51:39 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.4

This is such a small thing, but I had never noticed this before.

In other Prologs it is possible to add a line such as

:-['some_file.p'].

at the top of a file and the file is consulted in the usual way. But it seems Gnu Prolog does not allow this? When I try I get "Unknown directive '.'/2 - maybe use initialization/1 - directive ignored"

If I then do as suggested with

:-initialization(['some_file.p']).

it works as expected.

Since initialization/1 is an ISO directive I wonder, is this a more preferred way of doing this? And the other way is discouraged to the point where GNU Prolog does not even support it?




reply via email to

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