Christopher Allan Webber writes:

> I've noticed that it's common in Guile modules to use "foo?" for
> variable names involving booleans.  It's tempting,

> But is it a good idea?

It's an idea that I like and use.  Not sure that says anything about
good or bad.

I would like to help you paint though!

We have functions like null? and pair? that return booleans, where I
would like the [non]-nil value.  I often find myself writing things like

   (let ((bar (if (pair? foo) (baz foo)
               #f)))
   
where I would rather like to write something like

   (let ((bar (and=> (pair?=> foo) baz)))

How do you do these things, and how do you call your pair?=> function?

Greetings, --janneke

-- 
Jan Nieuwenhuizen <[email protected]> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ®  http://AvatarAcademy.nl  

Reply via email to