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
jemc has joined #ponylang
jmiven has quit [Quit: co'o]
jmiven has joined #ponylang
<emilbayes> This example mentions callbacks as a possible way to handle a reply from an async operation: https://github.com/ponylang/ponyc/blob/493cc93a072fefefe98219c20cb6019d0d1e931a/examples/producer-consumer/main.pony#L7
<emilbayes> I haven't been able to find anything on callbacks in any of the official pony repos, only the C FFI callbacks. Is what's meant a lambda like in Node.js or did the author have something else in mind?
<emilbayes> Oh, ping SeanTAllen. Seems you wrote this example :)
jemc has quit [Ping timeout: 250 seconds]
graaff has joined #ponylang
gornikm_ has joined #ponylang
sjums_ has joined #ponylang
sjums has quit [Ping timeout: 252 seconds]
atk has quit [Ping timeout: 250 seconds]
gornikm has quit [Ping timeout: 250 seconds]
itscaleb has quit [Ping timeout: 250 seconds]
gornikm_ has joined #ponylang
gornikm_ has quit [Changing host]
gornikm_ is now known as gornikm
atk has joined #ponylang
atk has quit [Changing host]
atk has joined #ponylang
itscaleb has joined #ponylang
<doublec> emilbayes: a lambda was meant I believe
<doublec> emilbayes: I wrote a bit about the options here https://bluishcoder.co.nz/2016/05/11/exploring-actors-in-pony.html
<doublec> emilbayes: (see the simulating return values section)
amclain has quit [Quit: Leaving]
Praetonus has joined #ponylang
_andre has joined #ponylang
zevlg` has quit [Remote host closed the connection]
zevlg has joined #ponylang
<SeanTAllen> emilbayes: or simply passing a tag reference to yourself.
<SeanTAllen> if there's a known protocol
<SeanTAllen> for example
<SeanTAllen> actor2.foo(this)
<SeanTAllen> and then in actor2, you can call back into later as:
<SeanTAllen> savedActor.bar()
felko has joined #ponylang
<TwoNotes> How do I display a ByteSeq in gdb? "print *data" says "No data fields"
<Praetonus> A ByteSeq is an interface type, so the compiler can't generate debug info for its fields
<Praetonus> However, A ByteSeq is either an Array[U8] or a String and these types have the same binary layout
<TwoNotes> Can Debug.out() print it?
<Praetonus> So you should be able to cast a ByteSeq to an Array[U8] inside of gdb to print it
<Praetonus> Something like `print *(Array_U8_val*)(myByteSeq)
<TwoNotes> Well, that gives me the fields. Now to see the string
<Praetonus> It is stored in the _ptr field
<Praetonus> It looks like you have to cast it to char*
<TwoNotes> Can't display it with Debug.out because Array[U8] does not have a "string" method
<Praetonus> I got it with gdb
<Praetonus> `print (char*)((Array_U8_val*)(myByteSeq)->_ptr)`
<TwoNotes> yikes
<TwoNotes> Need extra parens around (Array_U8_val*)(data)
<Praetonus> Yeah, sorry
<TwoNotes> Maybe Debug could be made to understand Array[U8] and do something with it
<TwoNotes> I just got the first "Hello world!" HTML page from my new streaming HTTP server project.
<TwoNotes> Now to debug all the edge cases
jemc has joined #ponylang
jemc has quit [Ping timeout: 250 seconds]
_andre has quit [Quit: leaving]
graaff has quit [Quit: Leaving]
graaff has joined #ponylang
graaff has quit [Client Quit]
jemc has joined #ponylang
felko has quit [Ping timeout: 260 seconds]
<emilbayes> doublec SeanTAllen thanks guys! How about error handling / propagating errors? Is that sending a primitive (enum) along?
<emilbayes> Oh right, so that's where promises come in handy. What if I need to call multiple times like a notifier object?
Praetonus has quit [Quit: Leaving]
jemc has quit [Ping timeout: 245 seconds]
<doublec> emilbayes: if it needs to call back multiple times then a notifier object would be a good approach
<doublec> emilbayes: similar to how the net package works
<emilbayes> doublec: saw that on your blog ^^ didn't see anything on error handling in that case though?
<emilbayes> And how do you distinguish errors?
<SeanTAllen> what sort of errors emilbayes?
<SeanTAllen> the net notify's handle errors as well, if by errors you mean "unable to connect" and things of that sort.
<emilbayes> Yeah, that's what I was thinking. How do you get the cause of the error though, given that errors don't have an instance or type