Re: Naive DEFSYSTEM replacement
"Marco Antoniotti (as marco dot antoniotti at unimib dot it)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <CAG0Nw2kCtCUe8nQVKt=yjxvyWpD-s276dL2325R6Mjav0SJ4xA@mail.gmail.com> |
On Mon, Jul 28, 2025 at 1:39 AM Adam Weaver <[email protected]> wrote: > On Sun, 2025-07-27 at 15:13 +0200, Marco Antoniotti wrote: > > > > > > Well it generates what I think it should ... > > > > > > CL-USER> (riskmate::>box) > > > "<div class=\"box\"></div>" > > > CL-USER> > > > > > > ... what did *you* think it would generate? > > > > > > > > > > > > A proper object with a proper and well controlled PRINT-OBJECT > > method 😏 (controlled by the printer's parameters and others as > > well). > > > > Thanks Marco. That makes sense, as long as I'm right in guessing that > you're using XHTML's output for later frobbing? > Yep. Me, I'm only generating HTML just-in-time for returning via FastCGI > responder to the web server to the end browser. > > Originally I wrote a HTTP/1.1 web server, but when I realised how much > work it'd be to upgrade to HTTP2 and HTTP3, I decided to write a > FastCGI responder instead, and use an established web server (nginx or > caddy for example), and let that one handle SSL and the newer HTTP > variants. > > Yet another reason to love LW, COMM:START-UP-SERVER makes writing > internet services *just*so*easy* ! > > > > CL-USER 6 > (<:div (:class "box" :id 42) (<:p () "Foo")) ; You can > > write whatever functions you want (*) > > <div class="box" id="42"><p>Foo</p></div> > > > > CL-USER 7 > (describe *) > > > > <div class="box" id="42"><p>Foo</p></div> is an > > IT.UNIMIB.DISCO.MA.XHTMLAMBDA::ELEMENT > > TAG IT.UNIMIB.DISCO.MA.XHTMLAMBDA:DIV > > ATTRIBUTES ("class" "box" "id" 42) > > CONTENT (<p>Foo</p>) > > > > CL-USER 8 > > > > > So I'm guessing the value here to you, is that you can pass your > XHTMLAMBDA::ELEMENT object to other functions for munging in some way? > Yep again. I get that, and it's a cool idea, if that's a thing you do. Like if you > wrote a cold-start documentation generator for example? Just an idea :) > > I chose differently, because I'm just using HTML only as the "final > mile" - what's being delivered to the browser, and not as an > intermediate storage of state. > > No point in using an intermediate object model, because I'd only be > throwing it away instantly as I generated string HTML. > > *Functions* (procedures) are the engines of state, here, so my client > code creates HTML output by calling functions to create the HTML > interfaces. > > Like this sort of crap ... > > (defun >client-contacts-card-page (client) > (>column :gap t :content > (html > (:div (:id "contacts") (>client-info-card client)) > (:div (:id "notes") (>client-notes-card client)) > (:div (:id "policies") (>client-policies-card client))))) > > ... > > > > > > > (*) Now for the second shameless plug of the day: here is where > > (X)HTMΛ is used: https://helambdap.sf.net > > That's pretty cool. Reads like you wanted that code walker too, what > with the READing of unloaded and uninterned symbols. READing is a problem in fact; things that happen when reader errors (unknown package) are not standardized. I have been toying with the idea of using Eclector ( https://github.com/s-expressionists/Eclector), but did not have time. And yes. I wanted CLAST (https://clast.sf.net), but for a different reason :) It's because I am CLAZY (https://git.common-lisp.net/clazy/clazy) 😏 Cheers MA -- Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01 DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY REGAINS: https://regains.disco.unimib.it/