问题描述
我正在使用 Fedora 19 SBCL.我正在尝试安装 eager-future2 .我已经下载了源代码,但是我不知道如何安装它.我尝试过
I am using Fedora 19 SBCL. I'm trying to install eager-future2.I've downloaded the source, but I can't figure out how to install it. I tried
(asdf:load-system 'eager-future)
并且我什至尝试加载源中的单个.lisp文件,但是每当我尝试使用 pcall 函数时,都会出现错误,未定义的函数PCALL .
and I even tried loading individual .lisp files in the source, but whenever I try to use the pcall function, I get an error, "undefined function PCALL".
推荐答案
如果您使用的是 Quicklisp ,该数字可与数字一起使用常见的Lisp实现,您可以很容易地安装它.然后,在 eager-future2 包中定义了 pcall 函数,因此您需要编写包前缀,例如 eager-future2:pcall ,或使用您自己的程序包中的程序包.使用 apropos 是找出存在符号的好方法.因此,我能够做到这一点:
If you're using Quicklisp, which works with a number of Common Lisp implementations, you can install this pretty easily. Then, the pcall function is defined in the eager-future2 package, so you'll need to write the package prefix, e.g., eager-future2:pcall, or use the package in your own package. Using apropos is a good way to find out what symbols exist. Thus, I was able to do this:
CL-USER> (quicklisp:quickload "EAGER-FUTURE2")
;=> ("EAGER-FUTURE2")
CL-USER> (apropos "PCALL")
; EAGER-FUTURE2:PCALL (fbound)
; No value
CL-USER> (eager-future2:pcall (lambda () (print 'hello-world)))
;=> #<EAGER-FUTURE2:FUTURE {10059C8713}>
CL-USER> (defparameter *f* (eager-future2:pcall (lambda () (print 'hello))))
;=> *F*
CL-USER> *f*
;=> #<EAGER-FUTURE2:FUTURE {1005F4AD93}>
CL-USER> (eager-future2:ready-to-yield? *f*)
;=> T
CL-USER> (eager-future2:yield *f*)
;=> HELLO
这篇关于Eager-Future2库:Lisp中的并行编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!