phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
xkapastel has quit [Quit: Connection closed for inactivity]
nydel has joined #lisp
libertyprime has joined #lisp
libertyprime has quit [Client Quit]
zmt01 has joined #lisp
CCDelivery has joined #lisp
stackspa1e has joined #lisp
chrnybo has joined #lisp
zmt00 has quit [Ping timeout: 252 seconds]
stackspa1e is now known as dingusman
akoana has left #lisp ["Leaving"]
chrnybo has quit [Remote host closed the connection]
chrnybo has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
dingusman has quit [Quit: leaving]
chrnybo has quit [Ping timeout: 250 seconds]
ebrasca has quit [Remote host closed the connection]
stackspace has joined #lisp
chrnybo has joined #lisp
monkeystance has joined #lisp
chrnybo has quit [Ping timeout: 244 seconds]
asarch has joined #lisp
<asarch> How would traverse a directory in Common Lisp showing the kind of file (directory, link, plain file, etc) of each element found?
chrnybo has joined #lisp
xkapastel has joined #lisp
Essadon has quit [Quit: Qutting]
lumm has quit [Quit: lumm]
jprajzne has joined #lisp
chrnybo has quit [Ping timeout: 268 seconds]
<Jachy> Maybe just combine uiop:subdirectories and uiop:directory-files? Some post-processing could then resolve a symlink. The uiop suggests IOlib might handle symlink situations more cleanly.
emaczen has joined #lisp
jprajzne has quit [Quit: jprajzne]
<fiddlerwoaroof> asarch: OSICAT:WALK and CL-FAD:WALK-DIRECTORY might do the walking part of your question
<fiddlerwoaroof> OSICAT:WALK-DIRECTORY
<fiddlerwoaroof> UIOP doesn't have anything obvious, as far as I could tell with a quick apropos
<fiddlerwoaroof> symlink behavior is somewhat inconsistent between implementations, though
<fiddlerwoaroof> e.g. quicklisp doesn't recognize systems that are symlinked into local-projects while sbcl does
monkeystance has left #lisp ["Leaving"]
<aeth> fiddlerwoaroof: huh? Are you saying that Quicklisp doesn't recognize ~/quicklisp/local-projects/foo if foo is a symlink? Because I've never had anything but symlinks in there.
<fiddlerwoaroof> ... I meant "on CCL, quicklisp doesn't"
<fiddlerwoaroof> it's not exactly true, because CCL will pick up the projects if you quickload them in sbcl first
<aeth> ah, right, system-index.txt
<aeth> I never picked up on this because I've always tested it in SBCL first
<fiddlerwoaroof> Yeah, I've had some strange experiences where I happen to first use a new thing in local-projects from ccl
FreeBirdLjj has joined #lisp
<verisimilitude> What you should do is use DIRECTORY with a :WILD name and type and then call PATHNAME-TYPE on the resulting list, asarch.
<verisimilitude> You should map PATHNAME-TYPE, that is.
<fiddlerwoaroof> verisimilitude: that doesn't walk a directory tree
<fiddlerwoaroof> ah, but maybe he doesn't need to traverse it recursively
<verisimilitude> Yes; asarch didn't ask for anything more.
<fiddlerwoaroof> PATHNAME-TYPE isn't right, though, that's like asking for the extension
<fiddlerwoaroof> it doesn't tel you if it's a pathname for a directory or a file, does it?
<verisimilitude> You get NIL on a directory.
<verisimilitude> At least, under SBCL on GNU/Linux you do.
<fiddlerwoaroof> you also get NIL for a file without an extension
<fiddlerwoaroof> And, you have to make sure that you're doing TRUENAME first, because that just tells you what the TYPE component of the PATHNAME struct is
FreeBirdLjj has quit [Remote host closed the connection]
<fiddlerwoaroof> so mkdir foo.bar; sbcl -e '(princ (pathname-type #p"foo.bar"))' wil print BAR
Lycurgus has quit [Quit: Exeunt]
<fiddlerwoaroof> or bar lowercased
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
<aeth> verisimilitude: Is it correct to say 'SBCL on GNU/Linux'? Does SBCL require any GNU software past compilation? (or even in compilation? can the C component use LLVM?)
FreeBirdLjj has joined #lisp
<verisimilitude> In any case, I'd suggest using the standard CL functions for manipulating the file system before I started recommending a library for it; for what asarch wants, it's likely sufficient.
<verisimilitude> I'm using GNU/Linux, so yes, aeth.
akoana has joined #lisp
<fiddlerwoaroof> pathnames are underspecified in the standard, imho, so it's one place where it's better to use a library like UIOP than the standard functions
<fiddlerwoaroof> because, if you use the standard functions, you will almost certainly run into weird cross-implementation edgecases when dealing with the sorts of filenames you find on a modern linux system
mathrick has quit [Ping timeout: 240 seconds]
<verisimilitude> The situation there is already damned due to a lack of any foresight, fiddlerwoaroof. Under most POSIX systems, OS X being an exception, filenames are just octects, without any imposed structure, so it's not even necessarily proper UTF-8, making headaches for any system that doesn't encourage C's chronic lack of typing.
<verisimilitude> It's my understanding this is an issue for Python, even, which actually does make an effort to adopt POSIX nonsense.
<verisimilitude> Dow does UIOP handle filenames that aren't valid UTF-8, anyway?
<aeth> verisimilitude: test it?
<fiddlerwoaroof> verisimilitude: for the sorts of files one actually does encounter in "normal" systems (read, "any system I've used between 2005 and now"), python has never had an issue opening a file.
<fiddlerwoaroof> In CL, I've run into issue like "CL expects the first dot to separate the name from the type and the second dot, if present, to separate the type from the version"
quazimodo has joined #lisp
<verisimilitude> I don't have UIOP installed, aeth.
<fiddlerwoaroof> And, there is no consistent way to escape the dots cross-implementations
<fiddlerwoaroof> verisimilitude: you do, if you have ASDF
<verisimilitude> I don't use ASDF.
markoong has quit [Quit: Konversation terminated!]
<verisimilitude> Anyway, standard Common Lisp doesn't address this, and there's not really a good way to. It seems silly, to me, to suggest a library if it won't solve the entire problem anyway. Do tell if any of you test this.
<fiddlerwoaroof> uiop manages to handle all the issues one runs into
<verisimilitude> My point, fiddlerwoaroof, is that filenames under most POSIX systems are already a broken mess.
<fiddlerwoaroof> Sure, but the good thing is that most of the time assuming that filenames are UTF-8 (or some other encoding) is good enough
<fiddlerwoaroof> And, one generally prefers to use things the problems one has, not the problems one might have
<verisimilitude> I suggest to everyone to simply read the standard and its guarantees and simply try to program using only those. Many programs handle filenames provided by the user, which can generally be manipulated more than well enough to accomplish what is wanted. Then, you get to have a program that will work on any system with Common Lisp thirty years from now.
<asarch> Can you show me the code?
<verisimilitude> You're asking me?
<aeth> verisimilitude: UIOP will still run in 30 years if anyone's still running ASDF on CL in 30 years.
<verisimilitude> Sure; I'll show you, asarch.
<verisimilitude> Here's a basic example using the home directory:
<verisimilitude> (let ((pathname (user-homedir-pathname)))
<verisimilitude> (mapcar 'pathname-type (directory (make-pathname :name :wild :type :wild :defaults pathname))))
<verisimilitude> If USER-HOMEDIR-PATHNAME returns NIL, which it can, then this will be in error, but I wanted this to be concise.
<asarch> THANK YOU!
<asarch> Thank you very much :-)
<verisimilitude> You're welcome, asarch; I'm glad I could help.
mathrick has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
<verisimilitude> If I'm writing a program that expects to use a filename provided by the user, my approach is to MAKE-PATHNAME using the different PATHNAME- functions to get at the parts I actually care about from the pathname namestring and I have the defaults use *DEFAULT-PATHNAME-DEFAULTS*, USER-HOMEDIR-PATHNAME, or then conditionally-included pathnames for POSIX or WINDOWS systems or what have you if neither of those first two are present.
<verisimilitude> It's perfectly fine to include pathnames that only apply to certain systems if they're properly conditionally-included and you have proper standard fallbacks. This is using conditionally-included code correctly, because you get an enhanced program rather than a nonstandard one.
pierpal has joined #lisp
pierpal has quit [Ping timeout: 245 seconds]
milanj has quit [Quit: This computer has gone to sleep]
<buffergn0me> I ran into that Quicklisp CCL local-projects symlinks issue last night for the first time. Not obvious that on CCL (directory X :directories t :follow-links nil) would not pick up symlinks. I wonder if that has anything to do with having consistent behavior on Mac OS or Windows.
<buffergn0me> (I run CCL on Linux)
<LdBeth> I have no such a issue on macOS
xkapastel has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit []
wxie has joined #lisp
FreeBirdLjj has joined #lisp
karlosz has quit [Quit: karlosz]
pierpal has joined #lisp
pierpal has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
karlosz has joined #lisp
CCDelivery has quit [Ping timeout: 244 seconds]
<akater> fiddlerwoaroof: There is a bug in SBCL with improper initialization. I'm aware of u-i-f-r-c.
jfb4 has quit [Ping timeout: 244 seconds]
jfb4 has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
chrnybo has joined #lisp
ggole has joined #lisp
dddddd has quit [Remote host closed the connection]
chrnybo has quit [Ping timeout: 250 seconds]
pierpal has joined #lisp
emaczen has quit [Ping timeout: 268 seconds]
pierpal has quit [Read error: Connection reset by peer]
<fiddlerwoaroof> akater: cool, I was thinking you might be able to work around your issues while waiting for a patch
<beach> Good morning everyone!
<fiddlerwoaroof> buffergn0me: I forget exactly what the issue was, but I remember finding some indication in the code that this was intentional
karlosz has quit [Quit: karlosz]
<loke> I've been writing a text document explaining some details ablout the clipboard work. Where should I put it in the McCLIM source repository?
<loke> Do I add a new subdirectory under Documentation/ ?
<beach> loke: Did you mean that question for #clim?
<loke> Yes :-)
<beach> Documentation sounds fine to me.
pierpal has joined #lisp
dale has joined #lisp
nanoz has joined #lisp
<loke> beach: I've just started, and it's very incomplete.
chrnybo has joined #lisp
<beach> Excellent!
Arcaelyx has joined #lisp
<loke> I'm still designing the details with regards to how presentations work
<beach> Sure, no rush.
chrnybo has quit [Ping timeout: 244 seconds]
<akater> fiddlerwoaroof: this is not necessarily easily reproducible. I'm not even sure we've come to conclusion that there is a bug. I'm quite sure there is.
<akater> Quite some time ago, I patched a system in ~/common-lisp and since then ASDF reloads it each time sbcl starts. Used to load fasls. What could this be?
<fiddlerwoaroof> loke: does mcclim integrate with the system clipboard now?
<fiddlerwoaroof> akater: yeah, I've run into weird cases like this recently myself
<fiddlerwoaroof> The other day I had an issue where I had to clear the class definition to recompile the class form
<fiddlerwoaroof> how are you loading the system akater
<fiddlerwoaroof> ql:quickload or asdf:load-system?
<akater> fiddlerwoaroof: (asdf:load-system :elephant)
akoana has left #lisp ["Leaving"]
<akater> It is not in Quicklisp. It also compiles some C code. But as far as I can remember, used to cache everything properly. There's .so in a dir.
<akater> My patch made it compatible with some recent ASDF (deprecated use of 'ASDF/LISP-ACTION:LOAD-OP)
<fiddlerwoaroof> nevermind, I thought I remembered seeing code where ASDF:LOAD-SYSTEM defaulted to recompiling
<fiddlerwoaroof> I've found that the behavior of ASDF and its cache is really unpredictable
<fiddlerwoaroof> sometimes ASDF decides to load from fasls and sometimes, for no apparent reason, it recompiles everything
<fiddlerwoaroof> maybe something you changed introduced an operation with broken staleness checks?
<akater> There was one single change: make-instance to make-operation at one single point. https://github.com/gonzojive/elephant/pull/1/files
<akater> I'm not sure how do I check for broken staleness checks. :-(
pierpal has quit [Ping timeout: 246 seconds]
pierpal has joined #lisp
<akater> Maybe someone who has more experience with ASDF could see something here immediately. I got some other asdf-related patch for this but don't feel like proposing until I figure this out.
<fiddlerwoaroof> j
<no-defun-allowed> h
<no-defun-allowed> i'm an idiot, K comes after J
<fiddlerwoaroof> :)
space_otter has joined #lisp
<fiddlerwoaroof> The biggest issue with evil-mode is accidentally sending normal mode commands to an IRC channel
<no-defun-allowed> The biggest issue is you have evil installed (:
rippa has joined #lisp
notzmv has quit [Ping timeout: 250 seconds]
nanoz has quit [Ping timeout: 240 seconds]
_whitelogger has joined #lisp
Bike has quit [Quit: Lost terminal]
torbo has quit [Remote host closed the connection]
nanoz has joined #lisp
Oladon has quit [Quit: Leaving.]
libertyprime has joined #lisp
keep_learning_M has quit [Quit: Leaving]
chrnybo has joined #lisp
asarch has quit [Quit: Leaving]
chrnybo has quit [Ping timeout: 246 seconds]
pritambaral has joined #lisp
kushal has quit [Ping timeout: 256 seconds]
kushal has joined #lisp
makomo has joined #lisp
dale has quit [Read error: Connection reset by peer]
dale has joined #lisp
shka_ has joined #lisp
space_otter has quit [Remote host closed the connection]
chrnybo has joined #lisp
chrnybo has quit [Ping timeout: 250 seconds]
dale has quit [Read error: Connection reset by peer]
dale has joined #lisp
dale has quit [Quit: dale]
lumm has joined #lisp
karlosz has joined #lisp
ravenousmoose has joined #lisp
ravenousmoose has quit [Client Quit]
<fiddlerwoaroof> Any way to copy a hash table exactly, including implementation-specific extensions
ravenousmoose has joined #lisp
<verisimilitude> Iterate over the contents of the hash table and add them to the new one.
<verisimilitude> If this isn't sufficient, then there's no standard way to do what you want, then, I don't believe.
<no-defun-allowed> Yeah, but that wouldn't include "implementation-specific extensions".
<no-defun-allowed> Also, you'd probably want to copy the test, size and rehash-size
<fiddlerwoaroof> oops, copying is the wrong word, I want an empty hash-table that's exactly like the given hash-table
q9929t has joined #lisp
<verisimilitude> Well, there's no COPY-HASHTABLE, so it doesn't seem there's a standard way to get this either, fiddlerwoaroof.
<no-defun-allowed> Then, you'd need a lot of implementation-specific stuff at least.
<no-defun-allowed> (make-hash-table :test (hash-table-test foo) :rehash-size ... :size ...) is probably the best way to copy the metadata on the table.
<verisimilitude> That only applies to standard metadata, though.
wxie has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
_whitelogger has joined #lisp
<pjb> (apropos-list "COPY-HASH")) #| --> (com.informatimago.common-lisp.lisp-reader.reader::copy-hash-table com.informatimago.common-lisp.cesarum.utility:copy-hash-table alexandria.0.dev:copy-hash-table) |#
<pjb>
<pjb> verisimilitude: I guess you could reclaim from vendors providing non-standard meta-data for hash-table, to provide a extensions:copy-hash-table function…
<pjb> No good deed shall remain unpunished.
q9929t has quit [Ping timeout: 246 seconds]
zotan has quit [Ping timeout: 268 seconds]
zotan has joined #lisp
<no-defun-allowed> In CLIM, is there some form of scrollable pane I can put gadgets in?
<no-defun-allowed> I'd like to try to create a frame which (to the user) magically contains an infinite set of gadgets, which are loaded as the user scrolls down.
zotan has quit [Ping timeout: 250 seconds]
zotan has joined #lisp
libertyprime has quit [Quit: leaving]
<no-defun-allowed> Actually, I'll pick this up tommorow, this might be too complex given it's almost bedtime.
milanj has joined #lisp
karlosz has quit [Quit: karlosz]
zotan has quit [Ping timeout: 240 seconds]
zotan has joined #lisp
lumm_ has joined #lisp
lumm has quit [Ping timeout: 250 seconds]
lumm_ is now known as lumm
q9929t has joined #lisp
zotan has quit [Ping timeout: 272 seconds]
zotan has joined #lisp
random-nick has joined #lisp
lumm has quit [Ping timeout: 250 seconds]
lumm has joined #lisp
akater has quit [Quit: WeeChat 2.3]
akater has joined #lisp
Inline has quit [Read error: Connection reset by peer]
lumm has quit [Read error: Connection reset by peer]
Inline has joined #lisp
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
lumm has joined #lisp
Zaab1t has joined #lisp
wxie has joined #lisp
dddddd has joined #lisp
void_pointer has joined #lisp
imjacobclark has joined #lisp
Achylles has joined #lisp
<imjacobclark> Hello - I am delving into the world of socket programming with sbcl and Lisp, I have a working TCP server (woop) which can receive data and send data back. My dad is received as an octet stream and thrown into an array with an element type of unsigned-byte
<imjacobclark> but its of fixed length - and ideally id like it to be dynamic length
<imjacobclark> so i can accept input of any size
<imjacobclark> how could i go about this? LOC relevant: https://github.com/imjacobclark/cl-servers/blob/master/simple-tcp-server.lisp#L16
mifff has joined #lisp
<pjb> imjacobclark: you can use adjustable arrays.
schjetne has joined #lisp
<pjb> with a fill pointer.
<pjb> (make-array 2042 :element-type '(unsigned-byte 8) :initial-element 0 :adjustable t :fill-pointer 0)
<imjacobclark> ah, excellent
<imjacobclark> thankyou
<pjb> Then you can indeed use adjust-array or vector-push-extend.
mifff has quit [Quit: WeeChat 2.3]
<imjacobclark> pjb: so would this rely on "(sb-bsd-sockets:socket-receive accepted-socket *receive-buffer* nil)" being able to do adjust-array/vector-push-extend ?
<imjacobclark> as i dont push the data in my code, socket-receive does that
<pjb> You would have to adjust it before receiving, to free some space where to receive the data.
<imjacobclark> interesting, i guess I would never know the size of the data before I receive, and i clear the buffer anyway before i receive new data
q9929t has quit [Quit: q9929t]
wxie has quit [Remote host closed the connection]
<imjacobclark> does this mean i have to just set the buffer initially to a very large value?
wxie has joined #lisp
<pjb> Yes.
<imjacobclark> as afaik - i cant peek at the size of the receiving buffer until i actually receive it, which is what sb-bsd-sockets:socket-receive does
<pjb> Or you can use a protocol that announce the size of the data to be transfered first.
<imjacobclark> does http do this?
<pjb> It has a Content-Size: header.
q9929t has joined #lisp
<imjacobclark> doesn't socket-receive take the entire response though, how could i chunk it up so i can read the content-length header first?
<imjacobclark> doesn't socket-receive "throw" the data away once called
<pjb> I don't know sbcl good enough to answer. read the documentation.
<imjacobclark> (as technically at that point the data has been received, regardless of your buffering)
<imjacobclark> okay
<imjacobclark> i guess in http-land this is only a problem on POSTs
<imjacobclark> GETs would never need to recieve
<nirved> imjacobclark: you could look at how it's done in other software, i.e. drakma - https://github.com/edicl/drakma/blob/master/request.lisp#L129
<imjacobclark> ah - they stream the data
zmv has joined #lisp
lumm_ has joined #lisp
<nirved> imjacobclark: for post data you could see at hunchentoot too - https://github.com/edicl/hunchentoot/blob/master/request.lisp#L150
<imjacobclark> yeah - looks like on both of those they're streaming the data
<imjacobclark> socket-make-stream appears to be able to do both input and output
lumm has quit [Ping timeout: 250 seconds]
Arcaelyx has quit [Ping timeout: 250 seconds]
lumm_ has quit [Ping timeout: 240 seconds]
lumm has joined #lisp
MichaelRaskin has joined #lisp
igemnace has quit [Quit: WeeChat 2.3]
ravenousmoose has joined #lisp
nanoz has quit [Ping timeout: 250 seconds]
pierpal has quit [Ping timeout: 250 seconds]
markoong has joined #lisp
FreeBirdLjj has joined #lisp
kenu has joined #lisp
q9929t has quit [Quit: q9929t]
<Xach> imjacobclark: i've seen one client read a byte at a time until it gets the end-of-header marker.
<Xach> i prefer to read in chunks and scan the chunks for markers.
<imjacobclark> Xach: is this possible with sb-bsd-sockets? I know usocket returns 4 bytes at a time, but I think sb-bsd-sockets:socket-read wants to read the whole thing all at once
<Xach> imjacobclark: you can read whatever you like.
<imjacobclark> how is that achieved? ive tried (sb-bsd-sockets:socket-receive accepted-socket "" 8) and then another (sb-bsd-sockets:socket-receive accepted-socket "" 8)
<imjacobclark> expecting it to read two lots of 8 bytes
<imjacobclark> but it just waits for input twice
pierpal has joined #lisp
<Xach> (sb-bsd-sockets:socket-receive socket buffer (length buffer)) is the thing to use, then look at the second value to see how much you got.
<Xach> Don't pass a buffer of size zero.
<Xach> If you only want to read 1 byte, use a length of 1, but make sure the buffer is able to hold at least one thing.
<Xach> Same with 8, or 47
<imjacobclark> so, once i know the second value (e.g how much I got) what do I do next to continue reading?
<Xach> imjacobclark: you can call it again.
lumm_ has joined #lisp
<Xach> you can get a long way with an api that does something like "call a function on each chunk you get up to matching this particular pattern" and "call a function on each chunk you get for a certain number of bytes". higher-level things can be build on top of that.
<imjacobclark> okay
<imjacobclark> im just trying this
<Xach> http generally goes: headers end with a pattern, body has a fixed size. or if it's chunked, it's headers up to a pattern, many repeated header pattern/sized chunks.
<imjacobclark> would you expect that to be able to read 8 bytes, then another 8 bytes?
wxie has quit [Ping timeout: 245 seconds]
lumm has quit [Ping timeout: 272 seconds]
lumm_ is now known as lumm
<imjacobclark> at the moment, using netcat - if i type "hi" and hit enter, it waits for a second input of "hi" and proceeds to print a single hi on the server
<imjacobclark> really i guess what i want to achieve is the ability to pass an arbitrary long string across to the server which it can chunk up and read into a buffer
<Xach> imjacobclark: what did you expect to happen when you send only four octets?
<Xach> Or maybe three?
<Xach> On the server-side, that is.
<imjacobclark> hmm
<imjacobclark> im not sure
<imjacobclark> it to read the 3 it did get?
<Xach> imjacobclark: do you close netcat after writing "hi" enter?
<imjacobclark> I don't - it prompts for a second input, I type hi again and then it closes, writing back hi...
<imjacobclark> but if I type hello world it does something different
<imjacobclark> it immediately returns "hi" (which I programmed the server to send back the string hi)
<imjacobclark> but the server itself outputs this...
<Xach> imjacobclark: socket-read will return if there is any data available from the client.
<imjacobclark> "rld
<Xach> imjacobclark: so if the client socket sends three bytes, the first call returns, and puts that data in the buffer. then the next read will read whatever is available, again. then the server prints the buffer and returns.
<Xach> if you send more than 16 bytes, both calls return immediately because there is data there.
<imjacobclark> ah
<imjacobclark> are you saying, its returning and closing the socket because im not handling that return
<Xach> if the client socket is closed, the socket-read returns 0 length, which is the special value that means it's done in this case.
<Xach> I'm saying that socket-receive can read less than you are asking for.
<Xach> and the second return value tells you what you got, and a second return value of 0 is special.
<imjacobclark> so when i send "hello world" over as 8 bit the server only prints "rld - why is it reading from the back?
<Xach> imjacobclark: you are using one buffer without printing after the first call. the second read overwrites the first.
<Xach> scribbling over the result of the first call with the second
lumm has quit [Ping timeout: 245 seconds]
Lord_of_Life has joined #lisp
<imjacobclark> dammit - of course
<imjacobclark> Hah
random-nick has quit [Ping timeout: 250 seconds]
<imjacobclark> That was why I was confused
<imjacobclark> I see what you mean by it returning now, its read less data than it expected to, so it waits for the next lot
<imjacobclark> thats why i should wait for the EOL to know when ive really finished reading, right?
<Xach> imjacobclark: there are so many options - it depends on your needs
<imjacobclark> i guess in this case - to be very simple, i'd just like to know when there is no more data left to read
<Xach> you can't know in advance how much data you'll get so you have to piece it together if you want to read patterns
<Xach> imjacobclark: socket-receive will return 0 as its second value
<imjacobclark> yeah
<Xach> that means the remote end closed
<imjacobclark> i couldn't see that in the sbcl user man, how did you find that out? http://www.sbcl.org/manual/#Sockets-Overview
<Xach> imjacobclark: i'm familiar with the underlying C api
<Xach> SBCL's sb-bsd-sockets is a relatively thin layer over it - in a pinch you can make your own thin layer.
<Xach> M-. into any of the socket functions to see what's going on
Essadon has joined #lisp
<Xach> Not that you should necessarily roll your own when sb-bsd-sockets is generally good enough. I'm easily disgruntled with it, though, and know how to get to the low-level functionality i want.
varjag has joined #lisp
<imjacobclark> Xach: thanks for your help - i very much appreciate it
<Xach> no problem
Bike has joined #lisp
lumm has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
random-nick has joined #lisp
lumm has quit [Read error: Connection reset by peer]
<akater> Fun fact: in ECL, (defclass q nil nil nil) creates a class. In SBCL, error is signalled.
scymtym has joined #lisp
<akater> The error message is not very helpful which is why I shared this.
<akater> (The error message mentions an initarg while no initarg was actually provided in the form.)
<pjb> Something like: Class option nil is not one of (:primary-p :documentation :direct-default-initargs :direct-slots :direct-superclasses :name) ? How is that not very helpful?
<akater> I get Invalid initialization argument: NIL in call for class #<STANDARD-CLASS COMMON-LISP:STANDARD-CLASS>.
<pjb> Yes, a litle less helpful, but still, clearly states the problem.
<pjb> It doesn't mention an initarg, but one of the initialization arguments.
<pjb> What's more of a problem, is that ecl accepts this non-conforming form…
<akater> Yes. The initial form did not contain anything resembling an initialization argument. Also: I only checked in Maxima's ECL on my Android so it might be dated.
ebrasca has joined #lisp
lumm has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
<imjacobclark> Xach: So I changed my buffer length to 1 and used (print (nth-value 1 (sb-bsd-sockets:socket-receive accepted-socket *receive-buffer* (length *receive-buffer*)))) to view the second return of of the socket-receive function
<imjacobclark> Sending "h" in the client returns 1 in the server
makomo has quit [Ping timeout: 272 seconds]
<imjacobclark> underneath the first (print (nth-value 1 (sb-bsd-sockets:socket-receive accepted-socket *receive-buffer* (length *receive-buffer*)))) I have another (print (nth-value 1 (sb-bsd-sockets:socket-receive accepted-socket *receive-buffer* (length *receive-buffer*))))
FreeBirdLjj has quit [Ping timeout: 245 seconds]
<imjacobclark> the second nth-value prints nothing until the next socket request, but it prints 1, not 0 like you suggegst
<imjacobclark> have i missed something?
FreeBirdLjj has joined #lisp
<Xach> imjacobclark: what do you mean by "next socket request"
<imjacobclark> the next call to socket-recieve
<imjacobclark> sorry
lumm has quit [Ping timeout: 250 seconds]
<imjacobclark> its as if when its finished reading, it breaks out of my loop
<Xach> imjacobclark: i suggest it will return 0 when there is no data left to read and the remote end has shut down.
<Xach> it will return non-zero while there is data pending
<imjacobclark> in netcat, if i type just "h" and hit enter, wont it move into that state?
<imjacobclark> there shouldnt be any data pending
<Xach> imjacobclark: there is "h" and [enter], at least.
<imjacobclark> hmm
<imjacobclark> so if i up my buffer to 2 chars?
<Xach> What are you trying to observe?
<imjacobclark> So I expect that, when running this code: https://gist.github.com/imjacobclark/89723165137efc5e506a4095fcaee7e9 - then doing "nc localhost 8080" - it will prompt for data, I will type "h" [enter] - the server will at first print the length of the sequence "h" [enter] from the socket-recieve and the second socket-recieve will print 0
FreeBirdLjj has quit [Remote host closed the connection]
<Xach> imjacobclark: do you quit nc on the client side?
<imjacobclark> once ive done "h" [enter] it removes the ability to input, and on the server I have the line (sb-bsd-sockets:socket-send accepted-socket *response* *response-length*) - so it immediately then says "hi"
<imjacobclark> [clarkj84:~/Desktop/cl-servers]$ nc localhost 8080
<imjacobclark> h
<imjacobclark> hi% [clarkj84:~/Desktop/cl-servers]$
<imjacobclark> thats what happens
void_pointer has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<imjacobclark> when netcat accepts the data, could it be sending along another input char?
themsay has quit [Ping timeout: 250 seconds]
<Xach> imjacobclark: enter is included in the input. you can use "h" followed by Ctrl-d
<Xach> that will push it immediately with no newline
<Xach> h<ctrl-d>i<ctrl-d>
nanoz has joined #lisp
<imjacobclark> interesting, c<ctrl-d> returns "" on the server
<imjacobclark> ah
<imjacobclark> got it
<Xach> ctrl-d mainly means "push what data is pending" - something newline also does, but includes a newline
FreeBirdLjj has joined #lisp
<imjacobclark> so thats cool - i guess theres nothing wrong with the code, nc is sending [enter] litterally
<Xach> enter is part of the data sent, yes
<imjacobclark> Last thing then, so when I have a (print buffer) directly after my socket-receive - it doesn't immediately print, it prints on the next lot of input from the client, its as if socket-receive is causing the loop to short circuit when its done reading - is that expected?
<Xach> imjacobclark: try a force-output after the print.
<Xach> buffering may be the explanation.
<imjacobclark> That worked
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<imjacobclark> Is lisp doing something internally with printing to stdout?
lumm has joined #lisp
<Xach> imjacobclark: output may be buffered
xkapastel has joined #lisp
matijja has joined #lisp
rumbler31 has joined #lisp
ravenousmoose is now known as ravenousmoose[aw
ravenousmoose[aw has quit [Quit: Taking a quick nap...ZZzzz]
makomo has joined #lisp
rumbler31 has quit [Remote host closed the connection]
<imjacobclark> Xach: Thanks for your help again, I'm now able to read chars sent in, at the min it overwrites the buffer each time, i just need to work out how to adjust the buffer size :) https://github.com/imjacobclark/cl-servers/blob/master/simple-tcp-server.lisp#L20-L26
imjacobclark has quit [Remote host closed the connection]
imjacobclark has joined #lisp
imjacobclark has quit [Remote host closed the connection]
ravenousmoose has joined #lisp
mejja has joined #lisp
zmv has quit [Ping timeout: 250 seconds]
Oladon has joined #lisp
CCDelivery has joined #lisp
Josh_2 has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
Josh_2 has quit [Read error: Connection reset by peer]
Josh_2 has joined #lisp
milanj has joined #lisp
igemnace has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
Josh_2 has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
Josh_2 has joined #lisp
Guest22118 has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
<kenu> Trying to change session-cookie-name in hunchentoot, but what does it exactly mean to specilize generic function and how one do that?
Guest22118 has left #lisp [#lisp]
xkapastel has quit [Quit: Connection closed for inactivity]
nanoz has quit [Ping timeout: 244 seconds]
CCDelivery has quit [Ping timeout: 245 seconds]
<_death> if you have your own acceptor (sub)class, then it's a matter of (defmethod hunchentoot:session-cookie-name ((acceptor my-acceptor)) <code here>)
rumbler31 has joined #lisp
imjacobclark has joined #lisp
imjacobclark has quit [Remote host closed the connection]
ebrasca has quit [Read error: No route to host]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Read error: Connection reset by peer]
<drmeister> beach is in the news: https://news.ycombinator.com/item?id=19121443
<drmeister> Some of the only freakin' news worth reading.
nanoz has joined #lisp
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
lumm has quit [Ping timeout: 240 seconds]
<Xach> maybe the 50th time i've seen the "emacs is a lisp os" joke
<ecraven> Xach: I don't see it as a joke any longer :P
markoong has quit [Quit: Konversation terminated!]
markoong has joined #lisp
<drmeister> Yeah - it's funny because it's true.
ravenousmoose has joined #lisp
lumm has joined #lisp
<makomo> can anyone tell me how much was ELS registration the previous few years (preferably for students)?
<makomo> i think i heard someone say that it was rather low/symbolic, especially for students
lumm has quit [Client Quit]
lumm has joined #lisp
<makomo> but from what i see, this year it's €120/€160 (early/late) for students
<makomo> are such prices the norm? was it previously lower but now that it's colocated with <Programming> it's higher?
<MichaelRaskin> In the middle of the page of year 2019 I see «Because the student fee is higher than our normal rate, we will also implement a student refund program when the conference is over, as we did two years ago.»
<MichaelRaskin> I do not know the details/exact amounts
<makomo> MichaelRaskin: i saw that as well, but haven't found further details
<nirved> drmeister: do you have a secret plan to make a lisp machine out of spiroligomers?
<drmeister> Not secret
<drmeister> I'm a professor I try to teach and inspire.
<MichaelRaskin> makomo: It is possible that there is something not completely clear about the exact interaction with the maing organising committee.
<MichaelRaskin> If you subscribe to the list, you can look at 2017 archives.
<jackdaniel> before programming the cost was (if I recall correctly) 40 euro for students and 80 euro for everyone else (early birds)
<MichaelRaskin> I think it was a bit more expensive
<jackdaniel> I may be wrong
<makomo> hmm, i see
<MichaelRaskin> Anyway, in 2017 I see an announcement of a not-too-complicated procedure with a 50€ refund for students registered for workshop days of Programming and precommitting to attend both days of ELS and signing some paperwork in the ELS room on both days.
<makomo> ah, so ELS was colocated with <Programming> before too?
<MichaelRaskin> Yes, in 2017 (which was probably the first year of once-in-two-years Programming)
<jackdaniel> in 2015 it was 120 for one person (not a student)
<jackdaniel> with +1 for banquet it was 160
<jackdaniel> So I suspect I guess it could be 80 for students
nowhereman has quit [Ping timeout: 252 seconds]
lumm has quit [Read error: Connection reset by peer]
lumm has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
lumm has quit [Client Quit]
lumm has joined #lisp
space_otter has joined #lisp
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
xkapastel has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
random-nick has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
<Xach> I can't make it this time around
<Xach> It makes me sad because this is essentially the only Common Lisp conference in the world right now.
random-nick has joined #lisp
lumm has quit [Ping timeout: 252 seconds]
random-nick has quit [Ping timeout: 240 seconds]
ggole has quit [Quit: Leaving]
ravenousmoose has joined #lisp
Arcaelyx has joined #lisp
<margaritamike> Is it harder to do refactoring in Common Lisp than other languages like Java/Haskell?
marvin2 has joined #lisp
<jackdaniel> I'm sure it is harder for Java/Haskell programmers :-)
<dlowe> I still have a T-shirt from the one in Cambridge a few years ago
<margaritamike> Well what tools do we use to refactor Common Lisp?
q3d has joined #lisp
<dlowe> emacs, mostly
<margaritamike> Maybe this is a better question for #slime then
<fiddlerwoaroof> margaritamike: I find that paredit and keyboard macros are a pretty good substitute for the refactoring tools something like IntelliJ provides
<fiddlerwoaroof> If you're doing something like renaming a function, there's slime-who-calls ( C-c C-w C-c ) for that
Oladon has quit [Quit: Leaving.]
lumm has joined #lisp
<Xach> margaritamike: i think there are fewer tools for automatic widespread refactoring then in other environments.
<fiddlerwoaroof> I believe there was something called redshank that provided some minimal refactorings
mr_noobs has quit [Ping timeout: 244 seconds]
<Xach> I think there are pieces available to build nice refactoring tools but I'm not aware of any completed and available projects along those lines
<shka_> well, there is eclector and scymtym (i think?) was doing some really impressive things with it
<scymtym> not ready for use though
<shka_> what if somebody would want to contribute though
lumm has quit [Ping timeout: 268 seconds]
<shka_> anyway, eclector is currently the best base to build such refactoring tools i suspect
<scymtym> eclector is all i can offer in that regard for now, sorry (i hope to change that this year)
<shka_> scymtym: it is really promising, i hope you will make it awesome
<LdBeth> I'm trying to make a projectional editor, which I suppose can make refacting easier
lumm has joined #lisp
<scymtym> shka_: same
<scymtym> LdBeth: that's another possibility. are you aware of http://projectured.org/ ?
<LdBeth> however I'm not sure if people are ok with using binary file format to store their project
<LdBeth> scymtym: I've looked into it, but the approch I choose is using a Concordia/Scribe like markup rather than serialized CLOS object. The format accepts malformed input which could be more pratical in converting exsisted projects.
<scymtym> LdBeth: i see
lumm has quit [Ping timeout: 250 seconds]
paul424 has joined #lisp
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
drolax has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
xkapastel has joined #lisp
akoana has joined #lisp
scymtym has quit [Ping timeout: 268 seconds]
igemnace has quit [Quit: WeeChat 2.3]
q3d has quit [Ping timeout: 256 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
nanoz has quit [Ping timeout: 240 seconds]
shka_ has quit [Ping timeout: 268 seconds]
random-nick has joined #lisp
akoana has left #lisp ["Leaving"]
scymtym has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
random-nick has joined #lisp
matijja has quit [Ping timeout: 272 seconds]
random-nick has quit [Remote host closed the connection]
rjid has joined #lisp
dale has joined #lisp
random-nick has joined #lisp
paul424 has quit [Quit: Leaving]
libertyprime has joined #lisp
Oladon has joined #lisp
karlosz has joined #lisp
FoxyBoxes has joined #lisp
Kaisyu has joined #lisp
lumm has joined #lisp
drolax has quit [Ping timeout: 252 seconds]
elem6 has joined #lisp
lumm has quit [Quit: lumm]
lumm has joined #lisp
montxero has joined #lisp
lumm has quit [Client Quit]
lumm has joined #lisp
<montxero> Hi, in slime-repl, when the screen is cleared with C-l and a form is evaluated, part of the previously cleard screen comes back moveing the new results lower. How can one avoid this such after clearing the screen, old stuff doesn't come back unless one does C-l or M-v or something similar?
keep_learning has quit [Ping timeout: 250 seconds]
elem6 has quit [Remote host closed the connection]
q9929t has joined #lisp
<akater> montxero: slime-repl-clear-buffer ?
pritambaral has quit [Ping timeout: 246 seconds]
<Xach> That is bound to C-c M-o for me.
q9929t has quit [Quit: q9929t]
rjid has quit [Ping timeout: 256 seconds]
Jesin has quit [Quit: Leaving]
random-nick has quit [Ping timeout: 245 seconds]
pillton has joined #lisp
Jesin has joined #lisp
wxie has joined #lisp
CCDelivery has joined #lisp
Essadon has quit [Quit: Qutting]
wxie has quit [Ping timeout: 246 seconds]
mgsk has joined #lisp
<mgsk> I'm trying to write a macro that uses some lexical variable's symbol-value as the value for return-from. Having trouble thinking about compile time vs. run time, and how to do it properly https://gist.github.com/notmgsk/e1ca6f104bce29444c53255f3966db50
<pjb> mgsk: learn about lexical variables and special variables (lexical binding vs. dynamic binding).
<pjb> mgsk: what have you been told about naming your variables defined with defvar?
<mgsk> Um, I dunno. Not much? Am I mixing up lexical vs dynamic
<pjb> yes, you're doing whatever.
<pjb> mgsk: notice also that you can define local macros.
<pjb> So basically, there's almost one error per line…
<pjb> Also, you didn't mention that you wanted to work with the name of the function. There might be more than one error per line…
<Xach> lexical variables don't have a symbol-value
<Xach> mgsk: block/return-from and throw/catch might help achieve some kind of flow control there. but it's a little hard to tell from the example.
<Xach> It's not too hard to implicitly establish some context that is then implicitly used later but it depends on the context.
<montxero> akater: Heck yes, thanks mate
lumm has quit [Remote host closed the connection]
akater has quit [Quit: WeeChat 2.3]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 246 seconds]
Lord_of_Life_ is now known as Lord_of_Life