From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thomas Morley Newsgroups: gmane.lisp.guile.user Subject: Re: A value for "nothing" Date: Sun, 26 Aug 2018 19:21:50 +0200 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 1535304018 470 195.159.176.226 (26 Aug 2018 17:20:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Aug 2018 17:20:18 +0000 (UTC) Cc: guile-user@gnu.org To: HiPhish Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 26 19:20:14 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 1ftyhx-0008PW-IC for guile-user@m.gmane.org; Sun, 26 Aug 2018 19:20:13 +0200 Original-Received: from localhost ([::1]:49845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftyk3-00067C-I7 for guile-user@m.gmane.org; Sun, 26 Aug 2018 13:22:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftyja-000677-Ld for guile-user@gnu.org; Sun, 26 Aug 2018 13:21:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftyjY-0004cz-My for guile-user@gnu.org; Sun, 26 Aug 2018 13:21:54 -0400 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:39522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ftyjY-0004bU-1H for guile-user@gnu.org; Sun, 26 Aug 2018 13:21:52 -0400 Original-Received: by mail-wm0-x232.google.com with SMTP id q8-v6so6150360wmq.4 for ; Sun, 26 Aug 2018 10:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7HKQDfhSj5ld+vDD3JfgFJ7xXCA8qA//QLbfqePUuoY=; b=dOnoT1VShjNYbXYfpDMWNr4nyduG5p2f8DO+KFFKzSDL7ivSRbAstQV56GFAYDm9tH mwIoBhMpNYX7Gp2n6x29lMuipRj4mz5zCmGIcPMJLJOsNgrakQJEWKwz6xStd83dADPk DUxpZYzlkA5monwwQjbUPVA8XO+aobDOMYJEAbAqDyZ28sCCypHbn1ClDyWywyiu8YL1 xYQXmljYyyf61pQpKMpcq9AKDF/s9UFnPZZMMCfSkgdypGayjY2tFBqo4tOen1EPyQ1H fpzt0yixi9qgZNsVcpX0/+cTkaYBfQPrbqiJsw6i7w1L3Zk44cX4HcMJb1kEwnxbubug ntLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7HKQDfhSj5ld+vDD3JfgFJ7xXCA8qA//QLbfqePUuoY=; b=AOwNrv+f3GNmb5BiRMJh9F11sStMREqJ7t9m8zMy+SR5+MBNt+DTdpVLMuSR1dIdTK 50OnEkj4PEqsXAs36s9x6vvakop8o84ZloWctw5Jtvj/4yXnO7tD0zJ1Ssds4kaZ/biQ 0abKxYTq9msErFVugF3h9fDHo1YzUXrT4b+xZcAJwnR5hfk/yD9DzwMcmsxXHCFJ6BvS QSFo5zranjVVEwlF3ybxm9/J5N0ZHbRysOJPdb6hxoAP0nFDXPks9/7IpSFEN77YxlUz ePPkwtXsdXY60kW2m7SIsomBorcGMZt+EIgtiEN2wv6CHPmCDMgrubkOc7XVRH9mLOkI sBVQ== X-Gm-Message-State: APzg51DWt4mNQUVl9b3rKbr1Muat4hCEgVNG6Yr1yhbHqVWylL7KbSuT vpvDHwTXdbA6JXWsxLp5BlDpDC6bQmgXujdtWBM= X-Google-Smtp-Source: ANB0Vdb6bh8e4l8Dcg+xv+27fwdI7OUS0FGox3G9exu1UEqP+sdy7WoGdQw9Znzg0uZS34lwLJ5RT4GYyE4eQncC7AA= X-Received: by 2002:a1c:d702:: with SMTP id o2-v6mr3574455wmg.115.1535304111071; Sun, 26 Aug 2018 10:21:51 -0700 (PDT) Original-Received: by 2002:adf:a616:0:0:0:0:0 with HTTP; Sun, 26 Aug 2018 10:21:50 -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:400c:c09::232 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:14762 Archived-At: 2018-08-26 12:13 GMT+02:00 HiPhish : > 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? Well, actually that's how the value of *unspecified* is defined. >From boot9.scm: ;;; {The Unspecified Value} ;;; ;;; Currently Guile represents unspecified values via one particular value, ;;; which may be obtained by evaluating (if #f #f). It would be nice in the ;;; future if we could replace this with a return of 0 values, though. ;;; (define-syntax *unspecified* (identifier-syntax (if #f #f))) (define (unspecified? v) (eq? v *unspecified*)) Cheers, Harm > > 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 > > >