From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,( Date: Thu, 14 Aug 2014 11:19:51 +0200 Message-ID: References: <87y4w9jog8.fsf@drakenvlieg.flower> <874myvudnk.fsf@gnu.org> <87y4vaf3fr.fsf@drakenvlieg.flower> <87a97buix8.fsf@gnu.org> <878ums17q3.fsf@drakenvlieg.flower> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1408008011 17449 80.91.229.3 (14 Aug 2014 09:20:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2014 09:20:11 +0000 (UTC) Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , "guile-user@gnu.org" To: Jan Nieuwenhuizen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Aug 14 11:20:06 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 1XHrCX-0002Qm-Sv for guile-user@m.gmane.org; Thu, 14 Aug 2014 11:20:06 +0200 Original-Received: from localhost ([::1]:52876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHrCX-0007uG-DN for guile-user@m.gmane.org; Thu, 14 Aug 2014 05:20:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHrCN-0007uB-BS for guile-user@gnu.org; Thu, 14 Aug 2014 05:19:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHrCL-0002Kv-2w for guile-user@gnu.org; Thu, 14 Aug 2014 05:19:55 -0400 Original-Received: from mail-vc0-x236.google.com ([2607:f8b0:400c:c03::236]:64085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHrCK-0002Ko-Us; Thu, 14 Aug 2014 05:19:53 -0400 Original-Received: by mail-vc0-f182.google.com with SMTP id hy4so1066739vcb.13 for ; Thu, 14 Aug 2014 02:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zZZgLMFYE20fuJkJ5Z4giPQHpexGFDHy4jkdlUUANRM=; b=J9j+5Bu94s0fl6m5kftlC4N52eKNaLjp40/hHvQE+o7idk6hgRAql3nYHT2mMwy2Oa YrnrF1+akaXKUUCct/VGfP9N7BwAYYMatZrSoYQotbNmPSfzNo5UwCVwrvUPn12xq+dA 9yVCruWzNwpU3fMzV8HorpOENn5ru4fnX2Ww1x3zTqukKJIPHzFxoLTPtt3ORtXMGSiz 429t49mfhxKR1RuTdCpzGFTn8PYaoFNKiQ7sX5z1INLPb5x1DMZagfVg7p9JXJtmWdHO b6MVVPbTO5FGuaDtSxmuscyMXhU+KV1wpJT6T2J+A6zRMAYwb5A5UpNKRiqxgNxjb0ha qwTA== X-Received: by 10.52.35.81 with SMTP id f17mr274243vdj.13.1408007992113; Thu, 14 Aug 2014 02:19:52 -0700 (PDT) Original-Received: by 10.221.66.79 with HTTP; Thu, 14 Aug 2014 02:19:51 -0700 (PDT) In-Reply-To: <878ums17q3.fsf@drakenvlieg.flower> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c03::236 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:11403 Archived-At: 2014-08-13 21:59 GMT+02:00 Jan Nieuwenhuizen : > Ludovic Court=C3=A8s writes: > >> The problem is that SRFI-10 itself does not specify an external >> representation for hash tables, nor does Guile. Thus this patch cannot >> be applied. > > Yes, I understand that...Still, "wouldn't it be nice" if Scheme/Guile > had something that javascript has, in JSON hash tables are "simply" > > {"key0": value, "key1": value} I have been thinking about that issue a lot, and concluded that it wouldn't be "the Scheme way". Scheme already has a nice representation for associactions, namely the assoc lists. However, they are a bit problematic, because they are ordered by nature and hence there's not much one can do with their linear access time. The proper solution, I believe, is to provide some means to create unordered collections (i.e. sets or multisets). Some hints for constructing such collections were given by Daniel Friedman and reminded recently (like 10 years ago ;]) in Guy Steele's talk for Friedman's 60th birthday: http://www.youtube.com/watch?v=3DIHP7P_HlcBk After that, a paper came out which described that idea in greater detail: http://projects.csail.mit.edu/wiki/pub/JoeNear/FernMonad/frons.pdf Anyway, I think it would be nice to provide a notation for unordered collections in Scheme, so that the associations, written as '{(key . value) ...}, could eventually be optimized and perhaps implemented as hash tables internally in some cases.