Little more lisp help =)

On Thu, 10 Feb 2005 03:27:16 +0000, dataangel <k04jg02 kzoo edu> wrote:
> This time I'm trying to modify the jump-or-exec code (it's on the wiki
>       (mapc (lambda (gWin)
>           (display-window gWin))
>         (filter filterGroupPred (windows-in-group wind)))
> This code doesn't work :/ filterGroupPred is passed to the function that
> runs this code, and I've tested it with (lambda (w) (`t)) as
> filterGroupPred and it still doesn't work. What am I missing?

   I must admit, even after reading the code you're working from
(available at,
I still lack a "big picture" of what you're doing exactly.  Just the
   You might want to test your code a bit with sawfish-client.
Considering I'm not terribly great with Lisp, I find it's a good way
to avoid having to see if I'm on the right track.  I tried the code
you provided and received:

user> ((lambda(w) ('t)) 'something)
*** Invalid function: t"

   You'll want to omit the extra parens around 't.  Then it will be
the closure you're after.
   Otherwise, it appears right to me.  I tested:

user> (define (ic_filter filter_func)
    (mapc (lambda(w) (iconify-window w))
              (filter filter_func (managed-windows))))
user> (define (play-filter w) (string-match "Play" (window-name w)))
user> (ic_filter #'play-filter)

   And all of XMMS disappeared.  So it looks like the code you posted
was correct.
   (Sending to the list this time instead of accidentally responding privately.)

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