Re: [Scheme-reports] Seeking review of sets and hash tables proposals taylanbayirli@gmail.com (25 May 2013 14:25 UTC)
Re: [Scheme-reports] Seeking review of sets and hash tables proposals Evan Hanson (25 May 2013 01:17 UTC)

Re: [Scheme-reports] Seeking review of sets and hash tables proposals Evan Hanson 25 May 2013 01:17 UTC

On 2013/05/25 08:27P, Daniel Hartwig wrote:
> On 24 May 2013 21:55, Alaric Snell-Pym <alaric@snell-pym.org.uk> wrote:
> > 1) What about printed representations? I feel there should be a written
> > syntax for important data structures in Scheme, and that literals should
> > self-evaluate.
>
> The problem with this is that e.g. a set is a collection of items
> *and* also an equivalence predicate, which can be any arbitrary
> procedure, and arbitrary procedures can not be written out.

Literal sets or hash tables could be defined as having a specific
equivalence procedure.

Alternatively, the proposal could be changed to specify a default
equivalence when none is provided (e.g. (make-set) = (make-set equal?)),
with printed representations having that equivalence.

I like this idea, but it would probably come with lots of complications.
For example, one wouldn't be able to rely on the ability to round-trip
such an object through its written representation (and what exactly
should happen when the equivalence is not the default? Raise an error?
Write "#<hash-table>" instead? How would one test its printability?).

Evan

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports