Re: Naive DEFSYSTEM replacement

"Adam Weaver (as adam at cleversure dot com dot au)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
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?

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?

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&Lambda; 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.  

A.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.