freenode/#lisp - IRC Chatlog
Search
2:31:19
verisimilitude
From what I've seen, xterm and its ilk have multiple incompatible encodings for the function keys; I've only implemented one of these.
2:34:21
_death
verisimilitude: well, I started using it for some tui library ( see https://adeht.org/casts/tui.html ) but holidays were over and other stuff got my time..
2:37:43
verisimilitude
I have made some recent changes, so you will want to download the latest version and take a look at the updated documentation.
3:19:49
fouric
question: if i'm using symbols for "communication" between code in different packages
3:20:11
fouric
for instance, i have a library that opens a file descriptor and gets input from the keyboard, represented as a list of symbols
3:20:48
fouric
...should i (1) intern the symbols in the package of the called library (2) intern the packages in the keyword package (3) intern the symbols in the common-lisp-user package (4) not use symbols for that or something else?
3:22:15
verisimilitude
Interning in the KEYWORD package isn't suggested unless it's a finite set and using CL-USER for this is poor, since you're not guaranteed its particular contents.
3:22:34
verisimilitude
I'd recommend you avoid using symbols for this, but more detail as to what you're doing would help.
3:23:23
fouric
i have a small library that takes keyup and keydown events and returns chords like ((C M) . s) would be ctrl + meta + s
3:23:50
fouric
...it translates keyup and keydown events into chords, and i need to find a good representation
4:29:55
aeth
A more elaborate version of this could be used for words: '#.`(unsigned-byte ,(if (find :64-bit *features*) 64 32))
9:29:12
ogamita
(block found (nsubst-if nil (lambda (item) (if (eql item 42) (return-from found 42)) nil) '((1 . 2) (3 . 42) 4))) #| --> 42 |#
9:34:54
ogamita
loke: then it's easier to write it yourself, but you may have a look at: http://groups.google.com/group/comp.lang.lisp/msg/0c66e597e08be90d
9:38:28
ogamita
You have more considerations: depth, width of the tree (so can you use a recursive function or should you derecursive it), and you want to collect the finds.
10:02:48
norserob
Hi, I'm trying to write a JSN string to a UNIX domain socket, to control the mpv player. It works fine from the command line, but not from ccl. Here is a small example to pause the mpv player: https://gist.github.com/rfolland/6458fcce83c73c4645cf8793771e1d75
10:08:53
ogamita
nope. No flush, no send. Well, since you close, it should flush automatically, but since the close comes just after receiving the command, it's possible the problem is at the receiving end.
10:10:20
norserob
Tried a forec-output now, did not help. It is not a TCP socket, just a UNIX file socket
10:12:07
norserob
I appreciate the help, I've spent some time on this today. Now I can move on. Thanks again.
13:08:06
_death
hmm, last night.. surprised that the machine actually took my rubbish and produced a right result.. but the lisp trick (compare ENCODE and ENCODING) may be of note, used it many times for stuff like this.. https://gist.github.com/death/e330b4a48c87104de341ba3a11ff5836
13:18:24
neirac
I'm kind of lost creating a package. if my package has dependencies that are met using quicklisp how do I specify them using defpackage ?
13:29:06
Xach
quicklisp also has another concept in between project and system -- "release" -- which is a snapshot of a project at some point in time taken in some way
13:29:20
Xach
anyway, for relationship management, it is normal to define a system via a system file
13:40:23
neirac
I'm trying to implement a rest service is there any recommended packages to use ? I was looking at caveman2 at this point
13:41:47
Xach
I like to use hunchentoot, which is lower-level so that might not be the best option available these days.
14:11:54
neirac
I'm reading this https://leanpub.com/fullstacklisp/read#leanpub-auto-the-web-stack it's good for beginners like me.
14:15:48
jmercouris
can someone explain why these two structs are not considered equal: https://pastebin.com/LAsELupe ?
14:18:25
pfdietz
The problem is there is no such thing as a generally applicable equality function. It's inherently context specific. Baker had a paper on this, if I recall correctly.
14:18:48
pfdietz
It ties closely to why there's no general purpose hash function, and no general purpose copy function.
14:19:05
jmercouris
beach: here's the interesting thing, shouldn't it still be passing with eq? or is the issue the list of strings?
14:19:32
jmercouris
the list of strings is the issue I guess, if modifiers was purely a string, of all of the string elements concatenated, it would work, no?
14:20:04
Xach
jmercouris: EQ is only for the exact same identical object. an existing object will never be EQ to something that comes from MAKE-whatever (unless MAKE-whatever isn't really making)
14:21:37
pfdietz
My rule of thumb is to always use EQL instead of EQ, and let the compiler optimization to EQ if it can determine that's safe.
14:21:43
jmercouris
well, I see no solution then to using a hash-table with structs as keys, without using equalp, that's the only logical path
14:22:09
jmercouris
otherwise, what's the point of a hash-table if I have to maintain a reference to every struct?
14:23:34
jmercouris
my original problem was distinguishing between: https://pastebin.com/qf408e0h as keys for a hash table
14:23:50
jmercouris
however, I see now that I will have to use something other than a lowercase/uppercase to distinguish
14:24:42
jmercouris
Xach: that's the ultimate goal yes, but I was using lower case "s" as a modifier for shift and upper case "S" as a modifier for super
14:25:22
jmercouris
however, if equalp cannot distinguish between the two I gave above, and equal will simply not work for my hash table, then I must change from using upper and lowercase "s" to some other letter in the alphabet entirely
14:25:25
Xach
jmercouris: i think one common trick is to have an integer where some bits represent modifiers and the rest of the bits represent the code. that is a good hash key.
14:26:13
jmercouris
e.g. the printable representation of a key-chord struct makes it obvious what keys were being pressed at that time without reading documentation
14:27:00
jmercouris
I will then need to change how the actual keymaps are made, but that can be done