freenode/lisp - IRC Chatlog
Search
2:10:54
dmiles
(though i guess is just getting the stream copied correctly is the basic underlying problem)
2:10:56
sjl
I'm not just gonna copy the entire stream contents into a buffer or something. There could be more things in the stream after the file
2:12:39
dmiles
*not* what i am wondering is if you wanted to copy the data out of the stream is even really possible
2:13:16
sjl
Xach: I read an article somewhere that mentioned them, and they seem like a simple way to get graphics in/out, using e.g. imagemagic to reencode at the boundaries
2:13:40
Zhivago
sjl: Presumably you don't care about streams -- just about reading the next N bytes -- so why not just provide a function which does that?
2:14:31
sjl
Zhivago: I care about providing a simple interface to the user, not working around the streams problem by making them provide a function
2:14:42
dmiles
Zhivago: i assume slj is wanting to be able to in most cases be able to extract which accessor will make sense
2:14:58
sjl
I want them to say (read-ppm-from *standard-input*) not (read-ppm-with (alexandria:curry #'read-byte *standard-input*))
2:18:21
Zhivago
sjl: You have stream-element-type which should allow you to automatically select an appropriate accessor, no?
2:19:28
sjl
Zhivago: I want to ensure binary streams, but not exclude bivalent streams like sbcl's standard-input
2:19:33
Xach
it did give me some lemonodor-fame over 10 years ago though! http://lemonodor.com/archives/2004/06/flashy.html
2:22:29
dmiles
actualy what almost sounds reasonable is for the user to &key stream-type for bivaliant streams
2:23:12
sjl
I think Xach's idea of trying to read the magic byte with read-byte first is a good compromise
2:32:12
dmiles
i would have expected the user to use the wrong type of stream even out of no choices so reading for a magic would be required most cases
2:47:59
dmiles
in a program i work with, a user supplies concatenated ascii and binary mixed from FASLs over a socket opened as either ascii or binary .. so in most transmitions i must change the element types based on some headers and even then they tend to lie
3:03:05
Zhivago
dmiles: Just imagine how much simpler it would have been if they couldn't do that. :)
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/