From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.user Subject: Re: A value for "nothing" Date: Sun, 26 Aug 2018 13:49:29 -0400 Message-ID: References: <21036238.c6yQEfjfIL@aleksandar-ixtreme-m5740> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1535305678 6185 195.159.176.226 (26 Aug 2018 17:47:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Aug 2018 17:47:58 +0000 (UTC) Cc: guile-user@gnu.org To: hiphish@posteo.de Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 26 19:47:54 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 1ftz8k-0001Sf-2c for guile-user@m.gmane.org; Sun, 26 Aug 2018 19:47:54 +0200 Original-Received: from localhost ([::1]:49902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftzAq-0008HP-09 for guile-user@m.gmane.org; Sun, 26 Aug 2018 13:50:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftzAV-0008HK-9D for guile-user@gnu.org; Sun, 26 Aug 2018 13:49:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftzAU-0002wQ-3h for guile-user@gnu.org; Sun, 26 Aug 2018 13:49:43 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:37654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ftzAT-0002vv-Qs for guile-user@gnu.org; Sun, 26 Aug 2018 13:49:42 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id u12-v6so10226721wrr.4 for ; Sun, 26 Aug 2018 10:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1R5AzGfIeNLfSh3y3tCGbWIniLaPokHbJRTJnIVtB6U=; b=qeu5EcpggnCfR0FCPmWDrsWWDmRgpLFCLbnyQpuPfbo9kYEwlL4ykkhhXla+UWXsu6 BosQPJwtng5pvnQi3YegwpUYb20vpoWHixLZ1Cxc4dS6cweCWiMIYNXN9rJyEEoQZMQZ ql0DBOJQHITHZCMmwVaQdOH4K9+6j6Rbec//on9R25LBNs4FAwaPB7MswE7Dbo2pV3MJ NiGcrBnennBuWHGjq0tWGEd8drajn9hwhw6ixa0R5Rp99tAJm9x9GzkjkBLUB+UCBmv2 KEyAVKMhWxNeR7FFRn/tRCH9qTwgvVV6kvhFjhAj1nu1M32r5MYd97Seg+8zFkHbMuJu ubKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1R5AzGfIeNLfSh3y3tCGbWIniLaPokHbJRTJnIVtB6U=; b=MNhYkQZy0NyviiTb8Hkz7UmCejToJmkdgcrCRM/9CfCRk9miYi7CXFby85Vc02Vuft pSFJlFe7TmHRkRzqv4hIZkc284W/h2FcMkXR3b2JTBvbqiDxAfPuce+dRe4KbtB8/7lq NP0rUWRjOH/9nsC/gnLlosiCml1yNhp7wwEJl4YtKevxympXSfpDJ/T0GYXnfrG9Zmyz p9fnftogODm5RLTI8CpYxnXQgyesG/phODFZlEHbonbPs//XZ7tZxB2rS3AWLHC7AEXz SWBer1Dfe0sT20JY6RYMsQuqJziG+JXYOQ9DzxO2jHkhw1RQ7YrmHPV6WJlVmwmw2WzH EEPA== X-Gm-Message-State: APzg51B9l7QP2O19Jt98wkPBq6JILKjGc4eiK3qYuDU4XO+QoJ8NJS18 ZQenoePxDOqSs/XAsrULSPUKEv3jQeJqgBDGJFIhoQ== X-Google-Smtp-Source: ANB0VdY+HSD/YxANMRLDTY1b/fX1/tKPBgS4Pv0V586hMcIA7KsJ0eTUnuxrsJ4AqkLTJ+hseacMNKk+Dt6q/93Ru0A= X-Received: by 2002:a5d:4d82:: with SMTP id b2-v6mr6332800wru.80.1535305780303; Sun, 26 Aug 2018 10:49:40 -0700 (PDT) In-Reply-To: <21036238.c6yQEfjfIL@aleksandar-ixtreme-m5740> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f 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:14763 Archived-At: Well, you could use #nil, a Guile-specific unique object that is both falsy (like #f) and answers #t to the null? predicate. It is used to emulate Common Lisp's and Elisp's nil. But a more portable approach would be to define a record type with no slots and make just one instance of it. On Sun, Aug 26, 2018 at 10:09 AM HiPhish wrote: > 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 > > > >