freenode/#lisp - IRC Chatlog
Search
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.
2:52:25
aeth
The only difference is that you'd want multiple-value-bind if you put it in something like alexandria (especially with matching the's API because the does accept values)
2:52:38
aeth
(the (values integer integer) (values 1 2)) vs. (ensure-the (values integer integer) (values 1 2))
2:53:59
aeth
SBCL's (the (values integer integer) (values 1 2d0)) doesn't behave like check-type (you cannot provide a new value) so there would be a use for a macro like this
2:56:49
aeth
pillton: I already wrote this macro, actually. Well, I use the same principle to do return type checks in my define-function macro when in check-type mode so the only thing missing is determining if there's one type or a values list and passing it into the function return-type-check.
2:56:54
aeth
https://gitlab.com/zombie-raptor/zombie-raptor/blob/089c7e4382ff2d7bb1e8c1bb40d9708d45f0a46e/util/typed-bindings.lisp#L80-87
2:58:15
aeth
(i.e. If it's a list whose car is VALUES, treat it as a return type list; otherwise, treat it as a type.)
3:01:36
elderK
Guys, what's the point of adding :execute alongside :compile-toplevel and :load-toplevel/
3:01:52
elderK
As far as understand, :execute is only really used when the eval-when is not a top-level form.
3:02:21
elderK
And if the compiler sees a progn, it treats everything in the progn as top-level forms, so, eval-when inside a progn would be treated just as if it were at the top-level.
3:10:07
aeth
pillton: Well, this is how I implemented it: https://gitlab.com/zombie-raptor/zombie-raptor/commit/ae26e8c4f75f565643f53dea51941b3895e6071b
3:10:20
aeth
https://gitlab.com/zombie-raptor/zombie-raptor/blob/ae26e8c4f75f565643f53dea51941b3895e6071b/util/util.lisp#L227-235
3:11:52
aeth
A strange consequence is that it will append nils to the end because of how multiple-value-bind works. Only multiple-value-list and multiple-value-call can actually catch if you don't provide a value when a value is expected.
3:12:01
pillton
aeth: You need to expand the compound type before checking if the car is equal to 'values.
3:12:48
pillton
Someone could do (deftype shonky-values () '(values (and (integer 0) (integer * (0))))).
3:23:17
elderK
:| Hmm. SBCL, stuff that you add to the environment during compilation, seems to stay around after the compile-file.
3:25:11
elderK
Yes, but it's implementation defined whether stuff that enters the environment during compilation, is present in the environment after compilation completes.
3:25:51
elderK
And compile-file, afaiu, the compiler's environment is that which is in effect when compile-file is called.
3:30:43
elderK
At least, that's how I interpret http://www.lispworks.com/documentation/HyperSpec/Body/03_ba.htm
3:33:09
pillton
"The compilation environment inherits from the evaluation environment, and the compilation environment and evaluation environment might be identical."
3:36:17
elderK
" The startup environment is the environment of the Lisp image from which the compiler was invoked."
3:36:59
pillton
Yes, so the evaluation environment might be identical to the startup environment. Thus any processing of eval-when forms will change the startup environment.
3:38:18
elderK
The key is, of course, is that there is no requirement for the startup environment and the compilation environment to be identical. The compilation environment could be a copy of the startup environment, a distinct environment.
3:42:26
pillton
I suspect a lot of things would break though since there isn't much discussion on with-compilation-unit.
3:44:11
elderK
I'm just glad I provided a hook for testing whether metadata instances are "compatible."
3:44:26
elderK
So that if you redefine something, it'll issue an error (or warning) only if they're not "compatible."
4:46:17
romulas
Made with LISP: "We conjure the spirits of the computer with our spells" https://www.youtube.com/watch?v=aHk42kDwesM
4:48:50
beach
So, it would be best to start with making sure your postings conform to the topic and ask some modest questions about the purpose of this channel.
4:50:08
fiddlerwoaroof
pillton: interesting, I didn't realize that with-compilation-unit was in the standard
4:51:02
fiddlerwoaroof
I'd seen something like that in the documentation for implementations, but I never noticed that it was a thing in CLHS
4:51:51
beach
fiddlerwoaroof: That's probably because you have never attempted to write an implementation of Common Lisp.
4:54:28
fiddlerwoaroof
Hmm, does a form with an implicit progn like with-compilation-unit have the same effect as progn wrt. toplevel-ness of the subforms?
4:56:49
beach
Because it is specified that COMPILE-FILE wraps the compilation in WITH-COMPILATION-UNIT.
5:00:18
fiddlerwoaroof
The question I'm asking is, more explicitly, would the defun in (form-specified-to-have-an-explicit-progn ... (defun foo ())) be considered to be a toplevel form?
5:00:38
fiddlerwoaroof
Because, if it's an explicit _progn_, then it should have the semantics of progn
5:01:09
fiddlerwoaroof
Although, I guess one could say that the implicit progn doesn't occur at toplevel.
5:02:15
specbot
Processing of Top Level Forms: http://www.lispworks.com/reference/HyperSpec/Body/03_bca.htm
5:12:31
fiddlerwoaroof
there is no circumstance (at the toplevel, at least), where the subforms will be executed
5:14:03
fiddlerwoaroof
My current project is to figure out if porting sbcl to power9 looks like a feasible project