libera/#commonlisp - IRC Chatlog
Search
9:12:21
loke
I made the mistake of looking at c.l.l just now... That WJ guy (changed name now though) is _still_ posting the same garbage. I cannot believe a human can be that insane. But if it's not a human, it's a quite decent AI.
9:13:05
ck_
no-defun-allowed: just randomly sample comp.lang.lisp and you'll probably find one of their posts
9:13:21
loke
The guy who keeps posting replies to decades-old posts with answers in any language except for Lisp.
9:13:59
loke
He's been doing it for years, plenty of posts every single day. I would love to know what kind of broken mindis behind it.
9:16:35
ck_
from their perspective, the same goes for things like slack, discord, or "internet forums"
10:28:30
shka_
does anybody here has a setup in emacs that will send-notify when slime debugger window pops up in emacs?
11:22:08
nirved
shka_: (defun your-notify-fn () (notifications-notify :title "title" ...)) (add-hook 'sldb-hook 'your-notify-fn)
14:14:57
antoszka
https://dream.tex-design.com.tw/products/shinobi?variant=16969883779162 ← kinda reminds one of the spacesaver
14:42:56
boeg
Can anyone recommend a good code base (for learning purposes) that effectively uses conditions and return values where it makes sense to handle errors? I'm look to get a better grasp of when/what/how of error handling in lisp and I've read a lot of literature but what like to see some concrete examples
14:52:44
beach
boeg: You are then giving the caller the option of not handling errors, so the error then propagates further during execution, making it very hard to find the bug later.
14:53:48
beach
boeg: furthermore, you must then handle the error in intermediate functions, like if A calls B and B calls C, C detects an error that B does not what to do with, but A does, then B must still look at the return value and return it to A.
14:55:01
beach
boeg: So for simple things, call ERROR in the function that detects the error situation and use HANDLER-CASE in the function that (directly or indirectly) invoked the function that detects the error.
14:56:05
beach
For more sophisticated situations, provide one or more restarts in the function that detects the error, letting the caller choose a restart so that execution can continue.
14:56:17
boeg
beach: Yes, what I meant was a code base that is good at returning values where it makes sense and using conditions what that makes sense
14:58:12
beach
Then almost any code base will do, because they all return values and they all handle errors.
14:58:43
boeg
sure, but can you recommend a good code base that are good at doing it "properly"? That is maybe not too big but neither trivial
14:59:08
beach
THROW is a function in Common Lisp, but it doesn't have anything to do with error handling.
14:59:39
boeg
you know, i'd like to study a code base that is of good quality but not too big that the size will be a hindrance for the actual goal
14:59:42
beach
You can look at Cluffer if you like. It is pretty well organized if I may say so myself.
15:01:25
minion
boeg: look at PCL: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
15:14:41
beach
The plan is for Second Climacs to be so good for editing Common Lisp that I don't need to use Emacs for that anymore.
15:15:36
boeg
like some use emacs for everything for writing software, to email, to browsing and so on because it can be used as a kinda lisp machine
15:17:14
beach
We are also working on other components of an IDE for Common Lisp, like a debugger (Clordane, embryonic for now), inspector Clouseau (by scymtym, very complete), etc.
15:19:01
pjb
boeg: Perhaps an interpreter would do; there are syntax errors, parsing errors, type errors, etc: https://github.com/informatimago/nasium-lse/
15:20:32
boeg
beach: sounds cool, although I dunno if I would be interested in such a thing. What I like about emacs is that its an environment that understands (a) lisp so I can do whatever with it, like programming common lisp in it or taking notes and so on. I'm not interested in a "common lisp editor". I'm probably not the target though
15:22:20
didi
What should be the result of (let ((x 42)) (mapcar (lambda (x) (declare (ignore x)) x) '(1 2 3)))?
15:22:45
boeg
is it an editor in an environment where you can program the environment live by evaluating things in the editor?
15:23:18
pjb
didi: declarations are optional. A good implementation would signal a compile-time warning that a variable is not ignored as declared.
15:31:11
beach
boeg: But SICL is necessary for the complete Second Climacs because I plan to compile the buffer at typing speed.
15:49:45
didi
Should I use `assert' for sanity checks? For example, X must be a list of length 1 at this point; there is no fixing if it is not.
16:10:18
pjb
minion: memo for didi: note that CL:ASSERT let you fix the problem: Try: (let ((list (list 1 2 3))) (assert (= 1 (length list)) (list) "should be a list of 1 element")) and select the restart that let you enter a new value for LIST.
17:05:40
scymtym
boeg: this is not second climacs but it demonstrates some of the things that can be done by using the Lisp reader instead of regex-based analysis: https://techfak.de/~jmoringe/style-check.html . or see https://techfak.de/~jmoringe/eclector-cst-toy-2.ogv , https://techfak.de/~jmoringe/eclector-context-completion.ogv for a deeper analysis, in emacs but based on the same approach
18:11:31
aeth
I'd prefer CHECK-TYPE to ASSERT if it can be expressed as a type in a reasonable way (so e.g. not a SATISFIES type).
18:12:04
aeth
For list length, maybe ASSERT is the most straightforward, but for vector length, a CHECK-TYPE is the most readable and concise.
19:41:53
rumbler31
sorry for the noob question, but I want to return a specific value from a loop once it is complete
19:45:12
rumbler31
oh man. I forgot about that I keep thinking about return in loops as the return verb and forgetting that function call
19:49:27
jebes
everything is meant to tie together, there isn't arbitary differences like statements vs expressions
20:01:02
pjb
rumbler31: that means that loop doesn't return. return returns. If you want to return from a loop you must combine loop and return.