freenode/#lisp - IRC Chatlog
Search
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
2:56:16
r13l
is it correct that there’s no way to kill processes started by uiop:run-program (e.g. if one receives a SIGTERM oneself)? maybe i should try to add support for uiop:launch-program to inferior-shell …
6:55:35
beach
Not bad, thanks. My favorite coauthor is coming over for lunch, and then we will work on our ELS paper submissions for this year.
7:00:38
madrik
I've got to the point where I can ask my system which client IP made how many connections; what domains has a given IP visited frequently; etc.
7:01:26
beach
We think this one is pretty much ready to go: http://metamodular.com/bootstrapping.pdf
7:05:19
madrik
In abstract, wasn't this one of the motivations in the birth of SBCL -- that its ancestor, CMUCL, had a rather involved bootstrapping procedure to build it?
7:09:37
beach
We are taking it one step further by bootstrapping CLOS first, rather than last, as is common with implementations that were started before CLOS was part of the standard.
7:13:25
beach
There is this widespread idea that bootstrapping has to be done from a subset of the language to the full language in well defined increments.
7:14:10
beach
But that is obviously not the case if you bootstrap on an existing conforming Common Lisp implementation. Because then, you already have the full language at your disposal.
7:14:53
beach
Having said that, I should add that the procedure for doing it is pretty involved, mainly because of the way that Common Lisp defines compilation differently from other languages.
7:31:30
beach
ACTION is guessing that madrik is thinking hard about going before answering his question.
7:56:58
beach
I suppose. I didn't check. It seems reasonable since TYPE-OF must call CLASS-OF or something like that for standard objects.
8:02:48
LdBeth
from Design Patterns: An object can have many types, and objects of different classes can have the same type.
8:05:18
beach
An object in Common Lisp can have many types, sure. In particular, that is the case for numbers.
8:06:24
beach
And I assume you meant the type of the instances of the classes that share only T as superclass.
8:12:24
LdBeth
I don’t know if CL use the same term, but predicate type is type defined by a predicate function
8:13:07
beach
DEFTYPE does not define a function, so it would not be a predicate type with that definition.
8:15:46
beach
TYPE-OF is defined as a function in Common Lisp. But, in general the type of an object is not a mathematical function, since it has several values.
8:52:00
heisig
What is the recommended way to pass additional initialization arguments to a custom generic function?
8:52:51
fiddlerwoaroof
The standard allows it: "Implementations can extend defgeneric to include other options. It is required that an implementation signal an error if it observes an option that is not implemented locally."
8:57:09
heisig
SBCL signals a simple-program-error at macroexpansion time when I supply an unknown option.
8:57:45
fiddlerwoaroof
Anyways, I think this might rule out user extension: http://metamodular.com/CLOS-MOP/the-defgeneric-macro.html
8:57:59
fiddlerwoaroof
"The arguments received by ensure-generic-function are derived from the defgeneric form in a defined way..."
8:58:48
fiddlerwoaroof
The rest of that page seems to specify how DEFGENERIC translates to ENSURE-GENERIC-FUNCTION but doesn't really say anything about extra init args
8:59:28
heisig
fiddlerwoaroof: Yes, I have a custom generic metaclass. (My goal is to implement sealable metaobjects: https://github.com/marcoheisig/sealable-metaobjects )
9:00:24
heisig
Things look good, so far. But I would prefer another mechanism for supplying initialization arguments than hidden use of special variables.
9:05:57
heisig
Yes, I will probably go for a custom macro DEFINE-SEALABLE-GENERIC-FUNCTION that expands into DEFGENERIC plus some further initialization.
9:06:42
fiddlerwoaroof
The other option (which would probably be a lot of work) you could also have something like defgeneric* that has a defined mapping between unrecognized options and calls to accessors?
9:06:52
beach
note to self: For WSCL, investigate the possibility of extending DEFGENERIC with additional options.
9:09:17
madrik
beach: Okay. It just seemed a very comprehensive system, with a compiler, an interpreter, /and/ a byte-code subsystem.
9:10:51
beach
madrik: I think "comprehensive" also means "highly redundant", thus requiring additional maintenance for which no manpower is available.
9:12:06
heisig
fiddlerwoaroof: defgeneric* could work. Maybe one could supply all excess options as an additional plist to ensure-generic-function. I will think about it.
9:12:52
fiddlerwoaroof
heisig: a defgeneric* macro would also be useful on its own, for other people that want to do similar things
9:15:28
fiddlerwoaroof
I generally make sure as much of my code as possible runs on at least sbcl and ccl
9:15:53
fiddlerwoaroof
And, on Macs, ccl has better integration out of the box with Objective-C and Cocoa
9:19:31
heisig
fiddlerwoaroof: Here I go, developing a utility library for a utility library of a module of a Lisp implementation on which I want to develop a utility library for parallel programming :D
9:20:31
fiddlerwoaroof
I occasionally write "real" code, but mostly I write one or two stages away from the problem I want to be working on.
9:21:06
fiddlerwoaroof
Most recently, I've been working on a way to treat an emacs buffer as an output stream
9:21:27
madrik
Oh, just for fun, I was writing a naive function to compute e, when I came to point where I thought, "Why isn't there a MULF by analogy to INCF?"
9:24:51
beach
madrik: I recommend you read the book On Lisp that discusses macro definitions at length.
9:25:21
fiddlerwoaroof
It's almost always better to use abstractions like this because they hide the noise and just let you express your intent
9:25:49
loke
You can do the same using DEFINE-SETF-EXPANDER, but in this case the former is much easier.
9:35:13
loke
madrik: It doesn't have to be that long: (loop for i from 1 to n for e = #1=(1+ (/ n)) then (* e #1#) finally return e)
9:40:15
heisig
shka_: Somewhat. But if it would be like final, I would have called it sealed-metaobjects. The idea is that you can manipulate and, most importantly, subclass sealable metaobjects until they are explicitly sealed.
9:45:14
heisig
The idea is that you get calls with built-in (or sealed) instances as fast as regular +, but that you can still extend such a generic function it in the general case.
9:46:05
shka_
heisig: just realized that i made my code resistant to this form of optimization few months ago ;-)