freenode/lisp - IRC Chatlog
Search
7:19:59
fiddlerwoaroof
So, I've noticed there's been a lot of talk about abandoned libraries and libraries that are about to be abandoned.
7:20:40
fiddlerwoaroof
I'd love to be able to be able to help maintain some libraries, but I don't have much spare time these days
7:56:33
Fare
so no big breakage expected. Actually, Xach and stassats will probably be relieved that I'm not there anymore... unless someone even more radical than I replaces me, of course.
8:35:36
jackdaniel
code doesn't belong to "self-documenting" type either, so maintaining it would require some motivation and time
12:09:30
dmiles
if someone use LABELS at the toplevel of a file, are these declared in the global environment?
12:13:35
jackdaniel
so if you define functions A and B in labels and you call B from A, it will call this B you have defined
12:14:11
jackdaniel
if you define them in flet, then it will call B from the environment in which you put flet/labels
12:15:12
jackdaniel
try (defun a () (pring "hi!")) ; (labels ((a () (print "hi from labels!")) (b () (a))) (b)) ; (flet ((a () (print "hi from flet!")) (b () (a))) (b))
12:21:57
elonopea
anyone know how to turn off auto-repeat-mode in CLX for the duration the program is running, and then ensure it's turned back on before gracefully exiting? I currently have the auto-repeat-mode turned off globally before the loop, and turn it back on on a key-release event, but this doesn't work unless I return nil from the key-release clause. if I close/destroy the window/display within the key-release clause, auto-repeat-mode gets
12:23:14
elonopea
I then issue Abort and get back to REPL with key repeat back on, but how to do this cleanly?
12:24:03
elonopea
sorry, auto-repeat-mode gets turned ON if I destroy the screen/display within the clause
12:25:43
elonopea
I thought I could just add the call to turn auto-repeat-mode off into the key-release event clause (within event-case) as that would return T, but although the program exits auto-repeat-mode stays off
12:28:57
elonopea
I'm not sure how to go about this. yes, key repeat remains off globally in X after the program exits.
12:31:50
elonopea
here is the code: https://pastebin.com/UTq1FXRr (sorry about horrid indentation, comments and stray parens, I've been moving stuff around in desperate attempt to fix this)
12:32:36
jackdaniel
I would appreciate if you could fix the indentation before I try to tread the code
12:51:12
elonopea
jackdaniel: https://pastebin.com/7qLiWsrq - hopefully better, though not necessarily perfect by the book...
12:54:22
elonopea
apparently sneaked in an indent inconsistency with the key-repeat declarations. I've been splitting the keywords on separate lines for clarity, and try to condense when I think I'm done twiddling with them
12:57:52
elonopea
jackdaniel: when I release key 's', the key-repeat is turned back on, but it throws me into debugger: https://pastebin.com/Nv6un6Yv
12:59:22
elonopea
I tried to put it after the event-case form, but it never changed the key-repeat, so when I get back to REPL it's off
13:00:45
elonopea
same if I only leave the change-keyboard-control call to turn repeat back on inside the key-release clause within event-case, then the program exits but key-repeat is still off. I don't get it to be honest.
13:02:29
jackdaniel
btw, what clx do you use? I see `require' call – what is your lisp implementation?
13:03:27
elonopea
with the current code, key-repeat is on (as supposed), but it throws me into the debugger. I don't really understand the event handling well, seems like it's async and I don't know how to bring the whole thing down in controlled manner
13:04:12
elonopea
the xembed is for something else entirely, it's from quicklisp. not sure if I even need it (for something else I'm doing)
13:15:38
elonopea
alright, thanks... I've been reading the manual but frankly the lack of examples is killing me. even google has been quite unhelpful on this particular topic and I've had to resort to somewhat unrewarding studying of random (mostly uncommented) code
13:16:35
jackdaniel
when you grok it, and if you are willing to spend some time, you could write a tutorial for CLX
13:22:14
elonopea
I glanced at it but often my problem with reading other people's CL sources is the (IMO) over-eager abstraction... people toss way too many layers upon layers of code for the sake of making everything general, tidy and purpose-built, but hiding the simple and obvious logic and structure in the process. or that's how I often feel. when I'm trying to get friendly with a new API I appreciate really, really stupid code that I can then h
13:23:30
elonopea
anyway I'm going to take a more careful look at the demos now... if I get somewhere with this stuff I'll take the tutorial into consideration :-)
13:29:25
pjb
elonopea: on the other hand, I don't find that most lisp code is too high level or abstracted at all; on the contrary, I find it rather rare to find multi-layered abstraction levels. The reason being that it's costly to produce (in time and IQ).
13:29:47
|3b|
Shinmera: isn't that a protocol problem, so clients can at best be "more conservative" rather than "not broken"?
13:30:38
Shinmera
|3b|: There is a way to make it perfect, but even just having an arbitrary limit that is low enough to not just split your messages is better than trimming your messages and not realising.
13:30:58
pjb
elonopea: you may want to read/study sicp Structure and Interpretation of Computer Programs http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/
14:11:08
elonopea
pjb: thanks. I know SICP but never got around to reading it. meanwhile I've acquired a ton of other literature on Lisp.
14:19:53
mfiano
It is conforming for a client of IRC to either continue or cut off text consisting of more than 503 characters.
14:29:08
mfiano
Reading it again, it's kind of funny though, because character encoding is not mentioned at all.
14:30:21
|3b|
ACTION thought it also includes host names, making it harder to predict where it will be further truncated during transmission
14:31:32
Shinmera
|3b| is correct. You can't know your own hostname because the server might change it somehow
14:31:49
Shinmera
So you need to first probe for your own hostname, remember that, and then calculate the proper prefix length to split "perfectly".
14:40:11
pjb
mfiano: and indeed, in practice you have channels using any coding system. Some are ASCII, some are Latin-1, some are utf-8, some are KOI, etc. You can find any encoding.