guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A value for "nothing"


From: Mark H Weaver
Subject: Re: A value for "nothing"
Date: Mon, 27 Aug 2018 17:29:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

John Cowan <address@hidden> writes:

> On Mon, Aug 27, 2018 at 12:54 AM Mark H Weaver <address@hidden> wrote:
>  
>  However, in most cases, symbols are precisely what's needed to represent
>  distinguished atomic objects such as this.
>
> The problem with symbols in Scheme is that they are not namespaced, so
> two different modules can use the same symbols in different ways.
> Exported variable bindings can be managed with the module system.

Right, but this is only a problem if the same variable might contain
either a MessagePack or some other data type that uses the same symbol
to mean something different.  In other words, this is only a problem if
you need to be able to distinguish between a MessagePack and some other
data type.

However, given that a MessagePack can also be a boolean, integer, float,
string, etc, and that the plan is apparently to use the corresponding
native Scheme objects to represent these things (which I agree is a good
idea), it will already be infeasible to distinguish between a
MessagePack and anything else.

So, while I agree that this is something to keep in mind when using
symbols in Scheme, I think it's a moot point in this case.

On the other hand, one disadvantage with using record types is that they
cannot be written and then read back in with the standard Scheme reader.
If this is considered desirable, it might be a point in favor of using
symbols instead of records.

      Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]