Re: "Essential lisp utilities": where are they?
- From: "William James" <w_a_x_man@xxxxxxxxx>
- Date: Fri, 31 Oct 2008 15:06:52 +0100 (CET)
Mirko.Vukovic@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
.
- Follow-Ups:
- Re: "Essential lisp utilities": where are they?
- From: Mirko . Vukovic
- Re: "Essential lisp utilities": where are they?
- References:
- "Essential lisp utilities": where are they?
- From: Mirko . Vukovic
- "Essential lisp utilities": where are they?
- Prev by Date: Symbol clashes: how to avoid them. Part 2
- Next by Date: Re: How to Get Started?
- Previous by thread: Re: "Essential lisp utilities": where are they?
- Next by thread: Re: "Essential lisp utilities": where are they?
- Index(es):
Relevant Pages
|