Skip to content

Instantly share code, notes, and snippets.

(import ../lib/location :as l)
(import ../lib/jipper :as j)
(comment
(def a-def
"(def a 1)")
(def a-def-with-tuple-destructuring
"(def [x y] [8 9])")
* code to help with "compiling" / "cat-ing" multiple files into a
self-contained single script
* develop with files split, but "compile" to single script
* "include" files that have their "effectively" top-level
definition names (and uses) renamed to use `<ns>/` as a prefix.
more detail elsewhere in document.
* remove certain import forms from "main" script
value (def)
src/janet/src/boot/boot.janet on line 11, column 3
defn
(defn name & more)
Define a function. Equivalent to `(def name (fn name [args] ...))`.
--------------------------------------------------------------------
@sogaiu
sogaiu / byte-use-in-janet-symbol-names.txt
Last active November 30, 2025 03:01
bytes used in janet symbol names
032 [ ]: 0
033 [!]: 596
034 ["]: 0
035 [#]: 0
036 [$]: 408
037 [%]: 235
038 [&]: 24
039 [']: 0
040 [(]: 0
041 [)]: 0
@sogaiu
sogaiu / comment-top-level-defs.janet
Last active November 29, 2025 11:15
comment top-level def extraction test
(import ./lib/location :as l)
(import ./lib/jipper :as j)
(comment
(def an-import
"(import ./analyze :as a)")
(def a-def
"(def a 1)")
@sogaiu
sogaiu / top-level-defs.janet
Last active November 29, 2025 10:50
top-level def extraction test
(import ./lib/location :as l)
(import ./lib/jipper :as j)
(comment
(def an-import
"(import ./analyze :as a)")
(def a-def
"(def a 1)")
@sogaiu
sogaiu / comment-out-import-line.janet
Last active November 29, 2025 07:52
zipper comment out test
(import ./lib/location :as l)
(import ./lib/jipper :as j)
(comment
(def src
(string "(import ./analyze :as a)\n"
"\n"
"(defn main\n"
" [& args]\n"
@sogaiu
sogaiu / edit-twice.janet
Last active November 29, 2025 08:18
zipper modify test
(import ./lib/location :as l)
(import ./lib/jipper :as j)
(comment
(def src
(string "(import ./analyze :as a)\n"
"\n"
"(defn main\n"
" [& args]\n"
@sogaiu
sogaiu / gist:db7968ad2995c744531ad1e5dbe22e92
Last active November 28, 2025 06:36
building emacs from source with user-specific tree-sitter
# XXX: draft
# user-specific tree-sitter installation is doable via use of PREFIX
# assuming so...
cd ~/src
git clone https://github.com/emacs-mirror/emacs emacs-30.2
cd ~/src/emacs-30.2
git checkout emacs-30.2