CCL

编译 Clozure CL 的 Mac IDE 版,超级简单

风流意气都作罢 提交于 2019-12-07 18:40:52
编译 Clozure CL 的 Mac IDE 版,超级简单 打开 CCL 的文档,看了一下,就几步,描述如下: 5.2. Building the IDE Building the Clozure CL IDE is now a very simple process. In a shell session, cd to the ccl directory. Run ccl from the shell. The easiest way to do this is generally to execute the ccl or ccl64 command. Evaluate the form (require :cocoa-application) For example, assuming that the Clozure CL distribution is installed in "/usr/local/ccl", the following sequence of shell interactions builds the IDE: oshirion:ccl mikel$ ccl64 Welcome to Clozure Common Lisp Version 1.2-r9198M-trunk (DarwinX8664)! ? (require :cocoa

CLozure CL 多线程函数使用实例

大城市里の小女人 提交于 2019-12-07 12:52:57
CLozure CL 多线程函数使用实例 一、简单介绍 Common Lisp 的标准没有对多线程的描述,因此各种 CL 实现都给出了自己的多线程功能函数,具体细节有所不同,这里大致讲解一下 Clozure CL 的多线程函数的简单用法(参照 CCL 的描述文档中多线程部分 第7章 Programming with threads)。 我在阅读CCL文档时被搞晕了,发现找不到线程对象作为参数的正确写法,后来经过 cn-lisp 的朋友指点,才发现不存在所谓的正确写法,只能把线程对象绑定到全局变量上使用,估计有人在学习 CCL 的多线程时会遇到类似的问题,所以这里把我的一点学习体会记录下来,希望能对其他初学者有所助益,帮助其他人少走些弯路。 二、CCL 线程函数基本知识 1、首先介绍几个线程相关的全局变量: 【全局变量】当前线程:*current-process* 在 ccl 中执行如下: Welcome to Clozure Common Lisp Version 1.8-store-r15418 (DarwinX8664)! ? ? *current-process* #<COCOA-LISTENER-PROCESS Listener(15) [Active] #x30200108839D> ? 其中 #< . . . > 是线程对象的表示方式,第一列表示线程类型

用Lisp(CCL)调用Cocoa的nib文件--Nib-Loading 使用指导(教程翻译)

∥☆過路亽.° 提交于 2019-12-07 07:50:46
用Lisp(CCL)调用Cocoa的nib文件-Nib-Loading 使用指导(教程翻译) === 原文地址: http://trac.clozure.com/ccl/browser/trunk/source/examples/cocoa/nib-loading/HOWTO.html 原文标题: Nib-Loading HOWTO 翻译者: FreeBlues 2013-06-17 === 目录 0 概述 1 Nibfiles 的相关知识 2 对 Nibfiles 的使用 3 如何调用一个 nibfile 3.1 获取区域 zone 3.2 建立字典 3.3 调用 nibfile 4 建立一个 nib-loading 函数 5 如何卸载 nibfile 0 概述 这篇教程说明如何通过对 Lisp 形式(forms)求值, 加载 nibfiles 到正在运行的 Clozure CL 副本中。你可能想通过这种方式加载 nibfiles 来为你正在工作的一个应用程序项目来测试用户界面元素,或使应用程序能够动态加载可选的用户界面元素。 1 Nibfiles 的相关知识 Cocoa应用程序开发有很大一部分是使用Cocoa框架来创建用户界面元素的。虽然它是完全有可能只是通过对框架的方法调用创建任何用户界面元素,设计用户界面更标准的方式是使用苹果的 InterfaceBuilder

Clozure Common Lisp 帮助文档-第14章 Objective-C 桥(中文版)

风格不统一 提交于 2019-12-06 21:24:43
Clozure Common Lisp 帮助文档-第14章 Objective-C 桥(中文版) === 原文地址: 网络: http://ccl.clozure.com/ccl-documentation.html 原文标题: Clozure CL Documentation 翻译者: FreeBlues 2013-08-03 === 目录 14 Objective-C 桥 the Objective-C Bridge 14.1 版本 1.2 里的变化 Changes in 1.2 14.2 使用 Objective-C 的类 Using Objective-C Classes 14.3 实例化 Objective-C 对象 Instantiating Objective-C Objects 14.4 调用 Objective-C 方法 Calling Objective-C Methods 14.4.1 Objective-C 方法调用的类型强制 Type Coercion for Objective-C Method Calls 14.4.2 返回结构的方法 Methods which Return Structures 14.4.3 参数数量可变的消息 Variable-Arity Messages 14.4.4 优化 Optimization 14.5 定义

Common Lisp 和 Cocoa 结合起来编写 APP 的例子--代码中设置加载路径

馋奶兔 提交于 2019-12-06 15:05:40
Common Lisp 和 Cocoa 结合起来编写 APP 的例子--代码中设置加载路径 话说最近越来越觉得 Objective-C 的代码太繁琐了, 但是在 OSX 下写程序又离不开苹果的框架,于是就希望能把苹果 Cocoa 提供的界面组件和其他更简单的编程语言结合起来使用(比如 Common Lisp), 查了查, 发现可以搞,苹果提供了 bridge , Common Lisp 提供了 FFI,. 翻了翻文档, 在 Clozure CL 中找到一篇比较简单的,就是一个汇率转换器. 具体就是: 1、先用XCode 的 Interface Builder 完成界面组件的设置, 输出一个名为 correncyconverter.nib 的文件; 2、再用 Common Lisp 创建一个名为 currency-converter.lisp 的源文件, 在这个lisp文件里写代码操作这些界面组件; 3、最后在 CCL 环境里把这两个文件编译成一个独立的 APP。 一切都很完美,唯一的缺憾就是要把 Lisp 的 image 包含进去, 使得最终的 app 文件体积稍微偏大--大概50M. 具体的教程在 Clozure CL 的目录下 "/ccl-1.8-darwinx86/examples/cocoa/currency-converter/howto.html"

Retrieving (load)ed source code from CCL?

南楼画角 提交于 2019-12-05 03:08:37
问题 I called (load "code.lisp") with CCL, then accidentally deleted code.lisp. Is there any way for me to retrieve the source code? Does CCL have it in memory anywhere? 回答1: That's a very special functionality. Here only for Clozure CL . The code won't work anywhere else. This works for me in the CCL IDE. It retrieves the source code of symbols who are :internal or :external in a certain package. It doesn't do that for symbols which are inherited from other packages (you would then often have the

common lisp: slot-value for defstruct structures

孤街浪徒 提交于 2019-12-01 16:21:50
In common lisp, what can I use to access structure slot using slot name/symbol? What I want is (defstruct point (x 0) (y 0)) (defmacro -> (struct slot) `(slot-value ,struct ,slot)) (setf p (make-point)) (setf (slot-value p 'x) 1) (setf (-> p 'y) 2) I'm using clozure cl, and In clozure cl this works. However, AFAIK this is non-standard behavior (equivalent to "undefined behavior" C++). I'm not planning to switch to another CL implementation, so should I keep using slot-value for structures, or is there a better way to do it? Usually you would use accessor functions with structures. Your code

common lisp: slot-value for defstruct structures

孤者浪人 提交于 2019-12-01 15:03:55
问题 In common lisp, what can I use to access structure slot using slot name/symbol? What I want is (defstruct point (x 0) (y 0)) (defmacro -> (struct slot) `(slot-value ,struct ,slot)) (setf p (make-point)) (setf (slot-value p 'x) 1) (setf (-> p 'y) 2) I'm using clozure cl, and In clozure cl this works. However, AFAIK this is non-standard behavior (equivalent to "undefined behavior" C++). I'm not planning to switch to another CL implementation, so should I keep using slot-value for structures, or

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

有些话、适合烂在心里 提交于 2019-12-01 02:59:09
In clisp, the following code works: (defun hit-history () (shell "tail ssqHitNum.txt")) However, in Clozure CL, the shell function is not supported! 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-shell seems to be prefered these days, as Ehvince points out in a comment and his own answer. You could also

Unix signal handling in (common) lisp

流过昼夜 提交于 2019-11-30 13:56:15
问题 I've done a bit of research on this subject and am turning up blanks. There seem to be implementation-dependent ways of doing Unix signal handling in Common Lisp, but is there a package that gives a cross-implementation way of doing signal handling? I would mainly like to listen for SIGINT and do a graceful shutdown in my app. I'm using Clozure CL 1.7 on linux...like mentioned, it would be great for a package for this, but if I have to resort to implementation-specific code, that's fine. I'm