From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jan Wedekind Newsgroups: gmane.lisp.guile.user Subject: Re: ?-suffix for booleans... good-idea? or bad-idea? Date: Tue, 25 Apr 2017 16:50:08 +0100 Message-ID: References: <878tmpoi3x.fsf@dustycloud.org> <87inltgnj8.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1493135502 1756 195.159.176.226 (25 Apr 2017 15:51:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2017 15:51:42 +0000 (UTC) User-Agent: K-9 Mail for Android Cc: "guile-user@gnu.org" To: Alex Vong , Christopher Allan Webber Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Apr 25 17:51:36 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 1d32kY-0000FD-7n for guile-user@m.gmane.org; Tue, 25 Apr 2017 17:51:34 +0200 Original-Received: from localhost ([::1]:50044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d32ke-0000se-0M for guile-user@m.gmane.org; Tue, 25 Apr 2017 11:51:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d32js-0000pV-SZ for guile-user@gnu.org; Tue, 25 Apr 2017 11:50:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d32jp-0007uL-P0 for guile-user@gnu.org; Tue, 25 Apr 2017 11:50:52 -0400 Original-Received: from wp424.webpack.hosteurope.de ([2a01:488:42:1000:50ed:85c1::]:35212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d32jp-0007sM-Hi for guile-user@gnu.org; Tue, 25 Apr 2017 11:50:49 -0400 Original-Received: from [149.254.181.46] (helo=[10.42.196.53]); authenticated by wp424.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) id 1d32je-0006yG-P5; Tue, 25 Apr 2017 17:50:43 +0200 In-Reply-To: <87inltgnj8.fsf@gmail.com> X-bounce-key: webpack.hosteurope.de;jan@wedesoft.de;1493135449;90015873; X-HE-SMSGID: 1d32je-0006yG-P5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a01:488:42:1000:50ed:85c1:: X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:13627 Archived-At: In Ruby ...? is used for methods returning boolean. E.g. 5.even?. Boolean variables are not sufficed. E.g. x = 5.even? The method call "even?" is the question. "x" is the answer. On 25. April 2017 04:43:23 GMT+00:00, Alex Vong wrote: >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 -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.