freenode/#lisp - IRC Chatlog
Search
8:29:59
matzy_
is it possible to check the types of each individual memnber of a list? i'm having a hard time finding function that does that on the hyperspec
8:34:47
beach
Or, if not, and if you can describe the types as a regular expression, you can use the RTE technique designed by Jim Newton and Didier Verna.
8:38:14
matzy_
its confusing, because i'm passing them as URL params in a POST body, but cl-dbi will only take them if I wrap each in double-quotes and even then smashes them into the same column with the column names included
8:39:22
matzy_
i'm admitting the first column which is an auto-incrementing id column from my INSERT, but I assume that OK
9:37:02
gaqwas
"In an unless form, if the test-form yields *false*, the forms are evaluated[..] Otherwise, if the test-form yields *false* (sic?), the forms are not evaluated, "
9:58:21
beach
aeth: I am not use to Hacker News. Is it possible, starting from that link, to back up in the history?
10:04:29
aeth
You can click on the [-] to collapse that thread. It's a bit hard to see the left line by default (I actually modify the style locally with a browser plugin)
10:06:39
beach
OK, thanks. I don't think this stuff was made for me. I wasn't looking to collapse the thread. I was wondering what prompted heisig to talk about CLOSOS, but I see now way to get to the previous message in the thread.
10:07:48
aeth
These sorts of websites are structured so that there's a link or a text post at the top, and everything else is a threaded reply to it
10:08:00
aeth
The top level is: Closos: Specification of a Lisp operating system (2013) [pdf] (metamodular.com) which is a link to https://news.ycombinator.com/item?id=23730107
10:09:38
aeth
You're welcome. And, yes, that website design was confusing to me, too, when I first saw it, probably 10 years ago.
10:10:19
beach
I can imagine. I don't have time to hang out in yet another place. Especially one with this kind of exchange. So I will probably always be confused.
10:10:33
aeth
It's a forum started by Paul Graham, so Lisp stuff sometimes trends on it, but not anywhere near as much as it used to.
10:11:35
aeth
It is the only known piece of public software written in Arc, the Lisp language that flopped. (Other than Arc implementations themselves, of course.)
10:39:56
phoe
if I want to use CHECK-TYPE properly inside SHARED-INITIALIZE, I assume that I must do that inside an :AROUND or primary method
10:40:13
phoe
and then CALL-NEXT-METHOD explicitly with all arguments, in case the CHECK-TYPE restart modifies the variables
10:47:22
aeth
phoe: You might be approaching the problem wrong. Personally, I type check at slot setting (to cover initialization and setters). Unfortunately, because this uses the MOP, I have to use ASSERT instead of CHECK-TYPE because the type isn't available at compile time. https://gitlab.com/zombie-raptor/zr-utils/-/blob/master/metaobject.lisp
10:49:12
phoe
can I use that with typechecking lists? like, assert that every element of the list is of type FOO
10:49:19
aeth
Well, yes and no. You can't rely on :type because SBCL doesn't typecheck at default optimization levels, which means that 80-90% of your users won't actually have typechecks there if you use :type
10:50:27
aeth
phoe: You can of course use a SATISFIES type, but I probably should just make it a generalized precondition/postcondition system since I'm using ASSERT anyway.
10:51:51
aeth
I should probably move the file I linked to into its own library because it's independent of my zr-utils and it's pretty much complete and usable, unlike the rest of it.
10:55:31
aeth
Well, it wouldn't just be type checked because I'd add a second slot for general assertions, mainly for sequence/etc. checking.
10:55:33
phoe
I'd actually be pedantic and manually expand a CHECK-TYPE in there to make it possible to pass the type dynamically at runtime, so the STORE-VALUE restart is preserved
10:57:05
aeth
phoe: How could you use a CHECK-TYPE at all in there? CHECK-TYPE's type isn't quoted. MACROLET?
10:57:31
aeth
I don't think I've ever used a MACROLET because they're nearly impossible to debug when someone else uses them.
10:58:48
aeth
Although if I guess if I did use a CHECK-TYPE it would probably make the other custom argument fairly obvious: checked-assertion...
11:19:14
phoe
(huh, writing this kind of stuff becomes suspiciously trivial once you've written your own condition system)
11:47:42
aeth
phoe: Oh, can you look over my conditions file? https://gitlab.com/zombie-raptor/zr-utils/-/blob/master/conditions.lisp
11:48:08
aeth
phoe: Those were the most common (error foo) patterns in my engine so I turned those into define-conditions a while back.
11:49:08
aeth
The idea of putting it in my utility library (and I might even move that into its own standalone library) is that that makes it easier for different libraries/programs to use the same conditions
11:51:33
aeth
Oh, hmm, I guess I don't. This is why I like exports at the top of the file. Makes it easier to spot that kind of thing.
11:52:04
phoe
a unit test suite would have caught this sort of thing - which is why I try to unit test every single thing I can
11:52:59
phoe
I'd split longer report functions into their own named functions, but that's a matter of taste
11:53:48
aeth
I probably will build those out of helper functions/macros at some point, but I haven't written enough to make clear patterns
11:54:01
phoe
and the starting vowel kind of stuff literally begs to be a helper function unto its own
11:55:34
aeth
yeah, I'm not very happy with that lambda in general... it was pretty tricky to write and iirc it was more about getting it to work correctly with the (REPL, not unit) tests.
11:55:56
aeth
Quite a few different branches, but they're all useful because of how common that error is
11:57:37
aeth
I could probably build required-input-error into another, third assertion in the checked-types metaclass
14:10:03
jcowan
aeth: I never thought macrolet/let-syntax made very much sense. "In section 2 of this paper, the notation A ~ B means blablabla, but in all other sections it means bliblibli". Who organizes papers like that?
14:23:07
jcowan
In Dijkstra's guarded-command language, if you refer to a variable in an inner block you must redeclare it there
16:15:07
beach
I mean, I don't think there is a requirement like that. If you stick an :AROUND method that supplies initargs, I don't think that is illegal.
16:17:29
phoe
"The generic function reinitialize-instance can be used to change the values of local slots of an instance according to initargs."
16:18:03
phoe
I can kinda infer that if the user supplies no INITARGS then the user may expect nothing to change
16:18:35
specbot
Reinitializing an Instance: http://www.lispworks.com/reference/HyperSpec/Body/07_c.htm
16:24:07
phoe
I ran into an issue where my buggy code cleared out values of slots after calling REINITIALIZE-INSTANCE with no initargs
16:24:34
Bike
but if you want reinitialize-instance to refresh its place in an external store or something that would probably be okay.
19:41:09
pimpom
Can I "expand a list" an pass the contents as input to a function in CL? E.g. I have some function (defun some-fun (arg1 &rest args) ...) and want to pass "args" as several arguments to another function call within this function.