[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A value for "nothing"
From: |
tomas |
Subject: |
Re: A value for "nothing" |
Date: |
Mon, 27 Aug 2018 10:02:44 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, Aug 27, 2018 at 02:17:06AM +0200, Panicz Maciej Godek wrote:
> niedz., 26 sie 2018 o 16:09 HiPhish <address@hidden> napisał(a):
>
> > 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 `#<unspecified>` 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 my experience, if #f doesn't make sense as a legal value, then using #f
> is probably the idiomatic Scheme way to go.
[...]
In this case, as msgpack has explicit true and false values, those seem
the "natural" correspondents of Scheme's #t and #f.
Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAluDsCQACgkQBcgs9XrR2kYI2QCeIL2joDmoLFb/8ckMDAGy1Ebd
0KQAn0k/6r4ZL9ZynRrjJ/xYJuE9BxyK
=+z4g
-----END PGP SIGNATURE-----
- Re: A value for "nothing", (continued)
- Re: A value for "nothing", Mark H Weaver, 2018/08/27
- Re: A value for "nothing", Matt Wette, 2018/08/27
- Re: A value for "nothing", Mark H Weaver, 2018/08/28
- Re: A value for "nothing", John Cowan, 2018/08/28
- Re: A value for "nothing", Mark H Weaver, 2018/08/28
- Re: A value for "nothing", Mark H Weaver, 2018/08/28
- Re: A value for "nothing", John Cowan, 2018/08/28
- Re: A value for "nothing", Mark H Weaver, 2018/08/28
- Re: A value for "nothing", Mark H Weaver, 2018/08/28
Re: A value for "nothing", Panicz Maciej Godek, 2018/08/26
Message not available
Message not available
Re: A value for "nothing", HiPhish, 2018/08/26