mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#macros

0 posts0 participants0 posts today

SSS 🐂 (The Supreme Sexp System) proudly announces version v2.3.23 of the project:

codeberg.org/jjba23/sss

It brings stability fixes and small improvements, to #hyprland and #labwc configurations, as well as the ability to turn #emacs #lisp #keyboard #macros into clean persistent code that can be bound to keys.

SSS is a Lisp machine adventure with #gnu #linux #guix where #hacking culture is celebrated.

Can you get enough Emacs really ?

My small overview of "JRM’s Syntax-rules Primer for the Merely Eccentric" paper about Scheme macros and useful tricks for writing them. Difficulty: medium-easy.

mpv youtu.be/A2vi3vQ15kM

Paper:
- phyast.pitt.edu/~micheles/synt
- hipster.home.xs4all.nl/lib/sch

Spoiler: at the end of the paper a minimal scheme evaluator implemented purely with macros.

Today I learned that Racket and Guile represent syntax objects for lists differently.

I don't know yet which one I prefer, because in Guile `syntax` not always returns a syntax-object as one could expect, sometimes it returns a list.

(use-modules (system syntax))
(syntax? (syntax (+ 3 4))) ;; => #f
(syntax? (syntax hi)) ;; => #t

On the other hand TSPL4 book says that #'(+ 3 4) returns a valid list.

Who read RnRS? What does it say for this case?

We use scalasql at work (yes, I'd recommend) and we had a bug where we mistakenly created nested transactions (which scalasql doesn't support -- but it does support savepoints).

Anyway, we found a clever way to statically prevent nesting transactions using macros, which I thought I'd share as an illustration of the helpfulness of macros
gist.github.com/aboisvert/c716

GistIllustration of using Scala macro to statically prevent nested transactions using the scalasql libraryIllustration of using Scala macro to statically prevent nested transactions using the scalasql library - preventNestedTransaction.scala