00:00
atk has quit [Quit: Well this is unexpected.]
00:00
atk has joined #ponylang
03:12
jemc has joined #ponylang
04:16
jmiven has quit [Quit: co'o]
04:18
jmiven has joined #ponylang
05:35
<
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?
05:35
<
emilbayes >
Oh, ping SeanTAllen. Seems you wrote this example :)
05:42
jemc has quit [Ping timeout: 250 seconds]
05:50
graaff has joined #ponylang
06:50
gornikm_ has joined #ponylang
06:52
sjums_ has joined #ponylang
06:53
sjums has quit [Ping timeout: 252 seconds]
06:53
atk has quit [Ping timeout: 250 seconds]
06:53
gornikm has quit [Ping timeout: 250 seconds]
06:53
itscaleb has quit [Ping timeout: 250 seconds]
06:53
gornikm_ has joined #ponylang
06:53
gornikm_ has quit [Changing host]
06:54
gornikm_ is now known as gornikm
06:55
atk has joined #ponylang
06:55
atk has quit [Changing host]
06:55
atk has joined #ponylang
06:56
itscaleb has joined #ponylang
07:14
<
doublec >
emilbayes: a lambda was meant I believe
07:14
<
doublec >
emilbayes: (see the simulating return values section)
07:52
amclain has quit [Quit: Leaving]
09:55
Praetonus has joined #ponylang
10:23
_andre has joined #ponylang
11:28
zevlg` has quit [Remote host closed the connection]
12:09
zevlg has joined #ponylang
12:27
<
SeanTAllen >
emilbayes: or simply passing a tag reference to yourself.
12:27
<
SeanTAllen >
if there's a known protocol
12:27
<
SeanTAllen >
for example
12:27
<
SeanTAllen >
actor2.foo(this)
12:28
<
SeanTAllen >
and then in actor2, you can call back into later as:
12:28
<
SeanTAllen >
savedActor.bar()
12:47
felko has joined #ponylang
14:21
<
TwoNotes >
How do I display a ByteSeq in gdb? "print *data" says "No data fields"
14:25
<
Praetonus >
A ByteSeq is an interface type, so the compiler can't generate debug info for its fields
14:26
<
Praetonus >
However, A ByteSeq is either an Array[U8] or a String and these types have the same binary layout
14:26
<
TwoNotes >
Can Debug.out() print it?
14:26
<
Praetonus >
So you should be able to cast a ByteSeq to an Array[U8] inside of gdb to print it
14:27
<
Praetonus >
Something like `print *(Array_U8_val*)(myByteSeq)
14:27
<
TwoNotes >
Well, that gives me the fields. Now to see the string
14:28
<
Praetonus >
It is stored in the _ptr field
14:31
<
Praetonus >
It looks like you have to cast it to char*
14:33
<
TwoNotes >
Can't display it with Debug.out because Array[U8] does not have a "string" method
14:36
<
Praetonus >
I got it with gdb
14:36
<
Praetonus >
`print (char*)((Array_U8_val*)(myByteSeq)->_ptr)`
14:38
<
TwoNotes >
Need extra parens around (Array_U8_val*)(data)
14:39
<
Praetonus >
Yeah, sorry
14:40
<
TwoNotes >
Maybe Debug could be made to understand Array[U8] and do something with it
14:54
<
TwoNotes >
I just got the first "Hello world!" HTML page from my new streaming HTTP server project.
14:54
<
TwoNotes >
Now to debug all the edge cases
16:53
jemc has joined #ponylang
18:44
jemc has quit [Ping timeout: 250 seconds]
19:07
_andre has quit [Quit: leaving]
19:15
graaff has quit [Quit: Leaving]
19:17
graaff has joined #ponylang
19:18
graaff has quit [Client Quit]
22:47
jemc has joined #ponylang
23:15
felko has quit [Ping timeout: 260 seconds]
23:22
<
emilbayes >
doublec SeanTAllen thanks guys! How about error handling / propagating errors? Is that sending a primitive (enum) along?
23:25
<
emilbayes >
Oh right, so that's where promises come in handy. What if I need to call multiple times like a notifier object?
23:37
Praetonus has quit [Quit: Leaving]
23:43
jemc has quit [Ping timeout: 245 seconds]
23:47
<
doublec >
emilbayes: if it needs to call back multiple times then a notifier object would be a good approach
23:48
<
doublec >
emilbayes: similar to how the net package works
23:48
<
emilbayes >
doublec: saw that on your blog ^^ didn't see anything on error handling in that case though?
23:54
<
emilbayes >
And how do you distinguish errors?
23:58
<
SeanTAllen >
what sort of errors emilbayes?
23:58
<
SeanTAllen >
the net notify's handle errors as well, if by errors you mean "unable to connect" and things of that sort.
23:59
<
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