OtakuSenpai has quit [Remote host closed the connection]
OtakuSenpai has joined #ponylang
ExtraCrispy has quit [Ping timeout: 256 seconds]
ExtraCrispy has joined #ponylang
OtakuSenpai has quit [Ping timeout: 245 seconds]
OtakuSenpai has joined #ponylang
acarrico has quit [Ping timeout: 245 seconds]
<SeanTAllen>
Hi folks, we are now accepting contributions to help support our ongoing costs for Pony. Thanks in advance for your support! https://opencollective.com/ponyc
_whitelogger has joined #ponylang
jemc has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
jemc has quit [Ping timeout: 252 seconds]
Foaly has joined #ponylang
Foaly has quit [Remote host closed the connection]
Foaly has joined #ponylang
beardhatcode has joined #ponylang
SqREL has joined #ponylang
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
_whitelogger has joined #ponylang
OtakuSenpai has quit [Remote host closed the connection]
OtakuSenpai has joined #ponylang
beardhatcode has quit [Ping timeout: 244 seconds]
OtakuSenpai has quit [Read error: Connection reset by peer]
acarrico has joined #ponylang
ExtraCrispy has quit [Remote host closed the connection]
ExtraCrispy has joined #ponylang
ExtraCrispy has quit [Remote host closed the connection]
ExtraCrispy has joined #ponylang
emilbayes has joined #ponylang
Foaly has joined #ponylang
ExtraCrispy has quit [Remote host closed the connection]
SenasOzys has quit [Ping timeout: 245 seconds]
SenasOzys has joined #ponylang
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
ExtraCrispy has joined #ponylang
endformationage has joined #ponylang
SqREL has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SenasOzys has quit [Ping timeout: 276 seconds]
jemc has joined #ponylang
beardhatcode has joined #ponylang
<beardhatcode>
What does "Stick iso! is not a subtype of Stick iso: iso! is not a subcap of iso" mean? How do I typicaly solve it.
<aturley>
hey beardhatcode
<beardhatcode>
hi
<aturley>
usually that means you've tried to assign assign an object that already has an iso reference to another iso reference without getting rid of the first reference.
<aturley>
sometimes you'll see it if you have a function and you've said it returns `iso` when what you actually want is to return `iso ^`.
<aturley>
do you have any code i could look at?
<aturley>
i can try to cobble together an example for you ...
<beardhatcode>
And how do i create an ephemeral iso?
<aturley>
`Eating` and `Thinking` ... i'm already loving it.
SenasOzys has joined #ponylang
<aturley>
there's a few ways to create an ephemeral iso.
<aturley>
1. you can `consume` an existing iso
<aturley>
2. you can do a destructive read of an iso reference -- the old value is now an ephemeral iso
<aturley>
3. if you're creating an object, you can create it inside a recover block and use `recover iso` to make it an iso
<aturley>
4. you make the object's construct `iso` so that it returns an iso object
ExtraCrispy has quit [Remote host closed the connection]
<beardhatcode>
Ok, my problem is at line 80. I do _sticksOwn = (consume s as Stick iso, _sticksOwn._2);
<aturley>
yup, i'm looking at that right now.
<aturley>
beardhatcode you're doing some tricky stuff :)
<beardhatcode>
I'm trying to get what the capabilities are
<aturley>
so ... first off, you should be able to get rid of the `as Stick iso`, because consume will work on `s` whether it refers to a `Stick iso` or `None`.
<beardhatcode>
so I'm implementing the dining philosophers by moving the ownership to the philosopher
<aturley>
yup.
<vaninwagen>
beardhatcode: that is a nice exercise for learning pony. I once tried it but gave up
<aturley>
haha
<vaninwagen>
Would you mind sharing your results?
<aturley>
maybe we should have a warning on the website.
<aturley>
"do not attempt the dining philosophers as your introduction to refcaps"
<beardhatcode>
vaninwagen: I have it solved already but not with passing ownership
ExtraCrispy has joined #ponylang
<aturley>
tuples with isos always make me nervous. no matter what i do i always seem to think about them wrong.
<beardhatcode>
I'll try to get rid of the tupel
<vaninwagen>
The nain confusion for me comes from the fact that tuples are no refcapped entity on their own, only their elements are
<vaninwagen>
Yet you can consume a tuple as a whole
<aturley>
yeah
<aturley>
beardhatcode i'm not going to say you can't do this, but it might be easier to pull off if you have a class with two public fields rather than trying to represent this as a tuple.
<beardhatcode>
I'm doing it with two fields now
<beardhatcode>
(well I'm still refactoring)
<aturley>
cool, let us know how it goes.
<vaninwagen>
We hit the 10 backers on opencollective, i am honestly shocked and happy!
<vaninwagen>
We gonna have a champaign bottle and cuban cigars on every sync call lol
ExtraCrispy has quit [Ping timeout: 256 seconds]
<beardhatcode>
Why am I getting "can't read a field through Stick tag" from fun eq(that: box->Stick): Bool => this._id == that._id
beardhatcode has quit [Quit: beardhatcode]
<SeanTAllen>
vaninwagen: i'm hoping to get $5 contribution from every one of our twitter followers. i might be in for disappointment
<vaninwagen>
beardhatcode: a satisfying answer will take time, i will deliver in 1-2 hours or so
<jemc>
meaning that the type `box->(Stick iso)` resolves to `Stick tag`
<jemc>
A `tag` reference is opaque, meaning you can't read fields from it
bitcrusher has joined #ponylang
<jemc>
what you probably want is to define your parameter as `that: Stick box` instead of `that: box->Stick`
<jemc>
this is how `eq` methods are usually defined - they take a `box` receiver (`fun box`, the implicit default expansion of `fun`) and a `box` parameter to compare them
<jemc>
the `that: box->A` format is used for generics, where `A` is a type parameter
<jemc>
this works when the type parameter `A` is constrained to be of the cap set `#read`, which excludes `iso`
<jemc>
let me know if you need more detail or clarity on any of that explanation
<vaninwagen>
Yeah jemc delivered
<vaninwagen>
^5 jemc
<jemc>
(I finally have my new laptop, which is significantly reducing the friction for me to idle on IRC and chime in with help - yay!)
<SeanTAllen>
sweet
ivarsfg has joined #ponylang
ivarsfg has quit [Client Quit]
SqREL has joined #ponylang
SenasOzys__ has joined #ponylang
SenasOzys has quit [Ping timeout: 252 seconds]
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
SqREL has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]