From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Taylan Ulrich Bayirli/Kammer Newsgroups: gmane.lisp.guile.user Subject: Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,( Date: Thu, 14 Aug 2014 16:34:45 +0200 Message-ID: <87y4urw35m.fsf@taylan.uni.cx> References: <87y4w9jog8.fsf@drakenvlieg.flower> <874myvudnk.fsf@gnu.org> <87y4vaf3fr.fsf@drakenvlieg.flower> <87a97buix8.fsf@gnu.org> <878ums17q3.fsf@drakenvlieg.flower> <874mxfv1m3.fsf@elektro.pacujo.net> <87k36btl1u.fsf@elektro.pacujo.net> <8738czxr1k.fsf@taylan.uni.cx> <8738cztdlv.fsf@elektro.pacujo.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1408026918 881 80.91.229.3 (14 Aug 2014 14:35:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2014 14:35:18 +0000 (UTC) Cc: Ludovic =?utf-8?Q?Court?= =?utf-8?Q?=C3=A8s?= , "guile-user@gnu.org" To: Marko Rauhamaa Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Aug 14 16:35:11 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XHw7S-0005mn-8Y for guile-user@m.gmane.org; Thu, 14 Aug 2014 16:35:10 +0200 Original-Received: from localhost ([::1]:54335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHw7R-0002ih-C0 for guile-user@m.gmane.org; Thu, 14 Aug 2014 10:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHw7A-0002bO-MY for guile-user@gnu.org; Thu, 14 Aug 2014 10:34:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHw79-0004Ar-6C for guile-user@gnu.org; Thu, 14 Aug 2014 10:34:52 -0400 Original-Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:53440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHw78-0004An-U9; Thu, 14 Aug 2014 10:34:51 -0400 Original-Received: by mail-la0-f50.google.com with SMTP id pi18so1187475lab.23 for ; Thu, 14 Aug 2014 07:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=MvwkgWxzEphBVlz8DXXmhAoGmxPFbPTkMAx2Kdvxk2s=; b=qlp1lbivNwJpGw3o0GrP2OTRVMfSfEcOE3opUJ/zigQSn+RkpbWOoNj5c7X2OJ5cjk T92MckiuPuoJBdCGPx/xlf0QyctWjVWf3An476Nc3xzN/OVkf0rZWtbaoeYAuh1664yJ PnffVfcb+FtRbRMJhS9B26LNaybZmP6ZqzCn2zymTuE41Ki/SJT3Ok4pUkjqEwdhP4Jw MXRR2Ua0Sbb4b30Bhj7bARuKd+Czcf+59A46l8jOb6Bj6c8tWcv4CuX/D824Jv9s7bLc 7j3Tq1VtUbjTv9KXYsxQTsEFICF/xINxKZTXFSW4sY/smPvRqSqisWe+VlfdyFDhqk4v ujsg== X-Received: by 10.152.22.135 with SMTP id d7mr4362807laf.80.1408026889667; Thu, 14 Aug 2014 07:34:49 -0700 (PDT) Original-Received: from taylan.uni.cx (p200300514A44E2820213E8FFFEED36FB.dip0.t-ipconnect.de. [2003:51:4a44:e282:213:e8ff:feed:36fb]) by mx.google.com with ESMTPSA id e4sm8153697lbc.29.2014.08.14.07.34.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Aug 2014 07:34:49 -0700 (PDT) In-Reply-To: <8738cztdlv.fsf@elektro.pacujo.net> (Marko Rauhamaa's message of "Thu, 14 Aug 2014 16:17:16 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11413 Archived-At: Marko Rauhamaa writes: > A hash table is an optimized, internal lookup object. It is not a > meaningful representation format. An AVL tree and a hash table should > have identical external representations in almost all cases. Thus, my > implementation would have to make the translation on input anyway. If your program cares about specialized data structures like that then yes, but often one just wants a generic "dictionary" type with O(1) lookup, whatever the details. Though when I think of it, often I would be fine with O(n) too and could use alists in my code to begin with. As I said, I just think it's a minor annoyance, not having a "go to" dictionary type that covers 90% of use cases and can be serialized as well. Typos in keys is a bigger problem; having the compiler tell me I mistyped the name of an accessor is much better than having an exception thrown somewhere, sometime, and having to debug a little until I find out it was just a typo! Hence input-time validation is generally the way to go IMO. (Or maybe the relative difficulty of debugging Objective-C, the language I have to use at work, is making me biased.) > PS Speaking of AVL trees, my AVL tree implementation is bitten by the > apparent lack of a numeric object identifier in guile. Python has the > id() function that can be used to sort interned objects effectively. There is (pointer-address (object-pointer )) if that helps. (Nonstandard Scheme of course.) Taylan