freenode/#lisp - IRC Chatlog
Search
0:11:06
White_Flame
If I have a macro which should build up a hash table in a lexical scope for runtime code to use, what's the best way to do that? (let ((table ,populated-table)) ...) doesn't seem to be valid source code
0:30:20
pfdietz
You want the code generated from the macro to refer to the same hash table everywhere?
0:45:33
White_Flame
sorry, was afk for a bit. I run a compiler at compile-time, contained to a lexical scope. Some of its output should be exposed to the runtime as a hashtable. This generated function body should be able to run multiple times, seeing the same (read-only) hashtable which was populated at compile-time
0:46:31
White_Flame
so it's not the same hash table everywhere; each instance of it should have its own table it sees
0:48:23
White_Flame
I'm cleaning up old hacks, as well as fixing up code isn't working on new SBCL releases
0:48:58
White_Flame
so code isn't fine, but I'm also not sure that the crashes I'm hitting are related to this setup step
0:49:12
White_Flame
however, it's a hack I wish to eliminate, so gathering thoughts on a way this could be done
0:51:24
White_Flame
that wasn't working years ago, hence lots of workarounds. Might have been various pebcak problems
2:04:03
aeth
White_Flame: I don't see it as a hack, I see it as a valuable feature... that you can trivially make custom classes/structs also be able to do.
2:05:55
aeth
Trivial compile time evaluation is one of the last major remaining secret weapons CL has.
2:07:22
pfdietz
You could have multiple files using the macro, compiled at different times. How do you resolve the hash table differences?
2:10:09
pfdietz
One trick is to propagate values in the macroexpansion environment. I've used that for compile time lexical information.
2:23:49
White_Flame
aeth: the hack in place is to have a single global hashtable of hashtables, with gensyms per location doing a looup on invocation
2:24:54
White_Flame
ie, the code tested originally which tried to place hashtables in source code blew up. Now, I dont' recall if that was because of fasl loading or whatnot. Almost every problem we hit seems to be because we do appliation servers that are deployed as executable images, which then load up more code at the deployment site
3:18:19
aeth
White_Flame: What kind of functions? If they're 'foo instead of #'foo or lambda it should afaik be OK to funcall because it will look it up at runtime
3:21:57
_berke_
hi. I recall reading that there was something like a with-symbols macro but I can't find it
3:28:26
_berke_
now slime question. when you have erroneous code and hit C-c C-k slime asks you if you want to load the fasl. I don't, how can I get slime to STFU in that situation.
3:54:54
aeth
Personally, I use the online quicklisp because I can search it through !l1sp on DuckDuckGo (that's actually one of several supported sites), and I have a local copy as a backup for when the website is down or I am offline.
3:55:03
clintm
I swear there is, or used to be, a ql-installable package that starts a server in whatever image you load it on that has it.
3:57:44
jack_rabbit
hmmmm. (documentation 'package-name t) does not return my docstring... I must be doing something wrong in the defpackage.
3:59:21
beach
jack_rabbit: In the long run, you will save a lot of time by learning how to interpret the (sometimes a bit cryptic) dictionary pages of the Common Lisp HyperSpec.
4:00:00
jack_rabbit
beach, Yes, I need to get better at that. I realized my mistake, but not quick enough.
4:22:28
_berke_
I'm trying some cl-cuda examples and I wrote a simple macro, but as soon as I use quasiquotations I get a ton of SBCL warnings. https://pastebin.com/FMpVhysG (test1 totoro) is fine, (test2 totoro) gives warnings
4:32:41
_berke_
interestingly if I use (intern (symbol-name (gensym))) instead of straight up (gensym) it works, but I have no idea why or if this is correct
6:47:36
pillton
shka: I usually do (assert (typep x type)) to avoid the use-value restart messing with type inference.
7:04:43
pillton
Oh it is checked. The fact that an arbitrary value can be stored in the variable is probably the problem.