michael_campbell has quit [Read error: Connection reset by peer]
michael_campbell has joined #ponylang
amclain has joined #ponylang
mcguire2 has joined #ponylang
so_ has joined #ponylang
Fuuzetsu_ has joined #ponylang
sylvanc_ has joined #ponylang
gornikm has quit [*.net *.split]
sylvanc has quit [*.net *.split]
so has quit [*.net *.split]
Fuuzetsu has quit [*.net *.split]
Fuuzetsu_ is now known as Fuuzetsu
gornikm has joined #ponylang
SilverKey has joined #ponylang
amclain has quit [Ping timeout: 244 seconds]
amclain has joined #ponylang
_andre has quit [Quit: leaving]
SilverKey has quit [Quit: Halted.]
gornikm has quit [Changing host]
gornikm has joined #ponylang
Matthias247 has joined #ponylang
SilverKey has joined #ponylang
<SeanTAllen>
jemc: we wrote a split_in_place ala trim_in_place, just PR it?
<jemc>
SeanTAllen: what does it mean to "split in place"? the result of a split operation is an Array[String], so I don't understand how it could be "in place", which implies it mutates the original
SilverKey has quit [Quit: Halted.]
montanonic has joined #ponylang
<SeanTAllen>
You only do it on a val. You get back an array of string val without allocating new memory jemc.
<SeanTAllen>
Perhaps a better name?
<doublec>
How does that work if strings are null terminated?
<jemc>
SeanTAllen: yeah, that doesn't sound like "in place" to me
<jemc>
SeanTAllen: the reason I used the term `trim` in my RFC was to differentiate from the existing `slice` method
<jemc>
that is, `trim` was the zero-copy equivalent of the `slice` operation
<jemc>
and `trim` is the one that operates on a `val`, while `trim_in_place` operates on a `ref`
<jemc>
so following that convention, I would expect the new method you're proposing to use a different term (other than `split`) or to change the name of the current `split` method to use a different term
<jemc>
I'm not totally sure what that term should be, in either case
<jemc>
doublec: the resulting strings would not be null-terminated (except the last one)
<jemc>
doublec: String now has methods for checking/ensuring that a String is null terminated before passing it to FFI
<doublec>
jemc: ah, i'm out of date, thanks :)
<jemc>
no worries - this was relatively recently added (though the RFC is kind of old)
<jemc>
anyway, in practice it's not *that* often that you need to pass a String to an FFI that is not length-specified
<jemc>
and we shouldn't be crippling performance of other uses of String for those needs
<SeanTAllen>
jemc: so perphaps new one is split (on val) and old is "split_in_place" on ref and split_in_place creates new strings when splitting?
<jemc>
I don't think "in place" makes sense when the receiver isn't mutated - to me, that's the essence of what "in place" tells you in a method name
<jemc>
however, something like `split_copy` or `split_clone` could make sense
<doublec>
split_view, split_shared, split_slice?
<jemc>
possibly `split_trim` could be the `val` version, referencing the fact that it operates the same as if you had called `trim` a bunch of times
<SeanTAllen>
we could have some fun ruby shorthand like ? ! # and what not...
<SeanTAllen>
im half joking and half serious
<doublec>
Coming from scheme and dylan I'm used to that and like it
Matthias247 has quit [Read error: Connection reset by peer]