Constructing master lists of data types hga@xxxxxx (30 Sep 2019 14:51 UTC)
Re: Constructing master lists of data types Lassi Kortela (30 Sep 2019 15:09 UTC)
Re: Constructing master lists of data types hga@xxxxxx (30 Sep 2019 18:00 UTC)
Re: Constructing master lists of data types John Cowan (02 Oct 2019 17:15 UTC)
How to store the master lists of data types hga@xxxxxx (02 Oct 2019 17:52 UTC)
Re: How to store the master lists of data types Arthur A. Gleckler (02 Oct 2019 21:10 UTC)
Re: How to store the master lists of data types Lassi Kortela (02 Oct 2019 21:31 UTC)
Re: How to store the master lists of data types hga@xxxxxx (02 Oct 2019 21:54 UTC)
Re: How to store the master lists of data types hga@xxxxxx (02 Oct 2019 21:42 UTC)
Re: How to store the master lists of data types Arthur A. Gleckler (03 Oct 2019 04:11 UTC)
Re: How to store the master lists of data types hga@xxxxxx (03 Oct 2019 12:27 UTC)
Re: How to store the master lists of data types Lassi Kortela (03 Oct 2019 14:55 UTC)
Re: How to store the master lists of data types Arthur A. Gleckler (03 Oct 2019 15:07 UTC)
Re: Constructing master lists of data types Alaric Snell-Pym (01 Oct 2019 09:11 UTC)
Re: Constructing master lists of data types John Cowan (30 Sep 2019 21:59 UTC)
Re: Constructing master lists of data types hga@xxxxxx (30 Sep 2019 22:14 UTC)
Re: Constructing master lists of data types John Cowan (01 Oct 2019 20:05 UTC)
Re: Constructing master lists of data types Alaric Snell-Pym (02 Oct 2019 16:15 UTC)
Re: Constructing master lists of data types Alaric Snell-Pym (01 Oct 2019 09:33 UTC)

Re: Constructing master lists of data types Alaric Snell-Pym 02 Oct 2019 16:14 UTC
On 01/10/2019 21:05, John Cowan wrote:
>  Enums are a
> problem: the native ASN.1 format just sends the ordinal of the enum and
> depends on the ASN.1 schema, which we hates it, so we would need something
> more complex and I don't know what.
With regards to what to send to databases for enums:

MySQL has an enum type, which is written something like
ENUM('FOO','BAR','BAZ'); valid values are then strings 'FOO', 'BAR' or
'BAZ' and I presume the implementation just stores a small enum index on
disk. So a natural mapping of Scheme enums would be to send the symbolic
name as a string by default - DBs without ENUM types can just store a
string, and MySQL with a matching ENUM type in the table will do the
right thing.

Overriding the values sent (using different strings, or just using
numeric indices) should be possible, but just sending the symbol name is
a good default.

As for how to represent them in the serialisation formats - I've not
looked at proposals for R7RS enums yet, but I strongly suspect they'll
need to be sent as the symbolic names as well, even in the binary
format, so that cases where the reader doesn't have the type definition,
or has a different version of the type definition, can still extract
maximal meaning.

--
Alaric Snell-Pym   (M7KIT)
http://www.snell-pym.org.uk/alaric/