[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Trivial error: Error: call of non-procedure: #<unspecifi
From: |
mfv |
Subject: |
[Chicken-users] Trivial error: Error: call of non-procedure: #<unspecified> |
Date: |
Sat, 4 Jan 2014 18:28:01 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi folks (and a great new year!),
I have a small but trivial problem I can not get around.
When loading
(define lcd '((#(0 0 0) ("Wooden Whale" "Beorold" "Korgal") "Leif") (#(1 0
0)) (#(2 0 0) "Jerome" "Azog" ("Diamond Princess")) (#(3 0 0))))
into a hash-table via
;; using hash tables
(use srfi-69)
(define unitlocs (make-hash-table))
;; load the stuff with a func
(define (fill-unitlocs alist)
(cond ((= (length alist) 0)
(print "Loading finished: " (length alist) ) )
(else (
(hash-table-set! unitlocs (car (car alist)) (cdr (car
alist)))
(fill-unitlocs (cdr alist))))))
I get the following error:
Error: call of non-procedure: #<unspecified>
Call history:
<eval> [fill-unitlocs] (fill-unitlocs (cdr alist))
<eval> [fill-unitlocs] (cdr alist)
<eval> [fill-unitlocs] (= (length alist) 0)
<eval> [fill-unitlocs] (length alist)
<eval> [fill-unitlocs] ((hash-table-set! unitlocs (car (car
alist)) (cdr (car alist))) (fill-unitlocs (cdr alist)))
<eval> [fill-unitlocs] (hash-table-set! unitlocs (car (car
alist)) (cdr (car alist)))
<eval> [fill-unitlocs] (car (car alist))
<eval> [fill-unitlocs] (car alist)
<eval> [fill-unitlocs] (cdr (car alist))
<eval> [fill-unitlocs] (car alist)
<eval> [fill-unitlocs] (fill-unitlocs (cdr alist))
<eval> [fill-unitlocs] (cdr alist)
<eval> [fill-unitlocs] (= (length alist) 0)
<eval> [fill-unitlocs] (length alist)
<eval> [fill-unitlocs] (print "Loading finished: " (length
alist))
<eval> [fill-unitlocs] (length alist) <--
Loading finished: 0
Now, after getting a bit smarter with google/chicken wiki it seems that
there is a paranthesis call too much in the whole thing. But I can't find.
Note that I know that
(define unitlocs (alist->hash-table lcd))
would solve the hassle - but I would like to know what I did wrong.. &$*#$(/
Cheers,
mfv
- [Chicken-users] Trivial error: Error: call of non-procedure: #<unspecified>,
mfv <=