[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: json parser
From: |
Andy Wingo |
Subject: |
Re: json parser |
Date: |
Sat, 28 Aug 2010 16:55:59 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi Corey,
On Thu 01 Apr 2010 18:39, Corey Thomasson <address@hidden> writes:
> I'm new to scheme/guile, but I got tired of writing web pages in
> php/html and started poking around my shared hosts /bin. Turns out
> guile 1.8 is installed, so I got to hacking.
>
> I couldn't find any json parsers that worked with guile, so I hacked
> on together.
>
> I don't know if it works with 1.9x, or how it could be improved
> (though I'm positive it could), or how unidiomatic it is, so any
> comment/advice/criticism/ridicule is welcome.
>
> http://github.com/cthom06/guile-json
Interesting stuff :) Some comments:
* Indentation is non-standard; you should read
http://mumble.net/~campbell/scheme/style.txt. It's a bit
curmudgeonly, but correct.
* Alists would be better for objects, I think, as it's a serializable
data structure; obviously some form of serializable map would be
better, if Guile had them ;)
* Use #:use-module and #:export clauses in your define-module forms.
* In fact a number of your let statements have bad syntax; apologies
that guile 1.8 didn't catch this for you (it would have if the code
were executed). 2.0 would have caught it at expansion time.
There are a few more things. If we were to include this in Guile 2.0
we'd probably use an expansion-time parser/lexer generator, perhaps via
PEG.
Happy hacking,
Andy
--
http://wingolog.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: json parser,
Andy Wingo <=