From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: How do I really do this? Date: 06 Mar 2004 18:00:08 +0000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <85ad2tkg9j.fsf@ossau.uklinux.net> References: <40466FAF.3A286BB0@veritas.com> <85hdx2rwyr.fsf@ossau.uklinux.net> <404A0DD0.C024CC4@veritas.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1078952274 32115 80.91.224.253 (10 Mar 2004 20:57:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Mar 2004 20:57:54 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Mar 10 21:57:36 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B1Alk-00087D-00 for ; Wed, 10 Mar 2004 21:57:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B1AkB-0007hF-An for guile-devel@m.gmane.org; Wed, 10 Mar 2004 15:55:59 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1Azg9G-0003tg-1i for guile-devel@gnu.org; Sat, 06 Mar 2004 13:03:42 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1Azg8i-0003iW-Re for guile-devel@gnu.org; Sat, 06 Mar 2004 13:03:39 -0500 Original-Received: from [80.84.72.14] (helo=mail2.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.30) id 1Azg8i-0003iS-Dp for guile-devel@gnu.org; Sat, 06 Mar 2004 13:03:08 -0500 Original-Received: from laruns.ossau.uklinux.net (unknown [213.78.71.231]) by mail2.uklinux.net (Postfix) with ESMTP id 038D040A00B; Sat, 6 Mar 2004 18:03:03 +0000 (UTC) Original-Received: by laruns.ossau.uklinux.net (Postfix, from userid 1002) id 4252A77654; Sat, 6 Mar 2004 18:00:09 +0000 (GMT) Original-To: Bruce Korb In-Reply-To: <404A0DD0.C024CC4@veritas.com> Original-Lines: 87 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3494 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3494 Bruce Korb writes: > How do I get a hash table started? I've grepped throught he > ice-9 code and I'm sure something's in there. But looking at > code around 'hash-create' and 'hashq-create' or even just "hash" > didn't yield anything that worked. I guess I just need something > really explicit, like: > > (define my-hash-table (hash-table-create)) > > except that doesn't work. What does? The procedure you want is `make-hash-table': guile> (help make-hash-table) `make-hash-table' is a primitive procedure in the (guile) module. - Scheme Procedure: make-hash-table [n] Make a hash table with optional minimum number of buckets N Note also that you might have found this using `apropos': guile> (apropos "hash") (guile): hashq # (guile): hashv # (guile): hash # (guile): make-hash-table # (guile): make-weak-key-hash-table # (guile): make-weak-value-hash-table # (guile): make-doubly-weak-hash-table # (guile): hash-table? # (guile): weak-key-hash-table? # (guile): weak-value-hash-table? # (guile): doubly-weak-hash-table? # (guile): hash-clear! # (guile): hashq-get-handle # (guile): hashq-create-handle! # (guile): hashq-ref # (guile): hashq-set! # (guile): hashq-remove! # (guile): hashv-get-handle # (guile): hashv-create-handle! # (guile): hashv-ref # (guile): hashv-set! # (guile): hashv-remove! # (guile): hash-get-handle # (guile): hash-create-handle! # (guile): hash-ref # (guile): hash-set! # (guile): hash-remove! # (guile): hashx-get-handle # (guile): hashx-create-handle! # (guile): hashx-ref # (guile): hashx-set! # (guile): hash-fold # (guile): hash-for-each # (guile): hash-for-each-handle # (guile): hash-map->list #list> (guile): symbol-hash # (guile): read-hash-procedures (guile): read-hash-extend # (guile): source-whash > OK. This works: > > (define sym-name (value-function)) > > So, why doesn't this: > > (define (string->symbol "sym-name") (val-func)) Because this is the syntax for defining a procedure, and needs to be one of: (define (string->symbol) ...) (define (string->symbol ARG1 ...) ...) (define (string->symbol . ARGS) ...) where all the ARGs must be symbols (not strings). Also, string->symbol is already defined, so why are you trying to redefine it? Perhaps you're not trying to redefine it? In which case, I still don't understand what you are trying to do. Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel