|
From: | Stefan Israelsson Tampe |
Subject: | Re: Inconsistent behaviour of the pattern matcher |
Date: | Sun, 28 Apr 2013 18:29:18 +0200 |
Panicz Maciej Godek <address@hidden> writes:This can't work because a uniform numeric vector cannot hold symbols, so
> I've traced something that is not entirely a bug, but which was a
> little surprise for me. It has to do with the extensions that guile
> provides to the Scheme language -- namely, uniform vectors and arrays.
>
> The (ice-9 match) module offers the syntax
> (match #(1 2 3)
> (#(a b c)
> (list a b c)))
> ;===> (1 2 3)
>
> However, none of the following behaves as one could expect:
> (match #u8(1 2 3)
> (#u8(a b c)
> (list a b c)))
#u8(a b c) cannot be represented in the source code.
If you want generic accessors, I guess the array accessors are what you
want. Patches to extend the pattern matcher to handle arrays are
welcome :)
[Prev in Thread] | Current Thread | [Next in Thread] |