freenode/#lisp - IRC Chatlog
Search
19:44:50
Bike
ecl has some code to make things like (error '(or type-error simple-condition) ...) work. does anybody use such a thing? https://gitlab.com/embeddable-common-lisp/ecl/commit/c6e419101400ee5d4372d748f646011b1480d0a2
19:47:24
Bike
well, clhs says make-condition's first argument is a subtype of condition, so i guess it could be understood as standard
19:47:26
pjb
Bike: it looks like it's conforming! type---a type specifier (for a subtype of condition).
19:48:55
Bike
no, i mean the function ERROR takes a condition designator, and a condition designator is either a symbol or a format control or a condition.
19:49:02
pjb
Bike: error takes a condition n. 1. an object which represents a situation---usually, but not necessarily, during signaling. 2. an object of type condition.
19:49:39
Bike
yes and the designators are clearly defined in 9.1.2.1 and specify a symbol, not any subtype. okay? okay. so does anyone actually use this thing.
19:49:58
pjb
This is a great find! I've been definining conditions just to mix simple-condition with my errors!!!
19:50:43
Bike
well if you did (make-condition '(and my-error simple-condition) ...) that could still just be an empty type.
19:51:22
Bike
it's also in clasp, which is why i'm asking. dunno about others but i sorta doubt it. i'll check sbcl.
19:52:05
pjb
Bike: you're right about 9.1.2.1, but ERROR is specified to accept and OR type specifier, and MAKE-CONDITION is explicitely designed to accept it.
19:53:08
aeth
Tangentially related, but I'd say the weakest part of the standard is conditions. Didn't someone here write their own destructuring-bind just to get a consistent cross-implementation condition there?
19:53:46
pjb
Bike: error is specified to take a designator to a condition (glossary) with a very large definition.
21:58:17
t58
Hey I'm using slime with emacs is there a shortcut to close all the open parens? I'm sure there was one like C-c C-q or something like that but I can't find any reference to it online.
22:17:43
White_Flame
and paredit is highly recommended, nearly always keeping things balanced (except for cut'n'paste)
4:08:35
p0a
I'm familiar with emacs but it's been so long I've done some CL that I don't know what' sup
4:09:26
beach
I don't know about Debian in particular, but that combination is probably the most frequently used by #lisp participants.
5:05:22
p0a
but I don't want to have them run concurrently. I realize I can have 3 loop macros but I'm just wondering
5:09:32
beach
(loop with result = '() for i in list do (loop for j in list do (loop for k in list do (push (list i j k) result))) finally (return result))
5:21:29
beach
p0a: (loop for (i . ii) on list nconc (loop for (j . jj) on ii nconc (loop for k in jj collect (list i j k))))
5:25:49
p0a
also, is there a way to check if a list of bools is all true without REDUCEing over AND?
5:29:16
beach
p0a: All I did was to use the remaining list in the nested loops, rather than the entire list.
6:39:16
pjb
(defun combinations (list n) (cond ((zerop n) '()) ((= 1 n) (mapcar (function list) list)) (t (mapcan (lambda (rest) (mapcan (lambda (first) (list (cons first rest))) list)) (combinations list (1- n)))))) (combinations '(a b c) 3) #| --> ((a a a) (b a a) (c a a) (a b a) (b b a) (c b a) (a c a) (b c a) (c c a) (a a b) (b a b) (c a b) (a b b) (b b b) (c b b) (a c b) (b c b) (c c b) (a a c) (b a c) (c a c) (a b c) (b b c) (c b c) (a