unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* make-hash-table: Wrong type argument
@ 2008-07-09  8:34 Shakthi Kannan
  2008-07-10  7:35 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Shakthi Kannan @ 2008-07-09  8:34 UTC (permalink / raw)
  To: guile-user

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-10  7:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-09  8:34 make-hash-table: Wrong type argument Shakthi Kannan
2008-07-10  7:35 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).