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: Marko Rauhamaa
Subject: Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(
Date: Thu, 14 Aug 2014 12:53:24 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Panicz Maciej Godek <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.

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

Sexps are perfectly suitable to represent any imaginable data.

Circular sexps create funny effects in guile, though. Try inputting

   '(1 . #0#) 

to the (guile-1.8) reader.

Unfortunately, even

   (define a '(1 . #0#))

fails to finish.

Compare this with elisp, which is perfectly happy with:

   (setq a '#0=(1 . #0#))


Marko



reply via email to

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