libera/#sbcl - IRC Chatlog
Search
10:25:11
karlosz
stassats: did you have a sketch of how to implement the precise type checking for declared var cons.array types?
13:58:51
stassats`
just adding (assert-lvar-type (node-lvar node) (sb-kernel::member-rational results) (%coerce-to-policy node)) to derive-type works
15:29:35
karlosz
and did you also think that only stuff like (car x) with a variable declared of that type can actually get that assertion?
15:30:16
karlosz
if we are really strict then it's really just variable declarations and immediate accessors of them
15:41:59
stassats`
i had a comment somewhere about the memory model, if there are no serializing nodes between (read calls), then (the (cons fixnum fixnum) cons) really becomes (let ((car (the fixnum (car cons))) (cdr (the fixnum (cdr cons)))))
16:33:18
karlosz
stassats: what i meant is you can no longer assert the type once it’s not from a variable type declaration
16:35:38
karlosz
even if you bind X to (list int int int) and declare it to be so the compiler can not assert the derived type of (cdr x) to be (cons int int) so it has to throw it away
16:36:42
stassats`
if you declare a variable as something, and then lie about it, you get a type error
16:37:55
karlosz
(car x) when x is declared (cons fixnum fixnum) should assert that the car value is fixnum, yes
16:39:33
karlosz
but (let ((y (cdr x))) (random-call y) (car y)) when x is declared (cons fixnum (cons fixnum fixnum)) or whatever can no longer do anything
16:40:13
stassats`
not because it should go one level, we just don't have a way to express it using types
16:44:37
stassats`
(let ((y (cdr x))) (random-call y) (car y)) becomes (let ((y (the (cons fixnum fixnum) (cdr x)))) .. (car y))
16:44:48
stassats`
but (car y) should be (the fixnum (car y)), since it's still part of the original X
16:47:38
JoshYoshi
Under what circumstances can I guarantee that a variable whose contents is generated at compile time will be available after an application is deployed via save-lisp-and-die?
16:49:06
JoshYoshi
So if as part of the compilation I just call my function to build the contents then it'll be there as is in the running lisp? That makes my life much easier!
16:50:10
JoshYoshi
another random question, but what is the advantage of using defglobal over say (alexandria-2:define-constant ?
17:27:12
JoshYoshi
Manual says 'Allows more efficient value lookup in threaded environments in addition to expressing programmer intention.' So I can think of places where this is relevant