monkey_ has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.2)]
codingquark has joined #racket
ttree has quit [Ping timeout: 250 seconds]
arpunk has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 250 seconds]
jao has quit [Ping timeout: 272 seconds]
ur5us has joined #racket
ur5us has quit [Ping timeout: 250 seconds]
mfiano has quit [Quit: WeeChat 3.7.1]
mfiano has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 250 seconds]
runrin has joined #racket
skapata has quit [Read error: Connection reset by peer]
ur5us has joined #racket
manicennui has joined #racket
mfiano has quit [Quit: WeeChat 3.7.1]
mfiano has joined #racket
ur5us has quit [Quit: Leaving]
mfiano has quit [Quit: WeeChat 3.7.1]
mfiano has joined #racket
mfiano has left #racket [WeeChat 3.7.1]
TCZ has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 260 seconds]
badkins has joined #racket
TCZ has quit [Quit: Leaving]
badkins has quit [Ping timeout: 250 seconds]
badkins has joined #racket
skapata has joined #racket
badkins has quit [Ping timeout: 260 seconds]
badkins has joined #racket
badkins has quit [Ping timeout: 250 seconds]
codingquark has quit [Ping timeout: 246 seconds]
badkins has joined #racket
jao has joined #racket
badkins has quit [Ping timeout: 260 seconds]
badkins has joined #racket
msiism has joined #racket
<msiism>
I've implemented command-line parsing using lists. But now I wonder whether vectors might be better suited for the job.
<msiism>
One potential problem I see is the speed of going through a list vs. going through a vector.
<msiism>
I guess that, if you have a lot of operands, storing them in a list and then going through that list will tend to be slower than doing all that vector-based.
<msiism>
There's probably a good reason, `current-command-line-arguments` returns a vector.
<msiism>
Also, obtaining the length of a list probably causes much more overhead than the same operation on a vector.
<ncf>
going through a list exactly once should take as much time as going through a vector exactly once, in theory
<msiism>
I see. But when you need the length, my understanding is that that means going through the whole thing for lists, but not for vectors because they have a fixed length.
<ncf>
right, getting the length of a list will take O(n) operations, while the length of a vector would take O(1)
<msiism>
Okay.
<msiism>
I was thinking that going through a list would take longer than going through a vector because a list might be spread out over a comparably big area of memory, while a vector is stored in consecutive cells.
<ncf>
yes, in practice there are reasons it might not be quite as fast (although the asymptotic complexity is the same); i don't think this should matter much for command line processing, though
<ncf>
but, well, if the built-in functions already return vectors, might as well go with that
<msiism>
Yeah, that's what I thought. I probably shouldn't be converting to a list in the first place.
codingquark has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Ping timeout: 260 seconds]
badkins has joined #racket
codingquark has quit [Ping timeout: 276 seconds]
badkins has quit [Ping timeout: 250 seconds]
codingquark has joined #racket
TCZ has joined #racket
TCZ has quit [Quit: Leaving]
ec has quit [Remote host closed the connection]
ec has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 260 seconds]
TCZ has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 250 seconds]
jeosol has joined #racket
badkins has joined #racket
TCZ has quit [Quit: Leaving]
badkins has quit [Remote host closed the connection]
badkins has joined #racket
msiism has left #racket [Konversation vaporized.]
badkins has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Remote host closed the connection]