Skip to content

Instantly share code, notes, and snippets.

View johnhilts's full-sized avatar

John Hilts johnhilts

View GitHub Profile

Why not: from Common Lisp to Julia

This article is a response to mfiano’s From Common Lisp to Julia which might also convey some developments happening in Common Lisp. I do not intend to suggest that someone coming from a Matlab, R, or Python background should pickup Common Lisp. Julia is a reasonably good language when compared to what it intends to replace. You should pickup Common Lisp only if you are interested in programming in general, not limited to scientific computing, and envision yourself writing code for the rest of your life. It will expand your mind to what is possible, and that goes beyond the macro system. Along the same lines though, you should also pickup C, Haskell, Forth, and perhaps a few other languages that have some noteworthy things to teach, and that I too have been too lazy to learn.

/I also do not intend to offend anyone. I’m okay with criticizing Common Lisp (I myself have done it below!), but I want

@johnhilts
johnhilts / class-macro.lisp
Created October 12, 2021 23:41
Macro to make simple classes
(defmacro define-info-class (name &rest slots)
(labels ((make-slot (name slot)
(read-from-string
(concatenate 'string (string name) "-" (string slot)))))
(flet ((make-slot-list-item (slot)
(list slot :accessor (make-slot name slot)))
(make-name (name)
(read-from-string
(concatenate 'string (string name) "-info"))))
(let* ((class-name (make-name name))
<html>
<head>
<title>Modal Example, using boostrap</title>
<script
src="https://code.jquery.com/jquery-3.1.1.slim.min.js"
integrity="sha256-/SIrNqv8h6QGKDuNoLGA4iret+kyesCkHGzVUUV0shc="
crossorigin="anonymous"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">