libera/#commonlisp - IRC Chatlog
Search
22:29:57
fiddlerwoaroof
I dunno, I tend to find Lisp libraries higher quality than the typical library in other languages
22:33:17
aeth
But everyone seems to make the decision of no CHECK-TYPEs for you. Few packages export their custom type/class names.
22:35:53
aeth
but any string can just become a reader macro instead if you want to really annoy people and break all tools
22:56:04
cpli
_death i plan to use it specifically to `(when-let (key (remove-wrap "+key_" "+" sym)) ;...`
23:15:17
cpli
_death this is actually to `do-symbols` and generate a `case` to convert between (c enum) constants in a package and keywords
23:17:52
cpli
basically the `#:libevdev` package contains many `+key_<name>+` and i want a very long case statement which converts by `(case evdev-key-code (libevdev:+key_a+ :a) (libevdev:+key_b+ :b) #|...|# (libevdev:+key_<name>+ :<name>) ;...`
23:28:20
_death
you could also have some procedural code that checks if it's a symbol belonging to the libevdev package and its name having the right form and if so translate it on the fly
5:50:54
cpli
_death ~512 cases, right here: https://git.sr.ht/~cpli/clayboard/tree/dev/item/claybd/device.lisp#L24-32
8:18:37
cpli
i don't know why there even is a different macro for LET* if it makes LET entirely superfluous
8:24:58
hayley
LET provides "parallel" evaluation. Not as in that the values of the bound variables are produced in parallel, but that they don't observe each other.
8:25:04
beach
It doesn't make LET superfluous. You might want something like (LET ((X ...) (Y (F X))) to make X refer to an outer binding.
8:26:05
beach
cpli: But for this particular case, i.e., when the initform in a binding refers to a variable in a previous binding, LET* is the thing to use.
8:35:02
hayley
(We only have LET and LETREC in the system I'm co-designing; the latter behaves "close enough", except for when it doesn't, of course.)
9:59:34
cpli
beach i'm sorry, it does make sense to me. but being able to occasionally shadow a symbol seems far second to being able to use the symbols that you just defined
10:00:21
cpli
the fact that X may refer to an outer binding appears to me so situational and so niche i find it ludicrous for you to bring it up at all
10:01:03
splittist
cpli: using a LET rather than a LET* also signals to the human reader of the code that you are NOT referring to variables introduced in that LET, which aids in comprehension.
10:01:53
cpli
when was the last time you had deliberately referred to X after a LET-clause "declaring" that symbol?
10:02:28
cpli
i.e. referring to an outer binding after assigning to the same symbol for the body of the LET
10:03:00
cpli
splittist: then does splitting { a = f; b = g a, c = h a } into two LETs instead of one LET* not make sense?
10:03:46
jackdaniel
does it really matter if it is semantically correct and you prefer nested let (or single let*)?