mastodon warning! may contain trace amounts of Lisp

LISP

Table of Contents

1. obligatory polemics

2. miscellanea

3. loop decreasing

(loop for x from 3 downto 1 do (print x))

3 
2 
1

4. stumpwm

5. structs

(defstruct lemma meaning singular plural)

(lemma-meaning
  (read-from-string
    (prin1-to-string
      (make-lemma :meaning "ἵππος" :singular "horse" :plural "horses"))))

6. persistence

7. graphviz

Generating .dot files
s-dot2 (on quicklisp), a slightly massaged version of s-dot 1.3.
An example:
(s-dot:s-dot->dot t '(:graph ((:rankdir "LR"))
  (:node ((:id "a") (:label ":node1") (:fontsize "9") (:fontname "Arial")))
  (:node ((:id "b") (:label ":node2") (:fontsize "9") (:fontname "Arial")))
  (:node ((:id "c") (:label ":node3") (:fontsize "9") (:fontname "Arial")))
  (:node ((:id "d") (:label ":node4") (:fontsize "9") (:fontname "Arial")))
  (:edge ((:from "a") (:to "b") (:fontname "Arial") (:fontsize "9") (:label "edge1")))
  (:edge ((:from "a") (:to "c") (:fontname "Arial") (:fontsize "9") (:label "edge2")))
  (:edge ((:from "b") (:to "c") (:fontname "Arial") (:fontsize "9") (:label "edge3")))
  (:edge ((:from "b") (:to "d") (:fontname "Arial") (:fontsize "9") (:label "edge4")))
  (:edge ((:from "c") (:to "d") (:fontname "Arial") (:fontsize "9") (:label "edge5")))))

Result:

digraph g {compound="true"; bgcolor=""; fontcolor=""; fontname="";
fontsize=""; label=""; margin=""; nodesep=""; rankdir="LR";
ranksep=""; ratio=""; size=""; node[label=":node1", color="",
fillcolor="", fixedsize="", fontcolor="", fontname="Arial",
fontsize="9", height="", shape="", style="", width="", ] {"a"};
node[label=":node2", color="", fillcolor="", fixedsize="",
fontcolor="", fontname="Arial", fontsize="9", height="", shape="",
style="", width="", ] {"b"}; node[label=":node3", color="",
fillcolor="", fixedsize="", fontcolor="", fontname="Arial",
fontsize="9", height="", shape="", style="", width="", ] {"c"};
node[label=":node4", color="", fillcolor="", fixedsize="",
fontcolor="", fontname="Arial", fontsize="9", height="", shape="",
style="", width="", ] {"d"}; edge[arrowhead="", arrowsize="",
arrowtail="", color="", constraint="", decorate="", dir="",
fontcolor="", fontname="Arial", fontsize="9", headlabel="",
headport="", label="edge1", labeldistance="", labelfloat="",
labelfontcolor="", labelfontname="", labelfontsize="", minlen="",
style="", samehead="", sametail="", taillabel="", tailport="",
lhead="", ltail=""]"a" -> "b"; edge[arrowhead="", arrowsize="",
arrowtail="", color="", constraint="", decorate="", dir="",
fontcolor="", fontname="Arial", fontsize="9", headlabel="",
headport="", label="edge2", labeldistance="", labelfloat="",
labelfontcolor="", labelfontname="", labelfontsize="", minlen="",
style="", samehead="", sametail="", taillabel="", tailport="",
lhead="", ltail=""]"a" -> "c"; edge[arrowhead="", arrowsize="",
arrowtail="", color="", constraint="", decorate="", dir="",
fontcolor="", fontname="Arial", fontsize="9", headlabel="",
headport="", label="edge3", labeldistance="", labelfloat="",
labelfontcolor="", labelfontname="", labelfontsize="", minlen="",
style="", samehead="", sametail="", taillabel="", tailport="",
lhead="", ltail=""]"b" -> "c"; edge[arrowhead="", arrowsize="",
arrowtail="", color="", constraint="", decorate="", dir="",
fontcolor="", fontname="Arial", fontsize="9", headlabel="",
headport="", label="edge4", labeldistance="", labelfloat="",
labelfontcolor="", labelfontname="", labelfontsize="", minlen="",
style="", samehead="", sametail="", taillabel="", tailport="",
lhead="", ltail=""]"b" -> "d"; edge[arrowhead="", arrowsize="",
arrowtail="", color="", constraint="", decorate="", dir="",
fontcolor="", fontname="Arial", fontsize="9", headlabel="",
headport="", label="edge5", labeldistance="", labelfloat="",
labelfontcolor="", labelfontname="", labelfontsize="", minlen="",
style="", samehead="", sametail="", taillabel="", tailport="",
lhead="", ltail=""]"c" -> "d"; }

Still needs to be parsed by graphviz.


· © Edgard Bikelis (eſb) created using Emacs 29.0.50 (Org mode 9.5.3) ·
· created: 2017-11-20 last modified: 2022-07-18 ·