Search
Tuesday, 20th of October 2020, 21:01:06 UTC
21:37:26
Bike
the function copier needs to know, in general, which variables are closed over, so that it doesn't copy them
21:37:39
Bike
but i suppose i can just check the variables slot of the copied function
21:37:48
karlosz
you can query whether a variable is closed over without pcv, fyi
21:38:02
Bike
oh, by like, checking the readvar against the binder function
21:38:13
karlosz
yeah theres also closed-over-p that does that for you
21:38:26
karlosz
the idea is that pcv is only responsible for filling in environments transitively
21:38:37
Bike
i see. should be fine then.
21:38:40
karlosz
whihc is why it can basically be the very lsat thing that ever happens because nothing else should care
21:38:58
karlosz
its basically impossible to delete a variable from an environment transitively, so it has to go last
21:39:09
Bike
right, that's the problem i was wondering about
22:00:18
karlosz
did the hir compiler style warn about unused variables?
22:03:27
karlosz
what's slightly embarassing is that we don't do something like (if nil 1 2) => 2
22:03:38
karlosz
which is really a must with macro generated code
22:03:51
karlosz
having bottom up metaevaluation in any capacity would be nice
22:04:22
karlosz
with constant folding we could speed up a lot of stuff
22:04:29
karlosz
just need a better reresentation of constants
22:07:25
Bike
it did not warn about unused variables
22:07:34
Bike
constants should be better in bir now
22:07:46
Bike
like if you have nil in source code it will actually be a bir:constant with constant-value nil
22:08:02
Bike
also i remembered the actual problem: if you copy (lambda (x) (lambda () x)) you need to copy the inner function since the variable is copied
22:08:12
Bike
but if you copy (lambda () (lambda (y) y)) you don't need to copy the inner function
22:08:23
Bike
i guess i can probably finagle this without doing PCV though
22:10:54
karlosz
Bike: what are you using a function copier for, exactly?
22:22:02
Bike
it's less important for closures, admittedly
22:22:33
Bike
and copying everything is semantically fine
3:01:06
beach
Good morning everyone!
Wednesday, 21st of October 2020, 9:01:06 UTC