Skip to content
Snippets Groups Projects
Commit 45ca8e88 authored by Liam Healy's avatar Liam Healy
Browse files

Eliminated dependency on cl-utilities; error for obsolete defmpar

The defmobject argument 'class-slots-instance is no longer used, so
#'callback-arg-p and the only use of with-unique-names can be
eliminated, and thus the dependency on cl-utilities.

Constant GSL functions in the library (such as minimizers) which
were introduced in a GSL version newer than loaded now expand as
symbol macros which signal the 'obsolete-gsl-version error.
parent 86d01196
No related branches found
No related tags found
No related merge requests found
......@@ -112,8 +112,6 @@ combination for which the following are supported:</p>
version 0.10.0 or newer; callbacks and <code>foreign-funcall</code> must be supported
</li>
<li><a href="http://www.cliki.net/trivial-garbage">trivial-garbage</a>
<li><a href="http://common-lisp.net/project/cl-utilities/">cl-utilities</a>
</li>
<li><a href="http://www.cliki.net/asdf">ASDF</a></li>
<li><a href="http://repo.or.cz/w/lisp-unit.git">lisp-unit</a>, <i>(Optional)</i> necessary
to run <code>gsll-tests</code>
......@@ -155,11 +153,10 @@ Then in Lisp, load the system:
<ul>
<li><code>gsll get_git git://repo.or.cz/gsll.git</code></li>
<li><code>trivial-garbage get_darcs http://common-lisp.net/~loliveira/darcs/trivial-garbage</code></li>
<li><code>cl-utilities get_cvs_clnet</code></li>
</ul>
<p>and add
<ul>
<li><code>gsll cffi trivial-garbage cl-utilities</code></li>
<li><code>gsll cffi trivial-garbage</code></li>
</ul>
<p>
to <code>dependencies</code> and execute
......@@ -169,7 +166,7 @@ from within the clbuild directory:
</ul>
<h3>With Debian or Ubuntu</h3>
<ul>
<li><code>sudo aptitude install libgsl0-dev cl-cffi cl-utilities</code></li>
<li><code>sudo aptitude install libgsl0-dev cl-cffi</code></li>
<li><code>git clone git://repo.or.cz/gsll.git</code></li>
<li><code>darcs get http://common-lisp.net/~loliveira/darcs/trivial-garbage</code></li>
<li><code>clc-register-user-package trivial-garbage/trivial-garbage.asd</code></li>
......@@ -388,7 +385,7 @@ and arrays used internally or for function return.
<!-- Created: Feb 25 2005 -->
<!-- hhmts start -->
<small>
Time-stamp: <2009-03-31 22:41:54EDT index.html>
Time-stamp: <2009-04-04 09:58:19EDT index.html>
</small>
<!-- hhmts end -->
</div>
......
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2009-04-02 22:34:36EDT gsll.asd>
;; Time-stamp: <2009-04-04 09:55:40EDT gsll.asd>
;; $Id$
(asdf:defsystem "gsll"
......@@ -9,7 +9,7 @@
:version "0"
:author "Liam M. Healy"
:licence "LLGPL v3, FDL"
:depends-on (cffi trivial-garbage cl-utilities)
:depends-on (cffi trivial-garbage)
:components
((:module init
:components
......
;; Foreign callback functions.
;; Liam Healy
;; Time-stamp: <2009-04-02 22:32:19EDT callback.lisp>
;; Time-stamp: <2009-04-04 09:55:41EDT callback.lisp>
;; $Id$
(in-package :gsl)
......@@ -126,9 +126,6 @@
;;;; Using callback specification in function arugments
;;;;****************************************************************************
(defun callback-arg-p (arglist callbacks &optional key)
(member (parse-callback-static callbacks 'foreign-argument) arglist :key key))
(defun callback-replace-arg (replacement list callbacks)
"Replace in the list the symbol representing the foreign callback argument."
(if callbacks
......
;; Load GSL
;; Liam Healy Sat Mar 4 2006 - 18:53
;; Time-stamp: <2009-01-27 21:32:59EST init.lisp>
;; Time-stamp: <2009-04-04 09:55:29EDT init.lisp>
;; $Id$
(defpackage gsll
......@@ -38,21 +38,3 @@
#+sbcl
(eval-when (:compile-toplevel :load-toplevel :execute)
(pushnew :native *features*))
#+openmcl
(eval-when (:compile-toplevel :load-toplevel :execute)
(pushnew :callback-toplevel-only *features*))
;;; CFFI currently doesn't allow uninterned callback names for CCL;
;;; patch here. This patch can be removed once the fix in CFFI:
;;; http://common-lisp.net/pipermail/cffi-devel/2009-January/003046.html
;;; makes it into a released version.
#-openmcl (import 'cl-utilities:with-unique-names :gsll)
#+openmcl
(defmacro gsll::with-unique-names ((&rest bindings) &body body)
`(cl-utilities:with-unique-names
(,@bindings)
(let ,(mapcar (lambda (symb) `(,symb (intern (symbol-name ,symb))))
bindings)
,@body)))
;; Macros to interface GSL functions, including definitions necessary for defmfun.
;; Liam Healy
;; Time-stamp: <2009-03-31 22:51:22EDT interface.lisp>
;; Time-stamp: <2009-04-04 12:02:28EDT interface.lisp>
;; $Id$
(in-package :gsl)
......@@ -141,8 +141,8 @@
;; Insufficient version number handled by binding a special of
;; the same name to the condition. It would be nice to signal
;; the error, but it least this will provide some information.
`(defparameter ,cl-symbol
(make-condition
`(define-symbol-macro ,cl-symbol
(error
'obsolete-gsl-version :name ',cl-symbol :gsl-name
,gsl-symbol :gsl-version ',gsl-version ))))
......
;; Definition of GSL objects and ways to use them.
;; Liam Healy, Sun Dec 3 2006 - 10:21
;; Time-stamp: <2009-04-01 21:36:13EDT mobject.lisp>
;; Time-stamp: <2009-04-04 09:51:08EDT mobject.lisp>
;;; GSL objects are represented in GSLL as and instance of a 'mobject.
;;; The macro demobject takes care of defining the appropriate
......@@ -45,7 +45,6 @@
;;; allocator
;;; allocate-inputs
;;; freer
;;; class-slots-instance
;;; callbacks
;;; See callbacks.lisp
;;; superclasses
......@@ -58,7 +57,7 @@
(class prefix allocation-args description
&key documentation initialize-suffix initialize-name initialize-args
arglists-function inputs gsl-version allocator allocate-inputs freer
class-slots-instance callbacks
callbacks
(superclasses (if callbacks '(callback-included) '(mobject)))
singular)
"Define the class, the allocate, initialize-instance and
......@@ -105,8 +104,7 @@
(make-reinitialize-instance
class cl-initialize-args initialize-name prefix
initialize-suffix initialize-args inputs
(and (not (callback-arg-p class-slots-instance callbacks))
callbacks)
callbacks
superclasses))
(export '(,maker ,class))
,@(when callbacks `((record-callbacks-for-class ',class ',callbacks)))
......@@ -114,7 +112,7 @@
,(mobject-maker
maker arglists class cl-alloc-args cl-initialize-args
description documentation initialize-args initializerp settingp
singular class-slots-instance callbacks))
singular callbacks))
`(progn
(export ',maker)
(defun ,maker (&rest args)
......@@ -182,7 +180,7 @@
(defun mobject-maker
(maker arglists class cl-alloc-args cl-initialize-args
description documentation initialize-args initializerp settingp
singular class-slots-instance callbacks)
singular callbacks)
"Make the defun form that makes the mobject."
(when callbacks
(setf cl-initialize-args (append cl-initialize-args '((scalarsp t)))))
......@@ -194,8 +192,6 @@
(singularize
singular
`(,@cl-alloc-args
,@(callback-replace-arg
'functions class-slots-instance callbacks)
,@(when initargs
(append
(list
......@@ -211,22 +207,9 @@
(make-instance
',class
,@(when callbacks `(:callbacks ',callbacks))
,@(symbol-keyword-symbol
(callback-remove-arg class-slots-instance callbacks))
,@(when (callback-arg-p class-slots-instance callbacks)
(symbol-keyword-symbol 'functions))
,@(if arglists
(second arglists)
(symbol-keyword-symbol cl-alloc-args singular)))))
;; There is callback slot variable
,@(when (callback-arg-p class-slots-instance callbacks)
(with-unique-names (cbs)
`((let ((,cbs ,(make-cbstruct-object class)))
(setf (slot-value
object
',(parse-callback-static callbacks 'foreign-argument))
,cbs)
(tg:finalize object (lambda () (foreign-free ,cbs)))))))
;; There is an initialization step
,@(when initializerp
(if (or initialize-args arglists) ; with arguments
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment