freenode/#lisp - IRC Chatlog
Search
14:12:30
Bike
based on its use in ensure-compiled-body, i think this must work with whole lexical environments. how about that.
14:26:29
Bike
i've found the idea of a system where you could do (enclose [some function] closure-values...) interesting, and i guess you could use that to implement this, provided you were allowed to deal with the kind of uncompleted function
14:29:17
phoe
Bike: you'd need to have three kinds of functions then: functions that aren't closures at all, as in, they don't depend on their lexenv; "open closures" that require an environment but don't have it yet, and "closed closures" that have been supplied a lexical environment
14:31:41
Bike
of course for just this compiler thing, the second kind only exists within the system, so it's no big deal
14:33:06
phoe
yep - just, if you want to make them first-class objects, you'll want to elevate them into actual user-interactable objects
14:34:50
jackdaniel
beach: in a sense that I can't take the function lexenv at runtime and inquiry "what is X"
14:35:14
Bike
compile time lexenvs are first class, depending on what you mean by "first class", i guess
14:35:25
phoe
they usually only exist at macroexpansion- and compile-time, they are of dynamic extent, and pretty damn hard to reach and interact with
14:35:50
phoe
but they fulfill the notion of first-classness because they can be returned as values, taken as arguments, and operated upon via cltl2 functionality
14:35:58
Bike
letting code deal with runtime lexenvs arbitrarily puts you in perl world and makes compilation impossible, so i'm okay with that not happening
14:36:49
phoe
jackdaniel: that's another reason why I said kind-of-already-are; cltl2 isn't ansi cl, but implementations provide that functionality anyway, so we may as well live with it
14:37:00
jackdaniel
sure, I'm not saying it is not rational, just suggesting that when you need to interact with them at runtime it is problematic
14:37:28
phoe
jackdaniel: yes, it *is* problematic - these object aren't meant to be interacted with at runtime, unless you enjoy poking your fingers into compiler stack frames
14:38:26
phoe
jackdaniel: sure - it's possible that I'm just ignorant about the topic, my phrasing is based on what I've seen so far
14:40:22
Bike
https://franz.com/support/documentation/current/doc/operators/excl/compile-lambda-expr-in-env.htm
14:40:45
jackdaniel
phoe: I think that only cmu, sbcl and ccl (from free implementations) have cltl2 interface implemented
14:41:42
jackdaniel
(and last time I've tested it they had some problems with declarations, I have it noted somewhere to report when I'm done with cltl2 interface implementation for ecl - postponed for after 16.2.0)
14:44:17
jackdaniel
it is also a question of expectations. i.e you may optimize out some variables and have a very suprised programmer that lexenv doesn't have x
14:44:20
pfdietz
It just means keeping track of how you stored lexical variables (and their names), so you can hook new code into that. There's not even a performance penalty if the runtime lexenv is never manifested in the code.
14:46:54
pfdietz
If I am understanding it properly, the CLtL2 lexenv interface does miss one thing I'd want: getting a list of all the lexical variables visible in the lexenv (and lexical functions).
14:48:45
jackdaniel
I think that's true, I've just seen an email on cdr mailing list with mraskin proposal (based on cltl2): https://gitlab.common-lisp.net/mraskin/cdr-walkability/blob/master/walkability.txt
14:53:45
jackdaniel
I've got interrupted at some point with it, but it revealed some issues in cltl2
15:15:42
selwyn
moldybits: the library array-operations at https://github.com/bendudson/array-operations has some nice methods to combine and split arrays of arrays which may give the behaviour you would like
16:54:40
drmeister
How often do people (set-funcallable-instance-function funcinst (let ((x ...)) (lambda ...)))
16:55:45
drmeister
Setting the funcallable instance function to a closure? I may need to slow that down for thread safety
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.