Lisp

1. Common Lisp   cl

ID: af0ed8bb-4b45-42f9-b8be-82b8ea7935a3
CREATED: <2025-02-16 Sun 20:04>

[2025-01-17 Fri 15:49] Common Lisp [2025-01-17 Fri 19:19] common-lisp-libraries [2025-02-13 Thu 22:42] CL ANSI Standard Draft [2025-02-13 Thu 22:43] CLHS: Starting Points [2025-03-07 Fri 09:56] quotes

1.1. Syntax

ID: df41336d-5185-4047-9644-e25925529f08
CREATED: <2025-02-25 Tue 16:05>

1.1.1. common-lisp unicode support

ID: db68087d-cc4c-462d-b4e0-bbda756dc37c
CREATED: <2025-03-03 Mon 14:53>
  • State "NOTE" from [2023-10-20 Fri 01:11]
(defmacro λ (&rest symbols-and-expr)
  `(lambda ,(butlast symbols-and-expr)
     ,@(last symbols-and-expr)))

(mapcar (λ x (* x x)) '(1 2 3 4))

;; other tremendously useful characters:
'|αβγδεζηθικλμνξοπρστυϕχψω|
'|ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥϕΧΨΩ|
'|ℝℕℤℚ∥√∡∞∝ℵ∅∫|
'|¬∀∃∨∧⊥∈⊂∪∩⇐⇔⇒↦|

1.2. CLOS

ID: 8bc4ff14-f001-4515-ac1f-fd59ef8ef506
CREATED: <2025-02-07 Fri 20:59>

[2025-02-07 Fri 21:00] Fundamentals of CLOS [2025-02-07 Fri 21:01] Object Reorientation: Generic Functions [2025-02-07 Fri 21:02] CLHS: Chapter 7 [2025-03-03 Mon 14:03] <- EIEIO

1.2.1. Method Combination

ID: 4e7b8135-3d53-4739-9a72-563971a5b876
CREATED: <2025-01-17 Fri 19:19>

[2025-02-07 Fri 21:00] 28.1.7.2. Standard Method Combination [2025-02-07 Fri 21:06] 28.1.7.3. Declarative Method Combination [2025-02-07 Fri 21:05] 28.1.7.4. Built-in Method Combination Types [2025-02-07 Fri 21:16] CLHS: Macro DEFINE-METHOD-COMBINATION

  • simple built-in method combination types

The names of the built-in method combination types are +, and, append, list, max, min, nconc, or, progn, and standard.

(define-method-combination xor :identity-with-one-argument t)

1.3. Format Directives

ID: 852b2c7f-238e-480d-ad63-3b5b53c58929
CREATED: <2025-02-14 Fri 20:20>

[2025-02-14 Fri 20:20] Pretty Print Table Data in Common Lisp

1.4. Functions

ID: ebbc665a-10c3-46a3-8052-4f46bc9ac2b1
CREATED: <2025-02-25 Tue 16:08>

[2025-02-25 Tue 16:08] 5.2. Functions

1.4.1. Lambda Expressions

ID: 7555f8c6-5dd5-4607-ae1f-32643bf03ba9
CREATED: <2025-02-25 Tue 16:09>

[2025-02-25 Tue 16:09] 5.2.2. Lambda-Expressions

This is not SBCL specific, but according to the ANSI Common Lisp standard.

Convert a Lambda Expression as List to a Function

These are your options:

CL-USER 168 > (funcall (coerce '(lambda (x) (* x x)) 'function) 4) 16

CL-USER 169 > (funcall (compile nil '(lambda (x) (* x x))) 4) 16

CL-USER 170 > (funcall (eval '(lambda (x) (* x x))) 4) ; because LAMBDA is a macro, too 16 CL-USER 171 > (funcall (eval '(function (lambda (x) (* x x)))) 4) 16

Note though that the lambda expression is referencing the null lexical environment. Thus it has no access to any lexical variables from the surrounding code.

Lambda expressions are not function objects

Why is a lambda expression not a function?

Because it is just a list, not code. To make a lambda expression into code, you have to turn it into a function object.

Some other (often older) Lisps allow you to use lambda expressions as code, but not Common Lisp. This is defined by the standard.

You can't do (funcall '(lambda (x) (+ x x)) 3). You have to convert the lambda expression into a function object first.

FUNCTION is a special operator -> syntax+semantics

(funcall (function (struct-slot1 struct1)) 3)

This is a syntax error, already. FUNCTION is a special operator and expects a function name or a lambda expression. (struct-slot1 struct1) is neither. (struct-slot1 struct1) is code which retrieves a value from a structure. But it is not a function name, which would be a symbol or a list (setf <some-symbol>). It is also not a lambda expression, which would be something like (lambda (…) . ..).

1.4.2. Thunk

ID: d69c0095-59e3-4005-8360-f928c3ace460
CREATED: <2025-02-28 Fri 17:43>
  • from tagbody in Lisp discord

the inventors of the thunk recalling that the term "was coined after they realized (in the wee hours after hours of discussion) that the type of an argument in Algol-60 could be figured out in advance with a little compile-time thought […] In other words, it had 'already been thought of'; thus it was christened a thunk, which is 'the past tense of "think" at two in the morning'.

1.5. Loop

ID: 439a02f1-afcf-4ba3-bdf4-0304d152ba6f
CREATED: <2025-02-16 Sun 19:40>

1.6. Concurrency

ID: d9062d16-09f0-4c48-99ac-2e26407fc75b
CREATED: <2025-03-06 Thu 14:01>

[2025-03-06 Thu 14:02] -> Asynchrony [2025-03-06 Thu 14:03] << lparallel [2025-03-06 Thu 14:05] Threads, concurrency, parallelism

1.7. Macros

ID: 1ccb1faa-6e41-4b4f-877f-4382bc250e53
CREATED: <2025-02-16 Sun 19:40>

[2025-02-22 Sat 15:18] Let Over Lambda

1.7.1. Compiler Macros

ID: 961d0c81-11f0-49e2-8ccb-9c31f6b6528d
CREATED: <2025-02-28 Fri 18:27>

[2025-02-28 Fri 18:27] CLHS: Section 3.2.2.1

1.8. Applications

ID: 475491e1-eacd-4759-be06-1c027e91f565
CREATED: <2025-01-17 Fri 19:19>

1.8.1. screenshotbot-oss

ID: 54d32d4a-93fe-4f4d-9207-f291dbb1edc6
CREATED: <2025-01-17 Fri 19:20>

[2025-01-17 Fri 19:20] GitHub - screenshotbot/screenshotbot-oss

A Screenshot Testing service to tie with your existing Android, iOS and Web screenshot tests.

1.9. Libraries

ID: 82d4dffa-070c-4ead-b317-9f9b6820e2c1
CREATED: <2025-02-22 Sat 15:15>

1.9.1. CLX

ID: 54ea6883-851d-4829-8f71-889aa7f58c45
CREATED: <2025-02-22 Sat 15:15>

[2025-02-22 Sat 15:15] sharplispers/clx

clx/extensions

1.9.2. Shirakumo Ecosystem

ID: 503387d8-fa9c-4269-99bc-1d29415ab290
CREATED: <2025-03-02 Sun 20:09>

[2025-03-02 Sun 20:12] Shirakumo · GitHub

Shinmera runs an indie-game studio based on CL and has contributed well over 10% of the Quicklisp ecosystem. Impressive effort and worthy of a dedicated info node here.

  1. Radiance
    ID: 1beb282b-8c4d-4561-a293-07439d0367ae
    CREATED: <2025-03-02 Sun 20:11>
    

    [2025-03-02 Sun 20:11] Shirakumo/radiance: A Common Lisp web application environment

  2. Alloy
    ID: 8af234c8-1455-4dc8-a2df-e6d5b5777606
    CREATED: <2025-03-02 Sun 20:12>
    

    [2025-03-02 Sun 20:12] Shirakumo/alloy: A new user interface protocol and toolkit implementation

  3. Framebuffers
    ID: e70d50df-d897-4a5f-a669-fa5dc3f94b23
    CREATED: <2025-03-02 Sun 20:13>
    

    [2025-03-02 Sun 20:13] Shirakumo/framebuffers: A library for portable framebuffer access

1.9.3. Gambol

ID: a911344d-aed1-4603-a46f-e8edf53756f5
CREATED: <2025-03-04 Tue 18:09>

[2025-03-04 Tue 18:09] CLiki: Gambol [2025-03-04 Tue 18:11] -> Prolog

See also A Common Prolog

1.9.4. lparallel

ID: c560dc07-8c9c-42bc-9ce1-634630d26981
CREATED: <2025-03-06 Thu 14:02>

[2025-03-06 Thu 14:02] Lisp in Parallel : lparallel | (ql:quickload :lparallel) [2025-03-06 Thu 14:03] >> Concurrency

1.9.5. jscl

ID: 3addee17-b990-4a6d-9767-071969ed9d0e
CREATED: <2025-03-02 Sun 20:51>

[2025-03-02 Sun 20:52] jscl-project/jscl: A Lisp-to-JavaScript compiler bootstrapped from Common Lisp

1.10. Systems

ID: a6911466-c135-488c-a67e-689f22592a44
CREATED: <2025-03-03 Mon 18:54>

1.11. ASDF

ID: fb68413a-acd8-4107-bfb5-48ce32be8842
CREATED: <2025-03-03 Mon 18:54>

[2025-03-03 Mon 18:54] info

1.12. Packages

ID: 92dd3f0e-4789-4016-a623-48af3c45cd05
CREATED: <2025-02-26 Wed 20:52>

[2025-03-01 Sat 15:51] CLHS: Macro DEFPACKAGE

  • CLHS: Function SHADOW
  • :intern
    The symbols named by the argument symbol-names are found or created in the package being defined. The :intern option interacts with the :use option, since inherited symbols can be used rather than new ones created.

It is recommended that the entire package definition is put in a single place, and that all the package definitions of a program are in a single file. This file can be loaded before loading or compiling anything else that depends on those packages. Such a file can be read in the COMMON-LISP-USER package, avoiding any initial state issues.

  • SBCL supports some additions to defpackage (:lock and :implement) - uiop and our own defpkg supports even more (:recycle, etc)
  • SBCL Package Locks
  • :implement

    Each package has a list of associated implementation packages. A locked package, and the symbols whose home package it is, can be modified without violating package locks only when *package* is bound to one of the implementation packages of the locked package.

    Unless explicitly altered by defpackage, sb-ext:add-implementation-package, or sb-ext:remove-implementation-package each package is its own (only) implementation package.

1.13. History

ID: fb444369-a3e2-4451-8afc-e29571e706de
CREATED: <2025-03-07 Fri 23:29>

1.13.1. T

ID: 3951ac2e-dc3d-4c25-b0ab-7b1daac53b47
CREATED: <2025-03-07 Fri 23:32>

[2025-03-07 Fri 23:32] History of T

1.13.2. CAR and CDR

ID: 377a92dd-8e6e-4183-bd8a-70c47902d4d8
CREATED: <2025-03-07 Fri 23:33>

[2025-03-07 Fri 23:32] History of CAR and CDR

1.13.3. LAP   asm

ID: f8f4d3ea-663a-4a8e-a9a8-f0d7813c710f
CREATED: <2025-03-07 Fri 23:29>

[2025-03-07 Fri 23:30] spec

The LISP 2 Assembly Program

1.14. Books

ID: 04d98054-94f2-47d1-8af4-751c10827ee8
CREATED: <2025-03-04 Tue 15:57>

1.14.1. PAIP

ID: 91c00d39-6541-4b29-8d6b-a5b8c770cab0
CREATED: <2025-03-04 Tue 15:57>

[2025-03-04 Tue 16:04] >> Expert System

Paradigms of Artificial Intelligence Programming by Peter Norvig

1.14.2. PCL

ID: 53d96196-24d4-4737-93d0-a282f2cf5c0b
CREATED: <2025-03-04 Tue 18:05>

[2025-03-04 Tue 18:05] Practical Common Lisp [2025-03-04 Tue 18:06] CLiki: Practical Common Lisp

Practical Common Lisp - Peter Seibel

1.14.3. LoL

ID: 11b9f51e-4d47-41ba-814f-aa6738a65881
CREATED: <2025-03-04 Tue 15:57>

[2025-03-04 Tue 18:03] Let Over Lambda [2025-03-04 Tue 18:04] thephoeron/let-over-lambda

Let Over Lambda by Doug Hoyte

1.14.4. Land of Lisp

ID: 2b73b4e2-495a-4af0-9777-294196ad7f4d
CREATED: <2025-03-07 Fri 09:56>

[2025-03-07 Fri 09:56] landoflisp

1.15. Package Managers

ID: d41019fd-ca88-4608-af00-9e7a84dcd49f
CREATED: <2025-02-26 Wed 20:53>

1.15.1. Quicklisp

ID: 0b568dbe-fc89-4ce6-be86-fd18d1d2d5c0
CREATED: <2025-02-26 Wed 20:53>

[2025-02-26 Wed 20:54] Quicklisp beta [2025-03-01 Sat 16:07] quicklisp (Zach Beane) · GitHub

Quicklisp is a library manager for Common Lisp. It works with your existing Common Lisp implementation to download, install, and load any of over 1,500 libraries with a few simple commands.

  1. Ultralisp
    ID: 6cfca9d2-8d3d-4725-a08f-349e08fd44e3
    CREATED: <2025-02-26 Wed 20:54>
    

    [2025-02-26 Wed 20:54] Ultralisp - Fast Common Lisp Repository

    An alternative distribution for Quicklisp - tracks git branches.

2. Scheme   scm

ID: cce00db3-1428-4380-aa5d-8d2ec767b873
CREATED: <2025-02-16 Sun 20:03>

[2025-03-03 Mon 14:20] The Scheme Programming Language

Andersen, Leif, Stephen Chang, and Matthias Felleisen. 2017. “Super 8 languages for making movies (functional pearl).” Proc. acm program. lang. 1 (ICFP). https://doi.org/10.1145/3110274.

2.1. Racket

ID: 74140b0d-af83-4516-ac70-b62bfa3de68d
CREATED: <2025-02-16 Sun 20:03>

[2025-03-03 Mon 14:19] Racket [2025-03-06 Thu 13:51] The Racket Reference

  • Andersen, Chang, and Felleisen (2017) from the PLT guys at NEU - Racket

2.1.1. Contracts

ID: c1fdfebb-0dec-420d-abf9-aec7a2de5633
CREATED: <2025-03-06 Thu 13:52>

[2025-03-06 Thu 13:52] Contracts [2025-03-06 Thu 14:00] -> Contract Programming

2.1.2. Concurrency

ID: 79ecc4f2-f223-4045-a31a-565192efaf49
CREATED: <2025-03-06 Thu 13:52>

[2025-03-06 Thu 13:53] 11 Concurrency and Parallelism [2025-03-06 Thu 14:00] -> Asynchrony [2025-03-06 Thu 14:03] << lparallel

2.2. Guile

ID: 66e2ab9a-51e3-4360-b7ad-0b38eb0dd6e5
CREATED: <2025-03-03 Mon 20:03>

[2025-03-03 Mon 20:03] info [2025-03-03 Mon 20:03] GNU's programming and extension language — GNU Guile

3. Lisp Machine Lisp

ID: e21c02a5-5039-42c2-8416-aa5d45e70cb6
CREATED: <2025-02-26 Wed 20:49>

[2025-02-26 Wed 20:49] Lisp Machine Lisp - Wikipedia [2025-03-03 Mon 20:02] -> Lisp Machine

Maclisp->Zetalisp

4. Elisp   emacs elisp el cl cl

ID: 6c69c42b-3d0a-48bf-a5ad-43b350477387
CREATED: <2025-03-01 Sat 16:35>

[2025-03-01 Sat 16:36] Elisp info [2025-03-01 Sat 16:36] An Introduction to Programming in Emacs Lisp - GNU Project - Free Software Foundation (FSF) [2025-03-03 Mon 14:01] >> Emacs

4.1. Threads

ID: 5510378f-d1a7-4642-8a24-ada2d7f7e54d
CREATED: <2025-03-03 Mon 13:43>

[2025-03-03 Mon 14:14] ref

4.2. Widgets

ID: 95427021-7e0c-4657-9b70-a7ed874fe35a
CREATED: <2025-03-03 Mon 20:01>

[2025-03-03 Mon 20:01] info

(require 'widget)

(eval-when-compile
  (require 'wid-edit))

(defvar widget-example-repeat)

(defun widget-example ()
  "Create the widgets from the Widget manual."
  (interactive)
  (switch-to-buffer "*Widget Example*")
  (kill-all-local-variables)
  (make-local-variable 'widget-example-repeat)
  (let ((inhibit-read-only t))
    (erase-buffer))
  (remove-overlays)
  (widget-insert "Here is some documentation.\n\n")
  (widget-create 'editable-field
                 :size 13
                 :format "Name: %v " ; Text after the field!
                 "My Name")
  (widget-create 'menu-choice
                 :tag "Choose"
                 :value "This"
                 :help-echo "Choose me, please!"
                 :notify (lambda (widget &rest ignore)
                           (message "%s is a good choice!"
                                    (widget-value widget)))
                 '(item :tag "This option" :value "This")
                 '(choice-item "That option")
                 '(editable-field :menu-tag "No option" "Thus option"))
  (widget-create 'editable-field
                 :format "Address: %v"
                 "Some Place\nIn some City\nSome country.")
  (widget-insert "\nSee also ")
  (widget-create 'link
                 :notify (lambda (&rest ignore)
                           (widget-value-set widget-example-repeat
                                             '("En" "To" "Tre"))
                           (widget-setup))
                 "other work")
  (widget-insert
   " for more information.\n\nNumbers: count to three below\n")
  (setq widget-example-repeat
        (widget-create 'editable-list
                       :entry-format "%i %d %v"
                       :notify
                       (lambda (widget &rest ignore)
                         (let ((old (widget-get widget
                                                ':example-length))
                               (new (length (widget-value widget))))
                           (unless (eq old new)
                             (widget-put widget ':example-length new)
                             (message "You can count to %d." new))))
                       :value '("One" "Eh, two?" "Five!")
                       '(editable-field :value "three")))
  (widget-insert "\n\nSelect multiple:\n\n")
  (widget-create 'checkbox t)
  (widget-insert " This\n")
  (widget-create 'checkbox nil)
  (widget-insert " That\n")
  (widget-create 'checkbox
                 :notify (lambda (&rest ignore) (message "Tickle"))
                 t)
  (widget-insert " Thus\n\nSelect one:\n\n")
  (widget-create 'radio-button-choice
                 :value "One"
                 :notify (lambda (widget &rest ignore)
                           (message "You selected %s"
                                    (widget-value widget)))
                 '(item "One") '(item "Another One.")
                 '(item "A Final One."))
  (widget-insert "\n")
  (widget-create 'push-button
                 :notify (lambda (&rest ignore)
                           (if (= (length
                                   (widget-value widget-example-repeat))
                                  3)
                               (message "Congratulation!")
                             (error "Three was the count!")))
                 "Apply Form")
  (widget-insert " ")
  (widget-create 'push-button
                 :notify (lambda (&rest ignore)
                           (widget-example))
                 "Reset Form")
  (widget-insert "\n")
  (use-local-map widget-keymap)
  (widget-setup))

4.3. EIEIO

ID: da96454b-fc70-4a5c-bd7a-e66d148eb1d9
CREATED: <2025-03-03 Mon 14:02>

[2025-03-03 Mon 14:02] ref [2025-03-03 Mon 14:03] -> CLOS

4.4. Display

ID: dd393948-c526-4216-bf9b-5869a7121933
CREATED: <2025-03-03 Mon 14:05>

[2025-03-03 Mon 14:05] ref

4.4.1. Ewoc   gui

ID: 114b1269-7400-45a7-ac41-17032015ffaa
CREATED: <2025-03-03 Mon 14:05>

[2025-03-03 Mon 14:05] ref

4.4.2. Native Widgets

ID: 401e2cbd-2769-4c73-979e-ca98f4f6208c
CREATED: <2025-03-03 Mon 14:07>

[2025-03-03 Mon 14:08] ref

4.4.3. SVG Images

ID: c3aeb32d-5353-40e3-9817-c086f6beb58b
CREATED: <2025-03-03 Mon 14:08>

[2025-03-03 Mon 14:08] ref

4.5. Overlays

ID: 358a0e2b-b5e0-47ad-9c70-7bb72b1c548f
CREATED: <2025-03-03 Mon 14:08>

[2025-03-03 Mon 14:08] ref

5. Clojure   clj

ID: 45c83abe-cff5-4d00-9f01-f61c55525ca9
CREATED: <2025-03-03 Mon 19:36>

[2025-03-03 Mon 19:37] Clojure [2025-03-03 Mon 19:44] >> JVM