freenode/#lisp - IRC Chatlog
Search
2:54:58
ealfonso`
I want to mock a function like drakma:http-request within a unit test. Can I use flet? It seems that the scope of my flet binding is lexical, can I make it dynamic?
2:58:58
ealfonso`
does this gist mean I would have to implement it myself? https://gist.github.com/jasom/04606c9e418aee6f969c8b1fdf69ba68
3:04:12
oni-on-ion
ah ty! i was scrolling up feeling certain i seen something else in use #here very recently
3:06:14
beach
ealfonso`: Yes, there is no standard way of creating a function with dynamic extent. If you do it with a macro that changes the FDEFINITION, then make sure you have an UNWIND-PROTECT that sets it back.
3:13:52
loke
oni-on-ion: Also note that you really don't want to be running more than one thread while doing that trick.
3:16:03
loke
oni-on-ion: You can implement it by having a single constant replaced version of the function in question, and you setf the fdefinition of it in the beginning. Then, inside that function you check a thread-local binding of a variable that indicates which version you want and if it's unset, just forward the call to the real (original) version.
3:18:44
loke
I just remembered I did something similar in Climaxima when I want to change the behaviour of some internal Maxima functions
4:08:51
beach
DecimPrime: Though, people here are less likely to read that book than they are to read books like PAIP, AMOP etc., since this channel is dedicated to Common Lisp.
4:14:30
DecimPrime
beach: hah. ahh i see. i'm mostly using clojure but i just heard it was great for learning how to break down and solve problems so i'm going to look through it
4:16:19
beach
DecimPrime: And I am guessing the advocate a more "pure" style of programming, like more functional programming, more recursion, etc.
4:16:59
beach
The Common Lisp books are typically more pragmatic. And modern Common Lisp uses object-oriented programming (using CLOS) a lot.
4:29:59
no-defun-allowed
I want to find some inputs to imagemagick that will help me clean up captchas to give to tesseract-ocr. They have added noise that needs to be filtered out.
4:30:45
oni-on-ion
i was just reading about the first FPGA chips and how they were 'evolved' (1960s)
4:32:30
jcowan
beach: HDTP teaches elementary computer *programming*, whereas SICP teaches elementary computer *science*. Both of them use Scheme because of its simplicity and closeness to mathematical notation.
4:39:19
beach
jcowan: Still, my guess is that the programming style is going to be influenced by the convictions of the authors. But I should quit guessing and read the book instead.
4:39:42
theemacsshibe
for example, call-cc and macros aren't touched on since they don't really do much for the first few chapters
4:40:04
jcowan
Well, certainly. Indeed, I know of no textbooks whatsoever that are not influenced by the convictions of their authors1
4:40:54
theemacsshibe
MIT released recordings of the relevant lectures, too. each is an hour long in three 20-minute segments.
4:42:30
DecimPrime
jcowan: i see. i had and liked what i read of SICP. someone stole my book. i'll have to finish it off later on.
4:43:34
jcowan
Again, it's about *elementary* programming. The authors found that SICP gave insufficient attention to the problem of learning to produce a formalism that represents an informal intention.
4:44:36
DecimPrime
i've toyed with several languages...self taught but never got into meat of completing something. largely because i felt i've missed out on breaking things apart...which lisp in its self has helped out a lot with
4:44:56
jcowan
which is kind of like teaching singing by saying "Sing!" and then trying to help the people who sing -- it does nothing for the people who don't.
4:45:04
beach
There are a certain number of books that claim to do that, but in fact, many of them are hailed by colleagues with decades of experience as being exactly what is needed, but they make no sense whatsoever to the intended audience.
4:45:41
jcowan
I am not necessarily defending HTDP, as I have not read it either, just explaining what I understand its purpose to be.
4:46:38
beach
jcowan: Math is taught the same way. Students are shown lots of proofs, but no way of coming up with their own. They are supposed to generalize from examples.
4:49:58
jcowan
"The first and best way to solve ODEs is to guess the answer and see if it's right. If this fails, integrate both sides if you know how. Otherwise go to the Taylor expansion. If you can't solve it by any of these means, you probably can't solve it at all."
5:29:03
no-defun-allowed
unfortunately it seems my combination of tesseract and imagemagick switches only gets 2/5 chars right
5:32:05
lucca
There are more techniques for integration than grains of sand in all the beaches of all the worlds of the galaxy. Finding them is left as an exercise for the reader.
5:33:06
LdBeth
just found a really interesting thing https://liu.diva-portal.org/smash/get/diva2:256466/FULLTEXT03.pdf
7:56:50
beach
The other day, jackdaniel showed me this PDF of some slides from a talk by Rob Pike: http://doc.cat-v.org/bell_labs/utah2000/utah2000.pdf
7:57:40
beach
Perhaps some people will think I am less crazy for suggesting CLOSOS when they see that even very famous people think that it's a good idea to attempt to create new operating systems.
8:01:10
beach
There was a lot of innovation back then, and, as Rob Pike admits, Unix killed all innovation.
8:02:42
DecimPrime
=P well CL has been around for much longer. but still yes suprised it's so lively at this hour
8:03:08
beach
It slows down during the weekend. I suspect many people here have a real life as well.
8:04:13
DecimPrime
i have insomnia so i like to talk to people fom europe etc...they're up but still not as lively in certain rooms
8:05:09
beach
DecimPrime: #lisp is know to be active, and also very helpful, even to newbies (provided they take the advice they are given).