我正在尝试在服务器中托管XSB。我写了下面的代码:
:- module(server, [server/0, server/1]).
:- import http_server/2 from library(http/thread_httpd).
:- import http_dispatch/1 from library(http/http_dispatch).
:- use_module(swish, []).
server :-
server(localhost:3050).
server(Port) :-
http_server(http_dispatch,
[ port(Port),
workers(16)
]).
我得到以下错误
[xsb_configuration loaded]
[sysinitrc loaded]
[xsbbrat loaded]
[Compiling ./server]
++Warning[XSB]: [Compiler] ./server : Unused symbol http_dispatch/1
++Warning[XSB]: [Compiler] ./server : Unused symbol swish/0
++Warning[XSB]: [Compiler] ./server : Unused symbol library(http / http_dispatch)/0
++Error[XSB/Runtime/P]: [Type (library(http / thread_httpd) in place of atom)] in arg 1 of predicate atom_length/2
Forward Continuation...
... asmpass2:asm_putsym/2
谁能告诉我我哪里做错了?非常感谢您的帮助。
不能在XSB中使用SWI-Prolog HTTP库。这些库依赖于SWI-Prolog专有特性,在XSB中不能按原样工作。移植这些库也不是一项简单的任务,首先要知道SWI-Prolog中的模块系统是基于谓词的,而XSB中的模块系统是基于原子的。