freenode/#lisp - IRC Chatlog
Search
7:54:38
Shinmera
Statistically, compared to the things I haven't written yet, I have not written anything at all :)
7:56:52
aeth
Shinmera: did you write an infix library? it would be interesting to compare the various solutions people have for implementing one
7:58:24
aeth
I have no use for infix, but I got distracted by it because I think there can be some elegant solutions there.
8:00:38
aeth
I made a solution that at the moment is only designed to work with binary operators with no precedence rules (it's an error to write 1 + 2 - 3 because there's no precedence). https://gitlab.com/snippets/1747132
8:04:20
Shinmera
I mean if all you're interested in is the parser logic, here you go I guess https://github.com/Shirakumo/glsl-toolkit/blob/master/grammar.lisp#L176-L238
8:10:21
Shinmera
Hopefully at some point I can convince Baggers to make Varjo output to glsl-toolkit's AST so that the two can be combined easily.
8:13:31
aeth
The other GLSL generators' goals are actually to make it interchangeable with CL for easy refactoring afaik.
8:16:58
aeth
I can definitely see why Varjo's integration with a math library has it's users, though.
8:38:47
Ober
ACTION images ELS to be the same crowd of folks who would rush to greet an Alien saucer landing.
8:40:35
aeth
Ober: It's unlikely that an alien visitor to Earth would still be biological, so of course everyone would want to know what their source code looks like.
11:23:28
makomo
what is the proper way to ensure a function is available at compile-time for a macro, *if* it's from another package you don't control?
11:24:16
makomo
i.e. you can't just add an EVAL-WHEN around the DEFUN because you don't control the source
11:25:02
Shinmera
? If you have a system as a dependency it's loaded before your system even starts compiling.
11:26:47
makomo
right, that's what i thought but are those DEFUNs from the loaded system required to be in the compilation environment?
11:27:23
makomo
i mean, what's the difference between those and anything i control/compile? i need an EVAL-WHEN, why don't they?
11:27:50
_death
because you put your function in the same file and that file contains uses of the macro
11:29:43
_death
no, the point is the macro-using forms being in the same file as the macro and its dependencies..
11:36:17
Shinmera
It does not. Consider (compile-file "a.lisp") (compile-file "b.lisp") (load "a.lisp") (load "b.lisp")
11:37:21
Shinmera
You're just "lucky" that ASDF compiles and then immediately loads everything sequentially.
11:39:55
_death
if b.lisp is dependent on definitions in a.lisp, then it means a.fasl must be loaded before compiling b.lisp
11:42:59
pjb
If b.lisp needs at macroexpansion time functions defined in a.lisp, then use: (load (compile-file "a.lisp")) (compile-file "b.lisp")
11:43:30
pjb
makomo: the trick here, is that the compilation environment used by compile-file is the run-time environment where compile-file is called.
11:48:39
makomo
but isn't that a separate problem? i guess i wasn't too clear. what i was getting at with "it must be in the same file" was for the case when all of the macro's dependencies are within the same file as that macro
11:49:35
Shinmera
If the dependencies are in separate files, but the files are all compiled without being loaded, you still need to use eval-when.
11:50:10
_death
again, no.. if you move the macro-using forms to another file that gets loaded afterwards, then you don't need eval-when
11:50:33
Shinmera
In the general case of an ASDF sequential-plan, this case won't occur, but it really has nothing to do with files, but simply with the order in which the phases happen to which parts of code.
11:51:35
_death
makomo: me too. if you have a macro and a function that it calls when expanded, there's no need for eval-when if there's no expansion of it happening in the same file
11:51:59
Shinmera
defun is specified to only have load-time side-effects, so you need to eval-when it if you need it to have compile-time side-effects, that's all.
11:52:40
pjb
It's worse than that! If you compile the files without loading them, then it's possible that no compiled definition is known after compile-file returns!
11:52:42
makomo
Shinmera: yeah, true, it isn't intrinsically related to files. it's just that i think of it that way since the lisp compilation process specifically mentions files
11:53:16
pjb
The compilation environment is not necessarily the same as the startup environment! It can be a new environment created by compile-file, and thrown away once compilation of the compilation-unit is finished.
11:54:56
pjb
(with-compilation-unit (compile-file "a.lisp")) (compile-file "b.lisp") would let the compiler know what has been compiled in a.lisp while compiling b.lisp, but it wouldn't be sufficient, since the result of that former compilation may be not available. You would still have to wrap the functions definition in a needed by b in an eval-when.