From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Vong Newsgroups: gmane.lisp.guile.user Subject: Re: ?-suffix for booleans... good-idea? or bad-idea? Date: Tue, 25 Apr 2017 11:43:23 +0800 Message-ID: <87inltgnj8.fsf@gmail.com> References: <878tmpoi3x.fsf@dustycloud.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1493091853 2458 195.159.176.226 (25 Apr 2017 03:44:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2017 03:44:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: "guile-user@gnu.org" To: Christopher Allan Webber Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Apr 25 05:44:08 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 1d2rOa-0000Rk-57 for guile-user@m.gmane.org; Tue, 25 Apr 2017 05:44:08 +0200 Original-Received: from localhost ([::1]:46907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2rOd-0002t5-1c for guile-user@m.gmane.org; Mon, 24 Apr 2017 23:44:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2rOB-0002sz-9N for guile-user@gnu.org; Mon, 24 Apr 2017 23:43:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2rO8-0007Ka-6w for guile-user@gnu.org; Mon, 24 Apr 2017 23:43:43 -0400 Original-Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:33808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2rO8-0007K9-16 for guile-user@gnu.org; Mon, 24 Apr 2017 23:43:40 -0400 Original-Received: by mail-pf0-x243.google.com with SMTP id g23so7495929pfj.1 for ; Mon, 24 Apr 2017 20:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1h9hJWWxBWczJhfSp46gBDOK4OfBvLOR19QBkindjmU=; b=q0Qg6KjJV/WSTC9dkND/oDFiLJEE3ZkWR8NcVz+6Yr79E4mrFKDvt+SqfWH83z+4ht JqWUw1ZGoFU2UFHzEY9OnAvnMVdlWzL00Xc5dAwv0hKK13xK3NB3J5sYw9zThr8J7ouE NrKAubr5hrRN1tIXcdBKKFWAi7U3QqFtvFdDUV0yQWebNDlrGY/uuvcKY18BZkHb0RVL zX7I5ophisesGXAV6qnDHjL0OtOqzc8R14M9Se+IpZG/LaCbIrUShAWYln0NCd7nW7fR O6Yv0rO21N1sHuBb58/RLn1w6Hm5IFoFkxItSqhvYSwOVhmcJdjNxbqSPnlx8E9Sxf0D z9+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=1h9hJWWxBWczJhfSp46gBDOK4OfBvLOR19QBkindjmU=; b=LoTSdqkJI/qub3ZPfv7bBkCRZTDp8ckMoaODXUA/phJYBQA+tZ55Iwl8x7C+0OeMRm v3FrTYg63LdDRBm8x8Ms6HPYEv+RUlH57yVoARkIeE7SCnxJfmwOI6fvJyNvoTfVmG7h TFRc+4PHyhtTydjiX4Bly+NhKsOylWLu8ZubOuDqwPCEfm994efPhXo4mSvWEdN4yQMM uSSHUWoTgLt2nLMDVZJP/3IO+spFLE+NJWPjtu6jdO0j6+MRPlZ2EuHc+I/G8bOmrRDy kObjdUOwwQ3wF1eMXFC0VpaQNDtOVVTkSwuvLnA2cB5He5TKKZz5dtrBrYUlLZlWRYeo oPaQ== X-Gm-Message-State: AN3rC/6QUo7vZ9H55OWkFG0hlt/2wRCLO0fOWeZHe9L1P4qXurcKrmi1 HdMVRxxmWFchPw== X-Received: by 10.98.209.24 with SMTP id z24mr27594458pfg.200.1493091818778; Mon, 24 Apr 2017 20:43:38 -0700 (PDT) Original-Received: from debian (n218250043146.netvigator.com. [218.250.43.146]) by smtp.gmail.com with ESMTPSA id c63sm33117097pfb.13.2017.04.24.20.43.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Apr 2017 20:43:37 -0700 (PDT) In-Reply-To: <878tmpoi3x.fsf@dustycloud.org> (Christopher Allan Webber's message of "Mon, 24 Apr 2017 12:01:06 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 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:13622 Archived-At: --=-=-= Content-Type: text/plain Good question! I can't decide as well. I want to know how people think about it. In a lazy language, a variable is a 0-ary thunk, while a predicate is a 1-ary thunk. Since they are really just special case of a general thing, it make sense to use foo? for both cases. But we all know guile is not lazy, so I really don't know what to do. Christopher Allan Webber writes: > 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEdZDkzSn0Cycogr9IxYq4eRf1Ea4FAlj+xdwACgkQxYq4eRf1 Ea6YjBAAj6aYE56VaJiABfeaUXpQLC0VbCZQO7fOc7pEPsQ9JKEyB2JGOeFPy0lX XzwNLQWDvG8AbCn1r/FBH2UPw4OCw3jf/Pft06SJgCpg+q5y0Py+ZhefCvMypsgc 46x9PwCWTXPyoWF5HalCRW0VY2sZ1/eoDQ7epyCnRZsiNNRA/NFHV3G8oVzx7qEl MWq835ipOPAkAljt0T91WNXBj/2RUIacnSm+DUHJ7JaU0JIqUIYUQinpAnOcuVxN 7K5qT+6w42LT7zY6f5C0umQy8hXRHypQP9zd9qh4tLJbaSW5f2LEAT6l5IHEAuU7 Ckg/iNELDlKzv2p756w3/0YoDUsy/dAyI5/OOEhj/Yx4hCe63It9gCXEZUKlv7E5 WNESaVxp8s+1aqhvlDYGQ6OpJE+JiV1uVJLfpB2wLfHb2tsX/WFZDF6054KV43VA OD0Y0X7u+sFLSSxIMZ6T1V45O87/rgy3H6vtb/WZKnULjAHZIafp4DGmntsnqhut qUaogIJXL2xOol4Lr8ZiQ47yntLs1jDHN42XFV09117xeMiwOSrCc4GcSkOXzuQ8 TPE91+GlOTiJc5kag9z/4fn5UAPtboxfpYIRSf/NcQvrD5lKap30vjINrJ2A7ZGt FX71h7+ehs5psXhsMbgQA26jgGAXFzubw6+V7qVJwJYTZiNsMl8= =1Zqe -----END PGP SIGNATURE----- --=-=-=--