freenode/#lisp - IRC Chatlog
Search
14:51:59
Nilby
I suppose for many things the results are t/nil, but beach was talking earlier about his markov chain fuzzer style testing.
14:54:54
beach
Nilby: No, nothing fuzzy. It is just that I need for the same kind of operation to be repeated with some significant probability, like INSERT for instance. Otherwise, the Flexichain will forever remain short and the resizing operations won't be sufficiently tested.
14:55:01
_death
you can also keep the seed.. I can imagine a counterargument about sampling the problem state anew each time, but then maybe that means your samples are too small/uniform
14:57:59
Nilby
Hmmm. I guess randomized valid input isn't exactly the same as fuzzing with random invalid input.
15:00:50
Nilby
It's like those joke random sentence generators running the parser backwards, but with AMB or something.
15:19:19
nij
Suppose I have a list of READable stuff. Is there a package that helps me edit this list by editting its content through an emacs buffer?
15:28:43
beach
I assumed you meant what you normally do in an Emacs buffer, like inserting and deleting characters.
15:31:54
lukego
_death: I've written a performance regression tester a bit like that. spends hours running permutations of configurations and workloads on a system, collects all the data in a big CSV, allows you to do e.g. ANOVA to compare different software versions and say "hmm config option FOO is really slowing down workload BAR in the new release"
15:33:57
lukego
even hooked it into a CI that would automatically detect performance regressions. that was fun.
15:42:04
_death
lukego: very cool.. I remember a post from a year ago about boinkmarks.. wonder what sbcl uses nowadays
15:43:10
lukego
beach: Hey, humble idea to borrow a leaf from your testing book, I realize that when I'm converting data from text to objects then an easy way to get testability might be just having a canonical print routine to turn it back to test. then I can e.g. (assert (string= (tostring x) (tostring (fromstring (tostring x)))) to differentially test the printer and reader against each other
15:44:19
lukego
so for example if I goofed and put a value in the wrong slot it'd be caught automatically, without me having to manually create examples with tests that know exactly how the object representation should look
16:29:57
nij
Now the only problem is to lispily format a long list such that the length of each row isn't more than, say, 80.
16:53:31
Nilby
I usually use with-output-to-string in a loop. You could also just output to a string with a fill-pointer.
16:56:30
Nilby
e.g. (let ((s (make-array 0 :element-type 'character :fill-pointer t))) (loop for i from 0 to 10 do (format s "salmon")) s)
17:42:32
shka_
(with-output-to-string (stream) (loop for i from 0 to 10 do (format stream "salmon")))
17:42:39
shka_
jmercouris: reduce is a really bad option here since concat will allocate new copy fo string for each element of the sequence being reduced
17:43:07
shka_
also, technically speaking function passed to reduce should handle being called with 0, 1 or 2 arguments
17:46:17
Nilby
The format one is slower actually than the reduce, but takes much less memory, but the with-output-to-string seems the fastest.
17:49:02
_death
shka: they will never be called with one argument, and you can provide an initial value to ensure they will never be called with no arguments
17:50:04
Alfr_
... or ensure that sequence is never empty, then it won't be called with zero arguments as well.
18:32:10
jasom
with-output-to-string is definitely the idiomatic way to accumulate values into a string.
18:36:32
fiddlerwoaroof
jmercouris: (reduce (lambda (acc next) (format acc "~a" next)) seq :initial-value (make-array 10 :element-type 'character :fill-pointer 0))
18:37:27
fiddlerwoaroof
Reduce is just a loop with an accumulator, so if you control the initial value there's no reason not to mutate it :)
18:38:25
fiddlerwoaroof
If some FP purist complains, just explain that you're using dynamic linear types.
18:38:36
jasom
fiddlerwoaroof: but at that point why use reduce at all, and just put the mutation in the loop body?
19:08:03
wanko
hello, is it okay to ask beginner scheme questions here, or is there a different channel for that?
19:46:43
dbotton
I assume there is no way in lisp to "use" the sequence passed to subseq as part of an expression to calculate end?
19:47:57
jasom
dbotton: I think various utility libraries let you do python-style passing of negative values for subseq ranges. I can't speak to the quality of any of them though.
19:48:22
Xach
dbotton: (defun trim-last-char (s) (subseq s 0 (1- (length s))) is what i might do if i didn't a cluttered expression
20:00:29
jasom
fiddlerwoaroof: but the original question was phrased in a way that assumes the sequence was of at least length 1
20:06:30
Bike
oh, i thought maybe sbcl might do its magic shrink-vectors-even-if-they-don't-have-fill-pointers thing but i guess it's too messy
20:54:36
dbotton
From a GitHub discussion "Clog is totally fun. It made me re-start learning Lisp." Thought I would share for those that help me
21:00:09
alanz
I know, which is why I am speaking up. I love seeing it come together bit by bit, and appreciate the effort you put in to making clear, understandable code
21:13:48
alanz
dbotton, I got as far as using your tutorial 13 as a base. Now scratching my head wondering what the next thing to do is. The general idea is to help managing entries to https://www.facebook.com/saflowerunion/posts/4851293668246422
21:18:54
dbotton
Since an admin tool, maybe consider using tutorial 22 as your base and have a nice look desktop motif
21:20:30
alanz
thanks, will do so. I also see myself interacting with the local file system, and showinng pictures. So the desktop one is definitely a good basis
21:21:53
alanz
its going to be slow though, this is a back-burner project for me, which I am using to learn cl at the same time (from some experience with elisp)
21:26:08
dbotton
And that is why my plan is to do a CLOG Lisp tutorial, it is a cool way for people to learn because they see results right away
21:27:25
dbotton
Still hope someone with better language skills takes me up on project :) but if not I will do
21:35:52
alanz
you are doing fine, as far as I can see. Being active and enthusiastic is the most important thing, I reckon
1:11:50
charles`
can't they just be macros? that then (sometimes) expand into implementation specific magic
1:26:09
_death
the self-modifying code issue is interesting.. not just because it uses "bletcherous" jargon, but also because it mentions "displacing macros", which I will now try to find more about.. my guess is that they "patch" the form in place with their expansion