From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: Re: Display on guile Date: Thu, 5 Mar 2009 08:47:11 -0600 Message-ID: <3ae3aa420903050647y1d65d4ecqc6aaced871d7c963@mail.gmail.com> References: <00163646c1e6e017c404645aa0f2@google.com> Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1236264459 13964 80.91.229.12 (5 Mar 2009 14:47:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2009 14:47:39 +0000 (UTC) Cc: guile-user@gnu.org To: for.pdv@gmail.com Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Mar 05 15:48:56 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LfEsZ-0007Im-Gl for guile-user@m.gmane.org; Thu, 05 Mar 2009 15:48:55 +0100 Original-Received: from localhost ([127.0.0.1]:48145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfErE-0002jM-58 for guile-user@m.gmane.org; Thu, 05 Mar 2009 09:47:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LfEqw-0002fm-Lq for guile-user@gnu.org; Thu, 05 Mar 2009 09:47:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LfEqu-0002bo-SS for guile-user@gnu.org; Thu, 05 Mar 2009 09:47:14 -0500 Original-Received: from [199.232.76.173] (port=42029 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfEqu-0002bY-Nl for guile-user@gnu.org; Thu, 05 Mar 2009 09:47:12 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.244]:12154) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LfEqu-0000mc-C5 for guile-user@gnu.org; Thu, 05 Mar 2009 09:47:12 -0500 Original-Received: by an-out-0708.google.com with SMTP id b6so2240396ana.21 for ; Thu, 05 Mar 2009 06:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=zu/qzC2NAcC2jyI1NUzCZqBIjhrgLD6AdUw+6veU+So=; b=wTxVOgEtgzT4S4G8phsDC411cHOpDbkzLMEpfVq1OEsdLMc+SlIig/vYqzNaGfbD+S Ox1QNf3Gy8mKIlWC49ujEPBYiRn6MKEV3xA7w/rw/BPK6yKLJ3eMpsyIcFhkzY9IwvW2 YU8x0j6z/0L0Kr6Cd+6mLFKICblZgnpm+1l/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=WHgSxpzyYl/QjfhjsNDmi0ZIV//+5lEXcXmbgKg15j/QZ+zlYEBBuJkCcwg/Fwr4IB BHJWYv1A9/2l2vw2zaUVcjQyvTzVikKVwRRE6ooWCQOBvSHP+wp2y0e7CyS1Lb0xYT79 EH1fSpkFHJYJsBtpNHwKihEwadgfN+DCji5MM= Original-Received: by 10.100.107.3 with SMTP id f3mr903279anc.92.1236264431845; Thu, 05 Mar 2009 06:47:11 -0800 (PST) In-Reply-To: <00163646c1e6e017c404645aa0f2@google.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7164 Archived-At: 2009/3/5 : > hi Group, > > I executed these commands.. > > $ guile > guile> (define mc (cons 'a 'b)) > guile> mc > (a . b) > guile> (define ml (list 1 2 mc)) > guile> ml > (1 2 (a . b)) > guile> (list mc 1 2 3) > ((a . b) 1 2 3) > guile> (define mh (make-hash-table 2)) > guile> (hashq-create-handle! mh 'one mc) > (one a . b) > guile> (hashq-create-handle! mh 'two ml) > (two 1 2 (a . b)) > guile> mh > #(((two 1 2 (a . b)) (one a . b)) ()) > guile> (use-modules (ice-9 pretty-print)) > guile> (pretty-print mh) > #(((two 1 2 (a . b)) (one a . b)) ()) > guile> > > I was expecting handle:'one of hash:mh to be printed in parens as > #(((two 1 2 (a . b)) (one (a . b))) ()) According to your logic, you must have also been expecting #(((two (1 2 (a . b))) (one (a . b))) ()) which is not what you wrote. > Why is behaviour of print for a hash different from others? > Am I missing anything? When I read the documentation, I see: Return the (key . value) pair for key in the given hash table. If key is not in table then create an entry for it with init as the value, and return that pair. Notice the dot between key and value, which means that hashq-create-handle! behaves like cons, and not like list; from your mail, it seems that you were expecting it to behave like list. --linas