libera/commonlisp - IRC Chatlog
Search
22:47:29
_73
is there a library that provides reader macros on top of cl-ppcre that enables you to use syntax similar to perl?
22:48:38
Demosthenex
_73: i saw one that did #R for regexps, but its not going to improve the function calls
22:50:01
_73
Demosthenex: do you happen to remember what is was called? I was thinking of making my own but don't want to reinvent the wheel.
22:53:24
_73
Bike: this library goes beyond string interpolation? I was thinking syntax similar to perl's m// s/// etc.
22:55:23
Bike
it has stuff intended to allow you to write regexes exactly as you would in perl. i don't know anything beyond that.
23:07:09
tom
Hey! Any sly&sbcl users here? :) I'm trying to trace a method with sly, but it doesn't pass `:methods t` so sbcl doesn't trace the method
0:16:33
yottabyte
should I use fset:equal? instead of equalp for fset:set equality? both appear to work
6:02:52
beach
remexre: Sets are tricky things. There is really no abstract data type called a "set" because it is impossible to have all set operations be efficient simultaneously. That is why every abstract data type that contains other objects is defined by the operations that are supported. If you give us the operations you like, perhaps we can help.
6:03:22
beach
remexre: But in general, such a representation would not allow for many operations to be efficient.
6:05:14
moon-child
sorted vector gives you binary search if you care for it, but no in-place intersection or union
6:05:41
beach
remexre: For intersection, convert to lists, do the intersection, convert to a vector, sort.
6:07:11
beach
That sounds like premature micro-optimization without any measure to determine whether it is necessary.
6:07:51
beach
remexre: You are comparing cache effects and asymptotic complexity. They are not the same order of magnitude.
6:08:29
beach
remexre: My guess is that you are going to spend all the time comparing characters in strings anyway.
6:09:05
moon-child
beach: 'For intersection, convert to lists, do the intersection, convert to a vector, sort' hmm? If you were using such a representation--and you cared for performance--you could do it in O(m+n) by iterating over both vectors and VECTOR-PUSH-EXTENDing a result
6:09:18
moon-child
(and if you don't care for performance, just use a list and don't bother with anything else)
6:09:43
remexre
the point with the asymptotics was that they're not terrible; not ruining the cache by using vectors was more of the point
6:10:55
moon-child
sure. I think the problem is insufficiently motivated/contextualized. If it's desirable for some reason to use a vector in the first reason, that same reason may also make it undesirable to use an intermediate list (which was your suggestion)
6:11:55
moon-child
given two sorted vectors, you can produce a sorted intersection vector in linear time, without consing an intermediate list and calling SORT on it
6:12:33
moon-child
yes. And if it doesn't matter then you can just use lists. We are going in circles :P
6:13:46
moon-child
remexre: can you motivate your problem? Do you have set-processing code which is slow?
6:14:09
remexre
no, I'm planning on writing code that I don't want to go back and change the set representation for
6:14:46
moon-child
if your interface is properly abstracted, it should not be prohibitively difficult to change your representation
6:16:04
remexre
right, but i know the representation I want, and I would be surprised if I needed to change *from* that later