我在Ubuntu Raring上使用SLIME / SBCL / Emacs和Quicklisp。我有下面定义的功能。我想将其添加到我的Lisp库的顶级.lisp文件中,即彼此依赖的一个文件,这样我就可以在我用库编写的所有函数中使用它,只需添加(update-swank)一个函数即可,而不必添加下面的整个功能,以及使用该功能的每段代码。
(defun update-swank ()
"Grabs SWANK connections and tells it to handle requests.
Call this every loop in the main loop of your program"
(continuable
(let ((connection (or swank::*emacs-connection*
(swank::default-connection))))
(when connection
(swank::handle-requests connection t)))))
Run Code Online (Sandbox Code Playgroud)
当我这样做并重新启动emacs时,由于我的asdf:load-op.sbclrc文件中包含,因此在加载过程中加载了我的库,我得到了
READ error during COMPILE-FILE:
;
; Package SWANK does not exist.
Run Code Online (Sandbox Code Playgroud)
在劣等的Lisp中,由于库未加载,SLIME被卡住了轮询,因为在我当前的设置中,SLIME / SBCL update-swank在加载其中的.lisp文件时不知道到底是什么。我尝试添加(in-package :swank)到其中的文件update-swank中,但是得到了
The name "SWANK" does not designate any package.
Run Code Online (Sandbox Code Playgroud)
在emacs启动时加载我的库时,性能下降。
我搜索了CEPL(从https://github.com/cbaggers/cepl/blob/master/cepl-utils.lisp获得更新更新),然后复制了CEPL的创建者所做的工作并将函数导出到了我的包中.lisp。我确保像他在cepl-utils的第20行上一样添加了该功能,在这里https://github.com/cbaggers/cepl/blob/master/cepl-utils.lisp ...... …
你能帮我解决一下我的代码,我不明白为什么它没有返回我的wireList,它只是返回NIL
(defun table-wires-position(inputTable inputPosition)
(let ((wireList () ))
(dolist (x (table-wires inputTable) wireList)
(if (or (equal-position-p (wire-OriginCoin x) inputPosition)
(equal-position-p (wire-destinCoin x) inputPosition))
(cons x wireList)))))
Run Code Online (Sandbox Code Playgroud) 我们如何在 Jena 中定义类和子类并将它们添加为其他资源的类型?我使用 Java、Jena 和 RDF/XML 表示法。我想创建类似的东西:
<rdfs:Class rdf:about="http://www.help.me/NS/Classname"/>
<rdfs:Class rdf:about="http://www.help.me/NS/Subclassname">
<rdfs:subClassOf rdf:resource="http://www.help.me/NS/Classname"/>
</rdfs:Class>
Run Code Online (Sandbox Code Playgroud)
之后:将资源链接到子类:
<rdf:Description rdf:about="http://www.help.me/NS/NewResource">
<rdf:type rdf:resource="http://www.help.me/NS/Subclassname"/>
...
</rdf:Description>
Run Code Online (Sandbox Code Playgroud)
到目前为止,我找到了如何定义一个类:
model.createResource("http://www.help.me/NS/", RDFS.Class);
Run Code Online (Sandbox Code Playgroud) 我想从Java(特别是Jena和ARQ)创建SPARQL查询。我想让可能对SPARQL一无所知的用户仅通过写(例如,在Eclipse的控制台中)他想搜索的词来进行查询。以下代码提供了我要寻找的示例。如何将字符串word插入查询中?
String word="someThingToFind"; // a variable entered by the user who want to request my data
String queryString =
"Select ?a ?b"+
" Where { ...."+
" Filter (regex(?a = ".concat(word)+ "))"+// word is the String variable
" }";
Query query = QueryFactory.create(queryString, Syntax.syntaxARQ);
QueryExecution qe = QueryExecutionFactory.create(query, model);
ResultSet results = qe.execSelect();
ResultSetFormatter.out(System.out, results, query);
qe.close();
Run Code Online (Sandbox Code Playgroud) 是的,我正在为一位朋友在网站上工作,而我正试图让旋转木马正常工作.但是,看似无论我尝试什么.
标记:http://pastebin.com/PjftpnJx
文件夹结构:

Owl CSS文件的扩展名更改为.less并包含在我编译成CSS的主LESS文件中,这意味着文件存在.
我正在使用Fedora 19 SBCL.我正在尝试安装eager-future2.我已经下载了源代码,但我无法弄清楚如何安装它.我试过了
(asdf:load-system 'eager-future)
Run Code Online (Sandbox Code Playgroud)
我甚至尝试在源代码中加载单个.lisp文件,但每当我尝试使用pcall函数时,我都会收到错误,"未定义函数PCALL".
是否可以使用列表作为参数调用make-array函数?例如:
(make-array '((length '("a" "b")) (length '("r" "8" "5"))))
Run Code Online (Sandbox Code Playgroud)
返回:
#<TYPE-ERROR expected-type: NUMBER datum: (LENGTH '(...
Run Code Online (Sandbox Code Playgroud)
即使我尝试使用以下命令转换长度的结果:
(coerce (length '(1)) 'number)
Run Code Online (Sandbox Code Playgroud)
它适用于一维数组但不适用于二维数组.
是否可以使用SPARQL生成三元组的随机样本?我认为可能是通过SAMPLE函数,但这会返回一个SAMPLE.
我的解决方法是生成一个与OFFSET关键字一起使用的随机数,并使用LIMIT关键字返回所需的样本大小.我只是将偏移的随机数硬编码为200以方便,如下所示:
SELECT *
WHERE {
?s ?p ?o
}
OFFSET 200 #random number variable
LIMIT 100
Run Code Online (Sandbox Code Playgroud)
有没有更好的建议从SPARQL端点生成100个数据三元组的随机样本?
如何在Lisp中将数字从某个基数转换为基数10?是否有任何defaut功能可以做到这一点,如果不是我怎么能补充该功能?
common-lisp ×5
java ×3
jena ×3
lisp ×3
rdf ×3
sparql ×2
base ×1
html ×1
javascript ×1
jquery ×1
owl-carousel ×1
rdfs ×1
slime ×1
swank ×1