From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: HiPhish Newsgroups: gmane.lisp.guile.user Subject: A value for "nothing" Date: Sun, 26 Aug 2018 12:13:31 +0200 Message-ID: <21036238.c6yQEfjfIL@aleksandar-ixtreme-m5740> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: blaine.gmane.org 1535292461 2627 195.159.176.226 (26 Aug 2018 14:07:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Aug 2018 14:07:41 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 26 16:07:37 2018 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 1ftvhY-0000ZR-Ji for guile-user@m.gmane.org; Sun, 26 Aug 2018 16:07:36 +0200 Original-Received: from localhost ([::1]:49204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftvje-0005xL-Rv for guile-user@m.gmane.org; Sun, 26 Aug 2018 10:09:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fts5C-00031i-SO for guile-user@gnu.org; Sun, 26 Aug 2018 06:15:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fts3B-0007Vw-K6 for guile-user@gnu.org; Sun, 26 Aug 2018 06:13:44 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:55688) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fts3B-0007PZ-AD for guile-user@gnu.org; Sun, 26 Aug 2018 06:13:41 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id EA69720EB9 for ; Sun, 26 Aug 2018 12:13:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1535278412; bh=40GtOIRZ0684ZpJYvvL3oIpiik115XydckqJHIHxhko=; h=From:To:Subject:Date:From; b=IR/UAU3E8Mp06ECG6JD7HuEFr8U+YsLne64X90CyTKPM2upx3qhmV7suTL0Ja7el0 ZUA0aBAXzavRZF7Nj0EtX9YPuSetYV6sF3a7E4TnkHzvXGEc6Kf/RCY/aVzCP8hAnL JE6LQ8jhNyF6INLBRnh+0rf4yfs0npyeQNExS/41Ih2qiCdMRCUFxF3sfD9Z2AY18e fQiSIthH9x3pXDWXyXlbEyyJ+JGDvViWXrZXji8HKx8q8W7DybPpgXJNvMth3p2kjh eZd/FTitVWFn7YurrFNIn8cuS+SMdQM3IytsFGFj2cPMW+OLxuIp9c65ei/mhoSrcT ICpAEwJsAEF8A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 41yrSr2NWBz6tm6 for ; Sun, 26 Aug 2018 12:13:32 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.67.36.65 X-Mailman-Approved-At: Sun, 26 Aug 2018 10:07:48 -0400 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:14759 Archived-At: Hello Schemers, I am writing an implementation of MessagePack [1] for Guile and a part of the spec is the presence of a "nil" data type. What would be a good value to express "nothing" in Guile? I cannot use '() because that would be indistinguishable from the empty list, so I thought that the return value of a function that returns nothing would be a good fit. The function `display` for example returns an `#` value, but the only way of producing it without side effects so for is the value of `(if #f #f)`. Is there a better way? In Racket there is the `(void)` [2] procedure which returns a `#` object, so that's what I am using there [3][4]. Any suggestions for Guile? [1] https://msgpack.org/ [2] http://docs.racket-lang.org/reference/void.html?q=void [3] https://gitlab.com/HiPhish/MsgPack.rkt/blob/master/msgpack/unpack.rkt#L47 [4] https://gitlab.com/HiPhish/MsgPack.rkt/blob/master/msgpack/pack.rkt#L35