libera/#commonlisp - IRC Chatlog
Search
22:46:47
ashln
I'd like to read a constant number of bytes from a stream (or until EOF), like the interface provided by read(2). Is the only interface to binary file reading to do so one byte at a time with read-byte?
6:50:43
contrapunctus
I'm working on a code browser which displays code as trees, which have directories, files, and top-level Lisp forms as nodes.
6:50:53
contrapunctus
Currently, the constructor for file nodes takes a pathname and checks whether the file type is supported, by calling `(compute-applicable-methods #'parse-file (list pathname ... <file extension as a keyword>))` ...but I'm not sure I like this approach.
6:59:34
contrapunctus
Probably because it would error if there is no applicable method, and I haven't yet figured out how to add a method to `no-applicable-method`...
8:17:50
lisp123
and the subtraction of these two numbers will give you the direction to go from 1 to A
8:18:14
lisp123
And subtraction may not achieve this, but any sort of binary operation can be used in its place
8:19:29
pjb
powers of 2 for position in the toplevel list. Powers of 3 for positions in sublists of level 1. Powers of 5 for positions in sublists of level 2, etc.
8:22:50
lisp123
pjb: Have you ever used this in your own code or seen it somewhere in lisp code as a way to navigate within lists?
8:23:32
lisp123
I was thinking more of the Zipper algorithm (which represents the path from the top to the final element), so something like DRDR or DRR (where d = down, r = right)
8:23:58
lisp123
And was seeing if I could convert this 'string' view of element positions into a numerical equivalent
8:24:58
lisp123
rotateq: Connections like this between (C)Lisp and mathematical concepts really does seem to drive home the point that Lisp is the most natural language