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 10:20 +0200, Marco Antoniotti wrote:
>
> HTML generation?
>
> Shameless plug: https://gitlab.common-lisp.net/xhtmlambda/XHTMLambda
> and https://xhtmlambda.common-lisp.dev/
>
Isn't that the real curse of common lisp? Everyone invents their own
solution to a problem rather than work on someone else' codebase?
My solution is --sort-of-- similar to XHTMA but about 1,000 lines
shorter.
(defun >box (&key title rhs secondary padded id content)
(html
(:div (:class "box" :class secondary :class padded :id id)
(when title (html (>inline :between t :class "box-title")
(:span () title) rhs))
content)))
has a few syntactical borrowings from Rich Hickey's SVELTE language.
A ":class secondary" attribute renders "class='secondary'" into the
class list iff the free variable SECONDARY in the caller is true. and
":id id" renders as attribute id="value of id here" iff ID is non-nil.
> Having said that, the main answers to your hack are that: (1) works
> for you (not necessarily me, who is notorious for his very advanced
> NIH syndrome),
Oh samesies. I honestly try to use TP libraries, but they never work
the way I quite want them to. So I end up shaving some yaks and writing
my own.
> (2) it is LW only,
Well, so much of my codebase is LW only that the {ASDF|LW|MK}:DEFSYSTEM
part is literally the smallest part.
> and (3) it does not do what all the defsystems do.
Yeah. I'm still not clear on *what*it*is*that*real*defsystems* do.
There was a weak argument about running test loaders... really? There's
got to be more to it to warrant multiple thousands of lines of code.
And your one MK:DEFSYSTEM looked to have some chrome around calling a
c-compiler and linking. That's nice, and would be really handy next
time I have to write a little C glue library. But Lispworks' FLI:* is
so advanced that I haven't actually needed a shim yet :)
But I've given up on getting a real answer here.
I **miss** usenet. If I'd posted something like this to c.l.l back in
the day, I would've had Kenny screaming something about cells and PC
providing an 8,000 line CLOS hack, and PB coming up with something very
elegant and very French that didn't really solve the problem but was
oh-so-elegant anyway.
A.
PS I wonder what happened to Mr Tilton. About a decade after c.l.l
died, when Facebook announced their "React" technology, I had a shiver
down my back - "oh crap so THAT's what Kenny was raving about years and
years ago. He was right".
I'd really like a reactive CAPI interface; if I ever do need some CAPI
love I'll probably shave a herd of yaks to implement a reactive front-
end on it first. Bad, bad use of my time.
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html