unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* ?-suffix for booleans... good-idea? or bad-idea?
@ 2017-04-24 17:01 Christopher Allan Webber
  2017-04-25  3:43 ` Alex Vong
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Christopher Allan Webber @ 2017-04-24 17:01 UTC (permalink / raw)
  To: guile-user@gnu.org

Hello everyone!  Here's a little bikeshed for us to paint.

I've noticed that it's common in Guile modules to use "foo?" for
variable names involving booleans.  It's tempting, because this looks
an awful lot like you're asking a question... and it's also common
for this even to be keyword arguments to procedures, etc.

But is it a good idea?  I thought "foo?" was supposed to be for
predicates, as a nicer version of the "foo-p" predicate convention in
other non-scheme lisps.  I can't imagine other lisps doing "foo-p" for
just variables with boolean values.

On the other hand, once you start adding ? to the end of boolean'y
things, it *does* become tempting to put them at the end of boolean
variables and arguments.  It looks pretty nice.

What do people think?  I'm struggling with deciding what's the right
thing for my own code, but leaning towards "we shouldn't use the ?
suffix for just boolean values".

 - Chris



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-05-05 19:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-24 17:01 ?-suffix for booleans... good-idea? or bad-idea? Christopher Allan Webber
2017-04-25  3:43 ` Alex Vong
2017-04-25 15:50   ` Jan Wedekind
2017-04-25 16:21     ` Paul
2017-04-26 15:25       ` Alex Kost
2017-04-25 18:08   ` Neil Jerram
2017-04-25 16:53 ` Panicz Maciej Godek
2017-04-26  0:23 ` Thompson, David
2017-04-27 10:39 ` Jan Nieuwenhuizen
2017-04-27 10:53   ` Panicz Maciej Godek
2017-04-27 12:07   ` Marko Rauhamaa
2017-05-05 17:26 ` Vladimir Zhbanov
2017-05-05 19:44   ` szgyg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).