stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] Is it appropriate to modify the eval-line function in user.lisp


From: z_axis
Subject: [STUMP] Is it appropriate to modify the eval-line function in user.lisp ?
Date: Tue, 16 Oct 2012 15:43:55 +0800
User-agent: Opera Mail/11.62 (FreeBSD)

I want to use the following function to replace the eval-line in user.lisp:

(defcommand eval-me (cmd) ((:rest "Eval> "))
    (with-output-to-string (*standard-output*)
        (handler-case
            (format t "~{~a~^~%~}"
                (mapcar 'prin1-to-string
                    (multiple-value-list (eval (read-from-string cmd)))))
            (error (c)
                (format t "~A" c))

then the functions as below will work normally without using "with-output-to-string" respectively,

(defun div618 (p1 p2)
    (let ((ratio '(0. 0.191 0.236 0.382 0.5 0.618 0.809 1.))
(price #'(lambda (r) (if (<= p1 p2) (+ p1 (* (- p2 p1) r)) (- p1 (* (- p1 p2) r))))))
          (if (<= p1 p2)
(dolist (r (reverse ratio)) (format t "-------~3$ ~$-------~%" r (funcall price r))) (dolist (r ratio) (format t "-------~3$ ~$-------~%" r (funcall price r))))))


Any suggestion is appreciated !

Attachment: tmp.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]