guile-user
[Top][All Lists]
Advanced

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

make-hash-table: Wrong type argument


From: Shakthi Kannan
Subject: make-hash-table: Wrong type argument
Date: Wed, 9 Jul 2008 14:04:02 +0530

Hi,

Newbie here. I am trying to pass key/value to a procedure to add it to
the hash-table. It fails at:

"you"ERROR: In procedure hash_fn_create_handle_x:
ERROR: Wrong type argument in position 1: "foo"

=== BEGIN ===

#!/usr/local/bin/guile -s
-e main -s
!#
(use-modules (ice-9 rdelim))

(define make-dictionary
  (lambda (name size)
    (lambda ()
      (define name (make-hash-table size)))))

(define add-to-dictionary
  (lambda (table key value)
      (write value)
      (hash-set! table key value)))

(define (main args)
     (make-dictionary "foo" 4)
    (add-to-dictionary "foo" 'u "you")
    )

=== END ===

What am I missing? Is this abstraction ok?

Thanks!

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com




reply via email to

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