libera/#commonlisp - IRC Chatlog
Search
21:22:33
White_Flame
when a customer wants a program to do X, and just wants it invoked by whatever their devops does, regardless of language implemented
1:04:16
cpli
how do i include trivial-features in my project such that i can `error` on certain trivial features?
3:13:22
loke[m]
@cpli:libera.chat: you just add it to the dependencies in the asd file, or am I miunderstanding the question?
4:00:05
jmercouris
are you trying to actually literally call something from the trivial features system in your asd?
4:12:35
bitblit1
<jmercouris> "are you trying to actually..." <- I think that is what he was trying to do.
4:13:29
jmercouris
then you have a couple of options, basically you can require it, embed it in the top of your asd and use it
6:28:34
bitblit1
So, I asked about compiling your program while it's running to see "live reload". I understand now that anything in the loop with it's own compilation unit will be able to reload while the application is running. However, how will I update things that should NOT be in the loop. Such as init functions. Let's say I am working on creating a game or whatever, I want to write the code to create a window and compile it while the program is running
6:28:34
bitblit1
and want to see it update live. However, putting the CREATE-WINDOW function in the main loop will create too many windows. I don't know how to get around this problem. Do I have to check if it is the first instance of the loop? If so, when I compile, will the loop rerun making it the first iteration of the loop?
6:35:02
bitblit1
Or the loop which runs and keeps checking for any events that might have to be processed
6:55:30
beach
If your application starts by executing some initialization code and then runs an application event loop or command loop, then if you want to alter the initialization code, it is very likely that you need to restart the application.
6:55:31
beach
You could execute additional initialization code at the REPL, like to create a window, but it would be complicated to make your application take it into account. You would have to think hard about how to structure your application in order for it to take such modifications into account.
6:57:14
beach
In other words, you can't have an application with some arbitrary structure and then expect it to respond to arbitrary code modifications at the REPL. You have to think about the modifications you might want and structure your application accordingly.
7:00:17
bitblit1
beach: Yes, so I understand most of the implementation and structure now. For example, I could create a render method which could look at a list of windows and keep on rendering/updating them. This is great as I could have an empty list and it would render nothing. Now all I have to do is change the window list, however, to do that, I would need to be able to access it easily, through a global variable. If i want to avoid global variables, I
7:00:17
bitblit1
would have to create a state class which would keep track of my state and update that. Is this correct? And if so, is it even a good idea?
7:02:16
beach
Sure. For instance in a CLIM application, the "application frame" is meant to hold "global" information about the application. At some point, though, you need at least one global variable, and in a CLIM application, this is CLIM:*APPLICATION-FRAME*.