Running a Common Lisp function from a Terminal command prompt

后端 未结 4 1184
终归单人心
终归单人心 2020-12-05 19:36

I\'m having some difficulty finding an answer to this, so maybe it isn\'t possible. I\'d like the flexibility of being able to load/compile a lisp file from a command line,

4条回答
  •  广开言路
    2020-12-05 20:15

    I am trying to integrate sbcl Common-Lisp into R through knitr. Here are few tests on how to send a request for evaluation to sbcl and then return it to R. This works for sending forms, not a file. From the terminal:

    sbcl --noinform --eval '(progn (print (* 2 3 4 5)) (sb-ext:quit))'
    ;; 120

    sbcl --noinform --eval '(progn (print (* 2 3 4 5)) (sb-ext:quit))'
    ;; HELLO-WORLD

    sbcl --noinform --eval "(progn (dotimes (i 5) (print i)) (sb-ext:quit))"
    ;; 0
    ;; 1
    ;; 2
    ;; 3
    ;; 4

提交回复
热议问题