我正在尝试学习如何使用Common-Lisp的asdf,我有以下代码:
(asdf:defsystem example
:serial t
:components ((:file "first")
(:file "second")))
Run Code Online (Sandbox Code Playgroud)
但是,我一直收到错误:
Condition of type: SIMPLE-ERROR
Invalid relative pathname #P"first.lisp" for component ("example" "first")
Run Code Online (Sandbox Code Playgroud)
我在与这两个Lisp文件相同的目录中启动repl,但我不明白为什么会出现错误.我错过了什么?我在Windows上使用ECL
我正在努力将Embeddable Common Lisp嵌入到库中,我一直在编写实用程序函数来将ECL转换cl_object为各种C/C++类型 - 例如将cl_object表示字符串转换为std :: string.
我的问题是这个 - 为什么我没能在ECL中检索包含符号名称的字符串?
我无法使用以下函数ecl_symbol_to_string,它应该使用ECL符号并返回带有它名称的std :: string:
string ecl_symbol_to_string(cl_object sym) {
return ecl_string_to_string(sym->symbol.name);
}
string ecl_string_to_string(cl_object echar) {
string res("");
int j = echar->string.dim; //get dimension
ecl_character* selv = echar->string.self; //get pointer
//do simple pointer addition
for(int i=0;i<j;i++){
res += (*(selv+i));
}
return res;
};
Run Code Online (Sandbox Code Playgroud)
请注意,ecl_string_to_string适用于lisp字符串.
一个简单的单元测试说明了失败:
TEST_CASE( "ecl_symbol_to_string returns a string for symbol",
"[ecl_string_to_string]" ) {
LispRuntime *rt = new LispRuntime("()");
std::string eval_script;
cl_object eval_result; …Run Code Online (Sandbox Code Playgroud) 任务:在我的项目中嵌入ECL lisp,设置错误处理和详细的错误报告(发生的地方,错误类型等)
我试着这样做:
cl_def_c_function_va(
c_string_to_object("SYSTEM:UNIVERSAL-ERROR-HANDLER"),
LispErrorHandler);
Run Code Online (Sandbox Code Playgroud)
ECL没有关于其嵌入式API的文档,也没有关于错误处理的文档......
你能建议如何实现吗?
我正在尝试编译一个嵌入ECL的C程序示例,其中包含对C函数的回调. github.我已经安装了ECL(嵌入式的Common Lisp)通过克隆ECL回购git clone git://git.code.sf.net/p/ecls/ecl ecl,然后$ make和# make install,并安装似乎正常,至少ECL开发人员指南:2.6编译器例子编译的罚款.
当我尝试编译ecldemo.c时,gcc ecldemo.c -lecl我收到以下错误:
/usr/bin/ld: error: cannot find -lecl
/tmp/ccRk8Q48.o:ecldemo.c:function foo: error: undefined reference to 'ecl_make_integer'
/tmp/ccRk8Q48.o:ecldemo.c:function bar: error: undefined reference to 'ecl_make_integer'
/tmp/ccRk8Q48.o:ecldemo.c:function ecl_call: error: undefined reference to 'ecl_make_simple_base_string'
/tmp/ccRk8Q48.o:ecldemo.c:function ecl_call: error: undefined reference to 'si_string_to_object'
/tmp/ccRk8Q48.o:ecldemo.c:function ecl_call: error: undefined reference to 'si_safe_eval'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'cl_boot'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference …Run Code Online (Sandbox Code Playgroud)