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
<cquinn> Thanks vaninwagen,
<cquinn> I am writing an API and want to make sure the caps are friendly for users to pass array literal directly without any extra syntax. I guess box is the most flexible cap for method args.
<doublec> cquinn: generally you can leave the caps out and just leave it at the defaults in function arguments
<doublec> cquinn: if you make them box then the function can't modify them
<cquinn> In my case the args are maps that I will copy the elements out of. Although I guess in some cases I could just keep the original when I won't modify it.
nyarum has joined #ponylang
nyarum has quit [Ping timeout: 240 seconds]
<cquinn> it would be nice if there was an easy notation for making val literals.
<cquinn> Another ad hoc capabilities question: should new methods return ephemeral forms of caps? E.g. Array.create(n) should return a ref^ ? Since that is normally the only alias of the new object
<doublec> cquinn: create is a constructor so it returns the ephermeral type by default
<doublec> cquinn: it's mentioned here https://tutorial.ponylang.org/capabilities/aliasing.html
<cquinn> ah, makes sense. I'm just finally grokking the ephemeral forms now. I finally watched George Steed's video from last august and that helped
<cquinn> ok
nyarum has joined #ponylang
nyarum has quit [Ping timeout: 246 seconds]
vaninwagen_ has joined #ponylang
vaninwagen__ has joined #ponylang
vaninwagen__ has quit [Client Quit]
vaninwagen__ has joined #ponylang
vaninwagen__ has quit [Client Quit]
vaninwagen has joined #ponylang
vaninwagen_ has quit [Quit: Ex-Chat]
vaninwagen has quit [Ping timeout: 255 seconds]
vaninwagen has joined #ponylang
nyarum has joined #ponylang
nyarum has quit [Ping timeout: 246 seconds]
_andre has joined #ponylang
BlackYoup has quit [Quit: ZNC - http://znc.in]
BlackYoup has joined #ponylang
vaninwagen has quit [Ping timeout: 255 seconds]
vaninwagen has joined #ponylang
_whitelogger has joined #ponylang
vaninwagen has quit [Ping timeout: 240 seconds]
vaninwagen has joined #ponylang
vaninwagen has quit [Ping timeout: 260 seconds]
vaninwagen has joined #ponylang
vaninwagen has quit [Ping timeout: 246 seconds]
jemc has joined #ponylang
endformationage has joined #ponylang
obadz has quit [Ping timeout: 240 seconds]
obadz has joined #ponylang
jordan_ has joined #ponylang
<jordan_> hi folks im a beginner and i am wondering if ponylang has a "std::cin" equivalent of C++ and if so where I can learn more about implementing it
<jemc> jordan_: as of right now, there does not exist a common interface for input streams, which is something I'd like to change, but it's complicated by the fact that most input stream notifier objects also need stream-specific error handling methods
amclain has joined #ponylang
<jordan_> @jemc ok thats fine thanks!
<jemc> for example, a `TCPConnectionNotify` must implement `fun ref received(conn: TCPConnection ref, data: Array[U8] iso)`, but it also has to implement error handling methods like `connect_failed`
<jemc> cquinn: the pain point you're hitting with array literal caps is one I intend to solve by improving inference
<jemc> that is, an array literal is a `ref` by default, just because that was determined to be the most likely cap that you want when declaring it
<jemc> but in cases where you are passing an array literal directly to a method as an argument (or assigning it to a reference with an explicit type), the array literal could/should just use the cap that is expected by the right hand side
<jemc> (if it is possible, that is)
<jordan_> i have another pattern-based question: if in actor Main i call a behaviour of an actor A1 (which leads to a series of behaviours of A1_children for.e.g), and then call a behaviour of actor B2, is there a way to pattern to guarantee the behaviour of B2 is executed after all A1 (and its children) have completed?
<jemc> jordan_: in general, in Pony if you want to have a "happens before" relationship between event X and event Y, you have to create a causal link from X to Y
<jemc> there's different ways to do it, but one option in your case might be:
<jordan_> ic, i figured i have to make the link explicit (such as calling B2 from the last terminating A1 child behaviour)
<jemc> yeah, basically that's what I was going to suggest
<jemc> there are different ways to accomplish that, and I think it depends on how coupled you want the design of Main to be with A1, and A1 with its children
<jemc> if you don't mind being coupled, the most straightforward way is to pass Main to A1, and pass A1 to its children
<jemc> if you don't want the inner parts to be coupled to the outer parts, you could pass a lambda `val` inward that represents "what to do when the task is finished"
<jemc> or you could potentially use the `promises` package if that suits your use case better
<jordan_> thanks @jemc i will look into ur suggestions and promises package
<cquinn> yes, @jemc, that would be a nice addition. Would it help at all if array literals were ref^ (if they aren't already)?
Matthias247 has joined #ponylang
<jemc> they should be ephemeral already
jordan_ has quit [Quit: Page closed]
gornikm_ has joined #ponylang
pcarrier_ has joined #ponylang
BlackYoup_ has joined #ponylang
BlackYoup has quit [*.net *.split]
gornikm has quit [*.net *.split]
pcarrier has quit [*.net *.split]
katafrakt[m] has quit [*.net *.split]
kempe has quit [*.net *.split]
gornikm_ is now known as gornikm
pcarrier_ is now known as pcarrier
kempe has joined #ponylang
katafrakt[m] has joined #ponylang
obadz has quit [Ping timeout: 240 seconds]
obadz has joined #ponylang
nyarum has joined #ponylang
nyarum has quit [Remote host closed the connection]
pduncan has joined #ponylang
pduncan has quit [Ping timeout: 258 seconds]
jordan__ has joined #ponylang
jordan__ has quit [Client Quit]
pduncan has joined #ponylang
vaninwagen has joined #ponylang
_andre has quit [Quit: leaving]
bougyman has quit [Quit: ZNC 1.6.4 - http://znc.in]
bougyman has joined #ponylang
bougyman has quit [Changing host]
bougyman has joined #ponylang
irx[m] has quit [*.net *.split]
omarkj has quit [*.net *.split]
omarkj has joined #ponylang
irx[m] has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
vaninwagen has quit [Ping timeout: 260 seconds]