EDIT
ho fatto qualche ricerca più. Apparentemente questo è ciò che fa SWI-Prolog quando lo chiedi a una variabile non definita.
$ prolog
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.6.64)
Copyright (c) 1990-2008 University of Amsterdam.
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?- X.
% ... 1,000,000 ............ 10,000,000 years later
%
% >> 42 << (last release gives the question)
?-
UPDATE
Cambiare il nome alle opere minuscole. Maiuscolo è per le variabili:
helloworld.prolog:
helloworld:-write('Hello World!'),nl,fail.
Poi:
$ prolog
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.6.64)
Copyright (c) 1990-2008 University of Amsterdam.
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?- ['helloworld.prolog'].
% helloworld.prolog compiled 0.00 sec, 1,376 bytes
true.
?- helloworld.
Hello World!
false.
?-
Si noti che è necessario consultare il file prima. Ho provato questo e funziona di sicuro.
fonte
2010-03-31 20:33:43
A proposito, quel "messaggio di errore" è un riferimento a Guida galattica per gli autostoppisti. – tloflin
Lo so. Amo quei libri, ma trovo questo messaggio piuttosto stupido. È uno scherzo forzato e offuscante. – andandandand
Divertente però :) –