diff --git a/clpython.asd b/clpython.asd index 074a78e..8a32a00 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" ) @@ -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) 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.")) 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))))