libera/#commonlisp - IRC Chatlog
Search
17:08:22
alcor
A few days ago, I read an internet that said CL conditions can be used to implement progress notification without unwinding the stack. Where can I find more info about this use case?
17:12:29
edwlan[m]
You'd just use (define-condition progress ...) to define the condition and then (signal 'progress ...) to signal progress
17:24:13
scymtym
my take from many years ago: https://github.com/scymtym/more-conditions#tracking-and-reporting-progress-of-operations
17:57:47
bitblit1
What are your opinions on recursive functions; when do you use them? all the time, completely avoid, other. If you do you them then what is your mindset meaning how do you solve a problem using recursive functions?
17:58:35
bitblit1
In your case is it harder to solve a problem using recursion rather than iterative solutions? Or same or other?
18:05:51
beach
bitblit1: As edwlan[m] says, you use recursion when your data is naturally inductive, except that you don't use recursion on linear structures like lists.
18:17:14
edwlan[m]
Like, if you're working with a list, you have a base case, (), and then a step case (x . rest)
18:17:54
edwlan[m]
So, it's often easier to work recursively because you can define how to handle the base case and how to handle the step case and then reduce handling rest to a recursive call
18:54:19
pjb
alcor: more details in the clcs book. (there's a #clcs channel too). https://www.amazon.com/Common-Lisp-Condition-System-Mechanisms/dp/148426133X
21:19:18
zest
if there is a way not to use a gray stream like function, similar to file-position thatd be perfect...
21:19:51
zest
use case is i am writing a protocol and want to read as little as possible since the protocol is io heavy
21:20:28
zest
i looked to fast-io and trivial-gray-streams to no avail... surely there is a function like file-position for gray-streams...
3:09:03
hayley
prokhor: Indeed a parallel garbage collector for SBCL. I have to implement some compaction, and then it should be ready for...well, I wouldn't run it in production then, but it should be usable enough.
3:12:42
pony
hello. https://bpa.st/O6S2K when I change ast on line 30 to (), it seems the setf on line 34 doesn't work. I expected it to work like (let ((a ())) (setf a (append a (list 1 2 3))) a).
3:20:43
hayley
The empty list is NIL, so that could go wrong if you use NIL to mean that a function couldn't find anything to parse.
3:22:39
hayley
(trace parse-expr parse-atom parse-list parse-elems) might also help you spot any oddities too.
3:23:27
beach
pony: You need to work on the layout of your code if you are going to submit it for us to read.
3:31:38
hayley
beach: Hopefully this document <https://gist.github.com/no-defun-allowed/f79ea6e211b5f078e349c53937b5be74> is more successful at explaining how to adapt the "partial read barrier" idea for Common Lisp.