freenode/#lisp - IRC Chatlog
Search
15:43:37
beach
My guess is that the first C compiler was not terribly smart, so you had to write code like that to get the best performance. That changed with GCC.
15:49:12
madrik
Maybe it's just looking to the past, but I get a kick out of thinking that there used to be implementations of other languages besides Lisp on the Lisp machines.
15:50:41
dlowe
I've wondered if it'd be possible to do FFI in sbcl by providing a libc implementation that used underlying sbcl code, so that allocated memory would be gc'd as usual
15:51:45
dlowe
as far as I know, all the CL implementations keep non-CL code in its own little space
16:03:18
pjb
schweers: well, since char are upgraded to int when passed as parameter and in other places it's essentially the same.
16:04:37
pjb
The difference would be '\0'+'\1' = (char)1 instead of 0+'\1' = (int)1, but againm since (char)1 would be upgraded, I don't remember any circumstance where it would make a difference. (but there may still be one obscur case).
16:07:06
pjb
(let ((s #(1 2 3 4)) (d #(1 2 3 0)) (i 0) (j 0)) (loop :while (= (prog1 (aref s i) (incf i)) (prog1 (aref d j) (incf j)))) (list i j)) #| --> (4 4) |#
16:08:23
pjb
(let ((s #(1 2 3 0)) (d (vector 0 0 0 0)) (i 0)) (loop :while (prog1 (plusp (setf (aref d i) (aref s i))) (incf i))) d) #| --> #(1 2 3 0) |#
16:09:04
pjb
(let ((s #(1 2 3 0)) (d (vector 0 0 0 0)) (i 0) (j 0)) (loop :while (prog1 (plusp (setf (aref d i) (aref s j))) (incf i) (incf j))) d) #| --> #(1 2 3 0) |#
19:16:31
phoe
I have two trees of CLOS instances that form a cyclic graph. How can I compare them for equality? For slot values that are not standard instances, I'd like to use EQUAL; for slot values that are standard instances, I want to recurse while marking the instances I have already visited to avoid loops.
19:16:53
phoe
These instances are of different types; I also want to ensure that the respective instances are of the same type.
19:18:16
pjb
If you have associations that have a multiplicity more than 1, then there could be an abiguity, and you might need backtracking.
19:18:58
pjb
Otherwise, you will need a walk of the two graphs. You can keep the nodes that are already walked in a hash-table.
19:20:11
phoe
All instances have some sort of ID however, so I can sort them by that ID in each list and then assume that the order is the same.
19:20:48
phoe
Or, whenever I traverse one graph, I get the ID of the current instance, find the matching instance in the other graph, and use that instance for comparing the slot values.
19:20:51
pjb
Then you will have to backtrack. If you have a->nb and A->nB and a=A, then you will have to try n*(n-1) b=B.
19:21:27
phoe
Will I have to, if they are ordered? I can treat these collections as ordered, meaning that 1st element of one collection must be equal to 1st element of the other collection.
19:22:24
pjb
phoe: well, that depends if the two graph share the same nodes, or only nodes that are equal?
19:23:17
pjb
Ok. Then yes, you can have a subalgorithm to match the list of nodes in the same association.
19:24:55
pjb
There were a couple of math libraries developed in Japan. Perhaps they had something about graph, I'm not sure.
20:01:25
Xach
Josh_2: (asdf:load-asd "/path/to/file") I think. Although I note that I just tried that on a bogus pathname and it returned something, so I don't know what to expect any more.
20:31:32
pjb
phoe: actually if you have a graph that knows its list of nodes, we don't need to walk the graph, just process the list of nodes (and we have to). On the other hand, if the graph is connected, and we only have one "root" node, then we need to walk it.
21:39:18
fiddlerwoaroof
You should be able to do something like (let ((buf (make-string 10))) (read-sequence buf socket-stream) buf)
22:43:59
pillton
schweers: (loop for var = (allocate-lots-of-resources) do ...) is enough to trigger problems if you rely on finalizers.
0:28:18
fiddlerwoaroof
Speaking of which, nyef used to be really active here and in #sbcl, but I haven't seen them around in a year or so
1:06:10
Josh_2
am I missing something here because unwind-protect isn't shutting the socket when test crashes Q_Q https://plaster.tymoon.eu/view/1109#1109
1:11:49
Bike
i mean, you say test "crashes", but that means it signals an error and the debugger comes up, right?
1:22:47
dlowe
You need to set the SO_REUSEADDR socket option if you want to reuse it right afterward.
1:24:26
dlowe
The documentation says that it makes TCP less reliable, but in practice I've never had trouble with it
1:26:54
fiddlerwoaroof
Hmm, one thing you have to be a bit careful about is the stream keeping things open
1:27:46
fiddlerwoaroof
I don't know if this is relevant here, but I've had issues with drakma where I eventually run out of fds when I do (drakma:http-request "///" :want-stream t) because, unless I close the stream, the socket never gets released.
1:39:26
fiddlerwoaroof
I have a suspicion that additional unwind-protects won't make a difference, unless there's an error in establish-tcp-connection