From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Christopher Allan Webber Newsgroups: gmane.lisp.guile.user Subject: ?-suffix for booleans... good-idea? or bad-idea? Date: Mon, 24 Apr 2017 12:01:06 -0500 Message-ID: <878tmpoi3x.fsf@dustycloud.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493053301 32403 195.159.176.226 (24 Apr 2017 17:01:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2017 17:01:41 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.2.1 To: "guile-user\@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Apr 24 19:01:38 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2hMm-0008Fi-9a for guile-user@m.gmane.org; Mon, 24 Apr 2017 19:01:36 +0200 Original-Received: from localhost ([::1]:45178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2hMp-0002FJ-5h for guile-user@m.gmane.org; Mon, 24 Apr 2017 13:01:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2hMR-0002E6-JL for guile-user@gnu.org; Mon, 24 Apr 2017 13:01:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2hMN-0004NI-OY for guile-user@gnu.org; Mon, 24 Apr 2017 13:01:15 -0400 Original-Received: from dustycloud.org ([50.116.34.160]:53402) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2hMN-0004Li-Jm for guile-user@gnu.org; Mon, 24 Apr 2017 13:01:11 -0400 Original-Received: from oolong (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id 60A34265EE for ; Mon, 24 Apr 2017 13:01:07 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 50.116.34.160 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13620 Archived-At: 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