Search
Saturday, 22nd of July 2017, 10:28:35 UTC
10:29:44
phoe
Let me write a PoC of that
10:29:47
beach
axion: I am fine thanks :)
10:30:16
|3b|
loop/collect version sorts/splits the symbols from CL: in a little over 1.6 million cycles
10:31:19
axion
How do I use sort to case-insensitively sort?
10:31:35
specbot
http://www.lispworks.com/reference/HyperSpec/Body/f_stgeq_.htm
10:33:12
axion
beach: So is a lot of things here, such as algorithm efficiency and Emacs buffer data structures being a bad data structure for their use :)
10:33:39
phoe
axion: http://paste.lisp.org/display/351414#1
10:34:26
axion
Thanks for all the suggestions!
10:34:34
phoe
this splits the list into (1 3 5 7 9) (2 4 6 8 0)
10:37:39
axion
|3b|: some minor problems with your implementation, but nothing big
10:38:21
|3b|
ACTION just typed it into IRC without testing, what did i miss?
10:39:32
axion
I guess there's nothing wrong with it really. I just didn't expect a 2 element list of NIL's if given an initiallly empty list
10:40:14
|3b|
yeah, i guess problem is underspecified for that case :)
10:40:26
axion
|3b|: What is the point of the WHEN clause? I don't see when it would change anything
10:40:37
|3b|
splitting empty list into 2 empty lists sounds reasonable to me though :)
10:40:59
|3b|
with odd number of elements you'd get an extra nil at end of 2nd list
10:41:14
axion
That's not the case for me
10:41:24
axion
oh yeah. repl out of sync
10:46:24
|3b|
about 1/3 second to run on all symbols in my image, ~330k
10:46:59
|3b|
(well, all symbols iterated by do-symbols)
10:47:15
axion
phoe's implementation is extremely fast, but I was expecting that keeping a reference to tail
10:47:25
|3b|
but with lots of duplicates
10:49:37
|3b|
and looks like almost all of that is spent sorting
13:00:22
rk[ghost]
equivalent of assoc with strings instead of symbols?
13:01:39
shka_
rk[ghost]: pass equal as test
13:02:11
phoe
if only strings are taken into account here
13:02:16
shka_
axion: if you care that much about performance, use vector instead of list
13:02:25
shka_
sorting lisp is exactly fast
13:02:39
shka_
phoe: ok, string= will do
13:03:20
shka_
sorting list if not exactly fast :P
13:06:47
rk[ghost]
ah! you can past a test in to assoc, excellent
13:07:02
rk[ghost]
shka_: phoe: thaaanks!
13:07:16
rk[ghost]
quite a sensible implementation to allow test passing
13:07:26
rk[ghost]
ACTION starts whistleing
13:07:35
shka_
oh, most of those functions accept :test
13:08:08
rk[ghost]
doh, i am always so unaware of the gigantic library of CL
13:08:14
rk[ghost]
i end up implementing so many things myself -.-
13:08:23
shka_
it is not that gigantic to be honest
13:08:44
rk[ghost]
sure, but my head keeps thinking all i have is lisp 1.5
13:08:53
shka_
in fact it can be considered quite small when compared to other languages nowdays
13:09:20
rk[ghost]
maybe so. but even something like nth it is taking me a while to be like, use that and quit doing strange caaaddars..
13:10:01
shka_
well, honestly i'm also using stuff like cdaadr
13:10:12
shka_
not proud of it, though :D
13:10:30
shka_
usually, destructuring-bind is great
13:10:31
rk[ghost]
i find it difficult that CL has many ways to go about stuff
13:10:51
shka_
oh, well, it certainly has
13:11:00
shka_
anyway, I'm going afk now
13:11:07
shka_
glad we could help you :-)
13:11:08
rk[ghost]
i find i spend more time trying to decide how fancy to be about a solution rather than just solving it and moving on.
13:14:41
rk[ghost]
it would probably suit me to spend a few days reading the common lisp hyperspec more or reading others code more than programming.. as it seems like every day i come across a new library function which implements something i already spent time implementing by hand.
13:24:22
pjb
rk[ghost]: notice that: (let* ((k1 "k1") (k2 "k2") (a (acons k1 1 (acons k2 2 nil)))) (assoc k2 a)) #| --> ("k2" . 2) |# works perfectly with strings and without :test.
13:26:12
pjb
rk[ghost]: on the other hand: (assoc :foo '((bar . 1) (foo . 2))) #| --> nil |# doesn't work as you expect without :test! (assoc :foo '((bar . 1) (foo . 2)) :test (function string=)) #| --> (foo . 2) |#
13:26:24
pjb
rk[ghost]: it's not a matter of string or not string!
13:35:41
axion
shka_: It doesn't make much sense to use an intermediary vector when the input and output must be a list as mentioned
13:51:59
rk[ghost]
pjb: aye. thanks. looking in to it, i built my list as [key . object]s
13:52:52
rk[ghost]
anyhoot, :test #'string= solves my issue! :)
13:54:21
rk[ghost]
and helpful, because now i can make a fuzzy assoc with using search
18:50:09
flip214
When the accessor functions for a class are in a different package, is there a shorter way than the 2-symbols-version of WITH-ACCESSORS to map them to symbols in the local package?
18:50:39
flip214
Ie. (WITH-ACCESSORS ((accessor other-package:accessor) ...) object ...)
18:50:45
Bike
with-accessors doesnt know anything about packages
18:50:50
flip214
to not duplicate "accessor"?
18:51:09
flip214
so, if I really needed that, I'd need to write a macro....
18:51:22
flip214
but for a single use (even with 9 lines) it won't be an improvement
18:54:06
pjb
Macros should be written for abstractions, not for textual substitutions.
18:54:14
pjb
You can always import the symbols!
21:04:42
alandipert
is a hash table with T as vals an idiomatic way to represent a set?
21:04:59
Bike
it's not uncommon. a "hash set".
21:05:51
White_Flame
you could also store the key as the value, handy in some cases
21:07:45
Shinmera
If your set is small enough, a list and pushnew works just fine too.
21:59:44
Posterdati
please I've got this error quickloading iolib/syscalls on armhf: ondition of type: SIMPLE-ERROR
21:59:44
Posterdati
[22:30:34] <Posterdati> `(VECTOR ,SI::ELT-TYPE (,LENGTH)) is not a valid type specifier.
22:00:10
Posterdati
any hints? Thanks for help
22:02:46
Bike
Posterdati: looks like you expected a type specifier to be evaluated, but it wasn't
22:03:21
Posterdati
the error came up when loading iolib/syscalls
22:05:13
Posterdati
the funny thing is that I have another raspberry pi 3 with a cloned sdcard wich works
Saturday, 22nd of July 2017, 22:28:35 UTC