<asarch>
What is the keystroke to open multiple files in Emacs?
<jmercouris>
asarch: I don't think that's possible
megalography has joined #lisp
<jmercouris>
I think it is only possible via dired
<asarch>
Thank you
<asarch>
Thank you very much :-)
astronavt has quit [Ping timeout: 272 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jack_rabbit has quit [Ping timeout: 252 seconds]
phenoble has quit [Ping timeout: 252 seconds]
thetemplar has quit [Ping timeout: 252 seconds]
phenoble has joined #lisp
makomo has quit [Ping timeout: 260 seconds]
<aeth>
asarch: You can open multiple files if you can express them as a wildcard, so C-x C-f ~/your/path/*lisp RET will open all of your lisp files in that directory.
<Blackbeard>
aeth: 😱awesome
astronavt_ has joined #lisp
<jmercouris>
Assuming you don't have ivy or others...
astronavt__ has joined #lisp
astronavt_ has quit [Read error: Connection reset by peer]
Essadon has quit [Quit: Qutting]
fiddlerwoaroof has joined #lisp
astronavt__ has quit [Ping timeout: 272 seconds]
Balooga_ has quit [Quit: Balooga_]
jealousmonk has quit [Quit: Leaving]
moei has quit [Quit: Leaving...]
moei has joined #lisp
rumbler31 has joined #lisp
Oladon has joined #lisp
Balooga_ has joined #lisp
robotoad has quit [Quit: robotoad]
rumbler31 has quit [Ping timeout: 240 seconds]
robotoad has joined #lisp
Balooga_ has quit [Quit: Balooga_]
Guest25977 has quit [Ping timeout: 260 seconds]
jmercouris has quit [Remote host closed the connection]
siraben has joined #lisp
flazh has quit [Ping timeout: 252 seconds]
lemonpepper24 has joined #lisp
dented42 has joined #lisp
esrse has joined #lisp
kushal has quit [Remote host closed the connection]
kushal has joined #lisp
dddddd has quit [Remote host closed the connection]
dented42 has quit [Ping timeout: 252 seconds]
Balooga_ has joined #lisp
lemonpepper24 has quit [Ping timeout: 260 seconds]
<beach>
Good morning everyone!
<no-defun-allowed>
Morning beach
<beach>
asarch: There is beirc. I am told it needs some maintenance.
Balooga_ has quit [Quit: Balooga_]
Balooga_ has joined #lisp
megalography has quit [Ping timeout: 240 seconds]
dented42 has joined #lisp
flazh has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dented42 has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpal has joined #lisp
rumbler31 has joined #lisp
megalography has joined #lisp
ggole has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
Guest25977 has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
Guest25977 has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
dented42 has joined #lisp
dented42 has quit [Client Quit]
Roy_Fokker has quit [Read error: Connection reset by peer]
dented42 has joined #lisp
wigust has quit [Ping timeout: 252 seconds]
Oladon has quit [Quit: Leaving.]
acolarh has quit [Ping timeout: 245 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dented42 has joined #lisp
lemonpepper24 has joined #lisp
acolarh has joined #lisp
ealfonso has quit [Disconnected by services]
ealfonso has joined #lisp
<ealfonso>
I feel very insecure whenever I just run into 404s and domain errors when trying to find the website of a recommended CL library
<adlai>
pjb: there was this game i used to play on the toilet, years ago... basically the computer asked the person on the other side of the screen to route a PCB on its behalf. wonderful way to while away a constipated afternoon.
<White_Flame>
Flow Free or something?
<adlai>
quite possibly!
<White_Flame>
I played that tons when recovering from a concussion
<adlai>
yeah that's the gaussian integers version :D
<paule32>
haha
<adlai>
it can get quite frustrating, but then your constipation passes
<paule32>
i liked the qbasic game gorrilas on ms-dos
marvin2 has quit [Ping timeout: 252 seconds]
<paule32>
[1]> (+ + 1 2) *** - +: NIL is not a number
<no-defun-allowed>
checks out
zooey has quit [Ping timeout: 256 seconds]
zooey has joined #lisp
<paule32>
Break 1 [2]> (+ (+ 1 2))
<paule32>
3
<no-defun-allowed>
also good
random-nick has joined #lisp
cage_ has joined #lisp
<no-defun-allowed>
paule32: in common lisp, + at the start of an expression and + in the rest are not equivalent
robotoad has quit [Quit: robotoad]
<no-defun-allowed>
(+ ...) refers to the function +, whereas (... + ...) refers to the variable + which is defined by your REPL
<Shinmera>
please stop trying to help him, it is not productive. It's been close to two years of this guy getting advice in this channel and not heeding any of it
<no-defun-allowed>
alright then
doubledup has quit [Quit: Leaving]
orivej has quit [Ping timeout: 244 seconds]
marvin2 has joined #lisp
xrash has quit [Ping timeout: 246 seconds]
xrash has joined #lisp
dented42 has joined #lisp
shifty has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
kajo has joined #lisp
mkolenda has quit [Remote host closed the connection]
<jackdaniel>
when I create a broadcast-stream with s1 and s2: (make-broadcast-stream s1 s2) and call file-position on it, file position of s2 should be returned, right?
<jackdaniel>
excerpt from the standard: " The functions file-length, file-position, file-string-length, and stream-external-format return the value from the last component stream."
<|3b|>
yeah, that's how i read it
<jackdaniel>
thank you
<jackdaniel>
(a bit of context: ecl takes first component, so queried for a second opinion that it is wrong)
scymtym has joined #lisp
mkolenda has quit [Remote host closed the connection]
mkolenda has joined #lisp
orivej has quit [Ping timeout: 244 seconds]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
Nephromancer has joined #lisp
razzy has quit [Ping timeout: 252 seconds]
cl-arthur has quit [Quit: Lost terminal]
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
thetemplar has quit [Ping timeout: 252 seconds]
rozenglass has quit [Read error: Connection reset by peer]
shka_ has joined #lisp
tfeb has quit [Ping timeout: 245 seconds]
<phoe>
What is test-op supposed to do when a test failure happens in modern ASDF and Quicklisp configurations?
<phoe>
For example, when Quicklisp builds its systems each month, what should be done to make it know that there was a test failure?
<phoe>
Xach: ^
rtypo has joined #lisp
dddddd has joined #lisp
<phoe>
....I'm bamboozled that the CL package has no RETRY restart
<phoe>
It's a custom addition!
<oni-on-ion>
for CLIM listener and slime and stuff ?
<phoe>
yes
<oni-on-ion>
does CLHS say something like "would be good idea for implementation [to implement] for debug/trace purpose"
pjb has quit [Ping timeout: 240 seconds]
whartung has quit [Ping timeout: 245 seconds]
tfeb has joined #lisp
dale has quit [Quit: dale]
Roy_Fokker has joined #lisp
tfeb has quit [Ping timeout: 240 seconds]
makomo has quit [Read error: Connection reset by peer]
<_death>
Demosthenex: yesterday I worked a bit on editor windows like you can see in the second demo.. still there's much more to do there. I think the next step is to add mouse support and moving/resizing windows
<Demosthenex>
_death: nice
<_death>
there are also some missteps I should fix, added FIXMEs yesterday
rozenglass has joined #lisp
tfeb has joined #lisp
<_death>
I'm thinking a small demo application would indeed be something like a "turbo lisp".. with a repl and a file editor
<_death>
that incidentally also lets you change itself.. by nature of lisp (and smalltalk..)
tfeb has quit [Ping timeout: 246 seconds]
<Demosthenex>
_death: all my usecase is about data entry forms.... i'm tinkering with trying to make some editing widgets
<_death>
right.. not there yet
Balooga_ has joined #lisp
makomo_ has quit [Ping timeout: 252 seconds]
<Demosthenex>
_death: not laying the burden on you, i'm trying to see what i can come up with. i already got my async inputs and such going
thetemplar has joined #lisp
varjag has joined #lisp
<_death>
;)
housel has joined #lisp
makomo_ has joined #lisp
frodef has quit [Ping timeout: 246 seconds]
tfeb has joined #lisp
<phoe>
I have a SBCL thread that just hangs with 100% CPU usage. Its backtrace shows pretty much nothing, https://plaster.tymoon.eu/view/929#929 - how can I debug it?
<phoe>
I want to figure out where exactly it is and what it's doing, but a lack of a backtrace makes it pretty hard for me.
<_death>
add logging
xrash has joined #lisp
<phoe>
_death: hm. It'll be a ton of logs - it's a very intermittent issue.
<phoe>
But I guess there's no other option at this point.
nckx has quit [Quit: Updating my GNU GuixSD server — gnu.org/s/guix]
dueyfinster has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
rumbler31 has joined #lisp
nckx has joined #lisp
rumbler31 has quit [Ping timeout: 252 seconds]
<oni-on-ion>
phoe: CL has a nice tracer, called..
<oni-on-ion>
or what about using 'trace' ?
Pixel_Outlaw has joined #lisp
Oladon has joined #lisp
<phoe>
Something very fishy is going on.
<phoe>
When I C-c C-c a function, that thread unblocks.
<phoe>
Compiling a function happens in a completely separate thread, no?
<oni-on-ion>
afaik yep. if repl is 'blocked' for me i can still load/compile
paule32 has quit [Ping timeout: 260 seconds]
<Demosthenex>
hrm, i found justification in format, but not how to replace the default padding char while using center ie: (format nil "~70:@<~A~>" "Whee"), but what if i wanted .'s instead of spaces?
<phoe>
~70,'.
<phoe>
AFAIR this should work
<Demosthenex>
that made it right justified
<phoe>
oh, hm
esrse has quit [Ping timeout: 252 seconds]
<Demosthenex>
(format nil "~70,,,'.<~A~>" "Whee") made it use .'s and right justified
pjb has joined #lisp
<Demosthenex>
i get an error about using options after the @ modifier
<Demosthenex>
well crap, i was looking for bind-slots :P
<Demosthenex>
thanks
<makomo>
:-)
<makomo>
_death: that's a very nice article, but what about issues regarding localization?
<makomo>
for example, the same problem shows up in C++. you can either use iostreams and its text formatters, or you can use printf
Oladon has quit [Quit: Leaving.]
<makomo>
it's much easier to localize a printf/format-like "template", rather than individual parts of something like the article's OUT
<makomo>
because the translator has more context
steiner has joined #lisp
<makomo>
maybe this is just a tooling issues, i don't know
<makomo>
issue*
scymtym has quit [Ping timeout: 260 seconds]
<_death>
makomo: with Lisp you can store forms.. also, format control strings don't solve the localization problem.. but personally I don't care for localization so..
<Demosthenex>
is there a conflict using multiple-value-bind inside the body of a with-slot?
<_death>
makomo: in fact with an OUT like construct you can provide more hints that can help with localization.. since you construct a language for writing things
<_death>
instead of being limited to the low level format control language that perhaps lets you do something like ~/
<pjb>
_death: makomo: well, there's one way FORMAT helps solving the localization problem.
<pjb>
_death: makomo: it's with the format specifier ~*, which allows you to use the arguments by index, instead of by order, so you can easily use format string in different languages, without changing the program and the order of the arguments. In different languages, the order for formating of various data elements into the language often changes.
<_death>
instead of comparing to lesser languages, why not compare to a lispy language for solving the localization problem
nowhereman_ has quit [Ping timeout: 260 seconds]
<pjb>
(format t (get-localized 'qualified-object-format-string) object color size qualifier) -> "La petite balle bleu" "The small blue ball"
<pjb>
French: "~2@*~A ~0@*~A ~A" English: "~2@*~A ~1@*~A ~0@*~A" etc.
<pjb>
It is funny, because one of the most advanced localization system, ie. NeXTstep/Openstep/Cocoa's one, isn't even able to do that!
<pjb>
lame.
<_death>
now instead come up with a lispy grammar for describing it.. (:object ball :definite t :adjectives (small blue))
SumoSud0 has quit [Quit: 8y3 8y3]
cage_ has quit [Quit: Leaving]
lavaflow has joined #lisp
SumoSud0 has joined #lisp
<makomo>
_death: well, true, it doesn't solve it by itself, but it's much easier for a translator (the actual person doing the translations) to get context about what's being translated
<makomo>
at least that's what i remember reading somewhere
<pjb>
_death: the problem is not the lispy grammar. It's to localize the strings.
<makomo>
_death: that's a cool example, thanks
<_death>
a format control string doesn't give much context for the translator
<_death>
which sometimes makes for bad translations in big programs
<makomo>
_death: well, that horror from the article sure doesn't. but consider something like "there are ~a objects in the bag" or something
<makomo>
or "there are %d objects in the bag"
<_death>
1
<makomo>
instead of separate strings "there are" and "objects in the bag"
<_death>
now your string is bad
<makomo>
right, that also needs to be handled
<makomo>
but aside from that
<_death>
no, that's the point.. the "use format strings for localization purposes" is just an opportunistic hack.. in lesser languages, it's easy to externalize strings, so they get used and a translator has to work with that
<makomo>
_death: what's constantia btw? your own library?
<_death>
but printf, format, etc. wasn't designed with localization in mind
<_death>
so if you actually want to solve the problem, you find that you need more context and structure
<makomo>
well, it sure is a hack, but i'm not aware of any other approaches
frodef has joined #lisp
<TMA>
there is more to localization than simple exchange of strings. -- consider that you need to adjust sizes (an "OK" can be much smaller than "Budiz"); there are other directions for text than ltr-ttb; you might want to adjust colors (because of the connotations) images and icons, ...
<_death>
right.. so in the end it's (out (:l10n :there-are-n-objects-in-the-bag n)) ;)
<russellw>
Is there a way to get CCL to exit when a script is finished? wx86cl -Q -b -l test.lisp doesn't do it
<Demosthenex>
i saw ~?, but was there a way use a variable in the same format string to dynamically change padding?
random-nick has quit [Read error: Connection reset by peer]
<pjb>
_death: of course, you would write(format t (_ "format ~A etc" "The message printed when so and so") …) and (format nil (_ "format ~A etc" "The label of the button to do this and that") …)
<pjb>
But this is the 101 of localization.
<pjb>
and independent of the language. I
<Shinmera>
Demosthenex: sure, eg (format T "~va" 10 :woah)
<pjb>
only spoke about the specific advantages of lisp format in localization.
<Demosthenex>
Shinmera: i read that hyperspec several times and never saw v :P
<Shinmera>
"In place of a prefix parameter to a directive, V (or v) can be used. In this case, format takes an argument from args as a parameter to the directive. The argument should be an integer or character. If the arg used by a V parameter is nil, the effect is as if the parameter had been omitted. # can be used in place of a prefix parameter; it represents the number of args remaining to be processed. When used
<Shinmera>
within a recursive format, in the context of ~? or ~{, the # prefix parameter represents the number of format arguments remaining within the recursive call."
<pjb>
And for the desesperate cases, don't forget ~/
<pjb>
you can provide or let the translator provide a set of functions to do the exact formating required in strange languages.
<pjb>
makomo: "there are ~a objects in the bag" is not correct.
<makomo>
pjb: yeah, i know, it's a really trivial and dumb example
<_death>
pjb: like I said, the format control language is low level and barely extensible via ~/ ~? etc.
<pjb>
makomo: in CL, we'd write: (loop for i below 3 collect (format nil "There are ~a object~:*~P in the bag." i)) #| --> ("There are 0 objects in the bag." "There are 1 object in the bag." "There are 2 objects in the bag.") |#
<_death>
pjb: instead you can use the full power of lisp to make things easier to the (since "localization is more than translation" argument was made) localization mechanical turk
<_death>
but here SEARCH isn't the right tool.. instead you can use PATHNAME-TYPE
anewuser has joined #lisp
<Blackbeard>
_death (IRC): ohh !!
<_death>
otherwise foo.jpg.exe may be considered an image...
<pjb>
_death: right. :-) (loop for i below 3 collect (format nil "There ~[are~;is~;are~] ~:*~a object~:*~P in the bag." i)) #| --> ("There are 0 objects in the bag." "There is 1 object in the bag." "There are 2 objects in the bag.") |#
<pjb>
try to do that in C!
<_death>
pjb: so now you have this "~[are~;is~;are~]" inline.. but it's a useful thing to have named
<_death>
pjb: format control language doesn't give you much to abstract it
<_death>
pjb: and it really shouldn't, since stuffing everything into a string makes things cryptic
<pjb>
(loop for i below 3 collect (format nil "There ~/english-verb-conjugate/ ~0@*~a object~:*~P in the bag." i "to be"))
<pjb>
actually, with ~V/.../ since ~/ cannot take more than one argument.
<pjb>
you need to pass i as a parameter.
<_death>
pjb: right, now consider ~{ which is limited to lists
<Blackbeard>
_death (IRC): thanks!
<_death>
pjb: you switched to vectors.. now what ~/{-FOR-VECTORS/ ?
<pjb>
That's why you can pass a function as format-string!
<pjb>
(format t (smart-formatter "…") …)
<pjb>
You cannot anything against format, it's too customizable for that.
<_death>
pjb: ok.. now instead just do (smart-formatter "...")
<pjb>
smart-format you mean. No.
<_death>
pjb: rename it OUT.. even make it use FORMAT to save a bit of code
<pjb>
You want to integrate with the existing mechanisms.
paule32 has joined #lisp
lemonpepper24 has joined #lisp
<TMA>
you do not want to rely on format's English support too heavily for localization. ~P works ok-ish for English but not for other languages
<pjb>
Yes, it's only to generate log messages and debugging statements.
<_death>
it's true that error/etc. are burdened with format.. there's even simple-condition with :format-control and :format-arguments.. I use format here and there and when I don't want to depend on constantia.. but when things get too cryptic, I'll either use OUT or just Lisp with simple primitives
<TMA>
and even in English you would have hard time to use ~P on regular basis for e.g. ox
thetemplar has quit [Ping timeout: 260 seconds]
<_death>
"You have ~D copies of Emacs~:(P running"
<_death>
oof, ruined that joke.. -copied of
<pjb>
(loop for i below 3 collect (format nil "You have ~D cop~:*~@P of Emacs ~:(P running~)" i)) #| --> ("You have 0 copies of Emacs P Running" "You have 1 copy of Emacs P Running" "You have 2 copies of Emacs P Running") |#
charh has joined #lisp
rumbler31 has joined #lisp
paule32 has quit [Ping timeout: 252 seconds]
random-nick has joined #lisp
<russellw>
I'm about to write a function to return the last element of an array. Obviously this is a very simple function, sufficiently so that it probably already has a common name. The most obvious name is array-last; is that's what it's usually known as?
<pjb>
russellw: how do you define the last element of #3A((((1 2 3) (4 5 6)) ((1 2 3) (0 0 0))) (((1 2 3) (4 5 6)) ((1 2 3) (0 13 42)))) ?
<pjb>
russellw: that's beside the point. The point is that you asked for the last element of an array, not the last element of a vector or of a sequence.
<pjb>
russellw: my point is that if you are able to state clearly your requirements, then the code will generally follow easily.
<pjb>
russellw: alternatively, you could start speaking in lisp. and ask, How do I (defun last-element (x) (aref x (1- (length x))))? Oops, I answered in the question…
<Shinmera>
pjb: array-total-size would be a bit shorter and idiomatic than reducing array-dimensions.
<pjb>
russellw: sometimes, you don't know what english name to give to a function. Just start writting it: (defun foo (…) …) and once it's written you can usually find easily what to call it in english.
<pjb>
Shinmera: exact.
<pjb>
Also, for vectors, you can use length or (array-dimension v 0): you won't get the same result on vectors with fill-pointers.
<pjb>
(array-dimension v 0) or array-total-size.
<russellw>
pjb, er, if we are going to get snarky about exact wording, take a look at the question I asked, in which I observed that I have no difficulty writing the function; that part is very simple. I merely wanted to know whether it already had a common name. The answer to which was yes, thank you
lemonpepper24 has quit [Ping timeout: 260 seconds]
<pjb>
russellw: I didn't want to get snarky. In this case, I would have said that obviously, a function to return the last element of an array should be named last-element-of-array.
<pjb>
Blackbeard: don't mix is- with -p. They're two different conventions for the same thing.
<pjb>
Blackbeard: in lisp, p or -p is prefered.
<_death>
(member (pathname-type file) '(...) :test #'equal) ;; or equalp..
<russellw>
pjb, ah! Okay, while that's a little verbose for my tastes, it is a perfectly fair answer
<pjb>
russellw: you can stylistically choose: array-last-element. Or vector-last-element. Or just last-element, notably if that applies to sequences.
<pjb>
russellw: or you can write it as a generic function and have implementations for all kinds of collections.
<russellw>
(defun last-elt (s) (elt s (1- (length s)))); one of the things I like about dynamic languages is you get some degree of genericity for free
<pjb>
Blackbeard: member is nice. I often prefer to use FIND or even POSITION (for the side effect of computing the position if needed).
<pjb>
Blackbeard: member returns a tail of the searched list, so it may be ugly when printed (but otherwise, perfectly ok for the program).
nowhereman_ has joined #lisp
<pjb>
Blackbeard: FIND has the advantage of returning the element in the list, as a prototypal form. This can be useful, if you want to normalize them.
<pjb>
Blackbeard: also, testing for the file type is a bad idea. You could check the meta data (prefixp "image/" (Content-Type file)). Or check the contents. (But this may require more I/O and computation).
dale has joined #lisp
<pjb>
In any cases, be prepared to have non image file names .jpg or something else, and to have png files named .jpg and vice versa.
<_death>
you may also want to parse-native-namestring at the edges
thetemplar has joined #lisp
<aeth>
russellw: You are probably going to have to inline it to get good performance with it, though. (1) trivial, (2) no reason to redefine it, (3) works on arrays or numbers (here, arrays). So it's a good candidate for inlining.
<aeth>
That's just (declaim (inline foo)) right above the defun
<Blackbeard>
pjb _death (IRC) ohhh I see let me change it !! thakns :)
<aeth>
s/works on arrays or numbers/works generically on arrays or sequences or numbers/
<_death>
if you care about performance with lists you'd need another variant
moei has quit [Quit: Leaving...]
<aeth>
_death: Yes, if you wanted it to work on lists instead of 1D arrays (vectors) specifically, the ELT variant is bad. You would probably want an ETYPECASE to split it into two cases, one for lists and one for vectors. The compiler will probably optimize it out if it's inline
<russellw>
Right, in this case performance is not an issue, but will keep those considerations in mind if it becomes so
<aeth>
The important thing is that anything that's just a one liner with something like AREF (works on all arrays) or ELT (works on all sequences) or + (works on all numbers) can become a lot more efficient when inline.
shka_ has quit [Quit: Konversation terminated!]
<_death>
aeth: to keep it generic, you can just have (if (listp ...) (car (last ...)) (elt ...)) remember that type sequence is not necessarily type (or list vector)
<_death>
not sure what numbers have to do with it
<Blackbeard>
I am writing a module to change and set wallpapers for stumpwm
<Blackbeard>
it is something very simple,
<Blackbeard>
it is my first module of common lisp ever :)
<pjb>
That's because in (elt x (1- (length x))), we have to walks of a list. But only 2 O(1) accesses for vectors.
<Blackbeard>
my idea was to have a directory with a bunch of images
<aeth>
_death: I'd do it like this: (defun last-elt* (sequence) (etypecase sequence (list (car (last sequence))) (sequence (elt sequence (1- (length sequence))))))
<Blackbeard>
and I was writing the function to get all the images with (directory path)
<_death>
aeth: right, that's good too
<Blackbeard>
but your idea is better because I would be able to get images from more paths
<fiddlerwoaroof>
Blackbeard: That's a good way to start: assume that everything in the directory is an image and let the user pick one of them then, once you get that working, worry about filtering out non images.
<aeth>
_death: numbers and sequences behave very similarly for this sort of pattern
<fiddlerwoaroof>
And/or supporting more paths
<Blackbeard>
now I just need to get the mimetypes
<_death>
aeth: how?
<aeth>
_death: Numbers also have an efficient inline form that the compiler will generate (probably... obviously stuff like JSCL behave differently) if it has more type information
<_death>
aeth: I see.. you're talking about inline, not last-elt
<aeth>
_death: e.g. (defun foo () (last-elt* (vector 1 2 3))) is about half the size in disassemble as last-elt* is if you inline last-elt*
<aeth>
And (defun bar () (last-elt* '(1 2 3))) and (defun baz () (last-elt* #(1 2 3))) are compiled to constantly return 3 in SBCL
angavrilov has quit [Remote host closed the connection]
<Blackbeard>
I don't find any mimetype function for common lisp
<Blackbeard>
fiddlerwoaroof (IRC): oh ok :)
<Blackbeard>
I was thinking of using something like this
<oni-on-ion>
use emacs M-. to jump to that definition too
Fare has quit [Ping timeout: 252 seconds]
trittweiler has quit [Ping timeout: 244 seconds]
nly has joined #lisp
trittweiler has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
aydio has quit [Quit: WeeChat 2.2]
vlatkoB has quit [Remote host closed the connection]
random-nick has quit [Read error: Connection reset by peer]
trittweiler has quit [Ping timeout: 260 seconds]
moei has joined #lisp
Oladon has quit [Quit: Leaving.]
trittweiler has joined #lisp
TMA has quit [Ping timeout: 260 seconds]
<phoe>
Using usocket, how can I check if a server socket (made using socket-listen) has been closed or not?
terpri has joined #lisp
nly has quit [Read error: Connection reset by peer]
<phoe>
...I assume it no longer has a local port in that case, and errors when I attempt to fetch it.
<oni-on-ion>
usocket docs say to read from the socket and END-OF-FILE is signalled
<phoe>
oni-on-ion: I mean a server socket.
<phoe>
It does not have any associated stream that I can check for EOF.
<oni-on-ion>
same
<oni-on-ion>
oh
<oni-on-ion>
not sure then
Nephromancer has quit [Quit: Connection closed for inactivity]
<grobe0ba>
thats an easy one. assume all traffic can consist of no more than 1024KB and that the stream is defunct after that much traffic has passed. :P
<phoe>
grobe0ba: ...
<phoe>
I mean a server socket.
<phoe>
It does not have any associated stream that I can check for EOF.
<phoe>
A server socket's only role is accepting incoming connections and spawning stream sockets that *have* streams and *can* be used to transmit data.
<phoe>
I really hate the fact that a socket can close at any moment and because of this, at any moment while handling it, I can get an assortment of very non-portable errors such as sb-bsd-sockets:bad-file-descriptor-error.
terpri has quit [Ping timeout: 252 seconds]
<_death>
I don't understand.. if you have a socket created by socket-listen, it will get closed when you close it.. it is possible that socket-accept will return an error
<phoe>
No no, my last comment is about stream sockets
<phoe>
Server sockets themselves are pretty nice and polite.
<_death>
do you mean a socket created by socket-accept?
<phoe>
yes, socket-accept creates a stream socket
anewuser_ has quit [Read error: Connection reset by peer]
<_death>
then you're supposed to define a state machine and handle client shut down as well as errors
<phoe>
Yes, I know that one
<phoe>
I just dislike the fact there's multiple conditions that I need to handle
<phoe>
And I want to avoid handler-case'ing ERROR because this one captures way too much
<_death>
well, sockets are similar to threads in that they're usually not a convenient level for an application to do things
<phoe>
that's why I'm working on an abstraction now.
<phoe>
sleep time for me - good night
<_death>
night
anewuser_ has joined #lisp
<_death>
usocket defines its own condition types.. and socket-error's description is "Parent error for all socket related errors"
xrash has quit [Ping timeout: 245 seconds]
<phoe>
_death: I wish it would catch all of them. (:
xrash has joined #lisp
bgavran has joined #lisp
terpri has joined #lisp
varjag has quit [Ping timeout: 260 seconds]
anewuser_ is now known as anewuser
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
Oladon has joined #lisp
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
<alandipert>
is there a way to set the function cell of a symbol locally? ie i have a function that returns a function, and i want to call that returned function in calling code w/out funcall
terpri has quit [Ping timeout: 246 seconds]
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
rumbler31 has joined #lisp
tfeb has quit [Remote host closed the connection]
tfeb has joined #lisp
<_death>
you can have a with-functions macro that expands to labels
tfeb has quit [Client Quit]
<_death>
it doesn't set the symbol's function cell.. if you want that, there's setf (and you can define letf..)
<alandipert>
i don't think i need that.. just want to avoid funcall inside a let binding
<fiddlerwoaroof>
alandipert: it took me a while, but I eventually came to appreciate funcall, it eliminates a whole class of errors where a local symbol binding accidentally shadows the function you want to run.
frodef has quit [Ping timeout: 240 seconds]
<fiddlerwoaroof>
One way, though, to avoid using funcall all over the place is to define a bunch of combinators to help build up the function you want and then funcall the resulting lambda
<fiddlerwoaroof>
(ignore the "lens" part... I started this project with a different plan than what it ended up being :) )
adam4567 has joined #lisp
<pjb>
alandipert: perhaps you want flet or labels?
<pjb>
ie. not modifying the function cell, but defining a local lexical fbinding?
<pjb>
alandipert: setting the function cell is quite problematic. While you can do that to simulate dynamic binding, for functions it's also global to the image, not local to the current thread. So it can easily break hard.
<pjb>
alandipert: furthermore, to have good effects, you need to declare that function notinline.
<pjb>
Note that optional parameter will probably be slower than mandatory parameters, so it may be worth it to avoid them in inner (and local) functions.
lemonpepper24 has joined #lisp
mutenewt has joined #lisp
shifty has joined #lisp
<pfdietz>
And less self-documenting/extensible than keyword parameters.