freenode/#lisp - IRC Chatlog
Search
15:26:13
flip214
luis: like this? https://github.com/phmarek/slime/commit/8c3c3e630953ee6c2c633e36ef2da765a2466e5a
15:26:29
jackdaniel
flip214: please take a look at http://irclog.tymoon.eu/freenode/%23clim?around=1543403513#1543403513 (regarding CLIM specification)
15:28:30
akr
Hi there, I'm fairly new to CL and I don't know how to debug properly. How do I find out which line in the source does an error occur on?
15:29:59
jackdaniel
as of navigating to the source code, put cursor over the frame on backtrace you are interested in and press "v" key
15:32:17
akr
jackdaniel: I think there is some issue with connecting to a remote instance of slime, it fails to open the file
15:35:31
shka__
akr: https://common-lisp.net/project/slime/doc/html/Examining-frames.html#Examining-frames
15:42:05
loke`
spacemacs is a bit of a mess. I'd recommend starting with plain Emacs and add customisations yourself once you feel comfortable with it.
15:42:44
akr
loke`: I've been using it for about 2 years now and I can't complain too much. It is a bit rough around the edges in some places, but overall it's quite usable
15:46:10
sjl_
slimv isn't the one that requires vim8/neovim -- that's vlime. slimv works with older versions (unless he changed it recently)
15:46:59
jackdaniel
I'm afraid you will have to count lines by yourself or simply go at the position
15:47:47
jackdaniel
akr: you may consider setting tramp pathname translations (slime works with that just fine)
15:48:51
akr
jackdaniel: hmm, it seems to point me to where sb-int:simple-eval-in-lexenv is implemented
15:52:27
akr
the error is somewhere in (dbu::generate-payment-log-invoice pl) ;; the 500 line function
15:52:51
akr
so I execute this in the repl: (pomo:with-transaction (tr) (handler-case (dbu::generate-payment-log-invoice pl) (error (x) (pomo:abort-transaction tr) (error x))))
15:54:20
jackdaniel
notice, that there is :file and file name and :position which is position in the file of form which caused the condition
15:57:47
jackdaniel
since it is a macro which got expanded in your repl, there is no function in the source you could navigate to
15:58:52
akr
hmm, I know for sure though that the inner form given as argument to with-transaction starts to execute and fails halfway through
16:21:29
akr
so here is my current invocation: (pomo:with-transaction (tr) (handler-bind ((error #'lambda (x) (pomo:abort-transaction tr))) (dbu::generate-payment-log-invoice pl)))
16:26:09
fortitude
akr: v will take you to a specific line, but generally only if the function was compiled with debug info
16:28:58
fortitude
akr: it should, frame 2 looks like your function, so if generate-payment-log-invoice was compiled with debug info it should take you to the line in question
16:29:23
fortitude
unfortunately that's the line as it was when the function was compiled, so if you change source a lot it can be wrong
16:32:25
Xach
akr: in various popups and other modes you can use C-u C-c C-c also. like in the debugger on individual frames.
16:37:41
akr
hmm so even though I'm connected to a remote slime instance, once a function is compiled with debug info, `v` points to the local file
16:40:11
luis
flip214: left a comment on the commit. I say go for a pull request and mention issue #213
16:41:20
luis
flip214: a slight (but separate) improvement to the whole thing would be to have the contrib warn about being loaded in non-dedicated stream mode
16:44:12
jasom
C-u should work in evil-input-mode; not sure if it works in evil-normal-mode by default (I've bound a few useful-for-lisp keys in normal mode like M-. in my own settings)
17:43:11
PutYourLegOnDesk
Which book would you suggest for learning CL as an experienced programmer? I tried reading Land of Lisp but it got too dry and I couldn't get past page 90
17:43:31
minion
PutYourLegOnDesk: 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).
17:47:23
minion
There are multiple help modules. Try ``/msg minion help kind'', where kind is one of: "lookups", "helping others", "adding terms", "aliasing terms", "forgetting", "memos", "avoiding memos", "nicknames", "goodies", "eliza", "advice", "apropos", "acronyms".
17:47:33
minion
To add a term, say something like ``minion: add "term" as: the definition''. I will remember the definition.
17:48:52
jackdaniel
minion: add "PAIP" as: PAIP: Paradigms of Artificial Intelligence Programming. More Common Lisp than AI. Now freely available at https://github.com/norvig/paip-lisp.
17:49:42
jackdaniel
PutYourLegOnDesk: ANSI CL by Paul Graham has very good excercises and explanations
17:49:56
minion
jackdaniel: PAIP: PAIP: Paradigms of Artificial Intelligence Programming. More Common Lisp than AI. Now freely available at https://github.com/norvig/paip-lisp
17:50:08
jackdaniel
minion: add "PAIP" as: Paradigms of Artificial Intelligence Programming. More Common Lisp than AI. Now freely available at https://github.com/norvig/paip-lisp.
18:01:53
jackdaniel
minion: add "PAIP" as: Paradigms of Artificial Intelligence Programming. More about Common Lisp than Artificial Intelligence. Now freely available at https://github.com/norvig/paip-lisp.
18:40:12
sjl_
jackdaniel: maybe don't include the period at the end there, otherwise it might get included as part of a link by some clients.
19:10:57
ebrasca
minion: add "PAIP" as: Paradigms of Artificial Intelligence Programming. More about Common Lisp than Artificial Intelligence. Now freely available at https://github.com/norvig/paip-lisp .
20:21:48
wglb
I am using dexador https://github.com/fukamachi/dexador to read web pages from many different sites in the same session. If it runs long enough (accessing many different sites) the process dies with "too many open files". This is verified by running lsof against the process as it progresses. dex:get returns, among other things, a stream associated with the socket. I issue a close on that socket when it returns, but this does not
20:21:48
wglb
appear to actually close the socket and assocaited fd. Any words of experience here would be appreciated.
20:23:53
jkordani_
you'd still prefer for releasing the os resources to happen when or shortly after you ask it to happen as opposed to the next time the gc runs
20:24:50
wglb
Well, if calling close doesn't actually close it, I don't think it will get garbage collected.
20:25:25
jkordani_
wgbl: you may still find that raising the ulimit for open files will be necessary, even once you get file closing to happen successfully
20:28:49
jkordani_
wgl: do you issue a close on the socket, or the stream? oh, because the "burst rate" of open file handles for whatever it is your doing may still be higher than the ulmit imposed default, even after you are confident that you are closing file handles properly
20:39:13
dlowe
hm. there's two interpretations of connection pool, I guess. But you can make multiple requests on a single http connection, so if you're hitting the same site multiple times, it makes sense to keep the line open
20:39:43
dlowe
it could also mean that it just keeps the connection data structures around to avoid reallocation
20:41:37
wglb
jkordani_: Hitting different sites with each query, and not likely to come back to the same one.
22:42:09
jmercouris
beach: do you have the link to the style guide you reccommended me some time ago?
22:42:32
jmercouris
it was some PDF of sorts by some author, the only thing I can remember about the author is that they had a female name
22:46:10
sjl_
jmercouris: maybe it was the book "Lisp Style & Design" by Molly Miller and Eric Benson?
22:47:16
jmercouris
sjl_: I found it, I think, I think maybe I was mistaken about the female author, it's a Norvig conference paper: http://norvig.com/luv-slides.ps
22:47:35
jmercouris
basically I had been using if with a single conditional, and he pointed out to use when instead and linked to some article
23:33:13
elderK
But that isn't the same as saying "This suite must only run if this other suite passed."
2:11:22
trocado
hi! how do I write a function that, if it's going to return nil, lands the user in the debugger with the option to input a value, and then returns that value?
2:13:17
no-defun-allowed
use restart-case with a handler that does (return-from your-function value) somehow
2:30:44
aeth
assert and other ways will work, but check-type is the easiest, if it is easily expressable as a type
2:32:02
aeth
Note that check-type always returns NIL so you need to have foo, your return value, on the next line. foo should also be a place.