What am I doing wrong?

Hi all,

I have a problem that probably has to do with my not understanding the
semantics of first-class objects, and calling them.  Or something as
stupid as a syntax error.

Here is macro to map a workspace to a key

(defmacro map-workspace ( num )
  (let ((g-num (gensym)))
    (let ((g-num num))
      `(bind-keys global-keymap ,(concat "M-" (number->string g-num)) '(activate-workspace ,g-num)))))

then because I am really lazy I thought I would do this:
(defun map-workspaces ()
  (do ((x 1 (1+ x)))
      ((> x 7))
;;    (princ x)))
     (map-workspace x)))

This does not work, however if I switch it with the commented out
princ statement it works.  

I am very confused, and have looked through the info manual but it has
not helped with this in particular.

I would love any help as I think I will learn an important lesson in
the way librep works.



P.S. the map-workspace macro works so at the moment I use it like
(map-workspace 1)
(map-workspace 2)
(map-workspace 3)
(map-workspace 4)
(map-workspace 5)
(map-workspace 6)

It would just be nice to have the computer to the work in the future,
and to figure out what went wrong so I do not get bitten in the

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