Re: "Essential lisp utilities": where are they?



On Oct 31, 10:06 am, "William James" <w_a_x_...@xxxxxxxxx> wrote:
Mirko.Vuko...@xxxxxxxxx wrote:
Hello,

I recall seeing a library of "essential lisp utilities", but I just
spent a better part of an hour going through cliki, my bookmarks,
installed libraries, and the web, and other than suspects such as
trivial-features, and cannot find it.

The reason is that I just wrote a little macro with-dir
(defmacro with-dir ((new-dir) &body body)
  `(let ((old-dir (ext:cd)))
;;     (format t "will move to ~a~%" ,new-dir)
     (ext:cd ,new-dir)
;;     (format t "current dir ~a~%" (ext:cd))
     ,@body
     (ext:cd old-dir)))

A macro isn't needed for this.

Ruby:

def with_dir new_dir
  old_dir = Dir.getwd
  Dir.chdir new_dir
  yield
  Dir.chdir old_dir
end

p Dir.getwd
with_dir( ".." ){ p Dir.getwd }
p Dir.getwd

Um, that really was of no help:
- did not answer my question, or improve my answer
- did not even remotely convince me to look into Ruby, which would
entail to a) learn it & b) redo everything I did so far.
.



Relevant Pages