SenasOzys has quit [Remote host closed the connection]
SenasOzys has joined #ponylang
SenasOzys has quit [Client Quit]
SenasOzys has joined #ponylang
SenasOzys has quit [Client Quit]
SenasOzys has joined #ponylang
SenasOzys has quit [Client Quit]
SenasOzys has joined #ponylang
SenasOzys has quit [Remote host closed the connection]
SenasOzys has joined #ponylang
SenasOzys has quit [Remote host closed the connection]
_whitelogger has joined #ponylang
_whitelogger has joined #ponylang
_whitelogger has joined #ponylang
_whitelogger has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ponylang
Foaly has joined #ponylang
mahmudov has quit [Ping timeout: 268 seconds]
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
mahmudov has joined #ponylang
EEVV has joined #ponylang
<EEVV>
hey what is a subcap error?
<EEVV>
what is a subcap
<vaninwagen>
I think it is analogous to a subtype: a sub capability
<vaninwagen>
Something that a capability can be replaced with (i might not be 100% correct on this typesystem stuff)
<vaninwagen>
If you give more context i could provide some more help EEVV
<EEVV>
vaninwagen, I took a bit of a break from pony-lang, I was working on a project... I am changing the project a bit and I guess I messed up somewhere: I have a variable in my TCPConnectionNotify actor which stores a glorified array `ProtoBuffer`, most of the functions I do on the array are `fun ref`, but I tried setting the variable's type to `ProtoBuffer ref` with no luck
<EEVV>
it says that my variable is `box` but I set it to `ref`... maybe the problem is deeper than this? I do not understand reference capabilities that well
<EEVV>
I guess I mostly used the reference capabilities it wanted
Foaly has joined #ponylang
<EEVV>
ok, I think I had to change a function to `fun ref` but I am still confused.... Is `fun ref` a function that will change the local variables?
<EEVV>
I guess I'm just stupid lol
<EEVV>
also is it possible to copy a `ref` type to `val` without doing it manually?
<vaninwagen>
You are definitely not stupid
<vaninwagen>
After all you are here
<vaninwagen>
a fun ref is a function that can mutate fields on the receiver, yes
<vaninwagen>
If you have a simple fun (without the ref) then this is fun box
<EEVV>
vaninwagen, ok is it possible to copy `ref` to make a `val`?
<EEVV>
without doing it by hand?
<EEVV>
last time I think someone said there is an issue with it, but maybe it is possible now?
<EEVV>
I am also confused on `recover` and `consume`
<EEVV>
they seem to be opposites of each other, but why does `recover` take a block of statements?
<EEVV>
maybe i am asking too much
<EEVV>
cheat sheet says recover is to lift a capability and consume is getting rid of alias
<EEVV>
ok I'll just ask last question and I will try to figure out other problems on my own. When should I create actors? Right now I am just doing as STD tells me to (TCPConnectionNotify is actor, etc..)
<EEVV>
before you answer consider that I haven't used threading much elsewhere
<vaninwagen>
fun box means, you only see the receiver (mostly known as this) as read-only, so you cannot modify any fields
<vaninwagen>
EEVV: copying ref to val would be unsafe
<EEVV>
vaninwagen, I mean in the same actor
<vaninwagen>
Because a val is sendable, you can send it to another actor, while ref is not sendable, but doesnt restrict how many references you have locally
<vaninwagen>
EEVV still not possible, because the compiler doesnt know too well
<EEVV>
what I mean by copy is create an array that just has the same elements, I think deep copy is the word
<vaninwagen>
This is definitely possible
<EEVV>
Array[U8 val] ref ->> Array[U8 val] val
<vaninwagen>
Sorry, i misunderstood you apparantly
<EEVV>
I did it by using an Array[U8 val] iso, filled it with copies from the `Array[U8 val] ref` then consumed it to `val`