bug-guile
[Top][All Lists]
Advanced

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

bug#24155: SRFI-10: Example from the manual fails to execute.


From: Mathieu Lirzin
Subject: bug#24155: SRFI-10: Example from the manual fails to execute.
Date: Fri, 05 Aug 2016 03:19:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hello,

The following example from the Guile manual in subsection 7.5.9, fails
for me both on Guile master 2.1.3.94-1a1c3 and Guile 2.0.11 from Debian
Testing.

--8<---------------cut here---------------start------------->8---
     (use-modules (srfi srfi-10))

     (define-reader-ctor 'hash
       (lambda elems
         (let ((table (make-hash-table)))
           (for-each (lambda (elem)
                       (apply hash-set! table elem))
                     elems)
           table)))

     (define (animal->family animal)
       (hash-ref '#,(hash ("tiger" "cat")
                          ("lion"  "cat")
                          ("wolf"  "dog"))
                 animal))
--8<---------------cut here---------------end--------------->8---

The error is:

--8<---------------cut here---------------start------------->8---
While compiling expression:
ERROR: build-constant-store: unrecognized object #<hash-table 1c52c80 3/31>
--8<---------------cut here---------------end--------------->8---

Thanks,

-- 
Mathieu Lirzin





reply via email to

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