freenode/lisp - IRC Chatlog
Search
5:47:40
jasom
ugh... I couldn't find anything to parse rfc-2822 dates in lisp; this is what happens when I need to parse something late at night: https://gist.github.com/jasom/57333266b96dfde352956f779dd366d1
5:50:43
jasom
trivial-rfc-1123 could probably do it if I stripped comments first; I don't think any non-comment parts of the string contain parenthesis
5:51:01
jasom
no-defun-allowed: nope, it's not even remotely functional; just classic unstructured recursive-descent
5:52:40
no-defun-allowed
I thought it looked like something I would write with esrap, which in turn looks like combinators, but it is in fact a packrat parser.
5:53:17
Nilby
jasom: I don't think it's too bad this way. It's not much different than if you made an esrap parser, and performance is probably not a problem.
5:54:03
jasom
Nilby: if I changed the parse-error to returning a known value it would probably be faster than esrap; languages with limited backtracking are ususally slower in packrat
5:55:36
jasom
because packrat parsers memoize everything just in case backtracking might happen (which is a worst-case performance win in highly backtracking grammars, but a constant-factor loss in grammars with little (or no) backtracking)
5:58:11
Nilby
I've done small parsers like this and they seem too work fine. This one looks fairly clear. With a little documentation it could be an instant classic.
7:00:38
easye
Another month, another sbcl release <http://sbcl.org/news.html#2.0.10>. Kudos to the Kadence!
7:08:47
edgar-rft
charlie770: There are not many mezzano users yet and I'm not one of them. But when I look at the github code I think this is the file where everything starts -> https://github.com/froggey/Mezzano/blob/master/system/cold-start.lisp
7:22:35
charlie770
beach: I wanted to start reading common-lisp code and wanted to see how operating systems worked. By reading mezzano, I can do both.
7:27:55
Nilby
beach: Thanks for the book recommendation. My internet went out before I could reply yesterday.
13:44:06
sm2n
is there a way to get a compile warning when defining a function with a method call with an invalid method combination?
13:45:30
sm2n
obviously this can't be an error, since you may define a valid method later, but it'd be nice to know if the method existed at the time of definition
13:48:38
beach
You probably means something else, like whether FOO has any applicable methods for the argument you are passing.
13:49:15
beach
sm2n: But that would require solving the halting problem. Consider (defun bar () (foo (ackermann 4 5)))
13:51:14
beach
You don't know what type the value returned by the function is unless you execute it, or solve the halting problem.
13:51:51
sm2n
sbcl already calculates return types to the best of its ability, I would just like it if that information was used here
13:57:29
scymtym
how would you define mutually recursive methods without getting a warning? as in (defmethod foo ((x string)) (if … (foo 1) …)) (defmethod foo ((x integer)) (if … (foo "") …))
14:00:35
scymtym
you could probably delay the warning until the end of the compilation unit, but it would be kind of hard to avoid unwarranted warnings in general
14:00:57
sm2n
if I were defining those interactively, I would consider the warning as desirable even in that case, and if you were working at the file level, the information necessary to suppress the warning should be available to the compiler
14:03:33
scymtym
for simple cases, sure. but it is really hard to know in advance which methods will be applicable when the call is executed
14:04:26
_death
with some styles, it's also quite common to compile calls to a generic function before any methods are added to it
14:30:47
biglama
Hi guys, I have a beginner question without answers on Google : how can a sort characters in a single string (Emacs lisp) ?
14:31:44
_death
you can also see calling a generic function with no applicable methods as a normal thing, since by CLOS protocol, no-applicable-method gets called.. in many cases its default method is to signal an error, and there's nothing special going on