Read eval
John Thingstad <[email protected]> Sat, 11 Oct 2003 17:18:10 +0100
| Newsgroups | gmane.lisp.corman |
|---|---|
| Organization | private |
| Message-ID | <[email protected]> |
I am working with corman lisp under emacs.
Therfore I wish to extend the language with some read macro's to make it
more like Allgro lisp:
:ls
:pwd
:load <file>
:cd <file>
This is as far as i get:
(defun ls ()
(let* ((dir-string (namestring (current-directory)))
(search-string (concatenate 'string dir-string "/*"))
(files (directory (truename search-string))))
(dolist (file files)
(fresh-line)
(princ (concatenate 'string (pathname-name file) "." (pathname-type
file))))
(terpri)
(values)))
(defun pwd ()
(write-line (namestring (current-directory))))
(defun cd (dir)
(check-type dir string)
(setf (current-directory) dir)
(values))
(define-symbol-macro :pwd (current-directory))
(define-symbol-macro :ls (ls))
How do I go about allowing ':cd <file>' (without sting double quotes)
I tried with (set-macro-character #\: #'colon-dispach) but had trouble
with read..
Anyone have any experience with this they wish to share?
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs Online - Over 14,500 titles.
No Late Fees & Free Shipping.
Try Netflix for FREE!
http://us.click.yahoo.com/JYdFFC/XP.FAA/ySSFAA/SyjtlB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
[email protected]
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/