The problem: function-a takes the same arguments as function-b. In fact, function-a calls function-b. Without too much synchronized updating of the function signatures, I want (doc function-a) to show me the same argument lists as (doc function-b). The solution: Use :arglists in the metadata of the function. (defn function-b [{:keys [a b c]}] (println a b c)) (defn function-a {:arglists '([{:keys [a b c]}])} [args] (function-b args)) That’s the TL;DR. Read on for some rationale, and for some nerdy diving into the worlds of static and dynamic analysis.
Läs mer »I have been enjoying learning some Rust and some Macroquad game development via Olle Wreede’s tutorial (Swedish only so far, sorry!). When I sent some pull requests towards the tutorial I lacked a deployed version attached to the PR. I decided to add that, and my goto for such things is Netlify. However, the tutorial is authored with mdBook, and there doesn’t seem to be a straightforward way to get Netlify to build this.
Läs mer »Clojure has a lot of things going for it. To name just a few: Functional programming is the default. Clojure makes it easy to keep data immutable. The language is small and simple, and the programs you create stay smaller and simpler than with most programming language environments. Still, perhaps Clojure’s super power is Interactive Programming. I.e. using the REPL to connect to, inspect, and modify the running program as you are developing it.
Läs mer »
Visual Studio
Code has a command for stringing multiple commands together:
runCommands
. It’s designed to be used from keyboard
shortcuts. Here’s an example:
One of the great usages I get from generative AI is to use it for checking that my messages come across as I want them to do. ChatGPT, Midjourney and their likes are trained from vast amounts of human communication. To note how they interpret something gets to be a measure on how it would be received by fellow human travelers. At least I contend it is so. Additionally I can “carve out”, with pretty good precision, the specific target group I want to reach with my article, picture, video, email, or whatnot.
Läs mer »In ImageMagick + Pango + Babashka = ❤️ I told you about the Docker image cospaia/magick+pango+babashka, and that it allows for using Pango markup with ImageMagick locally as well as in CI. I also told you that I haven’t succeeded to install ImageMagic with Pango support on my Mac. Since I wrote that I have tried to figure it out, and when compiling ImageMagick from source failed in some opaque way, all too early in the make, I almost threw in the towel.
Läs mer »If you want to conveniently compose pictures and text programmatically you may want to have a look at ImageMagick. Especially when powered by Pango markup. The markup is SGML and the resulting text line breaks and flows automatically. It gets quite a lot easier to lay your text out this way, than to use ImageMagic’s built in text facilities. And some things do not only get easier, they become possible.
Läs mer »Here’s how I created a fully automated, weekly newsletter using only RSS, Buttondown, and Google Sheets. Full source code included! I run a hobby project (Cospaia, mostly in Swedish, but it’s not important for this article) together with some friends. We wanted a weekly automated newsletter. When figuring out how to do this, I compared it to a commercial project I’m involved with, where we use Netlify Forms and Mailchimp, with Zapier as glue.
Läs mer »Some 20 years ago I worked at a startup with a CEO who liked to cook up various tricks to make potential customers think we were further ahead than we were. I complained that he was setting us and the customers up for failure. I suggested that at the next meeting we should be completely open and honest about what they would buy into. We could leverage it, even. We could tell the customers about the big opportunity to be part of, and shape, our journey.
Läs mer »Are you bent out of shape by obscure emails? Do text walls on the intranet rub you the wrong way? Are you looking for the exit when the CFO pulls slide after slide with nothing but misplaced participles and spelling errors. I’m sorry if I got you revved up. Relax, take a deep breath and read on. Get a load of this: hasNoNoNotAdjs(...) If you think the above is from the popular 90-ies song “No Limit” you’re barking up the wrong tree.
Läs mer »