libera/#commonlisp - IRC Chatlog
Search
4:48:00
Spawns_Carpeting
i seem to catch on to the whole compiler thing a little more slowly than others
4:48:41
Spawns_Carpeting
i guess in my VM a struct slot accessor could just put a reference to a struct field on the stack or something
5:19:06
hayley
The easiest solution would be to pass the name of the slot to a SET-SLOT instruction, or something.
5:19:58
hayley
...and also some description of the structure that you want to write to, if you are checking types like an accessor function would.
5:45:34
Spawns_Carpeting
i have another question, sorry for asking so much stuff. are SBCL threads "managed", meaning I can use them without worrying about races and similar issues
5:46:28
Spawns_Carpeting
like, trying to read and write to something at the same time and ending up with the wrong value
5:46:57
hayley
As far as I know, Lisp implementations offer the same guarantees as Java, i.e. you'll read some written value and not total garbage.
5:47:50
dbotton
race conditions, they just map to system threads which do not provide any protections
5:48:21
hayley
(It's basically free on modern hardware, since cache coherency protocols just don't let you see word tearing.)
5:50:08
dbotton
Is there a way to "skip" adding to the return list during a mapping function like mapcar?
6:39:21
beach
dbotton: I recommend you do the thing that gives the most readable and maintainable code. Then you can measure whether your solution needs performance improvements and if so where.
6:40:00
beach
dbotton: Programmers are notorious for being wrong about what parts of the code take the most resources.
6:40:51
dbotton
Agreed. The remove nil version in this case more elegant and efficient enough for its purpose
6:41:42
beach
This is especially true for inexperienced programmers, who often fail to design good algorithms and data structures, and instead concentrate on what they (think they) know, i.e. low-level performance.
6:47:49
Bike
dbotton: you can do mapcan, returning a list of one element or nil. loop will probably be more readable though.
14:41:28
dbotton
My first paid for program was 40 years ago. A program for the psych department of Nova university (south Florida us) running on trs-80s attached to a cables so could load the app to many machines from the same tape recorder
15:02:14
pjb
dbotton: nice. Mine was a program in basic on TO7 to drive some lights on an advertizing panel for some conserve can manufacturer.