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
amclain has quit [Quit: Leaving]
amclain has joined #ponylang
amclain has quit [Quit: Leaving]
jemc has quit [Ping timeout: 260 seconds]
montanonic has quit [Ping timeout: 276 seconds]
jkaye has joined #ponylang
jemc has joined #ponylang
Perelandric has quit [Ping timeout: 264 seconds]
montanonic has joined #ponylang
c355e3b has quit [Quit: Connection closed for inactivity]
jkaye has quit [Ping timeout: 240 seconds]
jkaye has joined #ponylang
Dyserna__ has joined #ponylang
jkaye has quit [Ping timeout: 250 seconds]
mcguire1 has quit [Ping timeout: 250 seconds]
Dyserna_ has quit [Ping timeout: 252 seconds]
jkaye has joined #ponylang
jkaye has quit [Ping timeout: 276 seconds]
montanonic has quit [Ping timeout: 265 seconds]
montanonic has joined #ponylang
mcguire has quit [Ping timeout: 265 seconds]
mcguire has joined #ponylang
jemc has quit [Ping timeout: 264 seconds]
prettyvanilla has quit [Quit: Konversation terminated!]
gsteed has joined #ponylang
montanonic has quit [Ping timeout: 244 seconds]
c355e3b has joined #ponylang
michael_campbell has joined #ponylang
FunkyBob has left #ponylang [#ponylang]
_andre has joined #ponylang
jemc has joined #ponylang
Perelandric has joined #ponylang
TwoNotes has joined #ponylang
trapped has joined #ponylang
SilverKey has joined #ponylang
shelajev has joined #ponylang
amclain has joined #ponylang
runehog has quit [Remote host closed the connection]
TwoNotes has left #ponylang [#ponylang]
SilverKey has quit [Read error: Connection reset by peer]
prettyvanilla has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
runehog has joined #ponylang
montanonic has joined #ponylang
Matthias247 has joined #ponylang
gsteed has quit [Ping timeout: 264 seconds]
shelajev has quit [Remote host closed the connection]
<Perelandric> Well, I'm just stuck on a generics problem that on the surface seems like it would be pretty simple.
<Perelandric> It comes down to the generic type having a `clone()` method.
<Perelandric> My head is spinning from all the different combinations I've tried.
<Perelandric> If anyone has a moment to review some code, it would be much appreciated.
<Perelandric> The above link is to an earlier, simpler version to keep things cleaner.
<jemc> I'm not surprised that you're having issues - a general purpose `clone` in Pony with generics has some problems that many of us have discussed before, and I'm not sure it can be really solved without some form of specialization
<Perelandric> jemc: That alone is actually a pretty big relief. I was going nuts! :)
<jemc> FYI, this is what I'm talking about with "specialization" - https://github.com/ponylang/ponyc/issues/683
<jemc> I will take a look at the gist
<Perelandric> That would be great. Thank you.
shelajev has joined #ponylang
gsteed has joined #ponylang
shelajev has quit [Client Quit]
<sylvanc_> speaking of which...
sylvanc_ is now known as sylvanc
<sylvanc> we can do an `isolate` version of clone, for Array[A]
<sylvanc> fun isolate(): Array[iso->this->A!] iso^
<sylvanc> with the same body as `clone`
<jemc> well, I like the name better than the earlier-proposed `iso_clone` :)
<jemc> mainly because it seems obnoxious in Pony to have a convention of prepending rcaps as part of the identifier
<sylvanc> yeah i agree :)
<sylvanc> also, not wedded to that name - i tend to pick sub-optimal names :)
<sylvanc> sync call in 20 minutes, for anybody interested!
<Perelandric> I always enjoy the sync call recording when available.
<Perelandric> It's my weekly Pony porn. ;)
<sylvanc> :)
<sylvanc> i'm the replacement SeanTAllen today, so i'll make sure to record it
<sylvanc> you're also welcome to join the call, Perelandric
<Perelandric> Thank you. I may at some point in the future.
montanonic has quit [Ping timeout: 250 seconds]
<jemc> Perelandric: there are some other issues to work past to get to the following problem, but the crux of it, the problem is:
<jemc> errr... hold on
amclain has quit [Quit: Leaving]
amclain has joined #ponylang
montanonic has joined #ponylang
<SeanTAllen> jemc sylvanc: i'll do the house keeping around the two merged RFCs later tonight/tomorrow morning.
_andre has quit [Quit: leaving]
<jemc> Perelandric: did you catch george steed's pony VUG presentation last week?
<Perelandric> jemc: Yes, on the alternate model for rcaps, right? I should watch it again to get a better grasp.
<jemc> once I clear away a few minor issues with these changes: https://www.diffchecker.com/wgwjcfv2
<jemc> then the problem that remains is that you're trying to call `clone()` on a `Foo iso` that is still technically part of the array
<jemc> in this case, what you're doing is safe, since you don't retain a reference to the element you call `clone` on
<jemc> but the compiler doesn't see it as a safe case of auto recover
<jemc> automatic receiver recovery, I mean
<jemc> I'm wondering if george's more permissive model for viewpoint adaptations would make the compiler see it as safe, but I'm not totally sure of this
<jemc> for now, your best bet for working around the problem is to refactor to use a destructive read
<jemc> so something like `let x = values(i) = Foo.create(); let item = x.clone(); values(i) = consume x`
<jemc> that will give you exclusive ownership of the isolated reference, then you can clone it, then you put it back
<jemc> however, unfortunately, it requires being able to create a "placeholder" value (the `Foo.create()`) that can stay in the place of the `x` you extracted
<jemc> if goerge's revised model for viewpoint adaptation doesn't solve this, we could probably add an `Array.upsert` method which works like the `HashMap.upsert` method that SeanTAllen added
<Perelandric> Right now I'm getting "argument is not a subtype of parameter" on `let x = values(i) = Foo.create()`
<Perelandric> Pointing at the `= Foo.create()` assignment
<Perelandric> Hadn't thought about trying the `U^` though. That's interesting.
<Perelandric> Let me see what I'm missing.
<jemc> sorry, the Foo should be T, and there should be a recover block since your `create` method in your interface is implicitly `ref`
<jemc> however, after that you run into the problem of the fact that you can't mutate the array without your `fun clone` being `fun ref clone`... which is obviously not ideal
<Perelandric> Oh, yes of course. I should have seen that. Shame on me.
<jemc> hm, I wonder if Praetonus' object copying idiom would be helpful here: https://github.com/ponylang/rfcs/pull/22/files
<jemc> that is, I wonder if using `new from` in `MyTrait` would be superior to using `fun clone`
<jemc> no, you'd still have the problem of `values(i)` not being a subtype of `box`
<Perelandric> Still can't get it to compile on the same line as before, even with `T` and the `recover` wrapping the `.create()` call.
<Perelandric> In this part... `class Layers[T: MyTrait[T] iso]`, does this mean that `Foo` will be `iso` everywhere `T` is used?
<jemc> but it requires `fun clone` to be `fun ref clone`, which is again, not ideal for your purposes probably
<Perelandric> I think for now, that's going to be fine with `ref`. At least I'll apply this to the actual code and see if I can swing it.
<Perelandric> Either way, I learned a bunch, and will take this info and do more tinkering.
<Perelandric> In a couple days, if I'm not getting it to do what I need, I'll stop back here.
<Perelandric> ...or will just learn Java.
<Perelandric> (kidding!)
<Perelandric> Thank you for all the help, jemc!
runehog has quit [Remote host closed the connection]
runehog has joined #ponylang
<jemc> no problem - sorry the answer wasn't more satisfying
<jemc> hopefully george's rcap checking model will help cases like this (but I'm still not totally sure that it will)
runehog has quit [Ping timeout: 276 seconds]
unbalanced has joined #ponylang
lukecheeseman has joined #ponylang
unbalanced has quit [Client Quit]
lukecheeseman has quit [Ping timeout: 264 seconds]
mcguire has quit [Ping timeout: 265 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
mcguire has joined #ponylang
runehog has joined #ponylang
gsteed has quit [Quit: Leaving]
<emilbayes> Is there any convention for package names in pony? ie. patterns to use when looking for public repositories for pony code. I'm wanting to learn, and enjoy so the most by reading other peoples code
<emilbayes> (i have read the tutorial)
mcguire1 has joined #ponylang
<emilbayes> Also, someone should do a Pony https://learnxinyminutes.com/
atk has quit [Quit: You should never see this quit message.]