[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/3] Add CommonMark reader
From: |
Arun Isaac |
Subject: |
Re: [PATCH 0/3] Add CommonMark reader |
Date: |
Thu, 29 Feb 2024 00:40:04 +0000 |
>>> BTW, I figured the fact that readers emit code as sexps is pretty bad:
>>> it’s an additional layer that makes things more brittle and less
>>> efficient, because we need to pass that sexp through ‘eval’, and there
>>> could well be undefined variables and the likes. It would be more
>>> natural for readers to return a <document> object.
>>
>> I definitely agree. One of many dated decisions in skribilo for
>> sure. Could you describe what this <document> object should be
>> like?—what fields it should have, etc. Might come in handy if I or
>> someone else works on it later.
>
> I mean that <document> object as already defined in (skribilo ast).
>
> Concretely, instead of returning '(document …), readers would use
> (skribilo packages base) & co. and directly call the ‘document’
> procedure and its friends.
>
> That will require changing the section about the outline reader that
> shows the outline-to-sexp translation. tests/readers/* will also have
> to be adjusted to deal with ASTs instead of sexps; perhaps a
> ‘document->sexp’ procedure (ironically) can make that easier.
Thanks, I'll keep that in mind! Also happy if someone reading this
contributes patches!