freenode/#lisp - IRC Chatlog
Search
18:38:41
flip214
beach: hmmm, I'm used to seeing address 0 at the bottom of the page. Never mind, though.
22:20:57
makomo
AeroNotix: hey, i was talking a look at your z80 repo and found a bug: your UPDATEF macro has 2 problems: (1) variable capture, (2) multiple evaluation
23:30:43
makomo
AeroNotix: in your case, both are very easy to solve. your place-based macro falls in the category of "having the place as the first argument and evaluating *all* the other arguments (specifically, in left-to-right order)"
23:31:35
AeroNotix
makomo: uh, wait, I didn't even use this macro. I think I've not even ran it once
23:33:15
AeroNotix
Thanks for mentioning it but yeah, it's not used nor was it ever. I'm not even sure if I ran it even once to try it. I think I got half way through writing updatef and realised the original place I wanted to use it could be implemented in a different way
23:34:59
makomo
oh, just to clarify, (2) is a problem because of the place's *subforms*. most of the time the final "getter function" used in the get expression is free of side-effects
23:35:56
AeroNotix
yeah I get that. I usually don't both with dealing with multiple evaluation in macros until a last step. I find the noise of macros quickly builds up so it's easier to write them in the "dumb" way and then fill in with the typical macro safeguards.
23:42:07
makomo
AeroNotix: same, i haven't yet read it properly. cachef seemed the most complex to me
23:42:28
AeroNotix
cachef seems quite scary to use. I don't like somewhat implicit caching behaviour
6:13:36
russellw
When writing a Common Lisp program, are you supposed to put your main program code at top level, or in a 'main' function? From my experiments thus far, putting the main program code at top level seems to work when running interpreted but not compiled
6:14:33
Shinmera
typically you write you software as a library plus a singular entry function that you may call main or whatever else.
6:16:16
russellw
beach, okay, rather than get into terminology questions, let's pretend I didn't say that part; would you agree with Shinmera that main code should go into a function rather than top-level?
6:16:42
jackdaniel
having entry point has benefits: you may provide top-level error handler, unwind-protect, load necessary assets which are not part of the image etc
6:16:59
aeth
russellw: If I was writing it like a script, I'd do it Python-style and have a main function and then a call to main underneath it, like (defun main () ...) (main)