Yeah, they’re very similar to CL’s generics from what I’ve seen.
https://nenbutsu.github.io/ISLispHyperDraft/islisp-v23.html#generic_functions
Yeah, they’re very similar to CL’s generics from what I’ve seen.
https://nenbutsu.github.io/ISLispHyperDraft/islisp-v23.html#generic_functions
Is
(defmacro for ((param-name start-value end-value &optional (step 1)) &body body)
`(loop for ,param-name from ,start-value by ,step to ,end-value do (progn ,@body)))
cheating?
I definitely prefer scheme’s begin
, but progn
does have a consistent logic behind its name. (progn expr1 expr2 ... exprN)
returns the result of exprN
, and (prog1 expr1 expr2 ... exprN)
returns the result of expr1
. There’s also a prog2
which returns the obvious.
Getting a macro system up and running is the logical next step; then you can write macros that build on the very basic forms and provide other syntax.
So basically a scheme version of java’s LinkedHashMap?
Using a metacircular interpreter for lispy languages - one that implements the same language it’s written in, allows you to skip the often tedious parsing step by using the host’s read
to give you a syntax tree, letting you skip to the interesting bits of manipulating and transforming that tree and executing it (eval-apply in sicp terminology). Those bits are foundational stuff for writing an interpreter or compiler for any language, which lots of people find to be interesting projects.
So if you misconfigure Emacs, does it create a magnetic tornado spewing destruction across nearby cities?
Oh, it’s much much worse than that. It drops you into vi.
(define (atom? x) (not (pair? x)))
is the same as Common Lispatom
, but I’ve seen some Scheme texts that use versions that treat'()
as not an atom. Can be confusing if you have one definition in mind and look at something that uses the other.