Eager-Future2 Library :Parallel Programming in Lisp



我正在使用Fedora 19 SBCL。我正在尝试安装渴望的未来2。我已经下载了源代码,但我不知道如何安装它。我试过了

(asdf:load-system 'eager-future)

什至尝试在源代码中加载单个 .lisp 文件,但每当我尝试使用 pcall 函数时,我都会收到错误"未定义的函数 PCALL"。

如果你使用的是Quicklisp,它适用于许多Common Lisp实现,你可以很容易地安装它。 然后,在 eager-future2 包中定义了 pcall 函数,因此您需要编写包前缀,例如 eager-future2:pcall,或者在您自己的包中使用该包。 使用 apropos 是找出存在哪些符号的好方法。因此,我能够做到这一点:

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

最新更新