jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language<http://cliki.net/> logs:<https://irclog.whitequark.org/lisp,http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
kozy has quit [Remote host closed the connection]
skeuomorf has left #lisp ["Killed buffer"]
kozy has joined #lisp
siraben has quit [Ping timeout: 252 seconds]
dented42 has joined #lisp
robotoad has quit [Max SendQ exceeded]
Arcaelyx has joined #lisp
robotoad has joined #lisp
phao has joined #lisp
<phao> Hi. New to lisp here. Is there any way to have something like a pointer to a pointer with common lisp? I have a function which returns me a cons-cell, and I'd like to replace it by another thing, but in the place where that cons-cell came from. In C, I could do this by returning a pointer that cons-cell pointer. How could I do this sort of thing in CL?
<phao> From what I'm seeing, the "common pattern" in CL for this is to have something like (setf (my-getter-of-cons-cell obj) new-cons-cell) it seems. Not sure...
<no-defun-allowed> you could box it by putting it in a vector with just that cons
<no-defun-allowed> if you have to though, you may want to rethink things though, it's not typical for CL to do that
<phao> I see.
ryan_vw has quit [Ping timeout: 240 seconds]
<phao> Thanks.
<aeth> Sounds like you could use a closure. (let ((foo (cons 1 nil))) (defun foo () foo) (defun (setf foo) (new-value) (setf foo new-value))) Then (setf (foo) "Hello, world!") (foo) and your foo function now returns "Hello, world!"
<on_ion> ehe
<Bike> i'd rather see it and look at what is appropriate
<phao> Bike, It's an exercise on removing an element from a bst
<aeth> Yes, that is literally implementing what you want, but what are you trying to do? The code I wrote isn't very idiomatic (although it does use a getter/setter pair)
<nyingen_> Hm, I found the problem with chillax. Not sure it's anything in his lib specifically but drakma is returning a vector of octets instead of a string representing JSON (when talking to Couchdb)
<phao> I have a node in the tree n=(elt, left, right). I know n.left is null and I want to replace n, in the tree, by its right.
<phao> In C, having a pointer to n, I could do *n = (*n)->right
<on_ion> algorithm might be such that the C way may seem like the right option
<phao> that is what I have in mind. Without using pointers-to-pointers I have to keep track of "where I'm coming from"
<phao> But it's no big deal. It's not needed for me to do that. I was just curious if there was some straightforward way to do that.
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
<phao> Thanks all.
phao has quit [Quit: Leaving]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nyingen_> Anyone around who's familiar with Drakma?
<Bike> i mean, a little.
<nyingen_> So this couchdb lib uses Drakma to make requests and get responses via HTTP to the couchdb server
<nyingen_> CouchDB responds with JSON strings, but since it's content-type:application/json, Drakma returns it as a vector of octets
<nyingen_> Apparently the couchdb lib ("chillax") expects a plain string. Perhaps this was the behaviour 8 years ago when it was written?
<|3b|> https://edicl.github.io/drakma/#*text-content-types* <- add json to that i think
<nyingen_> Adding (flexi-streams:octets-to-string response) in the chillax source code fixes the problem but is that the right approach?
<nyingen_> ah, ok
<Bike> listen to 3b instead of me, even though we said the same thing
<nyingen_> Cool, now I don't need to patch chillax after all
<|3b|> best kind of bug fix :)
<Petit_Dejeuner> "listen to 3b instead of me" infinite loop
Oladon has joined #lisp
<nyingen_> I did look at the Drakma docs but I ended up thinking that the :external-format-out option to drakma:http-request had something to do with it
<no-defun-allowed> yes, you need to adjoin ("application" . "json") to that var
<drdo> Hmm, is there any standard util to coerce to boolean? i.e. non NIL is T
elderK has joined #lisp
<Bike> i just do not not
<Bike> or (if x t nil)
<drdo> Bike: yeah, just wondering if there was something in some widely use lib
<drdo> *used
<Bike> not that i am aware of.
shifty has joined #lisp
<on_ion> being in the base CL lib seems quite widely used.
robotoad has quit [Quit: robotoad]
doesthiswork has joined #lisp
elfmacs has joined #lisp
robotoad has joined #lisp
smaster has joined #lisp
smaster has quit [Quit: WeeChat 2.2]
Oladon has quit [Quit: Leaving.]
_whitelogger has joined #lisp
orivej has quit [Ping timeout: 252 seconds]
Roy_Fokker has quit [Read error: Connection reset by peer]
<beach> Good morning everyone!
<no-defun-allowed> morning beach
dale has joined #lisp
pierpal has joined #lisp
<on_ion> good morning
<beach> no-defun-allowed: It happens to all of us. There are several remedies. 1. Take a break entirely, grow vegetables instead for instance. 2. Start a different (simpler?) project.
<no-defun-allowed> good ideas
pierpal has quit [Quit: Poof]
<no-defun-allowed> it's spring now and i was considering growing tomatoes, heh
<LdBeth> GG
pierpal has joined #lisp
<LdBeth> I remember there's a expanding meme on starting new project
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
Copenhagen_Bram has quit [Quit: So long, and thanks for all the fish! 2.2 Weechat is best Weechat]
dddddd has quit [Remote host closed the connection]
Pixel_Outlaw has quit [Quit: Leaving]
<aeth> no-defun-allowed: 3. write documentation
<aeth> You're still moving forward, just not programming.
skeuomorf has joined #lisp
skeuomorf has quit [Client Quit]
<aeth> (writing tests might work, too)
<no-defun-allowed> i was writing docs
<aeth> oh well if you've exhausted that then GOTO 1
<no-defun-allowed> alright
jack_rabbit has quit [Ping timeout: 250 seconds]
<no-defun-allowed> these were docs i wrote before doing the programming cause it's a difficult topic
<LdBeth> well writing doc utils also word
<LdBeth> works
_whitelogger has joined #lisp
<no-defun-allowed> well, i was writing about how the MOP would work
elfmacs has quit [Ping timeout: 252 seconds]
<aeth> What are you using the MOP for?
<no-defun-allowed> it's not to be confused with the CLOS's MOP
<no-defun-allowed> but it's how objects get parsed and validated including the classes that are defined
ggole has joined #lisp
phadthai has quit [Quit: hardware upgrade]
megalography has joined #lisp
dale has quit [Quit: dale]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
<nyingen_> So (push (cons "application" "json") drakma:*text-content-types* ) works as expected when I call drakma:http-request from the repl
<nyingen_> However that had no effect on the chillax library which is using drakma to talk to couchdb
<nyingen_> I must be doing something incorrectly
<nyingen_> nevermind, there is a different problem going on.
ryan_vw has joined #lisp
pierpal has quit [Ping timeout: 252 seconds]
jack_rabbit has joined #lisp
pierpal has joined #lisp
<nyingen_> The Chillax lib does need a small patch, it turns out.
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
JohnMS has joined #lisp
<on_ion> nyingen_: for drakma?
phadthai has joined #lisp
<beach> no-defun-allowed: I think MOP-related stuff is way to complicated for you, judging from your reaction when I gave you a list of suggested projects. You said they were probably too complicated for you.
<no-defun-allowed> yeah probably
<no-defun-allowed> having that kind of dynamics would be a killer feature for my project though
<beach> I understand.
vlatkoB has joined #lisp
<no-defun-allowed> i'll do more reading i guess
<beach> If I were you, I would choose a small project that could be useful for several #lisp participants and that has to do with some Common Lisp tools, as opposed to an application.
<beach> That way, you would have many people to help you and give you advice.
<no-defun-allowed> alright
<beach> Not that I have anything specific in mind. At least not right now. But I guess I could give it some thought.
bacterio has joined #lisp
dented42 has joined #lisp
<no-defun-allowed> except for the object protocol this project seems very achievable though
<nyingen_> on_ion: The chillax lib (for couchdb) is using drakma:http-request incorrectly, it seems. I'm sure the code worked in 2010 but something seems to have changed
<nyingen_> Removing :external-format-in and :external-format-out from its invocation of that function makes everything work the way it's supposed to
<beach> no-defun-allowed: So why the mental block then?
<no-defun-allowed> cause of the object protocol part
<on_ion> nyingen_: ahh, cool.
<beach> no-defun-allowed: Oh, sorry, misread your previous utterance.
<no-defun-allowed> that's alright
<beach> The thing with applications, though, is that there is a great risk that you are the only one interested in that particular application, so you are pretty much on your own.
<beach> That's why I suggested a programming tool instead.
<no-defun-allowed> fair enough
<beach> I mean, it is fine to be on your own if you have the drive, and you are an experienced Common Lisp programmer. But that is not your case, as I understand it.
elfmacs has joined #lisp
<no-defun-allowed> one sec, playing tech support for my dad
<no-defun-allowed> back
<no-defun-allowed> well i know that i'm not the only one interested, my friends have been listening and asking questions about it
igemnace has quit [Quit: WeeChat 2.2]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<no-defun-allowed> i can't call it new either, i've been toying with the idea for at least a year now
<beach> Can you describe in a simple phrase what your application is doing?
<no-defun-allowed> this application is designed to transport and store various types of data across a distributed network.
igemnace has joined #lisp
<no-defun-allowed> however, it also provides elliptic-curve signing and key derivation for proving ownership, and schemas to turn the textual formats into actual objects in your favourite language (such as CL).
terpri has quit [Ping timeout: 268 seconds]
dented42 has joined #lisp
solb has joined #lisp
<solb> hey y'all, wondering about some problems with my function apparently using generic-+ instead of doing float arithmetic
<solb> the problem is only at optimize speed 2 and 3 and has to do with the reader value of my class
<beach> What is the "reader value of a class"?
dented42 has quit [Ping timeout: 244 seconds]
<solb> or sorry, :reader of my class
<solb> oh shit that's me testing making an inline function that just adds to double, but there's still pointer->double-float coercion that I don't exactly understand
rippa has joined #lisp
<beach> I strongly suspect that the :TYPE option is used only to check the type when things are stored, and that a boxed value is stored in any case.
<phoe> solb: unless you're writing this yourself as an exercise, https://github.com/Shinmera/3d-matrices
<solb> yeah I'm writing it myself as an exercise :)
<phoe> okiedokie
<solb> but thank you, will definitely use as a reference
<phoe> pointer -> double float coercion in SBCL most likely means that you are converting from a boxed value to an unboxed value
<beach> phoe: I think that is precisely what I said, no?
<phoe> beach: yes, correct.
<solb> I'm sorry for being a noobie, but what exactly does that mean for my use
<phoe> and :TYPE is only for compiler information. SBCL doesn't make use of that information and you can store integers in a :TYPE FLOAT slot.
<solb> ahhhhh, i see.
<solb> Is there anyway to force double-float at compile?
<beach> solb: I think you are out of luck.
<beach> solb: I suspect when it stores a double float in a standard object, it is always boxed.
<phoe> solb: I think you will want structure classes, created via DEFSTRUCT.
<solb> welp, makes sense.
<phoe> structure classes are dumber, as in, they don't make use of many of the advanced object-oriented facilities.
<solb> ahh i thought about using defstruct
<solb> I guess I should do that after all
Bike has quit [Quit: Lost terminal]
<phoe> but they also make it possible to either use structure-classes or to use a trick and use a vector as a structure.
<phoe> then all the DEFSTRUCT does is create make, predicate and accessor functions for that vector.
<solb> what is a structure-class?
<phoe> so, essentially, you'll use a typed vector of three floats, which is as efficient as you can get.
<phoe> solb: the type of class usually created by defstruct.
<solb> ooh, that sounds like exactly what I want :)
<phoe> defclass creates standard-classes, instances of which are standard-objects; defstruct creates structure-classes, instances of which are structure-objects.
<phoe> ...unless defstruct creates vectors or lists, which is the special case.
<phoe> but, if you're doing vector operations, it seems that you might want to use this.
<phoe> also, I posted a wrong link; you're doing vector operations and not matrix operations.
<solb> phoe, thank you so much
<phoe> it uses structure-objects for vectors, see https://github.com/Shinmera/3d-vectors/blob/master/struct.lisp
<beach> The existence of STANDARD-INSTANCE-ACCESS makes it tricky to store unboxed data in a STANDARD-OBJECT.
<beach> mop standard-instance-access
<phoe> beach: yep. I think the storage vector associated with instances is, in general, a simple-vector, meaning that things are always boxed inside it.
jack_rabbit has quit [Ping timeout: 252 seconds]
<beach> If you happen to ask for a slot that happens to contain an unboxed float, it will be interpreted as a Common Lisp object, and very likely crash your system.
<phoe> Creating different types of storage for a single instance might be problematic.
<beach> That part is doable I think.
<beach> The implementation would not use a simple vector.
<solb> What I'm getting is I should definitely use DEFSTRUCT, right?
<beach> Not from me.
<solb> What are your thoughts?
<phoe> solb: if you want it to go faster, I say yes. If you think your code is already fast enough, then there's no need to.
<beach> I never use DEFSTRUCT. But then, I don't have the problems you do.
<solb> Well this is a base for a N-Body gravity simulator, so speed is a pretty big priority
<beach> solb: I don't write N-Body gravity simulators.
<phoe> then do two things, in this order.
<phoe> 1) use defstruct for your vectors
doubledup has joined #lisp
<phoe> 2) switch for an external library that has been used and battle-tested for a longer while. (:
<phoe> 1) is for learning, 2) is for when you've already learned.
<solb> hahaha, I'm sure life would be much easier using an external library, yes.
<solb> But there's fun to building my own, right? :)
<phoe> exactly
<phoe> that's why I write code that I don't end up using later on
<solb> Well, it could break sometimes, as long as it works well enough to get some good numbers
<phoe> the worst way for it to break is not when it errors, but when it seems to work correctly
<phoe> except it doesn't
<solb> true, true.
<solb> I also stole back some speed writing my own ADD-DUB function that just adds two numbers I know to be doubles, and declaming that inline
<solb> as silly at that solution seems it gained some time
dented42 has joined #lisp
<phoe> solb: weird
<solb> Well anyways, off to bed for me now, but thanks for the help as usual :)
<phoe> as long as the compiler knows that both of your arguments are doubles, it should be able to speed it up for you
<phoe> no point in defining a separate function for that and then inlining it
meepdeew has joined #lisp
<aeth> solb: two ways to avoid boxing in a data structure: specialized array (possibly created through defstruct storing to a sequence) and :type in a(n ordinary) structure slot
<aeth> The latter is less portable, of course, but it'll work in a sufficiently optimizing compiler.
<aeth> pretty much will only avoid the boxes of double-float, (unsigned-byte 64) and (signed-byte 64) and you still have to be careful not to e.g. return one from a non-inline function or call a function that's not inline with it as a parameter.
<phoe> aeth: SBCL with SPEED 3 should warn of this last scenario.
<aeth> Yes, SBCL is very good about this.
solb has quit [Ping timeout: 256 seconds]
<aeth> SBCL is the only implementation where I'm sure every workaround like this I'm doing actually works because of its compiler notes, its commented disassemble output, its profiling, etc.
<aeth> I'd love for there to be some competition in tooling there.
stereosphere has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
doesthiswork has quit [Ping timeout: 268 seconds]
<phoe> Where in the standard CL are class names used as arguments? DEFCLASS, DEFMETHOD, (SETF) FIND-CLASS, ...?
<phoe> DEFGENERIC with :METHOD option, too, ...?
<no-defun-allowed> TYPEP
<phoe> that's type specifiers, but right.
<no-defun-allowed> well class names are type specifiers
<Shinmera> even class objects are type specifiers!
<no-defun-allowed> oh cool, didn't know that
<no-defun-allowed> ty Shinmera
<Shinmera> phoe: find-method is another
<Shinmera> Or, wait, no, that needs class objects
<Shinmera> change-class though
elfmacs has quit [Ping timeout: 272 seconds]
<on_ion> does make-instance count
<Shinmera> and allocate-instance
<no-defun-allowed> yes, m-i counts
shka_ has joined #lisp
themsay has quit [Ping timeout: 272 seconds]
<phoe> hm
<phoe> not all that much
<phoe> s/much/many/
<phoe> Shinmera: A-I doesn't accept class names
<phoe> I'll write a CLOS extension that allows it to accept classes named by lists of symbols, not only symbols
<Shinmera> blast my memory
ryan_vw has quit [Ping timeout: 268 seconds]
Lycurgus has joined #lisp
dented42 has quit [Ping timeout: 260 seconds]
bendersteed has joined #lisp
mkolenda has quit [Remote host closed the connection]
mkolenda has joined #lisp
nowhere_man has quit [Ping timeout: 252 seconds]
<LdBeth> brain power
kajo has joined #lisp
angavrilov has joined #lisp
desperek has joined #lisp
<desperek> hiya
<phoe> heyyy
dented42 has joined #lisp
random-nick has joined #lisp
* desperek awoos so the whole channel can hear him
JohnMS has quit [Quit: Konversation terminated!]
SenasOzys has joined #lisp
<no-defun-allowed> hi
<desperek> sup no-defun-allowed
<desperek> oh right, i had a question. how do you make a web server with lisp
<desperek> common lisp
<no-defun-allowed> you can use hunchentoot or some other server to make a web program
<desperek> no-defun-allowed, what about writing a server myself
<no-defun-allowed> (i found hunchentoot to be just the right balance of handholding and decisions. your mileage may vary :)
<no-defun-allowed> probably not worth it unless you have specific use cases
<desperek> i like the site of hunchenthot
<no-defun-allowed> fun and utterly useless fact: it's named after a frank zappa piece
<desperek> no-defun-allowed, thanks for letting me know about that
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
ebzzry has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
shifty has quit [Ping timeout: 252 seconds]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
rixard has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
<nyingen_> what do i do when the inferior lisp (in emacs slime mode) hangs?
<nyingen_> ctrl-c didn't help; I had to quit emacs entirely
rtypo has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
fiddlerwoaroof has joined #lisp
robotoad has quit [Quit: robotoad]
orivej has joined #lisp
knicklux has quit [Remote host closed the connection]
ravndal has quit [Quit: WeeChat 2.2]
rixard has quit [Quit: rixard]
ravndal has joined #lisp
scymtym has quit [Ping timeout: 252 seconds]
bendersteed has quit [Remote host closed the connection]
<no-defun-allowed> Somehow doing C-c C-c in inferior-lisp works.
Essadon has joined #lisp
<Gnuxie[m]> C-g
<Gnuxie[m]> if it's when you're typing something into the repl
<Gnuxie[m]> idk, it does that with me because of AC a lot
SenasOzys has quit [Quit: Leaving]
<nyingen_> Hm, I could try C-g next time
<nyingen_> I did try C-c C-c which usually works, but did not here
<nyingen_> this was doing something with cl-mysql
<nyingen_> not sure what made it hang, as I lost access to the debugger and repl
<nyingen_> very frustrating.
varjag has joined #lisp
dented42 has quit [Ping timeout: 252 seconds]
Lycurgus has quit [Quit: Exeunt]
v0|d has quit [Remote host closed the connection]
v0|d has joined #lisp
Josh_2 has joined #lisp
dddddd has joined #lisp
serichsen has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
scymtym has joined #lisp
fiddlerwoaroof has joined #lisp
Elon_Satoshi has joined #lisp
serichsen has quit [Ping timeout: 252 seconds]
lavaflow has quit [Ping timeout: 252 seconds]
theBlackDragon has joined #lisp
Elon_Satoshi has quit [Quit: So long, and thanks for all the fish! 2.2 Weechat is best Weechat]
Elon_Satoshi has joined #lisp
doubledup has quit [Quit: Leaving]
runejuhl has quit [Read error: Connection reset by peer]
runejuhl has joined #lisp
pierpal has quit [Ping timeout: 252 seconds]
theBlackDragon has quit [Remote host closed the connection]
theBlackDragon has joined #lisp
rjid has joined #lisp
kamog has joined #lisp
gabot has quit [Ping timeout: 245 seconds]
gabot has joined #lisp
dueyfinster has joined #lisp
knicklux has joined #lisp
igemnace has quit [Ping timeout: 264 seconds]
rjid has quit [Ping timeout: 256 seconds]
dented42 has joined #lisp
dueyfinster has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dueyfinster has joined #lisp
pierpal has joined #lisp
lavaflow has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
Bike has joined #lisp
pierpal has quit [Ping timeout: 268 seconds]
asymptotically has joined #lisp
_whitelogger has joined #lisp
ebzzry has quit [Ping timeout: 245 seconds]
<Shinmera> (defun prefix (strings) (with-output-to-string (o) (loop for i from 0 below (loop for s in strings minimize (length s)) while (loop for (a b) on strings always (or (null b) (char= (char a i) (char b i)))) do (write-char (char (first strings) i) o))))
<Shinmera> Could probably be done better, but whatever
moei has quit [Quit: Leaving...]
dented42 has quit [Ping timeout: 260 seconds]
<drdo> Shinmera: I'm reading up on suffix trees, I've long forgotten the details
dented42 has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
bacterio has left #lisp [#lisp]
rocx has quit [Remote host closed the connection]
rocx has joined #lisp
dueyfinster has quit [Quit: Textual IRC Client: www.textualapp.com]
myrkraverk has joined #lisp
dueyfinster has joined #lisp
igemnace has joined #lisp
siraben has quit [Remote host closed the connection]
Arcaelyx has quit [Ping timeout: 264 seconds]
jcowan has joined #lisp
Arcaelyx_ has joined #lisp
dented42 has quit [Ping timeout: 272 seconds]
<Xof> (defun prefix (strings) (let* ((sofar (first strings)) (len (length sofar))) (dolist (s (rest strings) sofar) (let ((m (mismatch s sofar :end len))) (when m (setf len m sofar (subseq sofar 0 m)))))))
warweasle has joined #lisp
<Shinmera> First time seeing mismatch, nice
siraben has joined #lisp
moei has joined #lisp
<phoe> Is DEFGENERIC allowed to expand into (PROGN (DEFGENERIC-INTERNAL ...) (DEFMETHOD ...)) with a DEFMETHOD for each :METHOD option specified inside DEFGENERIC?
<phoe> Or rather - is DEFMETHOD a valid part of DEFGENERIC expansion?
<Bike> sure, why not?
<Bike> you have to specially indicate that the methods are part of the defgeneric in a special way, but that's not much
<phoe> Bike: hm, that special way is what I'm interested in
<phoe> I assume there's no portable way of accessing that, is it?
<phoe> s/is it/is there/
<Bike> probably not.
<phoe> well then, a little bit more work for me.
<jcowan> phoe: Indeed, there is no reason why DEFGENERIC can't expand into a simpler version of DEFGENERIC, as long as the recursion bottoms out somewhere.
<phoe> jcowan: I'm working on my custom version of DEFGENERIC and I think it needs to expand into CL:DEFGENERIC since the only portable method of specifying initial methods is through DEFGENERIC's :METHOD.
<phoe> Which means that I need to do some list tweakin'
<jcowan> Makes sense
<jcowan> In general you cannot count on how a macro in the CL package will expand, except that it won't generate any nonstandard special forms.
<jcowan> Of course, there is no real difference between initially specified methods and other methods: you could expand into (BEGIN (DEFGENERIC ...) (DEFMETHOD ...) ...)
<beach> phoe: Those methods in the defgeneric form have a special status.
<beach> jcowan: There is.
<beach> "first, methods defined by previous defgeneric forms are removed"
<beach> clhs defgeneric
<phoe> beach: yep, so I can't do it any other way.
<beach> other than what?
<phoe> Expanding into CL:DEFGENERIC with :METHOD options.
<beach> You can't expand it to defgeneric-without-method plus defmethods.
<phoe> Yes, I can't do that.
<beach> Correct.
<jcowan> Yes, okay, so there is a magic side effect. But the methods themselves behave the same way whether defined in defgeneric or defmethod.
<beach> Of course.
<siraben> /whois jcowan
<siraben> Oops that ended up public :P
<phoe> gasp
<Shinmera> Shameful
<siraben> Sad face :(
<jcowan> /whois siraben
<jcowan> No leading space!
<siraben> Yes with /say , right?
<jcowan> Actually with //whois, though YMMV
<siraben> Emacs ERC has this weird feature that /say doesn't echo...
<siraben> I mean bug.
<jcowan> So presumably a method has to keep a bit saying "This method was defined by defgeneric".
<Bike> or the defgeneric keeps a list of which methods are from the defgeneric.
<jcowan> Sure.
<jcowan> Fortunately a method can't be shared between two generic functions.
<jcowan> Though I doubt redefining generic functions on the fly is something you want to do much (outside dev/debug context)
<beach> That's an important use case, though.
<phoe> beach: is a STANDARD-CLASS allowed to have a non-symbol name?
pierpal has joined #lisp
slyrus1 has quit [Ping timeout: 244 seconds]
nsrahmad has joined #lisp
<beach> According to the MOP, I think any class can have a non-symbol name.
dented42 has joined #lisp
<phoe> Then I've found an edge-case error in SBCL, I think.
Roy_Fokker has joined #lisp
<phoe> (defclass quux () ((fred :accessor fred :initform 42)))
<phoe> (setf (class-name (find-class 'quux)) '(frob)) signals an internal error in SBCL.
<beach> phoe: You need to figure out how McCLIM gets around that then.
<phoe> beach: ...or file a bugticket.
<phoe> The name is changed successfully; what errors is some internal assertion during accessor fixup.
<beach> Oh!
<beach> I see.
<beach> What happens if you use reinitialize instance instead?
knicklux has quit [Quit: Leaving]
<phoe> beach: REINITIALIZE-INSTANCE is on the stack. I assume the same error will happen.
<phoe> Like, it's called by SETF CLASS-NAME. Even the MOP page for SETF CLASS-NAME says that it calls R-I.
<beach> I see.
scottj has joined #lisp
flip214 has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
nanoz has joined #lisp
dented42 has quit [Ping timeout: 246 seconds]
fiddlerwoaroof has joined #lisp
<phoe> A workaround is to not define accessors in DEFCLASS and define them separately.
Bike has quit [Quit: Lost terminal]
asymptotically has quit [Quit: Leaving]
Josh_2 has quit [Ping timeout: 268 seconds]
nsrahmad has quit [Remote host closed the connection]
<on_ion> setf class-name... whoa =)
Elon_Satoshi has quit [Read error: Connection reset by peer]
<phoe> on_ion: huh?
<phoe> that's a pretty standard MOP feature
<phoe> and even a pretty standard ANSI CL feature
<beach> on_ion: The class name is not used for much. Don't confuse it with FIND-CLASS and (SETF FIND-CLASS).
<phoe> in particular, (defclass foo () ()) (setf (find-class 'bar) (find-class 'foo)) is valid
ryan_vw has joined #lisp
<phoe> beach: ...or did I forget anything up there?
<on_ion> yes yes, "what, these self-driving diamon and golden shoes? everyone in my 'hood has them, fairly standard issue."
<beach> phoe: It is valid.
<phoe> on_ion: welcome to Common Lisp, where tweaking your language's object system is absolutely normal
<phoe> beach: yep, thanks for confirming.
<on_ion> phoe: um hello hi, ive been here for a while, nice to meet you too. yes we all have diamond and golden clothes and amenities i know about all of those. i didnt know about the SHOES in particular, thats all. ~_~
<on_ion> good morning beach. happy thxgiving all
dueyfinster has quit [Read error: Connection reset by peer]
<beach> on_ion: Thanks. We don't celebrate that where I live, so I don't keep track. But thanks anyway.
Elon_Satoshi has joined #lisp
<on_ion> beach: ah, its a canadian day here, holiday. i only notice it because people start talking about turkeys. hope your weekend went/is going well anyhow
<beach> on_ion: Yes, thanks. Very busy, but it went well.
<beach> I hope the same for yours.
<on_ion> (setf (setf (find-class ..
<on_ion> ty
Elon_Satoshi has quit [Ping timeout: 244 seconds]
Oladon has joined #lisp
nanoz has quit [Ping timeout: 260 seconds]
Elon_Satoshi has joined #lisp
astronavt has joined #lisp
dented42 has joined #lisp
FreeBirdLjj has joined #lisp
<adlai> "welcome to common lisp, where the print-case is up and the read-case don't matter"
<Shinmera> unfortunately there are people that change read-case, and there's surprisingly many areas where that can screw you up
<on_ion> like find-package ?
<phoe> literally anything where you expect symbols to be named by uppercase characters only
Elon_Satoshi has quit [Ping timeout: 244 seconds]
flip214 has quit [Read error: Connection reset by peer]
slyrus1 has joined #lisp
Elon_Satoshi has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
flip214 has joined #lisp
fiddlerwoaroof has joined #lisp
asymptotically has joined #lisp
Josh_2 has joined #lisp
astronavt has quit [Ping timeout: 252 seconds]
Elon_Satoshi has quit [Read error: Connection reset by peer]
astronavt has joined #lisp
<Shinmera> if you wanted to write truly "portable code" you'd hawe to denote every CL symbol with uppercase and vertical bars
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<Shinmera> !!FUN!!
<phoe> (in-readtable my-silly-readtable)
<phoe> Shinmera: there, your vertical bars no longer work
r1b has joined #lisp
dented42 has quit [Ping timeout: 268 seconds]
makomo has quit [Ping timeout: 252 seconds]
<Shinmera> changing print-case can also screw you up if you think you can circumvent read-case problems with something like (find-symbol (format NIL "~a-~a" 'foo 'p))
fiddlerwoaroof has joined #lisp
Elon_Satoshi has joined #lisp
<jcowan> Whoever writes code not using the standard readtable deserves to lose.
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<beach> I was just thinking that, for implementations that don't have first-class global environments, that could be a bootstrapping trick.
<beach> I am not being serious.
fiddlerwoaroof has joined #lisp
<|3b|> code using strange readtables/case/etc is fine, loading other peoples code in strange readtables/etc is when you deserve to lose :)
fiddlerwoaroof has quit [Read error: Connection reset by peer]
* |3b| is willing to make some allowances for 'modern mode', since it seems like a reasonable thing to change, but anything beyond that is user error :)
<Shinmera> I'm not
<Shinmera> I'll write constants uppercase til I die and modern mode chokes on that
<beach> How long have you been not. [typical Eliza answer]
<on_ion> we have caps lock
<beach> Not me.
<on_ion> neither, but..
<beach> I traded it for Control
<|3b|> Shinmera: speaking of uppercase constants, does cl-spidev have any way to do unbuffered reads?
<on_ion> me as well. hey what do you think of this, beach ... moving backspace to top left (tilde ~?) and moving space to top right (bkspc)
* |3b| can't tell if TRANSMIT can do that or if it is only for full-duplex
fiddlerwoaroof has joined #lisp
<beach> on_ion: Maybe. What I really want is a narrow space key so that there is room for more mode keys there.
<|3b|> my code seems to be breaking due to buffering (i can read large chunks correctly, but any pauses give me bad data, with apparent missing parts so i lose sync with device's fixed size packets)
<shka_> phoe: did you figured out how to have list as a class name?
<on_ion> beach: hm yeah. i cant think of what to use space for otherwise. tab perhaps
<beach> I would have to think about it.
<beach> It could be Control I guess. I would like to keep my home position while pressing control.
<beach> Anyway, time to go fix dinner for my (admittedly small) family.
scymtym has quit [Ping timeout: 252 seconds]
<on_ion> enjoy
fiddlerwoaroof has quit [Read error: Connection reset by peer]
Essadon has quit [Read error: No route to host]
fiddlerwoaroof has joined #lisp
Essadon has joined #lisp
stereosphere has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
meepdeew has quit [Remote host closed the connection]
<phoe> shka_: yes, and discovered a SBCL bug along the way.
hugbubby has joined #lisp
astronavt has quit [Ping timeout: 260 seconds]
<hugbubby> .help
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<hugbubby> well I don't see any FAQ or nothing in the MOTD so I'll just ask: Is SICP still a good book to learn lisp with?
<phoe> hugbubby: depends on the Lisp dialect that you want to learn
<phoe> SICP is about Scheme; this channel is related to Common Lisp
<phoe> nonetheless, SICP is still a rather good read, and the SICP lectures are still very good to watch
<phoe> for learning CL, it is:
<phoe> minion: tell hugbubby about pcl
<minion> hugbubby: please see pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<phoe> minion: tell hugbubby about gentle
<minion> hugbubby: have a look at gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
<shka_> hugbubby: SICP is about learning fundamentals of programming
<shka_> scheme (not common lisp) is vessel picked by authors
<hugbubby> What is the difference between scheme and common lisp
<shka_> phoe: ok, thanks for info
<shka_> hugbubby: numerous
<shka_> different mindset, different goals, different implementations
<shka_> different semantics
<phoe> hugbubby: scheme is a smaller language that's oriented towards functional programming
<shka_> different features
<phoe> CL is a bigger language that is multi-paradigm by design
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
Elon_Satoshi has quit [Ping timeout: 252 seconds]
<hugbubby> thanks for the help
<phoe> hugbubby: no problem
fiddlerwoaroof has joined #lisp
<phoe> beach: I think I found the issue.
<phoe> SBCL internally assumes that #'CLASS-NAME returns symbols.
<phoe> Which is valid under ANSI CL but invalid under MOP conditions.
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<phoe> And I think I just fixed it, too.
<phoe> beach: is printing instances of anonymous classes defined by the standard?
<phoe> For a class #<STANDARD-CLASS (COMMON-LISP-USER::FROB) {100FF27103}>
<phoe> an instance looks like #<#<STANDARD-CLASS (COMMON-LISP-USER::FROB) {100FF27103}> {1010049DD3}>
fiddlerwoaroof has joined #lisp
<jcowan> phoe: I wouldn't say Scheme is particularly oriented toward functional programming
<phoe> jcowan: oh - it's been my impression for a long while
<phoe> could you give me some reading material on the topic?
<jcowan> it too is multi-paradigm, though the paradigms aren't made explicit
<jcowan> in any case, OO and FP are duals: "objects are poor man's closures, but then again, closures are poor man's objects"
<shka_> functional is such overloaded term
<jcowan> instance variables correspond to local variables, e.g.
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<jcowan> phoe: https://www.math.purdue.edu/~lucier/615/Meroon-Doc/MeroonV3.ps describes Meroon, a highly portable (and probably familiar) object system in Scheme
dented42 has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
sabrac has quit [Quit: Konversation terminated!]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
ryan_vw has quit [Ping timeout: 245 seconds]
kajo has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
roshanavand has joined #lisp
fiddlerwoaroof has joined #lisp
<phoe> shka_: anyway, yes, I found it, and I'm slowly turning it into a library
fiddlerwoaroof has quit [Read error: Connection reset by peer]
ggole has quit [Quit: ggole]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
r1b has quit [Quit: r1b]
dented42 has quit [Ping timeout: 264 seconds]
robotoad has joined #lisp
makomo has joined #lisp
fiddlerwoaroof has joined #lisp
kamog has quit [Quit: Leaving.]
<beach> phoe: I don't know what is said about printing class objects. But I don't think there is such a thing as an anonymous class. CLASS-NAME probably always returns a name that you can not unset.
fiddlerwoaroof has quit [Read error: Connection reset by peer]
sabrac has joined #lisp
flazh has quit [Quit: flazh]
<phoe> beach: I've searched for it; printing unreadable objects is implementation-dependent, so, in particular, printing standard-classes is implementation-dependent.
<phoe> beach: also, (allocate-instance 'standard-class) gives you a class instance whose name slot is *not* set.
<phoe> So #'CLASS-NAME cannot be relied on in all situations.
<phoe> (I actually made a SBCL bugticket about this the other day)
fiddlerwoaroof has joined #lisp
flazh has joined #lisp
roshanavand has quit [Ping timeout: 268 seconds]
roshanavand has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
Copenhagen_Bram has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
m3tti has joined #lisp
roshanavand has quit [Ping timeout: 244 seconds]
scymtym has joined #lisp
fiddlerwoaroof has joined #lisp
roshanavand has joined #lisp
<Shinmera> |3b|: I don't remember. It's a library I have very little memory of since I wrote it quite quickly and barely used it. Haven't gotten to working on the project that I initially wrote it for
fiddlerwoaroof has quit [Read error: Connection reset by peer]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
<LdBeth> Good morning
<Josh_2> Evening
pierpal has quit [Read error: Connection reset by peer]
<|3b|> Shinmera: ok, looks like i might be able to just use transmit, otherwise i can make a copy of it that does what i need
<|3b|> (assuming i can get anything to work, keep getting "message too long" from it currently)
pierpal has joined #lisp
<Shinmera> I'm definitely open to changes if you figure anything out
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
frgo has quit [Remote host closed the connection]
angavrilov has quit [Remote host closed the connection]
frgo has joined #lisp
roshanavand has quit [Ping timeout: 252 seconds]
robotoad has quit [Quit: robotoad]
roshanavand has joined #lisp
frgo has quit [Client Quit]
robotoad has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
frgo has joined #lisp
roshanavand has quit [Ping timeout: 252 seconds]
roshanavand has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
frgo has quit [Ping timeout: 246 seconds]
vlatkoB has quit [Remote host closed the connection]
fiddlerwoaroof has joined #lisp
ravndal has quit [Ping timeout: 252 seconds]
shka_ has quit [Ping timeout: 246 seconds]
fiddlerwoaroof has quit [Read error: Connection reset by peer]
frgo has joined #lisp
shifty has joined #lisp
fiddlerwoaroof has joined #lisp
ravndal has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
roshanavand has quit [Ping timeout: 252 seconds]
roshanavand has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
random-nick has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
roshanavand has quit [Ping timeout: 252 seconds]
roshanavand has joined #lisp
<phoe> minion: memo for shka: https://github.com/phoe/list-named-class
<minion> Remembered. I'll tell shka when he/she/it next speaks.
<phoe> minion: memo for shka_: https://github.com/phoe/list-named-class
<minion> Remembered. I'll tell shka_ when he/she/it next speaks.
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
zxcvz has quit [Quit: Leaving]
pierpal has quit [Remote host closed the connection]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
lnostdal has quit [Ping timeout: 252 seconds]
<|3b|> Shinmera: possibly starting to figure out the spi stuff, will try to send a pull request with my changes at some point
<Shinmera> Thanks, much appreciated. Sorry that I couldn't deliver on the "just works" experience
<|3b|> Shinmera: any thoughts on naming for a function that does (possibly multiple) fixed size read through ioctl?
<|3b|> Shinmera: np, mostly works aside from that one bit :)
<Shinmera> I'm currently stuck in low-level memory hell myself on a different project :/
<Shinmera> multiple in what way?
<|3b|> reads in multiple transactions, or maybe even multiple ioctls
* |3b| isn't sure exactly yet
<Shinmera> hmm
<Shinmera> read-chunked or something like that?
twokays has joined #lisp
* |3b| tried reading a bunch of packets at once and got errors, but looping on single packet-sized ioctl reads seems OK
<|3b|> next is trying multiple single-packet sized reads with 1 ioctl
fiddlerwoaroof has joined #lisp
<|3b|> though maybe single packet per ioctl calls is fast enough, if i can get it running on another thread
<|3b|> multiple per call would hopefully make it less CPU intensive and less sensitive to GC though
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
anewuser has joined #lisp
<phoe> Okay - this is a hack (obviously), but I have created a MOP-based toolkit for creating and using classes that are named with lists of symbols, not only symbols (as in ANSI CL).
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<phoe> Tests will be done tomorrow, when it's not night anymore.
m3tti has quit [Remote host closed the connection]
m3tti has joined #lisp
roshanavand has quit [Ping timeout: 244 seconds]
roshanavand has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
orivej has joined #lisp
jmercouris has joined #lisp
<jmercouris> does anyone know how to do file upload in caveman2?
Sauvin has quit [Ping timeout: 252 seconds]
sauvin_ has joined #lisp
fiddlerwoaroof has joined #lisp
pjb has joined #lisp
meepdeew has joined #lisp
sauvin_ is now known as Sauvin
ealfonso has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<jmercouris> can someone please remind me what #S means?
<jmercouris> I'm having a mental block right now
<no-defun-allowed> jmercouris: a structure follows.
<jmercouris> no-defun-allowed: like a struct?
<jmercouris> or any kind of structured data?
<Shinmera> clhs #s
<jmercouris> ok, so a struct
<jmercouris> thanks
<no-defun-allowed> A struct.
<Shinmera> The proper term /is/ a structure though, not a struct.
<jmercouris> I think we're all on the same page here.
fiddlerwoaroof has joined #lisp
<|3b|> Shinmera: looks like read-chunked works on my device with a small delay, can read 24 packets per call (apparently limited by kernel buffer size, so maybe more if i adjust kernel/module parameters)
<Shinmera> |3b|: Sounds good
<Shinmera> what kind of byte transfer rate do you get with that?
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<|3b|> looks like ~1.5MB/sec
<|3b|> with 18MHz clock (max 20 on the device)
<Shinmera> What are you reading from anyway?
<|3b|> 1.34 that try
<|3b|> thermal camera
<Shinmera> from a Pi? Nifty.
<|3b|> yeah
<Shinmera> I initially wrote it for a set of plates called "PiPlates" that use some weird custom spi based command protocol
<Shinmera> never got around to finish that tough
<ealfonso> anyone familiar with postmodern have any suggestion on how to handle jsonb types? for example, I'd like to serialize/deserialize with cl-json
<|3b|> this thing uses i2c for command/status stuff, so spent most of last day or 2 implementing that part
<Shinmera> heh
<|3b|> a lot of that was just typing in boilerplate once i got the basics done though... (define-get-set-enum command-name x y z enum1 enum2 enum3) etc
<|3b|> which would read or write 2 words and convert to/from specified keywords
<|3b|> or toggle a boolean, or read/write an int, etc
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<|3b|> pi plates looks interesting
fiddlerwoaroof has joined #lisp
<Shinmera> They have a python library, but the code's real bad
<|3b|> heh
<Shinmera> A somewhat direct translation is here, but it doesn't work yet and I never found the energy to debug https://github.com/Shinmera/pi-plates
* |3b| has enough things to hook up to my pi for now, but maybe next time i buy stuff :)
<jmercouris> I'm having a weird issue reading from a stream: https://gist.github.com/jmercouris/9c756df70f44b3055aff7cd6ca15f811
<jmercouris> here's the doc for circular-streams: https://github.com/fukamachi/circular-streams
orivej has quit [Ping timeout: 246 seconds]
<jmercouris> not sure what (sb-kernel:closed-flame ...) even means
groovy2shoes has joined #lisp
<|3b|> probably just the indicator stream is closed
fiddlerwoaroof has quit [Read error: Connection reset by peer]
prrs has joined #lisp
astronavt has joined #lisp
<jmercouris> indicator stream?
<|3b|> also, why do you have some many debuggers open?
<|3b|> indicator that the stream is closed, sorry for ambiguous syntax
<jmercouris> I just don't close them, I just usually C-g and go back to the code
<|3b|> q is easy way to get rid of debugger window
<jmercouris> You literally just changed my life
<jmercouris> I even had set-up ibuffer to group sldb to close them easily
<|3b|> q i think uses first 'abort' restart, in case that happens to matter at some point (sometimes you need to pick a different one when there are multiple)
<jmercouris> Well drilling down into the stream, it does indeed appear to be closed
<jmercouris> I wish I knew more about streams, where can I learn about them that isn't the CLHS?
fiddlerwoaroof has joined #lisp
<|3b|> try (read-char (lack... last-request) nil :eof) there instead
jcowan has quit [Quit: This computer has gone to sleep]
meepdeew has quit [Remote host closed the connection]
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<|3b|> looks like with that circular stream, you should be able to keep reading after that error
<jmercouris> still no luck
<|3b|> same error?
m3tti has quit [Remote host closed the connection]
<jmercouris> yeah, #<SB-SYS:FD-STREAM for "socket 127.0.0.1:5000, peer: 127.0.0.1:58816" {10020E3713}> is closed
m3tti has joined #lisp
<jmercouris> I'm trying to get the raw-body so that I can handle file uploads
<phoe> jmercouris: well, that error means that the socket got closed indeed
fiddlerwoaroof has joined #lisp
<jmercouris> Yes, I figured as much, it kind of makes sense
<jmercouris> as soon as the server responds, why would it stay open?
<jmercouris> I just want to peek inside
<jmercouris> I did find this helpful issue: https://github.com/fukamachi/caveman/issues/63
<phoe> actually
Copenhagen_Bram has quit [Read error: Connection reset by peer]
<phoe> you should be able to read from its stream
<phoe> and only after you exhaust it, you should get an EOF
<jmercouris> I should not get an EOF at all
<phoe> the data that the server sent you doesn't go anywhere
<jmercouris> it is a "circular stream"
lucca has joined #lisp
<phoe> oh, hm
<|3b|> from my reading, you should get an EOF, then you should get the contents again
<no-defun-allowed> Are there any web servers that give you streams instead of creating large strings?
<|3b|> (presumably buffered in memory though, so you can't get more data from server that way, or send to it)
<no-defun-allowed> Node gives you a response object you can write on, for example.
<|3b|> i think you can do that with hunchentoot
<phoe> no-defun-allowed: should be possible wit--- yes
<phoe> you should be able to get a stream from which you can read and to which you can write
<|3b|> though you might need to adjust the default thread per connection model if you have lots of clients and long requests
<no-defun-allowed> Good, good.
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<phoe> |3b|: I actually was digging for that
<phoe> lemme find that link
<phoe> thread-pooling-taskmaster that is
<phoe> it uses a lparallel kernel.
<|3b|> yeah, thought i'd seem it done, but haven't looked at details
* |3b| doesn't have that problem, so doesn't worry about it :p
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
random-nick has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
<jmercouris> Wow, unbelievable
<jmercouris> I forgot: enctype="multipart/form-data"
fiddlerwoaroof has quit [Read error: Connection reset by peer]
Bike has joined #lisp
<jmercouris> I just wasted like an hour thinking, why would this framework convert a file to a string?
<jmercouris> s/convert a file to a string/convert a file to the filename as a string
r1b has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Client Quit]
desperek has quit [Quit: xoxo]
robotoad has quit [Quit: robotoad]
astronavt has quit [Read error: Connection reset by peer]
<nyingen_> The MySQL situation in CL seems a bit under-done
<nyingen_> I had no trouble using sqlite with CL, but for mysql it looks like the choices are cl-mysql, which behaves strangely on my system (sbcl on linux) and CLSQL whose website and docs are 404
<jmercouris> under-done? There are so many SQL libraries in CL
<jmercouris> nyingen_: here is a good one I like to reccommend: http://8arrow.org/cl-dbi/
<nyingen_> jmercouris: I did see that one. According to the QL site, it uses cl-mysql to connect with MySQL
nowhere_man has quit [Ping timeout: 252 seconds]
<jmercouris> what kind of "strange" issues are you having?
<nyingen_> I've had the REPL hang when doing queries or fetching results
<jmercouris> could be a result of your communication style, for example
* |3b| has the impression postgres is more popular with CL devs, though hard to say if that is cause or effect of quality of mysql support :)
<nyingen_> I'm no stranger to the debugger but since it hangs, I can't see what the problem is
<jmercouris> in your .swank.lisp file you can do: (setf swank:*communication-style* :spawn)
<nyingen_> hm, ok
<jmercouris> or (setf swank:*communication-style* :fd-handler)
<jmercouris> try those out, and see if they help
<nyingen_> What's the difference there? Or is there a manual I can read?
<jmercouris> fd uses a file descriptor
<jmercouris> and spawn makes a new thread
ym has joined #lisp
<jmercouris> it is somewhere in the slime manual
<nyingen_> Ok, I'll check
<nyingen_> I figured it could be a threading issue
ym has quit [Remote host closed the connection]
<nyingen_> jmercouris: I will try that
<jmercouris> best of luck, if that doesn't work, and you don't have to use mysql, I would also suggest just switching to postgres
<nyingen_> Yeah, unfortunately I do have to use MySQL. I'm migrating a huge database to couchdb
<jmercouris> maybe you can migrate from mysql to postgres, and then to couchdb
<|3b|> did you try interrupting it when it hangs? (C-c C-c in repl, C-c C-b in other lisp buffers)
<jmercouris> you can use the postgres migration tool that dimitri (?) wrote
<nyingen_> Maybe, but the current trouble is getting the data out of MySQL
<nyingen_> |3b|: I did try that, to no effect
igemnace has quit [Quit: WeeChat 2.2]
<nyingen_> jmercouris: Interesting. I might try that as a last resort, but I've never used postgres and would rather not bring it in if I can avoid it
orivej has joined #lisp
<jmercouris> Yeah, it was just a thought
<nyingen_> This project started out as a perl script using perl's DBI, but the devil is in the details so I rewrote it to CL, not anticipating the trouble I was going to have with the mysql libs
<jmercouris> maybe you can write the migration in perl then
<jmercouris> oh, I misunderstood, I assumed it was a legacy perl application using mysql and you were moving to CL + couchdb
<|3b|> nyingen_: hmm, if interrupting it didn't work, did you check *inferior-lisp*? might have run out of memory or printed some other fatal error there
<nyingen_> yeah, unexpected issues cropped up with the migration and so I switched to using CL so I could use the debugger, sane data types, and so on
zigpaw has quit [Ping timeout: 260 seconds]
<nyingen_> |3b|: oh, good idea. Next time it hangs I will check that
<|3b|> possibly also increase heap size of sbcl if you have a large amount of data
<|3b|> i think it defaults to 1gb, which is easy to hit
prrs has quit [Remote host closed the connection]
<nyingen_> The DB is very large, yeah, but for testing purposes I'm only using 500 records, which should be only a few hundred KB at most
<nyingen_> also the SQL lib is not supposed to fetch them all, but return them row-by-row when asked
* |3b| tries to avoid assumptions like that when things aren't working :)
<|3b|> if it was behaving as i expected it to, it would be working :p
<|3b|> (but small test DB does sound like that probably isn't the problem)
jack_rabbit has joined #lisp
<jmercouris> are you sure your specifying the sql path correctly? are your credentials valid?
<jmercouris> is the sql server running?
<nyingen_> yes. some queries work, some hang the repl
<jmercouris> interesting
<nyingen_> My next step is probably to read the source code of cl-sql
<jmercouris> maybe some relationships within those queries?
<nyingen_> it has a design that seems odd to me, namely using a global connection handle
<jmercouris> do those same queries hang when executed from the sql cli?
<nyingen_> jmercouris: no, everything is fine from the sql cli
<nyingen_> also perl's DBI had no problem either
<jmercouris> very strange
<nyingen_> the trouble I was having there was figuring out mappings to couchdb's json, etc, and that problem is much better approached in CL
<jmercouris> I know this is going to sound very dumb, but have you tried restarting your inferior lisp?
<nyingen_> jmercouris: restarted it when? during the hang?
<jmercouris> just in general, maybe there is some strange conflicts going on
<jmercouris> perhaps something was redefined at some point
<jmercouris> who knows?
<jmercouris> maybe some asd in local-projects interferring with cl-sql?
<jmercouris> do you get any prompts when loading the system?
<jmercouris> maybe you have an old version of cl-sql? idk, I'm just guessing here, because the behavior you've described is very strange
<nyingen_> Yeah, I'll look into all these
<jmercouris> and I can't imagine how one would even begin troubleshooting it, some queries work, some hang, but they all work in the sql CLI
<nyingen_> my guess would be some sort of threading issue with cl-mysql or cl-mysql + swank or whatever
<jmercouris> oh that's a good idea
<jmercouris> you know what you should try
<jmercouris> start sbcl by itself in a new terminal window
<jmercouris> and try the same operations
<nyingen_> yeah, taking emacs/swank out of the equation is a good idea
asymptotically has quit [Quit: Leaving]
<nyingen_> jmercouris: ok, I get the same hanging in the standalone repl, so now I need to make sure my code is doing what I think it's doing, and if that's all good, check what cl-mysql is doing internally
<nyingen_> so swank is not the problem, thankfully
<jmercouris> Nice, well, that's a start
astronavt has joined #lisp
astronavt has quit [Max SendQ exceeded]
<nyingen_> Ideally I would switch to a different MySQL lib and try that, but the only other one seems to be CLSQL, whose website is 404 so I'm not too sure about that, even if its code is in the quicklisp repository
<jmercouris> well, you can examine the code if it is in the quicklisp repository
<jmercouris> just quickload it and it will be in ~/quicklisp/distributions/quicklisp I think
<jmercouris> something like that, there is a path, you'll find it
astronavt has joined #lisp
<jmercouris> the README could have pretty simple instructions, I would say it is worth a try
Copenhagen_Bram has joined #lisp
jmercouris has quit [Remote host closed the connection]
Khisanth has quit [Ping timeout: 245 seconds]
m3tti has quit [Ping timeout: 246 seconds]
Khisanth has joined #lisp
robotoad has joined #lisp
zigpaw has joined #lisp
frodef has joined #lisp
warweasle has joined #lisp
shifty has quit [Ping timeout: 244 seconds]
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
pjb has quit [Ping timeout: 252 seconds]
Josh_2 has quit [Remote host closed the connection]
astronavt has quit [Ping timeout: 268 seconds]
r1b has quit [Quit: r1b]
katco has joined #lisp
fiddlerwoaroof has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
prrs has joined #lisp
jack_rabbit has quit [Ping timeout: 264 seconds]
<katco> hey everyone, i've created a library to generate OpenAPI clients: https://github.com/kat-co/openapi2cl. i'd love feedback on coding standards/readibility, as well as bugs from folks working with it. just please read the numbered list of caveats in the readme first :)
<|3b|> katco: i see a (check-type ... function), any reason for not allowing function designators?
fiddlerwoaroof has joined #lisp
<katco> |3b|: likely ignorance =/
* |3b| frequently just uses 'foo instead of #'foo in situations where it doesn't matter
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<katco> so it would have to support symbols and functions?
<|3b|> using symbols in cl-user sounds like a bad idea, better to make a specific package for it
<|3b|> right
<katco> ok
<Bike> since funcall, apply etc already do that that's hopefully not too hard on you.
<katco> re. symbols in cl-user; that is purely so that when the code is piped through format it doesn't prepend everything with a package. if i specify another package, will it do the same?
<|3b|> just set *package* to whatever package they are in when you print it
<|3b|> and then it won't break if someone runs it from some other package :)
<katco> ah, great! i'll try that
<katco> if y'all are up for it, opening issues would be great. i'm traveling tomorrow and i don't want to lose this input. cool if not though!
<|3b|> use WHEN (or UNLESS) instead of single-branch IF. (just style, has same behavior)
jack_rabbit has joined #lisp
<katco> ty
astronavt has joined #lisp
pjb has joined #lisp
marusich has joined #lisp
<katco> i have to go pack, but tyvm for your comments so far :) i've logged them as issues here: https://github.com/kat-co/openapi2cl/issues
aeth has quit [Read error: Connection reset by peer]
aeth has joined #lisp
meepdeew has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
rtypo has quit [Ping timeout: 246 seconds]
siraben has quit [Ping timeout: 268 seconds]
astronavt_ has joined #lisp
astronavt has quit [Ping timeout: 252 seconds]
pjb has quit [Ping timeout: 240 seconds]
<no-defun-allowed> how can i stop hunchentoot logging requests?