unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: Marko Rauhamaa <marko@pacujo.net>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(
Date: Thu, 14 Aug 2014 15:58:18 +0200	[thread overview]
Message-ID: <CAMFYt2bud2EPVbXPeApjWD1J=YW8_ou9uHcR8dX27RpseBwQvg@mail.gmail.com> (raw)
In-Reply-To: <877g2bteeu.fsf@elektro.pacujo.net>

2014-08-14 14:59 GMT+02:00 Marko Rauhamaa <marko@pacujo.net>:
> Panicz Maciej Godek <godek.maciek@gmail.com>:
>
>>> I disagree. S-expressions far surpass whatever the others have to offer.
>>
>> You disagree on which point exactly?
>> - that using dictionaries is programmers' daily bread?
>
> No, we are talking about the external representation of hash tables. I'm
> saying the alist format is sufficient to communicate the abstract
> contents of hash tables or any other mapping. You don't need any new
> representation format for hash tables -- or I can't think of a use case.

I agree that it is sufficient. It's just that it isn't handy.
It's more succinct to write

x = {a : 5, b : 10} ...

or

(let ((x '{(a . 5)(b . 10)}))
  ...)

or

(let ((x '((a . 5)(b . 10))))
  ...)

than

(let ((x (alist->hash-table '((a . 5)(b . 10)))))
  ...)

Also, there's less that you (as a programmer) need to memoize, because
otherwise you'd need to check the documentation if it's
alist->hash-table or alist->hash-map or something else. Furthermore,
using alist->hash-table and hash-table->alist adds no value to your
program -- it's there only to optimize lookups, compared to assoc-ref
and assoc-set!, and essentialy has no impact on the semantics of your
program.

(however, weak hash-tables are an exception, because they represent a
concept that wouldn't otherwise be representable using alists)



  reply	other threads:[~2014-08-14 13:58 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y4w9jog8.fsf@drakenvlieg.flower>
2014-07-05 13:40 ` cannot compile: srfi-10 define-reader-ctor 'hash '#,( Ludovic Courtès
2014-07-31  6:27   ` Jan Nieuwenhuizen
2014-07-31 19:15     ` Neil Jerram
2014-08-14 10:27       ` Taylan Ulrich Bayirli/Kammer
2014-08-14 19:42         ` Neil Jerram
2014-08-14 19:54           ` Taylan Ulrich Bayirli/Kammer
2014-08-17 15:08       ` Ludovic Courtès
2014-08-11 15:48     ` Ludovic Courtès
2014-08-13 19:59       ` Jan Nieuwenhuizen
2014-08-13 20:43         ` Marko Rauhamaa
2014-08-13 21:00           ` Jan Nieuwenhuizen
2014-08-13 21:13             ` Ludovic Courtès
2014-08-13 21:33             ` Marko Rauhamaa
2014-08-14  4:03             ` Mark H Weaver
2014-08-13 21:06         ` Ludovic Courtès
2014-08-14  9:19         ` Panicz Maciej Godek
2014-08-14  9:53           ` Marko Rauhamaa
2014-08-14 10:30             ` Panicz Maciej Godek
2014-08-14 10:36               ` Marko Rauhamaa
2014-08-14 10:45                 ` Panicz Maciej Godek
2014-08-14 12:59                   ` Marko Rauhamaa
2014-08-14 13:58                     ` Panicz Maciej Godek [this message]
2014-08-14 11:13                 ` Taylan Ulrich Bayirli/Kammer
2014-08-14 13:17                   ` Marko Rauhamaa
2014-08-14 14:34                     ` Taylan Ulrich Bayirli/Kammer
2014-08-14 17:16                       ` Marko Rauhamaa
2014-08-14 18:28                         ` Taylan Ulrich Bayirli/Kammer
2014-08-14 19:24                           ` Marko Rauhamaa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMFYt2bud2EPVbXPeApjWD1J=YW8_ou9uHcR8dX27RpseBwQvg@mail.gmail.com' \
    --to=godek.maciek@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=ludo@gnu.org \
    --cc=marko@pacujo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).