CCL

How to get output of a Lisp program into Python?

五迷三道 提交于 2020-01-24 17:51:07
问题 I've got a very large Lisp project whose output I'd like to programmatically pipe to a Python program, i.e. use Python to call the Lisp program on some input and get the output back into Python. The project only compiles in Clozure Common Lisp (ccl64) and I did try to find a way to turn it into an executable (I'm using Mac OS X), but that ran into a lot of dead ends (I am not a Lisp programmer). This documentation for Clozure Common Lisp should provide the solution to the above, but I was not

pass command line arguments to Clozure common lisp

浪子不回头ぞ 提交于 2020-01-15 06:48:09
问题 I am familiar with python before and now I am trying to learn common lisp and using ccl(clozure common lisp)under windows system. I found that there is not a convenient way to run lisp file as python. So i write a bat file to compile and run a lisp file. @echo off set lisp_filename=%~1 set ccl_path=D:\_play_\lispbox-0.7\ccl-1.6-windowsx86\wx86cl.exe IF "%PROCESSOR_ARCHITECTURE%" == "x86" ( set fsl_filename=%lisp_filename:.lisp=.wx32fsl% ) ELSE ( set ccl_path=%ccl_path:wx86cl=wx86cl64% set fsl

STEP macro does not work in Clozure CL

允我心安 提交于 2020-01-03 15:56:08
问题 I want to use a step function to see how it went to the expected output, but it's not working. Like this simple example: (STEP (IF (ODDP 3) 'YES 'NO)) but nothing happens. Is there any optimization that makes me can't see the trace steps ??? How to turn it off? Thanks! 回答1: I don't think Clozure CL supports stepping. IIRC nobody has funded this feature yet. It would need some work, since Clozure CL lacks an interpreter (where stepping could be supported relatively painless). Other

STEP macro does not work in Clozure CL

落花浮王杯 提交于 2020-01-03 15:56:07
问题 I want to use a step function to see how it went to the expected output, but it's not working. Like this simple example: (STEP (IF (ODDP 3) 'YES 'NO)) but nothing happens. Is there any optimization that makes me can't see the trace steps ??? How to turn it off? Thanks! 回答1: I don't think Clozure CL supports stepping. IIRC nobody has funded this feature yet. It would need some work, since Clozure CL lacks an interpreter (where stepping could be supported relatively painless). Other

Clozure Common Lisp - TCP Socket Programming - Sending a Reply

白昼怎懂夜的黑 提交于 2020-01-03 13:06:11
问题 I have a very small program which opens a socket and accepts a connection. It then grabs the remote IP and port. I'd like to send a text message to the remote computer (telnet) and close the connection. I can't determine which function is for sending a message to the telnet client. The Clozure manual lists a function called "send to" but it says it's for UDP sockets and I'm working with TCP sockets. I hope someone can tell me what the proper function is, or, if "send-to" is the proper

Clozure Common Lisp - TCP Socket Programming - Sending a Reply

冷暖自知 提交于 2020-01-03 13:06:06
问题 I have a very small program which opens a socket and accepts a connection. It then grabs the remote IP and port. I'd like to send a text message to the remote computer (telnet) and close the connection. I can't determine which function is for sending a message to the telnet client. The Clozure manual lists a function called "send to" but it says it's for UDP sockets and I'm working with TCP sockets. I hope someone can tell me what the proper function is, or, if "send-to" is the proper

Common Lisp: Launch subprocess with different working directory than lisp process

依然范特西╮ 提交于 2019-12-19 09:13:06
问题 Suppose I have a directory A, and subdirectory B. I cd into A and launch lisp. In that lisp process, I would like to launch a Python subprocess where Python sees B as its current working directory. The lisp process needs to have cwd in A, and the python process should have cwd in B. How do I do this in a cross-platform, simple way? I'm looking for a solution that works with CCL and SBCL (probably using 'run-program function), and works for Windows, Linux, and OS X. I looked at the CCL run

Common Lisp: Launch subprocess with different working directory than lisp process

一世执手 提交于 2019-12-19 09:11:38
问题 Suppose I have a directory A, and subdirectory B. I cd into A and launch lisp. In that lisp process, I would like to launch a Python subprocess where Python sees B as its current working directory. The lisp process needs to have cwd in A, and the python process should have cwd in B. How do I do this in a cross-platform, simple way? I'm looking for a solution that works with CCL and SBCL (probably using 'run-program function), and works for Windows, Linux, and OS X. I looked at the CCL run

Does there exist standard way to run external program in Common Lisp?

淺唱寂寞╮ 提交于 2019-12-19 05:19:17
问题 In clisp, the following code works: (defun hit-history () (shell "tail ssqHitNum.txt")) However, in Clozure CL, the shell function is not supported! 回答1: No, there is no standard way, but there are libraries which provide this functionality for the important implementations. For example, there's trivial-shell available in Quicklisp, which provides shell-command . (I didn't actually test it, but its among the recommended libraries on CLiki.) There is also external-program. Update: inferior

USocket on SBCL: connection refused (Drakma and Dex)

白昼怎懂夜的黑 提交于 2019-12-12 23:31:09
问题 Running simple HTTP-request: with dexador or drakma and on SBCL 1.4.14 and on OS X 10.13.6 with (ql:client-version) equals to "2017-03-06" and (defvar qlqs-info:*version* "2015-01-28" (I've just installed Quicklisp from https://www.quicklisp.org/beta/ via https://beta.quicklisp.org/quicklisp.lisp) via Emacs+SLIME or just from the command line using only SBCL (dex:get "http://localhost:8000/wp-json/wp/v2/posts") fails with the error ( dex stacktrace) Condition USOCKET:CONNECTION-REFUSED-ERROR