Jan Nieuwenhuizen <jann...@gnu.org> skribis: > Ludovic Courtès 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}
Yes, it would. But the beauty of Scheme is that the language can be extended to support that, like with the ‘hash-table’ macro suggested at <http://lists.gnu.org/archive/html/guile-user/2014-07/msg00009.html>. > and although that's in some way much uncooler and restricted and set-in > stone wrt Scheme readers and SRFI-10...you *are* able to stream and > communicate objects over ascii/utf-8, unlike #,(hash ... If the goal is to serialize/unserialize things, then the best option is to devise an external representation, say: (hash-table (key0 value0) ...) And then have ‘read-hash-table’ and ‘write-hash-table’ procedures (rather than pass arbitrary sexps read from the wire to ‘eval’.) > Here we are with a unimaginable cool srfi-10 reader extension, but we > cannot really use it to communicate. SRFI-10 is cool to reduce typing, but I’m not convinced it really helps here. Ludo’.