<sarna>
vaninwagen: hmm, I'll try it out. thanks again!
<vaninwagen>
i am trying to build a persistent map of ByteSeq as key and value, and i want to use structural equality based on the content of the ByteSeq key (be it Array[U8] or String).
<vaninwagen>
now i see String using ponyint_hash_block to obtain its hash. would this also work for Array[U8] as they are kind of the same?
<vaninwagen>
and would this also work for any Array? Even for Array[SomeClass] ?
codec1 has quit [Quit: Leaving.]
mahmudov has quit [Quit: Leaving]
mahmudov has joined #ponylang
_andre has joined #ponylang
codec1 has joined #ponylang
vaninwagen has quit [Ping timeout: 248 seconds]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
codec1 has quit [Quit: Leaving.]
mahmudov has quit [Ping timeout: 268 seconds]
mahmudov has joined #ponylang
mahmudov has quit [Remote host closed the connection]
khan has quit [Quit: khan]
khan has joined #ponylang
codec1 has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
inoas has joined #ponylang
milisarge has quit [Ping timeout: 252 seconds]
milisarge has joined #ponylang
vaninwagen has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Quit: khan]
jemc has joined #ponylang
sarna[pc] has joined #ponylang
sarna__ has joined #ponylang
vaninwagen has quit [Ping timeout: 240 seconds]
dipin has joined #ponylang
mahmudov has joined #ponylang
mahsav has joined #ponylang
milisarge has quit [Ping timeout: 240 seconds]
dougmacdoug has joined #ponylang
Praetonus has joined #ponylang
jwashton has joined #ponylang
mahsav has quit [Ping timeout: 240 seconds]
sarna[pc] has quit [Remote host closed the connection]
sarna__ has quit [Remote host closed the connection]
sarna has quit [Quit: Connection closed for inactivity]
gokr has quit [Ping timeout: 248 seconds]
gokr has joined #ponylang
inoas has quit [Quit: inoas]
inoas has joined #ponylang
milisarge has joined #ponylang
jwashton has quit [Remote host closed the connection]
jwashton has joined #ponylang
jwashton has quit [Ping timeout: 256 seconds]
inoas has quit [Quit: inoas]
<codec1>
Hi everyone
<codec1>
a quick question, if I have an array of type Array[U8] ref
<codec1>
can I somehow call somehow trim on it AND modify it again later on ?
milisarge has quit [Ping timeout: 248 seconds]
milisarge has joined #ponylang
<jemc>
is `trim_in_place` not what you want?
khan has joined #ponylang
jwashton has joined #ponylang
jemc has quit [Ping timeout: 256 seconds]
nisanharamati has joined #ponylang
gokr has left #ponylang [#ponylang]
jemc has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
jwashton has quit [Remote host closed the connection]
khan has quit [Quit: khan]
khan has joined #ponylang
user10032 has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
<jemc>
vaninwagen: you could theoretically use `ponyint_hash_block` for any Array, with two caveats:
<jemc>
1. you'd need to account for the sizeof() the type, multiplying the array size by that number of bytes to get the total buffer size
<jemc>
2. you'd be comparing the elements by identity, so if they wanted to implement some form of their own structural equality, you'd be missing out on that
sarna has joined #ponylang
codec1 has joined #ponylang
<codec1>
jemc thanks
<jemc>
no problem
mahsav has joined #ponylang
milisarge has quit [Ping timeout: 264 seconds]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
bbryan has joined #ponylang
_andre has quit [Quit: leaving]
dipin has quit [Quit: dipin]
vaninwagen has joined #ponylang
<vaninwagen>
jemc, yeah, thats what i thought to, just wanted to check again.
<vaninwagen>
to be clear, it would nonetheless work for arrays of primitives, as for example Array[U8] , right?
sarna has quit [Quit: Connection closed for inactivity]
<jemc>
for *numeric* primitives (machine words), yes - as long as your account for the sizeof point I made above
<jemc>
so basically, `array.size() * (I.bitwidth() / 8)` for an integer type referenced as `I`
jemc has quit [Ping timeout: 240 seconds]
user10032 has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
user10032 has joined #ponylang
<vaninwagen>
jemc yeah, thats what i thought :)
aaaaa has joined #ponylang
aaaaa has quit [Client Quit]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
sarna has joined #ponylang
<sarna>
is there a way of including a string into the executable? like Rust's include_str! macro
<sarna>
or do I just use a multiline string somewhere
<dougmacdoug>
seems like a multiline on a primitive would work
<dougmacdoug>
but i'm pretty new to pony and i dont really know the compiler
<sarna>
yeah, that's what I'm going to use
<vaninwagen>
sarna, what does include_str! in rust do?
<sarna>
vaninwagen: `foo = include_str!("path")` is the same as `foo: String = "a very long string"`
<vaninwagen>
ah, it takes it from a file
<sarna>
it's convenient because you can have those long boys in separate files, instead of really long multiline strings
<sarna>
yeah
<sarna>
and it's included in the executable
<Praetonus>
sarna: No, there is no way to do that in Pony currently
<sarna>
Praetonus: I see. not that it's a game changing feature :)
jwashton has joined #ponylang
jwashton_ has joined #ponylang
jwashton_ has quit [Remote host closed the connection]
jwashton_ has joined #ponylang
jwashton has quit [Ping timeout: 256 seconds]
jwashton_ has quit [Ping timeout: 248 seconds]
vaninwagen has quit [Ping timeout: 248 seconds]
jemc has quit [Ping timeout: 260 seconds]
user10032 has quit [Quit: Leaving]
bbryan has left #ponylang [#ponylang]
jemc has joined #ponylang
bimawa4 has quit [Ping timeout: 256 seconds]
Praetonus has quit [Ping timeout: 256 seconds]
codec1 has quit [Read error: Connection reset by peer]