From 3d9269aa5d082e711c6c2413dccc8177c32e20f2 Mon Sep 17 00:00:00 2001 From: Willem Broekema Date: Sat, 30 Mar 2013 15:43:47 +0100 Subject: [PATCH 1/3] Use CL-FAD for temporary files (thanks Jonathan Smith) --- clpython.asd | 2 +- runtime/import.lisp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clpython.asd b/clpython.asd index 074a78e..1ccd1f8 100644 --- a/clpython.asd +++ b/clpython.asd @@ -69,7 +69,7 @@ (asdf:defsystem :clpython.runtime :description "Python runtime environment" - :depends-on (:clpython.basic :closer-mop #+ecl :cl-custom-hash-table :temporary-file) + :depends-on (:clpython.basic :closer-mop #+ecl :cl-custom-hash-table :cl-fad) :components ((:module "runtime" :serial t :components ((:file "rsetup" ) diff --git a/runtime/import.lisp b/runtime/import.lisp index 48d7509..108aa9d 100644 --- a/runtime/import.lisp +++ b/runtime/import.lisp @@ -81,8 +81,8 @@ When FILENAME-ITEMS is (:A :B :C) result could look like #p'/tmp/clpython-A.B.C- Might signal TEMPORARY-FILE:CANNOT-CREATE-TEMPORARY-FILE" (whereas ((file-name (gethash key *temp-file-map*))) (return-from get-temporary-file file-name)) - (let ((file-stream (temporary-file:open-temporary :template (format nil "TEMPORARY-FILES:~{~A~^-~}-%" filename-items) - :direction :output))) + (let ((file-stream (cl-fad:open-temporary :template (format nil "TEMPORARY-FILES:~{~A~^-~}-%" filename-items) + :direction :output))) (prog1 (setf (gethash key *temp-file-map*) (pathname file-stream)) (close file-stream)))) From 67e6b4ecc20335541e4679a2c523171192bd5003 Mon Sep 17 00:00:00 2001 From: Willem Broekema Date: Sat, 30 Mar 2013 15:36:52 +0100 Subject: [PATCH 2/3] Remove asdf:traverse methods: not supported in ASDF 3; not very useful (thanks Fare) --- clpython.asd | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/clpython.asd b/clpython.asd index 1ccd1f8..8a32a00 100644 --- a/clpython.asd +++ b/clpython.asd @@ -192,50 +192,6 @@ nil))) -;;; Nice error messages for missing required libraries - -(defmacro with-missing-dep-help (lib-texts &body body) - `(handler-bind ((asdf:missing-dependency - (lambda (c) - ,@(loop for (library warning-text) in lib-texts - collect `(when (eq (asdf::missing-requires c) ,library) - (warn ,warning-text)))))) - ,@body)) - -(let ((clpython (asdf:find-system :clpython))) - - (defmethod asdf::traverse :around ((op asdf:compile-op) (system (eql clpython))) - (with-missing-dep-help ((:closer-mop - "CL-Python requires library \"Closer to MOP\". ~ - Please check it out from the darcs repo: ~ - \"darcs get http://common-lisp.net/project/closer/repos/closer-mop\" ~ - or download the latest release from: ~ - http://common-lisp.net/project/closer/ftp/closer-mop_latest.tar.gz") - #-allegro - (:yacc - "CL-Python requires library \"CL-Yacc\". ~ - Please check it out from the darcs repo: ~ - \"darcs get http://www.pps.jussieu.fr/~~jch/software/repos/cl-yacc\" ~ - or download the latest release from: ~ - http://www.pps.jussieu.fr/~~jch/software/files/") - #+ecl - (:cl-custom-hash-table - "CL-Python requires library \"CL-CUSTOM-HASH-TABLE\". ~ - Please check it out from the git repo: ~ - \"git clone git://github.com/metawilm/cl-custom-hash-table.git\" ~ - or download the latest release from: ~ - https://github.com/metawilm/cl-custom-hash-table/zipball/master")) - (call-next-method))) - - #-allegro - (defmethod asdf::traverse :around ((op asdf:test-op) (system (eql clpython))) - (with-missing-dep-help ((:ptester - "CL-Python requires library \"ptester\". ~ - Please download the latest release from: ~ - http://files.b9.com/ptester/ptester-latest.tar.gz")) - (call-next-method)))) - - ;;; Suppress some warnings about package trickery (defmacro suppress-package-warnings (&body body) From f1b8dbb81ce84c5f6d3bb90c331eb5763795eab3 Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Wed, 17 Apr 2013 18:05:06 -0400 Subject: [PATCH 3/3] Change some funky quote into regular quote This was causing load of operator.lisp to fail on SBCL on Debian/Linux --- lib/operator.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/operator.lisp b/lib/operator.lisp index f9fb6da..cf47095 100644 --- a/lib/operator.lisp +++ b/lib/operator.lisp @@ -215,7 +215,7 @@ the call f(b) returns b.date.month." (export '|attrgetter|)) (defun |itemgetter| (&rest items) - "Return a callable object that fetches item from its operand using the operand’s + "Return a callable object that fetches item from its operand using the operand's __getitem__() method. If multiple items are specified, returns a tuple of lookup values. Equivalent to: @@ -229,7 +229,7 @@ values. Equivalent to: return tuple(obj[item] for item in items) return g -The items can be any type accepted by the operand’s __getitem__() method. Dictionaries +The items can be any type accepted by the operand's __getitem__() method. Dictionaries accept any hashable value. Lists, tuples, and strings accept an index or a slice." (cond ((null items) (py-raise '{ValueError} "One or more items must be provided."))