Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Neil Van Dyke
Thomas Lynch wrote on 07/29/2015 11:22 PM: The most obvious difference between racket's xexpr and yours is the '@' as the head of the attributes list. Any idea where else I will see divergences? You might not be able to implement a tool that works correctly with all conforming SXML, until

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Thomas Lynch
On Thu, Jul 30, 2015 at 11:09 AM, Thomas Lynch < thomas.ly...@reasoningtechnology.com> wrote: > Great! thanks Neil! > Ah spoke too soon! Those links just point back into this very same thread! The most obvious difference between racket's xexpr and yours is the '@' as the head of the attributes

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Thomas Lynch
Great! thanks Neil! On Thu, Jul 30, 2015 at 11:02 AM, Neil Van Dyke wrote: > Thomas Lynch wrote on 07/29/2015 10:25 PM: > >> Neil can you comment on what other differences I might expect to find? >> > > Are the below 2 messages to the list helpful? > > * Historical background on SXML and Racket

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Neil Van Dyke
Thomas Lynch wrote on 07/29/2015 10:25 PM: Neil can you comment on what other differences I might expect to find? Are the below 2 messages to the list helpful? * Historical background on SXML and Racket xexpr: https://groups.google.com/d/msg/racket-users/yaOtPkd_qvs/8ruIg-Smr7cJ * Technical n

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Thomas Lynch
Alexander, you will notice I pulled a couple lambdas to the top, and added a test routine at the bottom take those out ... then the code you sent isn't shorter. I am also expecting to have to add more code to the intermediate points. I like seeing those named. I think it is easy to read. ... Wh

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Thomas Lynch
.. the conversion for neil's xexpr .. at this point the two converters can be abstracted by passing in two lambdas, is-at-list predicate, and extract-at-list. Neil can you comment on what other differences I might expect to find? (define (neil-xexpr->tok-tree an-xexpr) (define (is-at-list

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Alexander D. Knauth
Would it be easier using match? (define (xexpr->tok-tree an-xexpr) (match as-xexpr ['() '()] [(not (cons _ _)) (tok-make ...)] [(list tag) (list tag)] [(list-rest tag (? is-at-list at-list) r2) ] )) On Jul 29, 2015, at 7:56 AM, Thomas Lynch wrot

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Thomas Lynch
I wrote primitive conversion routines to bring the xexpr or Neil's xexpr into ... oh gosh, my parser token format, which by coincidence is very close. Just playing with this now .. In my target format token children are always other tokens. All values given as attributes in value tokens. I use an

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-28 Thread Matthew Butterick
Yes, more or less. In an X-expression, an attribute list is the only element that's a list made of sublists. A list of embedded X-expressions, OTOH, will start with a symbol. To look at it another way, > (cons symbol (list xexpr ...)) really amounts to > (list symbol xexpr ...) which is just