libera/#commonlisp - IRC Chatlog
Search
22:13:46
pjb
but since you have to test for null, you can as well test for consp. Then if not consp, you can check for a dotted list with null only on the last cdr.
2:36:11
mfiano
Random thought: Should library authors that have public-facing interfaces that accept any specific or subset of sequences as input, is it a good idea to always use COPY-TREE or the appropriate function before mutating a list "from the outside" that you didn't create, or should the caller always be informed of the semantics and it's their responsibility not to pass a list literal...or both,
2:43:49
mfiano
Nevermind. That question didn't come out the way I wanted it to, and it doesn't make a lot of sense.
3:11:20
Bike
destructive interfaces are ok as long as they are documented as such (and "may destroy" versus "mutates in this particular way" is indicated)
3:11:45
Bike
and often a good idea practically speaking, since consing up a bunch of needless intermediate results slows things down
4:34:38
mfiano
One thing that upsets me about the standard, and I just had to double-check to make sure I was remembering correctly, is there is no way to get a lazy sequence of the keys stored in a hash table, except within the lexical environment of with-hash-table-iterator, and there are all sorts of UB around trying to make it dynamically scoped with a closure or whatnot.
4:35:54
mfiano
I really would like a non-consing alternative to MAPHASH-ing to retrieve all keys, as the starting state in a custom iterator, which is more or less, what I'm trying to accomplish.
9:24:01
beach
That's a very strange question. I mean, the answer is "Of course, it happens all the time. Just look at something like PRINT-OBJECT."
9:27:00
beach
The use of special variables is no different from the use of special variables in ordinary functions.
9:27:12
beach
The use of special variables in methods is no different from the use of special variables in ordinary functions, I mean.
9:29:54
beach
I don't see the relation between &ALLOW-OTHER-KEYS and special variables. Also, &ALLOW-OTHER-KEYS is not reserved for methods. It is used in ordinary functions as well.
9:31:05
lisp123
I was thinking of allowing people to override the primary method based on giving them flexibility in &allow-other-keys
9:35:38
lisp123
Where it is different from normal functions - there is typically no expectation that an ordinary function would be redefined,so arguably special variables should not be an implicit parameter but rather explicit in the parameter list
9:36:02
lisp123
Whereas with generic functions and the capabilities offered by method combinations, maybe its more appropriate