(LAMBDA (A)
(DECLARE (SYSTEM::SOURCE-LEVEL #<EQ Hash Table{0} 81D03EFF03>))
(DECLARE (LAMBDA-NAME FOO))
(PRINT (QUOTE HEY))
(PRINT A))
If not, one would probably need to do a bit of fiddling to tear away the function from the symbol if one should feel a sudden urge to do so.Perhaps similar to this:
: (de myfun (D)(prinl "heyo") (prinl D))
-> myfun
: myfun
-> ((D) (prinl "heyo") (prinl D))
: (mapcar '((D) (prinl "heyo") (prinl D)) '("world"))
heyo
world
-> ("world")
: (mapcar '(NIL (prinl "hey")) '(lel))
hey
-> ("hey")
: (car myfun)
-> (D)
: (cdr myfun)
-> ((prinl "heyo") (prinl D))
: (cons (car myfun) (cdr myfun))
-> ((D) (prinl "heyo") (prinl D))
: (mapcar (cons (car myfun) (cdr myfun)) '("world"))
heyo
world
-> ("world")
Mostly I use this to get at an implementation so I can test it or a portion of it against some particular value, or just to see how something works. Most builtins are implemented in assembler and their symbols only return a pointer, but for example 'doc is implemented in Picolisp: : doc
-> ((Sym Browser) (raw T) (call (or Browser (sys "BROWSER") "w3m") (pack "file:" (and (= 47 (char (path "@"))) "//") (path (if (get Sym 'doc) (pack @ "#" Sym) "@doc/ref.html")))) (raw NIL))
: de
-> 270351
: macro
-> ("Prg" (run (fill "Prg")))
I really like the Picolisp 'match (https://software-lab.de/doc/refM.html#match ) function. What's the easiest way to do the same in Common Lisp? If it's not obvious from the examples there, it can also be used with character lists, i.e. transient symbols, i.e. strings, chopped up into a list of UTF-8 characters. It's similar to unification in logic programming, which is something Picolisp supports.