jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
atk has quit [Quit: Well this is unexpected.]
atk has joined #ponylang
oraoro has quit [Ping timeout: 268 seconds]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oraoro has joined #ponylang
dipin has joined #ponylang
samuell has quit [Remote host closed the connection]
_whitelogger has joined #ponylang
dipin has quit [Quit: dipin]
martinium has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user10032 has joined #ponylang
user10032 has quit [Quit: Leaving]
gokr has joined #ponylang
samuell has joined #ponylang
vaninwagen has joined #ponylang
oraoro has quit [Ping timeout: 268 seconds]
oraoro has joined #ponylang
samuell has quit [Quit: Leaving]
benq has joined #ponylang
codec1 has joined #ponylang
codec2 has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
bimawa has quit [Quit: WeeChat 1.9.1]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
ShalokShalom has joined #ponylang
ShalokShalom_ has quit [Ping timeout: 240 seconds]
_andre has joined #ponylang
codec2 has quit [Ping timeout: 260 seconds]
oraoro has quit [Ping timeout: 268 seconds]
samuell has joined #ponylang
samuell has quit [Remote host closed the connection]
codec1 has joined #ponylang
benq has quit [Quit: Textual IRC Client: www.textualapp.com]
oraoro has joined #ponylang
vaninwagen has quit [Ping timeout: 240 seconds]
dipin has joined #ponylang
vaninwagen has joined #ponylang
vaninwagen has quit [Ping timeout: 248 seconds]
vaninwagen has joined #ponylang
trevorriles has joined #ponylang
oraoro has quit [Ping timeout: 248 seconds]
oraoro has joined #ponylang
oraoro has quit [Ping timeout: 248 seconds]
oraoro has joined #ponylang
oraoro has quit [Ping timeout: 248 seconds]
oraoro has joined #ponylang
oraoro has quit [Ping timeout: 248 seconds]
vaninwagen has quit [Ping timeout: 240 seconds]
trevorriles has quit [Ping timeout: 268 seconds]
samuell has joined #ponylang
gokr has quit [Ping timeout: 240 seconds]
vaninwagen has joined #ponylang
codec1 has quit [Ping timeout: 248 seconds]
vaninwagen has quit [Ping timeout: 258 seconds]
endformationage has joined #ponylang
user10032 has joined #ponylang
codec1 has joined #ponylang
vaninwagen has joined #ponylang
_andre has quit [Quit: leaving]
gokr has joined #ponylang
jc00ke has joined #ponylang
<jc00ke> Hi there! I'm confounded by trying to `Debug.out` the values of an array, can someone nudge me in the right direction?
<jc00ke> I'm sure it's something simple, but those compiler warnings are confusing me
<jc00ke> file.line() returns a String iso^ and then split returns an Array[String val]
<jc00ke> I figured the compiler would track the String -> Array[String] -> Bool (via Array#contains)
<jc00ke> Oh... when in doubt, google the error message
<jc00ke> Hmm
<jc00ke> I think it's an equality issue... Array#contains default predicate uses is, and I'm guessing I need ==
<vaninwagen> jc00ke, lemme have a look
<codec1> Hi
vaninwagen has quit [Remote host closed the connection]
<codec1> @jc00ke
<codec1> your code should works I think
<codec1> Take a look at this
<codec1> It mostly what you have written and contains return true for the first case
<codec1> since ¨2¨ is in the array but return false in the second case since ¨4¨ is not
vaninwagen has joined #ponylang
<jc00ke> 1) that playground loading a gist is freaking awesome
<jc00ke> 2) when I used a lambda that compares via == then the code works as expected
<jc00ke> lemme wire it up to the playground
<codec1> I think I got it
<codec1> looking at the source code it compare reference instead of values
<jc00ke> Well, scratch that since I'm using a file. Anyway, I've updated https://gist.github.com/jc00ke/68873ed19ab12133df870a326c3c763d
<jc00ke> Is there a better way to do this?
<codec1> I agree that the contains method default implementation is rather confusing
<codec1> About an other you can use a for loop
<codec1> for a more imperative way
<codec1> (no pun intented)
<jc00ke> heh
<jc00ke> Once I get this challenge done and I refactor it, I'll ask for feedback on how to improve
<jc00ke> Gotta go grab lunch before I pass out. Thanks for taking a look!
<codec1> you´re welcome
jc00ke has quit [Quit: Textual IRC Client: www.textualapp.com]
<vaninwagen> jc00ke the particular issue with the String.values() method is this line: https://github.com/ponylang/ponyc/blob/master/packages/builtin/string.pony#L1458
<vaninwagen> it creates a StringBytes(this) where this is an alias, so it is 'String iso!' (i.e. that is equivalent to 'tag') - but StringBytes expects 'box'
<vaninwagen> so the string needs to be sth. that aliases to box (or something that works where box is expected): box, val, ref, iso^ (consumed iso reference)
jtfmumm_ has joined #ponylang
jeremyheiler_ has joined #ponylang
jonrh has quit [Ping timeout: 255 seconds]
jeremyheiler has quit [Ping timeout: 255 seconds]
jtfmumm has quit [Ping timeout: 255 seconds]
jtfmumm_ is now known as jtfmumm
jeremyheiler_ is now known as jeremyheiler
<vaninwagen> jc00ke i have to admit this behaviour is somewhat surprising, but as the iterator needs to keep a hold on to the original String, it makes very much sense, as we shouldn't leak a reference
mindB has quit [Ping timeout: 240 seconds]
M-hrjet has quit [Ping timeout: 255 seconds]
irx[m] has quit [Ping timeout: 240 seconds]
dtz has quit [Ping timeout: 240 seconds]
ada[m] has quit [Ping timeout: 252 seconds]
srenatus has quit [Ping timeout: 252 seconds]
lalomartins[m] has quit [Ping timeout: 264 seconds]
irx[m] has joined #ponylang
user10032 has quit [Quit: Leaving]
ada[m] has joined #ponylang
mindB has joined #ponylang
dtz has joined #ponylang
M-hrjet has joined #ponylang
srenatus has joined #ponylang
lalomartins[m] has joined #ponylang
samuell has quit [Quit: Leaving]
vaninwagen has quit [Ping timeout: 248 seconds]
codec1 has quit [Read error: Connection reset by peer]
jonrh has joined #ponylang