tyson2 has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Ping timeout: 240 seconds]
Gleefre has quit [Ping timeout: 245 seconds]
Gleefre has joined #commonlisp
Lord_of_Life has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
skin has quit [Ping timeout: 265 seconds]
skin has joined #commonlisp
<jcowan>
cpli: Dynamic binding is an elegant way to deal with an inelegant thing, namely global variables. It lets you set their values pervasively, but if you want to make sure that they have particular values (e.g. you want PRINT to always output in decimal) then you have to bind *print-base* around every call to PRINT.
<jcowan>
In practice people often pretend that things like *print-base* aren't bindable and don't take these safety precautions.
eddof13 has joined #commonlisp
skin1 has joined #commonlisp
random-nick has quit [Ping timeout: 248 seconds]
NicknameJohn has quit [Ping timeout: 246 seconds]
<jeosol>
jcowan: til *print-base*. Is that efficient for dec2bin type calls with *print-base* set to 2.
<jcowan>
No idea
<jcowan>
I suspect not, as it would be a rather general implementation (of print, that is), but it would be convenient.
<jcowan>
You could set up an alist of options you want and then have a function that calls progv with the alist and passes it print with the arguments. You'd also want to expose all the default values as an initial alist from which the other alists are built.
<jcowan>
Some encapsulation might make sense here.
<jeosol>
jcowan: I am just wondering aloud, I implemented that functionality in a binary genetic algorithm code. I have the binary sequence as bits in an array.
<jeosol>
jcowan: with those ga code, we often go to binary and from binary back to decimal
<jcowan>
If efficiency was a concern, I'd write two functions, one to transform binary arrays to numbers and vice versa.
<jcowan>
s/binary arrays/bitvectors
<jeosol>
yeah, that's how I have it for now.
<jeosol>
dec2bin and bin2dec functions
<Bike>
it's probably not efficient, no
dcb has quit [Quit: MSN Messenger v2.16.1]
<jeosol>
I once asked about storage, storing as strings as vs bits, I think it was beach that said bits is better for storage, if memory serves me right
<jeosol>
Bike: how so ?
<Bike>
like jcowan said, the implementation is probably general. but i suppose it depends on what you're doing. i wouldn't think genetic algorithms involve writing out numbers much.
<Bike>
bits can definitely be stored more compactly than characters. a character is usually gonna be somewhere from 8 to 32 bits.
<jeosol>
in the binary genetic algorithm, the individuals are encoded as chromosomes represented as bits. For an optimization application taking a vector of real numbers, the x is encoded as bits in the chromosomes, then decoded back to real before computing f(x) - in general
<jeosol>
this binary implementation plays nicely with the crossover and mutation operators, analogous to the operations in human reproduction or biology.
<jcowan>
Hopefully not 32 bits: that's a lot bigger than Unicode.
<jeosol>
In real-coded/continuous ga's, the chromosomes are represented as real numbers, so no decoding is necessary.
<Bike>
jcowan: most implementations use utf-32
<jcowan>
Meaning that characters are boxes?
<jcowan>
s/boxes/boxed/
<Bike>
well that too, but even in an array of unboxed characters they'll probably be 32 bits per for random access
dcb has joined #commonlisp
<jcowan>
In many Schemes, characters are unboxed 21-bit values (basically fixnums with different type bits)
<Bike>
sure, but i imagine they're not packed together like that
<Bike>
i mean, probably a character will be an immediately like a fixnum yes
<Bike>
be an immediate
skin1 has quit [Quit: Leaving.]
<Bike>
but it's not like there's gonna be some other data packed into the eleven bits, other than a tag. so it takes up 32 bits
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #commonlisp
<jcowan>
Right.
<Bike>
i wrote a utf8 string system once on a lark using the sequences extension. linear time access is kinda funky. but it's probably a relatively rare action on strings compared to other arrays anyway
waleee has quit [Ping timeout: 255 seconds]
skin has quit [Ping timeout: 240 seconds]
skin has joined #commonlisp
skin has quit [Ping timeout: 260 seconds]
skin has joined #commonlisp
skin1 has joined #commonlisp
eddof13 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
danieli has quit [Remote host closed the connection]
danieli has joined #commonlisp
<jcowan>
It's possible to achieve O(1) access by using a kind of flattened rope representation: an (immutable) string is a length, a vector of bytevectors each of which contains exactly N characters (where N is fixed) and a value which indicates how many bytes in the first bytevector are not part of the string. Random access requires O(N) time, but because N is fixed, this is the same as O(1) time.
<jcowan>
Keeping the length and offset separately allows for sharing of the bytevectors.
johnjaye has joined #commonlisp
skin1 has quit [Quit: Leaving.]
skin has quit [Ping timeout: 255 seconds]
skin has joined #commonlisp
skin has quit [Ping timeout: 248 seconds]
skin has joined #commonlisp
_whitelogger has joined #commonlisp
cmack has joined #commonlisp
attila_lendvai has joined #commonlisp
dcb has quit [Quit: MSN Messenger v2.16.1]
czy has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
Cymew has joined #commonlisp
luffy[m]1 has joined #commonlisp
jon_atack has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 260 seconds]
jonatack has quit [Ping timeout: 255 seconds]
makomo has joined #commonlisp
johnjaye has quit [Ping timeout: 248 seconds]
johnjaye has joined #commonlisp
Bocaneri has joined #commonlisp
edgar-rft has quit [Remote host closed the connection]
edgar-rft has joined #commonlisp
Bocaneri is now known as Guest5440
Sauvin has quit [Read error: Connection reset by peer]
foretspaisibles has joined #commonlisp
foretspaisibles has quit [Client Quit]
foretspaisibles has joined #commonlisp
msavoritias_ has joined #commonlisp
Guest5440 is now known as Sauvin
rpx has joined #commonlisp
shka has joined #commonlisp
LW has joined #commonlisp
gxt__ has quit [Remote host closed the connection]
gxt__ has joined #commonlisp
Alfr has quit [Quit: Leaving]
MajorBiscuit has joined #commonlisp
kopiyka has quit [Remote host closed the connection]
kopiyka has joined #commonlisp
pve has joined #commonlisp
jeosol has quit [Ping timeout: 245 seconds]
MajorBiscuit has quit [Ping timeout: 255 seconds]
rgherdt has quit [Ping timeout: 265 seconds]
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
foretspaisibles has quit [Quit: Ping timeout (120 seconds)]
foretspaisibles has joined #commonlisp
czy has joined #commonlisp
morganw has joined #commonlisp
foretspaisibles has quit [Quit: Ping timeout (120 seconds)]
makomo has quit [Quit: WeeChat 3.6]
rgherdt has joined #commonlisp
Brucio-61 has quit [Ping timeout: 255 seconds]
scymtym has quit [Ping timeout: 248 seconds]
kagev has quit [Ping timeout: 255 seconds]
rgherdt has quit [Ping timeout: 276 seconds]
rgherdt has joined #commonlisp
rpx has quit [Ping timeout: 245 seconds]
kagev has joined #commonlisp
Brucio-61 has joined #commonlisp
mgl has joined #commonlisp
igemnace has quit [Remote host closed the connection]
varjag has joined #commonlisp
rgherdt has quit [Ping timeout: 265 seconds]
lucasta has quit [Remote host closed the connection]
foretspaisibles has joined #commonlisp
<splittist>
Isn’t WRITE for fine-grained control of printing options?
random-nick has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
czy has quit [Remote host closed the connection]
foretspaisibles has quit [Quit: Client closed]
foretspaisibles has joined #commonlisp
mgl has quit [Quit: Client closed]
LW has quit [Quit: WeeChat 3.8]
rgherdt has joined #commonlisp
<cpli>
have there been attempts at encoding recursive forms as circular lists? a la factorial: #0=(lambda (n k) (if (= 0 n)) k (#0# (- n 1) (* n k)))
Brucio-61 has quit [Ping timeout: 260 seconds]
<hayley>
Not exactly that, but you seem pretty close to reinventing the Y combinator (in lambda calculus terms).
Brucio-61 has joined #commonlisp
<cpli>
hayley sure i could just (ÿ (f) (ÿ (x) (funcall f (funcall x x))) (ÿ (x) (funcall f (funcall x x))))
<cpli>
but that's no fun
<cpli>
plus with strict evaluation you can say good bye to your stack
<hayley>
There's a funny variant of Y which behaves under strict evaluation.
<hayley>
I suspect circular lists won't make many CL compilers happy, so it wouldn't be too useful.
<Bike>
also it's almost as confusing to read as use of the y combinator is
NotThatRPG has joined #commonlisp
NotThatRPG has quit [Ping timeout: 248 seconds]
<cpli>
Bike, only almost? here have the imperative variant:
<cpli>
(let (k 1) #0=(if (= 0 n) k (progn (setq n (- n 1)) (setq k (* n k)) #0#)))
<buffet>
that's even more cursed
<ogamita>
cpli: this is not a Common Lisp form, unless it's not CL:LET.
<cpli>
valid picolisp.
<ogamita>
ok. There's #lisp
<cpli>
(i've just found out)
<cpli>
oh
tyson2 has joined #commonlisp
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
karlosz has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
enzuru has joined #commonlisp
akoana has joined #commonlisp
tyson2 has joined #commonlisp
nij- has quit [Ping timeout: 260 seconds]
<NotThatRPG>
Anyone had any experience with Eric Schulte's graph library? https://github.com/eschulte/graph ? It seems like it might be the most live CL library for graph algorithms. Trying to avoid having to do a reference implementation of an algorithm using Python and NetworkX!
<ixelp>
GitHub - eschulte/graph: Simple graph data structure and algorithms
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
<mfiano>
Sure I have used that, cl-graph, and digraph. They all have their shortcomings, and it really depends on your application.
tyson2` has joined #commonlisp
tyson2` has quit [Read error: Connection reset by peer]
<NotThatRPG>
mfiano: I used cl-graph a long time ago, and it had a big dependency tail and I found lots of bits of it were unfinished. Haven't tried digraph. Trying graph right now.
<NotThatRPG>
Trying to test it has busted SLY, which I'm not loving.
tyson2 has quit [Ping timeout: 255 seconds]
dcb has quit [Quit: MSN Messenger v2.16.1]
_cymew_ has quit [Ping timeout: 260 seconds]
zxcvz has quit [Quit: zxcvz]
zyni-moe has joined #commonlisp
zyni-moe has quit [Client Quit]
dcb has joined #commonlisp
attila_lendvai has quit [Ping timeout: 260 seconds]
<NotThatRPG>
I'm not a real quicklisp expert -- can anyone tell me why quickload might not be finding systems whose directories are symlinked into ~/quicklisp/local-projects/ ?
<edwlan[m]>
I had that issue sometimes with ccl
<Bike>
NotThatRPG: you may have to run ql:register-local-projects
<edwlan[m]>
I think the symlink handling of various file and path-related functions isn’t completely consistent across implementations
<NotThatRPG>
Interesting: it is a problem with symlinking.
<NotThatRPG>
QL (on Allegro) is finding only directories that are physically in the directory.
<NotThatRPG>
I suppose I could hard-link, but ... that's yucky
<edwlan[m]>
I’ve never seen this with sbcl, and once I load a system in sbcl, it sets up some metadata or something that makes it work with every implementation
<edwlan[m]>
Which has been my workaround here
<edwlan[m]>
(Or using asdf:load-asd explicitly)
<NotThatRPG>
edwlan[m]: Thanks. I will try that. Do you need to load it, or is register-local-projects sufficient?
<edwlan[m]>
I’m not sure, I’ve always loaded it, but my guess is the magic is r-l-p
<masinter>
Tedit treats embedded graphics as an "image object" big character
<NotThatRPG>
edwlan[m]: It works! Thanks so much! I never would have guessed to do that.
<Bike>
yeah, i have run into this too. register-local-projects only seems to work for me in sbcl.
<masinter>
oops
<edwlan[m]>
I guess this would be an opportunity to come up with spec clarifications around how the relevant functions work with symlinks
<edwlan[m]>
I don’t think I’ve ever had an issue on sbcl or lispworks
<edwlan[m]>
Ccl had issues, but I can’t use that implementation anymore on my normal computer (M1 issues).
mgl has joined #commonlisp
kevingal_ has quit [Ping timeout: 265 seconds]
kevingal has quit [Ping timeout: 265 seconds]
msavoritias_ has quit [Remote host closed the connection]
<mfiano>
Quicklisp's local-projects has a documented shortcoming with regard to directory depth, which may be an issue if you symlink a directory target inside local-projects, instead of targeting local-projects itself
<mfiano>
But yes, register-local-projects to work around it
<NotThatRPG>
mfiano: Well, it seems that edwlan[m] is right -- register-local-projects works around it when run on SBCL. After running rlp on SBCL, Allegro is able to load local projects correctly. But running rlp on Allegro is *not* sufficient to fix the problem
<ober>
don't you run out of heap?
<NotThatRPG>
mfiano: I see what you mean about the difference in utility. It's a nuisance that the graph library leaves adding node properties as an exercise for the reader. Attaching a property hash by default would be a lot nicer.
<mfiano>
You ain't joking.
<mfiano>
Sadly, there isn't a very robust and complete general purpose graph theory library for Common Lisp. Most people just write the ad-hoc algorithms they need for their application, which I am beginning to think is the right call for most projects, as it is apparently hard to design one general-purpose enough to be useful
<NotThatRPG>
I suppose I could add a mixin to the graph class that would provide added hash tables and accessors. But that makes it harder to use CL than Python, which I regret.
<NotThatRPG>
mfiano: NetworkX is a reasonable rebuttal to that argument.
<NotThatRPG>
One could get close by adding said mixins to "graph".
<mfiano>
Not really. You could implement half of any of those libraries in a day for a special purpose.
<mfiano>
It's generalizing them that is the problem.
<mfiano>
And I doubt you would need half of their algorithms.
<mfiano>
Even for complex dual graphs
<NotThatRPG>
Right, but if you want to do a rapid prototype, NetworkX is the bomb
<NotThatRPG>
It has a staggering number of algorithms baked in. Graph has a bunch of them, but having to add properties by hand is a serious disincentive.
<NotThatRPG>
If py4cl was just a *little bit* easier to use...
<edwlan[m]>
It supports symbols as nodes
<edwlan[m]>
And symbols come with plists :)
<NotThatRPG>
Another problem is that graph uses TYPE-OF in a bunch of places, which means that adding subclasses to support property annotations is gonna require more surgery
<NotThatRPG>
edwlan[m]: That's true. I kind of hate using symbol plists, but that would be a good way to get over the hump quickly. Thanks for the suggestion!
<NotThatRPG>
edwlan[m]: Unfortunately, that *won't* work for edges.
<Shinmera>
I did write Flow which has stuff that other graph libraries typically do not, namely specific connection ports on nodes that can also carry data/semantics.
<NotThatRPG>
Shinmera: Thanks, I will have a look!
<Shinmera>
It maps more to the "flow chart" mental model than the "mathematical graph" model.
<edwlan[m]>
Using #:uninterned symbols at least would solve the global side effect issue
<NotThatRPG>
edwlan[m]: package hygiene would be sufficient.
shka has quit [Ping timeout: 264 seconds]
<NotThatRPG>
More worrisome is the limitation on edges. You can't associate properties with ordered pairs as easily. And... if you have unlabeled edges you can't extend graph to multi-graphs.
<NotThatRPG>
The other issues seem fixable, but if you want multigraphs, the graph library's edge representation is going to be a real problem.
<NotThatRPG>
Fortunately, I don't need them right now.
<mfiano>
It is. I had to write a lot of custom code and I forgot exactly how I solved it but it wasn't pretty (when I needed a multigraph for my color theory library)
<mfiano>
Beware of cl-graph's BFS and DFS (one of which isn't exported, and the other one frequently recurs forever on some graphs.
<mfiano>
)
<NotThatRPG>
Well, thanks everyone for all the help, advice, and discussion. I have to head out now...
<NotThatRPG>
Yeah, I'm not trying cl-graph agains.
NotThatRPG has quit [Ping timeout: 256 seconds]
Krystof has quit [Ping timeout: 240 seconds]
Demosthenex has quit [Ping timeout: 255 seconds]
Demosthenex has joined #commonlisp
karlosz has joined #commonlisp
morganw has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
rgherdt has quit [Remote host closed the connection]