freenode/lisp - IRC Chatlog
Search
1:49:01
sjl
e.g. in SBCL debug 3 might not be enough: http://www.sbcl.org/manual/#Debugger-Policy-Control
1:58:17
Bike
break functions into small, almost pure functional components and test their i/o, is the main thing for me, but i don't think stepping is wrong
1:59:02
z3t0
What I am trying to do is understand the logic of that flet function and from my experience in js i usually step through
2:01:37
Bike
the inner function is completely independent - like, you could make it a separate defun
2:03:17
Bike
if i'm correct, it takes the entire file after the current position, and puts it in a string
2:03:30
Bike
the length of that string is the length of the file minus the length up to the position you're already at
2:04:03
z3t0
the contents of the string is something like "^@^@^@^@^@^@" which im not sure what that is...
2:04:30
Bike
make-string makes a new string of the given length. in this case the contents are not specified.
2:05:25
z3t0
I understand it has the correct size, but what sets its start position since start is not specified?
2:09:25
z3t0
Its amazing how many people are put off by lisps parens but its the parens that makes it such a breeze to edit
4:48:33
Fare
z3t0: uiop is almost as good as builtin, but much more portable and has more useful functions
4:49:22
z3t0
I see, though I wonder how can it be more portable than built in if built in is a part of the standard?
4:51:10
Fare
so every implementation does its own thing, and you can't rely on it at all if your code is to be portable.
4:53:21
beach
Fare: It would be good to extend UIOP with functions that can provide reliable results with patterns other than "*".
4:54:05
beach
I recall a comment saying something like "If you use a pattern other than * then you get into implementation-defined territory".
5:12:14
beach
wally1337: For example, I have this application: https://common-lisp.net/project/mcclim/static/media/screenshots/transclime.png to help me learn Vietnamese.
6:34:44
Shinmera
Xach: because I wanted to amend the commit, which required a force-push. I often push too early, it's a bad habit.
6:36:30
Shinmera
Xach: Anyway, when dealing with remote repositories in a script, it's often best to do `git fetch origin master && git reset --hard origin/master` than `git pull` as it'll deal properly with force pushes.
6:41:58
z3t0
right now I have dolist iterating over a loop and calling a function with some information from the particular element, can this be parallelized?
6:46:07
beach
z3t0: There is a compatibility library that makes threads look implementation independent. It is called Bordeaux-threads.
6:51:58
z3t0
my code: (bordeaux-threads:make-thread #'(lamdba () (print "hide")) :name "hello-func")
6:52:14
z3t0
Its complaining that the lambda statement is not a function name, but i thought I had specified the name using :name ..?
6:58:14
beach
Honeywell Bull tried to convince us that we wanted GCOS instead of Multics. But we insisted. :)
7:00:59
z3t0
But for some reason the thread number never seems to increase (it should be ~800) even though there are a lot of files
7:22:04
z3t0
I'm trying to figure out how i would adapt it for writing files, currently i am using (write path stream)
7:30:42
z3t0
http://sprunge.us/LjNK this is what i have so far but it is saying unexpected type STREAM datum: 512
7:51:42
z3t0
ah! so it seems i have been wasting my time optmising file writes... its the file reads that is taking 95% of the time...
8:04:40
pjb
z3t0: usually, it's only the first file read that takes time. Try reading the file several times! :-)
8:05:13
z3t0
im looking at https://github.com/chjj/marked/blob/master/lib/marked.js right now and trying to figure out how to port it
8:05:30
z3t0
a bit lost what half the odd constructs are ... https://github.com/chjj/marked/blob/master/lib/marked.js#L36
8:08:18
pjb
z3t0: probably translates into (funcall … (funcall (funcall (replace block.list) /bull/g, block.bullet) "hr", "\\n+…") … nil)
8:09:09
pjb
The function returns a closure until nil is passed in argument then it returns the final result.
8:32:57
z3t0
I've read about how common lisp can generate very fast code, comparable to c, is that realistic?
8:39:50
beach
z3t0: Check out the work of Didier Verna: https://www.lrde.epita.fr/~didier/research/publications/papers/verna.06.elw.pdf
8:42:19
beach
z3t0: Short version: If you provide the same information to the Common Lisp compiler as you HAVE TO provide to a C compiler, then the code is very likely comparable in speed.
8:54:39
antoszka
I need to analyze some RFC2822 e-mails using CL. As in: scan the headers (create KVPs from them) and do some mime-part unpacking (extract filenames and file types of the parts). Which libraries would you recommend that? cl-mime or mime4cl for the MIME disassembly?
9:24:32
flip214
antoszka: http://www.informatimago.com/develop/lisp/doc/com.informatimago.common-lisp.rfc2822.rfc2822.html looks like the docs
9:26:05
antoszka
flip214, beach – thanks guys, though I've just noticed that cl-mime has a parse-headers function which returns a nice alist of all the headers.
9:30:22
antoszka
beach: Yeah, especially that there are some unobvious quirks and multi-line issues with the RFC headers.
9:30:45
antoszka
So that'd actually be quite a lot of work to do it manually with (multiline) regexes.
9:41:00
p_l
I rememmber it mostly because there was this one oddball cpu which made it problematic - it had bit-addressed memory, so an 8bit char properly should be sizeof(char)==8
9:45:30
p_l
yeah, C generally doesn't deal well with memory that isn't addressed in multiplies of (size 1) chars
10:10:49
pjb
COM.INFORMATIMAGO.COMMON-LISP.RFC2822.RFC2822 is not a complete parser, just a few utility. There are other libraries that are more complete. check with cliki.
10:41:16
scymtym
Xach: they probably already fixed the issues. see https://sourceforge.net/p/sbcl/mailman/message/35957238/
10:54:26
BW^-
what's the point with the Find/Union thing in disjoint sets?? i see some literature and videos but what's the use case.. so .Find is supposed to tell you what. ranking at union time to decrease the search depth of the , works how??
11:07:19
p_l
phoe_: well, I have some code spelunked somewhere which deals with bytes from 1 to 64 bit long...
11:12:50
phoe_
I really can't stop being amazed by Lisp's ability to make read-time and compile-time assertions.
11:13:47
scymtym
Xach: ok. maybe a problem with their git repositories or the quicklisp project definitions, then. the DEF{METHOD,GENERIC} improvements seem to affect at least one other system, though
11:15:58
scymtym
if possible, i would like to keep the improvement if it doesn't cause too much trouble for you
11:16:10
Xach
https://github.com/mmaul/clml/blob/master/time-series/src/ts-anomaly-detection.lisp#L110
11:16:53
phoe_
random-nick: MOP is not a part of the ANSI Common Lisp standard, but is nonetheless adopted and supported widely enough
11:17:36
scymtym
Xach: probably https://github.com/sbcl/sbcl/commit/cdbde685bcb7371d45621752e5284194b4e8feaa
11:32:52
phoe_
Basically - I want to mutate a copy of a list, since the original is immutable, e.g. comes from a &REST somewhere.
11:43:09
attila_lendvai
Xach: forgot to pull to the live repos, should be fixed now (perec and meta-model were involved)
11:43:40
antoszka
phoe_: I'd say, copying the list ok, but change the name, to make your intention clearer.
11:44:30
Xach
I don't usually change the name - I often do (setf bar (copy-list bar)) or something like that.
11:45:31
_death
phoe: it's ok to copy to the list inside foo.. naming it may not be necessary if the function is made to do one thing only
12:05:56
pjb
(setf (car bar) (cadr bar) (cdr bar) (cddr bar)) ; but it cannot remove the last element.
13:00:07
attila_lendvai
Xach: I'm looking at that ql output. why does perec get loaded when loading hu.dwim.util.test ? to the best of my knowledge that shouldn't happen.
13:01:29
attila_lendvai
Xach: I mean, is there something ql specific magic, or I should dig in my own garden to find out why perec gets loaded?
13:03:01
attila_lendvai
Xach: never mind, I found it, it's :hu.dwim.util/production. maybe I should move that code away from there into another system, or address the TODO to get rid of the perec dependency