freenode/#lisp - IRC Chatlog
Search
12:31:36
Thetabit_
I'm having some trouble with Emacs + Slime + SBCL. I have a fairly bare bones setup because I have to do my development on a windows box. But SBCL keeps crashing and locking Emacs up. I don't experience the crashing in a linux environment so I am wondering if Emacs + SBCL + Slime are the best when working in Windows. What do you guys think?
13:29:32
thetabit
I'm reading PCL and going thru the function section. I am trying to 'call' each function in a list which using a loop, instead I am looking to (apply #'funcall (list fn1 fn2 fn3)) but this does not seem to work. What am I missing
13:31:36
phoe
(defun fn1 () (print "hello")) (defun fn2 () (print "allo")) (defun fn3 () (print "hola")) (apply #'funcall (list #'fn1 #'fn2 #'fn3))
13:43:52
phoe
and in the inner list, you have a plist, and you want to iterate over a set of plist key/value pairs, correct?
16:50:13
slark
Hello, i learnt how to create closures in the gigamonkeys tutorial, but i am not sure how and why to use them.
16:50:52
beach
slark: Suppose you want, for a given X, find the first element in a list that is greater than X.
16:51:26
beach
slark: You could do (defun find-greater (x list) (find-if (lambda (y) (> y x)) list))
16:54:08
slark
beach: yeah sorry.. i mean when i am designing code, in general, where should i use closure ?
16:59:27
nosefouratyou_
wow I completely don't understand (defun find-greater (x list) (find-if (lambda (y) (> y x)) list))
17:00:51
Bike
find-if finds the first element of list that satisfies the predicate (lambda (y) (> y x))
17:01:39
nosefouratyou_
because initially x is a number, but the inner find-if call passes a function as x, right?
17:03:20
nosefouratyou_
Bike: my bad, I thought find-greater/find-if were the same function. I was misreading it.
17:15:25
slark
in the chapter 6 in gigamonkeys tutorial there is this footnote: http://paste.lisp.org/display/350852
17:16:52
slark
what does it mean? does it mean we can use dynamic bindings in multithreaded application without problem ?
17:17:58
kang0
Which books in computer science or coding field; one must have /recommended to have in hard copy or printed form instead of ebooks
17:20:31
slark
knusbaum: so i will not have to mess up with "lock" and kind of stuff if my threads have access to this *stream-output* if i use dynamic bindings ?
17:21:37
knusbaum
If multiple threads are accessing the same object, you still have to synchronize that access.
17:23:50
knusbaum
slark: This is what the footnote was talking about: http://paste.lisp.org/display/350854
17:23:56
slark
knusbaum: dynamic binding is kind of global variable shadowing with the same name as the global variable
17:28:08
slark
knusbaum: ok so the second thread take the variable as global cause the dynamic binding is related to the 1st thread
17:48:27
beach
slark: Dinner, not lunch. But, what Bike said. Closures don't play a great strategic role in Common Lisp. They are used for tactical reasons in situations like I showed.
17:53:20
beach
slark: The book SICP (based on Scheme) uses closures strategically, because they allow encapsulation of state. But Common Lisp has CLOS, with its classes and generic functions (which is more flexible and more powerful), so we don't use closures that way.
17:58:09
kang0
Which programs or softwares needs to be installed in computer while reading or trying book sicp
18:04:26
slark
kang0: but in scip they use scheme, so if you are a bit familliar with lisp in general it should be OK to work with common lisp while reading scip
18:12:07
slark
kang0: all linux distro use great official reposority where you can download everything you want in 1 command line check your distro package documentation
18:12:45
slark
kang0: if for some reason your linux distro doesnt provide racket follow knusbaum link
18:20:00
slark
kango, for a solo beginner maybe you should go common lisp (clisp/sbcl) more materials on it, book, tutorial and communauty
20:04:34
phoe
Because https://github.com/rpav/cl-autowrap/issues/77#issuecomment-315454280 is what I get.
20:05:40
knobo
clhs says that a vector may or may not be simple after delete. But cltl2 says the vector is of same kind.
20:13:57
knobo
Because I did. Because I thought it was creating problems for me, but it turns out it does not after all.
20:14:00
aeth
If it relies on non-standard behavior in SBCL that could break on other CLs that that project supports, it is a bug.
20:14:09
Bike
i think it's a bad idea to rely on the return value being adjustable, but if implementations do actually return an adjustable array then it's kind of low priority.
20:14:29
aeth
I limit the amount of CLs that I officially support in my documentation, to limit the amount of bugs that way.
20:15:14
aeth
If all supported CLs behave like SBCL, there is no bug in my projects. But if projects implicitly spport all CLs and don't, then perhaps the bug is their lack of documentation.
20:16:18
aeth
In practice, most large projects don't actually support all CLs already. e.g. if they rely on a library that relies on CFFI
20:20:36
knobo
Anyway, I think that if there is a lot of delete/vector-push-extend maybe a list is more appropriate.
20:21:29
aeth
I don't think there's enough information to see which one is better with just that description.
20:22:23
aeth
I personally think that lists are the data structure that always should have to be justified (except in macros, of course, where there's no choice), especially because traditional Lisp culture overly relies on them.
20:30:49
knobo
Arrays are great. But it would be grater if delete would also set the deleted positions to nil or 0 or something approperiate, so that data could be garbage collected
20:32:11
knobo
And it would be greater with certainty that adjustable-array-p would be the same after delete.
20:54:12
knobo
So the more I think about arrays vs lists I think I'll go for lists as default then rather use array if I can justify that.
22:31:13
tetero
Quick (and likely stupid) question: What's the difference between (in-package :something) and (in-package something)?