freenode/#lisp - IRC Chatlog
Search
6:38:30
pillton
no-defun-allowed: You can dispatch on types in https://github.com/markcox80/specialization-store. There are a few caveats though.
6:41:44
fiddlerwoaroof
Lispworks will signal a condition like "Error: The type specifier (FUNCTION (STRING) BOOLEAN) cannot be used for discrimination." when using a function type as a slot type
6:44:34
fiddlerwoaroof
I think this maybe be fixed in more recent versions (I put in a support request and got a patch) but the Support person mentioned that the standard says that the slot type should be checked, which is impossible for function types
6:45:23
fiddlerwoaroof
Although, I guess at high safety levels, you could transparently wrap the SETFed function with a function that checks the arg types and the return type
6:47:20
fiddlerwoaroof
I was just trying to install something from QL and got an error, that I solved by removing the slot type definition
6:48:15
fiddlerwoaroof
Then, when I put in a ticket with Lispworks, the sales rep mentioned that the standard for defstruct seems to imply that type is checked... which he claimed to be impossibe
6:49:38
pillton
They are only useful for compiler declarations. You cannot use them to test if a closure accepts arguments according to a given function type.
6:50:17
pillton
I think Bike has looked in to using them for discrimination. I think he concluded that function types are a lost cause.
6:51:15
fiddlerwoaroof
Couldn't you dynamically replace a lambda with a lambda that does something like (check-type (old-lambda (check-type arg1 type1)) 'return-type), though?
6:52:08
fiddlerwoaroof
i.e. treat the type as a contract to be enforced at run time, rather than as a static type declaration
7:05:38
fiddlerwoaroof
Sure, but that's why you make it conditional on the safety and/or speed declarations
7:09:14
ggole
The performance hit can be pretty savage in bad cases, I think the racket people were talking about a few orders of magnitude.
7:23:42
fiddlerwoaroof
the racket contract system is pretty sophisticated too: they have things like Higher-order contracts and stuff
7:32:46
fiddlerwoaroof
But if you want something in the same spirit, there's https://github.com/shinmera/lass
7:34:25
fiddlerwoaroof
Shinmera used to be around here more often and I think that's how I found out about this
7:34:50
fiddlerwoaroof
Generally, Shinmera's libraries work well and have nice APIs and documentation
7:35:55
fiddlerwoaroof
most recently, I've pubilshed data-lens to quicklisp, which is a badly named collection of utilities for building functions up from simpler functions
7:39:48
fiddlerwoaroof
I intend to eventually add features for doing matching reads and "updates" to data structures in a functional styles, so it will actually be somewhat like its name
7:42:20
phoe
fe[nl]ix: lemme make a more descriptive ping: is my current version of split-sequence better for reviewing?
8:05:50
fiddlerwoaroof
rutils, which gets frequently pulled in as a dependency declares a macro on :+ :- :/ and :* to do in-place math
8:06:39
fiddlerwoaroof
Error: Defining macro :FOOBAR visible from package KEYWORD { *handle-warn-on-redefinition* is :ERROR }
8:33:16
dim
the main problem I have with pgloader/SBCL is “Heap exhausted during garbage collection”, where can I read about how to handle “consing” in CL and limit it drastically?
8:46:41
dim
last time I tried to profile pgloader the profiler worked but didn't get useful information, because in a typical small-data run we start a lot of short-lived threads
12:48:55
Ukari
https://plaster.tymoon.eu/view/1178, is it impossible to export function printop in eval-when block in this situation?
12:53:16
Ukari
https://lispcookbook.github.io/cl-cookbook/process.html#print-a-message-onto-the-top-level--read-time-eval-macro
12:57:17
_death
when you create a thread, it is possible to bind *standard-output* to the calling thread's *standard-output* value
13:38:05
Ukari
Is it a good practise to change a third library global variable, like bt:*default-special-bindings*?