4 ms·
TXR Lisp: This is the TXR Lisp interactive listener of TXR 243. Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet. Give me all the .c fi
by kazinator 6y ago
TXR Lisp:
This is the TXR Lisp interactive listener of TXR 243.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
Give me all the .c files:
1> (glob "*.c")
("abcd.c" "args.c" "arith.c" "buf.c" "cadr.c" "chksum.c" "combi.c"
"crazyffi.c" "debug.c" "dict.c" "eval.c" "ffi.c" "filter.c" "ftw.c"
"gc.c" "glob.c" "halfsip.c" "hash.c" "highest-bit-main.c" "highest-bit.c"
"highest-test.c" "isqrt.c" "itypes.c" "lex.yy.c" "lib.c" "lisplib.c"
"match.c" "parser.c" "protsym.c" "query.c" "rand.c" "regex.c"
"signal.c" "socket.c" "stream.c" "struct.c" "strudel.c" "sysif.c"
"syslog.c" "termios.c" "test.c" "tree.c" "txr.c" "unwind.c" "utf8.c"
"vecho.c" "vm.c" "y.tab.c")
OK, which ones are over 100000 bytes:
2> (keep-if [chain stat .size (op < 100000)] (glob "*.c"))
("arith.c" "eval.c" "ffi.c" "lex.yy.c" "lib.c" "match.c" "stream.c"
"y.tab.c")
- jonahbenton 6y agoClojure is already good at that- at conditional pipe / filter / aggregate semantics, bc it is a lisp. Specter is for a different problem. When you have a data structure that has some semantics and is deeply nested (and you aren't discovering the structure, like getting size from a node via a function call) Specter has a declarative set of operations to navigate and extract on that data structure, extremely efficiently.
- kazinator 6y ago1> (defstruct node () item next) #<struct-type node> 2> (new node next (new node next (new node item 42))) #S(node item nil next #S(node item nil next #S(node item 42 next nil))) 3> (call .next.next.item *2) 42
- reitzensteinm 6y agoI don't usually have a problem with you posting TXR comparisons in every lisp thread, but if you're not going to take the time to understand what the library does, this is just spam.
- deleted 6y ago[deleted]
- kimi 6y agoAdding a bit of context - as Clj data structures are immutable, changing something that is deeply nested cannot be done in-place (like in a Java set of nested objects - navigate until you find the one you need, call setFoo() on it, you're done). So it gets painful real quick. Specter is like search-and-replace - first you find all the elments you need, then you can replace / change them at the touch of a fn.