guile-user
[Top][All Lists]
Advanced

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

Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(


From: Panicz Maciej Godek
Subject: Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(
Date: Thu, 14 Aug 2014 12:30:02 +0200

2014-08-14 11:53 GMT+02:00 Marko Rauhamaa <address@hidden>:
>> Scheme already has a nice representation for associactions, namely the
>> assoc lists. However, they are a bit problematic, because they are
>> ordered by nature and hence there's not much one can do with their
>> linear access time.
>
> When we are talking about the representation of a mapping, it will be a
> full content dump, thus O(n) regardless. You don't gain anything by
> adding substructure to the assoc list.

We're talking about access time, so in this particular case -- about
assoc-ref and the like; not about printing. And about having an
efficient representation for sets, because obviously sets can be
represented using lists as well, although inefficiently.

> When you read in the collection, you can put it in the data structure of
> your choice (with alist->hash-table, for example).

Of course I can. But that isn't something that I wish to do. It simply
adds another layer of indirection, which is irrelevant to programmer's
intention. Using dictionaries is programmers' daily bread, yet Scheme
has no common way for doing that (unlike Perl, PHP, Python,
JavaScript, Clojure and other popular languages).



reply via email to

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