freenode/#lisp - IRC Chatlog
Search
17:32:30
pjb
drmeister: so I would say, not often. It's used with call-next-method in the closure in compute-discriminating-function.
18:21:03
moldybits
jdz: i'm representing a 2d dungeon. i want to be able to pick out rows, as well as rectangle slices easily. it's probably just as easy with arrays, but i lack experience with them
18:24:01
mfiano
Oh it's a procedural dungeon generation library I created and recreated a few times over the years. Sadly the images seem to be down: https://www.michaelfiano.com/projects/gamebox-dgen/
18:28:24
mfiano
The function `TEST` should draw it out using unicode line drawing characters in the REPL.
18:30:59
moldybits
cool. i'm patching this through to decent-username. he's doing the map generation thing :)
18:31:24
mfiano
I use it to create all my dungeons, like https://files.michaelfiano.com/images/screenshots/img-20190205113554.png
18:37:49
moldybits
i've had a miserable time getting started, but this is good practice. next jam i'll be more prepared :)
18:41:32
mfiano
That's the idea, and why it's encouraged to submit something even if you don't finish. It sets the bar for next year, and allows others to use it as a base to build upon
18:45:53
mfiano
Ah, I found a visualization of the data structure it produces: https://files.michaelfiano.com/images/screenshots/img-20190203163111.png
18:46:50
mfiano
dark gray = solid, light gray = corridors, blue = rooms, pink = doorways, and you can just ignore the orange circles
18:48:19
mfiano
and you can tweak it pretty well, such as controlling how windy the corridors between rooms are, and the number of cycles added to the MST
18:50:22
mfiano
The orange dots don't mean much after the dungeon is built. They define the graph for when the MST is computed. Basically, an orange dot represents where a doorway could have been.
18:51:37
moldybits
is there an obvious way to simulate an infinitely sized array (for the purpose of not having to worry about bounds-checking, and defaulting to some value)
18:51:59
mfiano
There are some constraints, such as a connector (orange dot) can't be next to a door (pink), and they must be orthogonally and never diagonally adjacent to grey or blue
18:59:21
mfiano
moldybits: either use a vector with vector-push-extend, or if you require a multiple dimension array, you'll have to do the work with adjust-array manually
19:01:22
moldybits
hm. okay, i'll look into that if there's time. for now i'll just make the dungeon extra large :)
19:01:59
aeth
Depends on what you mean by infinte. You have to be fancier if you're infinite in *both* directions. Probably by having two actual adjustable arrays, one starting at 0 and the other starting at -1 and then convert the minusp indices to (abs (1+ i)) on the second array
19:06:52
aeth
For people who use both structs and standard objects (some people never touch structs), holding thinly wrapped array data structures is a good use for structs imo.
19:27:05
sjl
I've used complexes instead of 2-element vectors for representing 2d coords in games/art/etc before. You get arithmetic functions, eql-ity, reader syntax, etc all for free.
19:41:49
jasom
fun fact, 2 64 bit integers are sufficient to represent any position on the surface of the earth to a precision of 1pm
20:32:04
aeth
There are all sorts of fun things you can do with location, like combining a (signed-byte 32) with a single-float
22:18:11
katco
it claims to convert CL types to python types, but this works: `(py4cl:python-eval "foo")` and this doesn't `(let ((s "foo")) (py4cl:python-eval s))`
22:26:08
grewal
Josh_2: One nice feature of python's type system is that there isn't a character type. They just have strings of length 1. It frequently simplifies things
22:30:28
[rg]
howdy, any books that give a cursory overview? the little schemer is cute but I could go faster without the repetition
22:37:26
Josh_2
There was an article sjl wrote about CL which people really like http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/
22:39:21
minion
[rg]: direct your attention towards Practical Common Lisp: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
22:40:49
no-defun-allowed
but it gets into full applications quicker than SICP which is useful for beginners to keep attention
22:41:22
no-defun-allowed
and the curve of the book is not as steep, SICP brings you up to creating a compiler for a register machine, PCL does not
22:51:34
Pixel_Outlaw
Does anyone have insight into the way the original LISP bound symbols? Was LET supported initially?
22:55:17
grewal
What do you mean by "Was LET supported"? You can use a lambda instead of let, so in a sense it's always been supported
22:58:12
Pixel_Outlaw
grewal: I just wanted to make sure that some form of scoping was provided. Some of the languages of the era just used a big bunch of global variables.
22:59:01
Pixel_Outlaw
grewel: I may or may not be in a small debate with a COBOLista on scoping and history.
22:59:06
grewal
I remember reading that all variables were dynamic. Lexical variables came with scheme.