[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird behavior of hash-table
From: |
tomas |
Subject: |
Re: Weird behavior of hash-table |
Date: |
Sun, 24 Nov 2019 09:57:57 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Nov 24, 2019 at 03:04:36AM -0500, Mark H Weaver wrote:
> Hi Zelphir,
>
> Zelphir Kaltstahl <address@hidden> writes:
>
> > I've noticed a strange behavior of hash tables [...]
> > (define SQUARES
> > ;; vector, constant time access
> > #('A1 'B1 'C1 'D1 'E1 'F1 'G1 'H1
[...]
> I guess that you meant for this to be a vector of symbols. In fact, it
> is a vector of lists of the form (quote <symbol>), for which '<symbol>
> is a shorthand.
>
> scheme@(guile-user)> (vector-ref SQUARES 0)
> $10 = (quote A1)
Yikes. I'd fall into this trap, too. Thanks you both for illustrating
it so well -- and thanks, Mark, for your unfailing sharp vision :-)
So the best thing for one's brain is to train it to read #(...)
as some weird relative of '(...)?
Is there a corresponding weird relative of `(...)?
Cheers
-- tomás
signature.asc
Description: Digital signature