From 71953e249ba138cc25fe3b1d94fd65a8d673b83c Mon Sep 17 00:00:00 2001 From: Leonardo Varuzza Date: Sun, 7 Oct 2007 12:55:59 -0300 Subject: [PATCH] Remove functions witch already is in cl-utilities --- lambda-utils/ext.lisp | 43 ------------------------------------------- lambda-utils/packages.lisp | 10 ++++++---- 2 files changed, 6 insertions(+), 47 deletions(-) diff --git a/lambda-utils/ext.lisp b/lambda-utils/ext.lisp index ec23272..98ad985 100644 --- a/lambda-utils/ext.lisp +++ b/lambda-utils/ext.lisp @@ -70,15 +70,6 @@ This carries the function name which makes the error message more useful.")) `(make-array (length ,init) :element-type ,type :initial-contents ,init))) -(defmacro with-gensyms (syms &body body) - "Bind symbols to gensyms. First sym is a string - `gensym' prefix. -Inspired by Paul Graham, , p. 145." - `(let (,@(mapcar (lambda (sy) - `(,sy (gensym ,(concatenate 'string (car syms) - (symbol-name sy) "-")))) - (cdr syms))) - ,@body)) - (defmacro map-in (fn seq &rest seqs) "`map-into' the first sequence, evaluating it once. (map-in F S) == (map-into S F S)" @@ -160,37 +151,3 @@ Useful for re-using the &REST arg after removing some options." "A useful default for required arguments and DEFSTRUCT slots." (error "A required argument was not supplied."))) -;;; -;;; Function Compositions -;;; - -(defmacro compose (&rest functions) - "Macro: compose functions or macros of 1 argument into a lambda. -E.g., (compose abs (dl-val zz) 'key) ==> - (lambda (yy) (abs (funcall (dl-val zz) (funcall key yy))))" - (labels ((rec (xx yy) - (let ((rr (list (car xx) (if (cdr xx) (rec (cdr xx) yy) yy)))) - (if (consp (car xx)) - (cons 'funcall (if (eq (caar xx) 'quote) - (cons (cadar xx) (cdr rr)) rr)) - rr)))) - (with-gensyms ("COMPOSE-" arg) - (let ((ff (rec functions arg))) - `(lambda (,arg) ,ff))))) - -(defun compose-f (&rest functions) - "Return the composition of all the arguments. -All FUNCTIONS should take one argument, except for -the last one, which can take several." - (reduce (lambda (f0 f1) - (declare (function f0 f1)) - (lambda (&rest args) (funcall f0 (apply f1 args)))) - functions :initial-value #'identity)) - -(defun compose-all (&rest functions) - "Return the composition of all the arguments. -All the values from nth function are fed to the n-1th." - (reduce (lambda (f0 f1) - (declare (function f0 f1)) - (lambda (&rest args) (multiple-value-call f0 (apply f1 args)))) - functions :initial-value #'identity)) diff --git a/lambda-utils/packages.lisp b/lambda-utils/packages.lisp index 962c95b..2ab1692 100644 --- a/lambda-utils/packages.lisp +++ b/lambda-utils/packages.lisp @@ -21,7 +21,6 @@ defsubst defcustom defconst - with-gensyms map-in gc quit @@ -29,8 +28,11 @@ eof-p strin-tokens remove-plist - compose - compose-f - compose-all + ;; Shell + run-prog + pipe-output + pipe-input + close-pipe + with-open-pipe )) -- 2.11.4.GIT