freenode/#lisp - IRC Chatlog
Search
18:13:48
didi
What about https://paste.debian.net/hidden/9b945b27 for reading every object from a stream?
19:45:01
nij
Hello! Frequently I need to parse timestrings in several different format. I have written ad hoc solutions for them.. but I think there should be a more general way to parse.. any package that has achieved that?
19:47:02
Bike
there's local-time https://common-lisp.net/project/local-time/manual.html#Parsing-and-Formatting
19:47:15
nij
Or.. is there a general enough parser that helps me do this, with a smarter control sequence?
19:47:43
nij
Bike: local-time is actually my favorite time-related library.. iirc it doesn lemme do that. Just checked its doc. But let me double check again.
19:50:21
nij
I feel this is used many times.. but weird enough that there is no general library as I checked..
19:50:38
nij
so maybe people just use full fledged parsers.. which is something that i haven't learned
20:06:30
nij
Ah.. but the limit of natural language parsing is that there's not standard answer anyways.. so sometimes it needs to guess.
20:06:57
nij
E.g. (chronicity:parse "12/11/2020") returns November, but (chronicity:parse "12/15/2020") returns December.
20:07:47
VincentVega
how do I import/export a ```defun (setf smth)```? ```(import '(smth))``` isn't doing the trick.
20:11:08
_death
nij: I wrote this https://plaster.tymoon.eu/view/2307#2307 a long-time ago for some small-time date-time parsing
20:13:23
Bike
VincentVega: import/export is about symbols. if SMTH is imported you can refer to SMTH, (setf smth), whatever
20:15:37
_death
nij: for example (parse-using-digits-template "22/11/0000 33:44" "05/08/1962 05:25")
20:17:51
VincentVega
pfdietz: OK! By the way, is there a way to check for unused symbols which were imported with a defpackage?
20:24:01
_death
anyway.. nowadays I wouldn't make some of the choices I did back then :).. but that's what I use in some scrapers I wrote back then
20:28:15
nij
Ah.. a typo sorry. Fixed: (collect "aaaa-bb-cc-b" "2020-11-20-@") => (:a "2020" :b "11@" :c
20:33:34
_death
you can use Lisp syntax for structure, instead of a string template.. like (collect '((a 2) (b 2) (c 2) (a 2) (b 2)) sequence)
20:42:29
_death
I tend not to use regular expressions.. but I guess for a task like scraping they may be ok
20:55:03
_death
nij: for format, there was a (setf format) thingy.. so you could (setf (format nil "~D-~D-~D" year month day) "1999-12-31") and it would assign the numbers to year/month/day
21:15:16
mfiano
LispWorks is nice, but it's very easy to write non-portable code with the array of impleemntation-specific niceties it has, and I can't justify the license cost over free and extremely performant SBCL.
21:17:26
nij
_death: Oh wow indeed, I thought rx is just for pattern matching.. but it's actually almost the same problem. There's a nice showcase here: http://francismurillo.github.io/2017-03-30-Exploring-Emacs-rx-Macro/
21:18:32
louis771
i'm just a few weeks into lisp and oscillate somewhat between CL and Racket. I found CL the more mature, practial Lisp however Racket provides a unified batteries-included approach incl. an IDE and a central package server.
21:19:17
louis771
What I don't like about Racket is the obsession of it being a language to program programming languages. It's just what I'm not so much interested in. I want to do more practical stuff (web app, etc.)
21:20:15
nij
louis771: A reason I heard of why Lisp is great is that it's easier for you to implement your own language for your specific problem.
21:20:21
mfiano
Well that's hard to answer. Racket being derived from Scheme has a different take on live-recompilation/incremental modifications.
21:22:36
louis771
some nice macros to make life easier is fine for me, but inventing a new DSL so nobody else but me will be able to understand my code is outside my scope :)
21:23:35
louis771
from a "getting things done" perspective, or say a more business point of view, you guys think that CL is the better alternative?
21:25:39
louis771
mfiano: I'm sorry, true. But when I do a search on quicklisp this is where I end up
21:28:17
louis771
nij: oh I have some nice conversations in the racket community in the last few days and did some coding, but somehow I "feel" that it's not the direction I wanna go. But I'm unable to express why at the moment.
21:29:32
louis771
Cthulhux: yes, Racket has a nice package management but try to get a packet in the package server.
21:29:51
louis771
You have to learn Scribble first, which is the documentation language written in Racket
21:30:34
louis771
Which was exactly the moment where I realized that maybe the price of "build a new language for every use case" is too high
21:31:29
Cthulhux
racket comes with half a dozen languages already - i'll need to find out how they can talk to each other though
21:32:00
Cthulhux
e.g. i haven't found out how to use lang/<anything else> features from lang/webserver
21:33:07
louis771
the racket devs are not interested in making Racket a day-to-day language for practical/business use cases. They are into language research, so everything in the community evolves around that.
21:33:48
VincentVega
louis771: I don't know how much of it is still relevant (e.g. racket 8.0 just came out and it's supposed to be quite faster), but here's the comparison https://gist.github.com/vindarel/c1ef5e043773921e3b11d8f4fe1ca7ac
21:33:53
Cthulhux
it's not. because there are no CL devs. the standard is there, everything else is a package
21:34:48
louis771
"No introspection compared to one with SLIME." - yes that was really disappointing
21:35:43
louis771
"most of Racket libraries are half-baked: unfinished, failing to build, and lacking documentation" - I must agree here too
21:37:15
louis771
VincentVega: a very nice article, thanks! I have to agree to most of it from what I experience the last few days of studying Racket
21:39:11
VincentVega
louis771: yeah, no problem : ) Note that Emacs is no small thing to consider either, especially with the aggressive-indent + paredit (lispyville for evil) combination, which I have grown to think of as indispensible now.
21:52:48
markasoftware
i've got a small MOP question. At http://mop.lisp.se/www.alu.org/mop/concepts.html#defmethod it says that the (make-instance) call for the method metaobject can receive a :declarations initarg
21:53:13
markasoftware
but here http://www.lispworks.com/documentation/lw71/MOP/mop/dictionary.html#Initialization there is no :declarations initarg mentioned for method metaobjects
21:56:32
markasoftware
and the SBCL definition of `standard-method` seems not to take a :declarations initarg
22:17:36
warweasle
Yay! I'm pulling data from the stock market! Ah, my ridiculously circuitous plan is one quarter complete!
22:20:06
warweasle
Honestly I'm a little more concerned with using the training data to create a stock predictor.
22:21:04
warweasle
Given the size of the data set and the number of variables... I should be done just before the heat death of the universe...if I had a quantum computer.
22:29:43
markasoftware
I'm also a confused about the example `defmethod` expansion given here http://mop.lisp.se/www.alu.org/mop/concepts.html#defmethod will work if the generic function is not defined yet
22:30:11
markasoftware
it seems to me like the (ensure-generic-function) call will initialize it with a nil lambda-list, so adding a method with a non-nil lambda list right afterwards will trigger an error
22:30:34
markasoftware
because the empty lambda list is not congruent with the lambda list of the new function
22:34:32
Bike
the MOP book has a lot of little issues like this. you might be better off looking at what implementations actually do.
0:10:07
gendl
Btw I added a quicklisp-patches/ directory which contains a few patched ql systems where my patches haven’t yet made it into the respective upstream distros for ql distribution (or at least haven’t been tested yet)
4:44:38
jeosol
no-defun-allowed: just saw your pull request on implement a linear-probing hash-table into SICL. Good work
4:50:01
beach
But thanks to the way bootstrapping works, most of the code exists, has been executed, and seems to work.
4:51:13
beach
I recently finished revamping the way high-level IR was generated in order to take into account the ideas in my draft paper on call-site optimization.
4:55:25
thmprover
Cool, I was just thinking about this topic earlier today. (Not that I have anything new to contribute, but just pondering function calls and their optimization in functional languages.)
4:56:13
beach
The technique in that paper will make Common Lisp function calls faster than a typical C function call in a shared library.
4:56:21
azrazalea
beach: You've been `beach` for yeeearrss though right? I've gone on a couple hiatuses and you're still here lol (thank goddess <3)
4:57:01
beach
azrazalea: Yes, I am not going anywhere. Unless the virus hits or something, of course.
5:00:40
thmprover
Oh, beach, David Gudeman's "Representing Type Information in Dynamically Typed Languages" (1993) is the earliest paper on NaN-boxing (if you still need a citation for footnote 1).