libera/#commonlisp - IRC Chatlog
Search
11:17:28
mfiano
What is a good way to transform a string repeatedly given a list of cons of translation characters. For example given the list ((#\, . #\-) (#\; . #\:)) and the string "foo,bar;baz", it should produce "foo-bar:baz"
11:20:58
semz
Although this may run into issues if one character is replaced with another character that is to be replaced later
11:33:14
lisp123
this week going to have about 5000 people using my CL app (for a few minutes each at a conf)
11:35:30
mfiano
Something like this maybe is sufficient: https://gist.github.com/mfiano/5616e646ad101334ff4c4938872caaa7
11:39:14
mfiano
I do not want subsequent passes to mutate previous passes. I want to do it all in one pass to avoid that
11:40:32
jackdaniel
what is a testimony that replace is perhaps not the best name for that particular function
11:41:42
rotateq
I always see what I didn't use yet so often. Or today, that NTH-VALUE is actually a macro.
11:44:37
mfiano
Maybe I should be looping over STRING instead of NEW-STRING. I have to read to iteration restrictions in the CLHS again
12:01:00
jackdaniel
clisp payed a dear price for rlwrap integration - it had to change its own license
12:17:40
Mrtn[m]
<lisp123> "one day I will learn C" <- What will you do in the afternoon of that day?
12:45:58
rotateq
trev: It's really one of the most impressive talks I know, due to the idea of translating the metaprogramming for chemistry.
12:56:09
mfiano
jackdaniel: How would you modify your example such that if the cdr is nil, it means trim the original character without replacing (shorter string)?
13:07:38
jackdaniel
I'd probably have a string with a fill pointer along with the index closed over (map nil …)
13:10:37
jackdaniel
(let ((string (make-it size :fill-pointer 0))) (map nil (lambda (c) (when-let ((val (assoc-value …))) (vector-push-extend val string))) *the-other-string*)
14:46:26
trev
i should also say that it made me feel like a total loser after watching, and now i am contemplating my entire purpose in life!
14:51:41
trev
beach, cause it was awesome stuff and when you are just working a mildly interesting day job just for money, it is easy to envy academia
14:54:18
jackdaniel
you should start putting easter eggs in the day job, then it will be for money *and* for easter eggs :)
15:14:03
Bike
relatedly, what de/serialization libraries are good. i tried marshal first, and that works okay, but i'd have to devise my own efficient output format and the code is a bit ugly in parts
15:25:09
mfiano
I am not sure. I used it quite a bit, but not for multi-dimensional arrays. Relatedly, the conspack author left Lisp some years ago, but I am still in contact with him. If you want to hack in support for that, I can see about transferring the repo to sharplispers etc.
15:33:49
Bike
indeed it does. i'm more concerned with compactness than speed here, but that's still nice
15:36:34
mfiano
I never used anything but conspack and cl-store, and elephant...i experienced corruption with the latter two.
15:37:11
Bike
it looks like i might be able to hack in md arrays through tmaps without actually altering the encoding... that would be convenient
15:46:16
Guest74
I've been thinking of how to provide game/character saves in a format that isn't trivially hacked to cheat. Seems like this conspack could provide at least one layer of obscurity.