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
trapped has quit [Read error: Connection reset by peer]
unbalancedparen has quit [Quit: WeeChat 1.5]
amclain has quit [Quit: Leaving]
felixgallo has quit [Ping timeout: 250 seconds]
k0nsl has quit [Ping timeout: 240 seconds]
k0nsl has joined #ponylang
jemc has joined #ponylang
Perelandric has quit [Ping timeout: 250 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
copy` has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 244 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 272 seconds]
jemc has joined #ponylang
mrkishi has quit [Ping timeout: 244 seconds]
jemc has quit [Ping timeout: 260 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
srenatus has joined #ponylang
mrkishi has joined #ponylang
mrkishi has quit [Ping timeout: 246 seconds]
hibnico has joined #ponylang
mrkishi has joined #ponylang
mrkishi has quit [Ping timeout: 240 seconds]
cquinn_ has joined #ponylang
Candle_ has joined #ponylang
dom96_ has joined #ponylang
dom96 has quit [*.net *.split]
Candle has quit [*.net *.split]
cquinn has quit [*.net *.split]
cquinn_ is now known as cquinn
dom96_ is now known as dom96
trapped has joined #ponylang
hibnico has quit [Quit: hibnico]
hibnico has joined #ponylang
mrkishi has joined #ponylang
hibnico has quit [Quit: hibnico]
c355e3b has joined #ponylang
mrkishi has quit [Ping timeout: 250 seconds]
hibnico has joined #ponylang
hibnico has quit [Quit: hibnico]
mrkishi has joined #ponylang
hibnico has joined #ponylang
hibnico has quit [Quit: hibnico]
hibnico has joined #ponylang
Perelandric has joined #ponylang
hibnico has quit [Quit: hibnico]
hibnico has joined #ponylang
hibnico has quit [Quit: hibnico]
hibnico has joined #ponylang
unbalancedparen has joined #ponylang
jemc has joined #ponylang
TwoNotes has joined #ponylang
nyarumes has joined #ponylang
nyarum has quit [Ping timeout: 276 seconds]
felixgallo has joined #ponylang
nyarum has joined #ponylang
nyarumes has quit [Ping timeout: 240 seconds]
michael_campbell has joined #ponylang
copy` has joined #ponylang
amclain has joined #ponylang
felixgallo has quit [Ping timeout: 258 seconds]
<Perelandric> Question regarding the discussion on this issue: https://github.com/ponylang/ponyc/issues/863
<Perelandric> Sylvan's example includes this line:
<Perelandric> foo1.go(foo1 = recover Foo end, FooReceiver)
<Perelandric> So it seems like in the `go()` method, 'this' and 'that' should be referencing the same object...
<Perelandric> because `foo1 = recover Foo end` looks like it should be returning the previous value of `foo1`
<Perelandric> which is the same as the receiver.
<Perelandric> Yet they'
<Perelandric> Yet they're different objects in the `go()` method.
<Perelandric> Why?
<Perelandric> Oh... it's reversed. The receiver is the new object, and the argument position passes the old one.
felixgallo has joined #ponylang
<Perelandric> Sylvan mentioned that the only way to resolve the original issue would be to not allow expressions in the argument position.
<Perelandric> ...but couldn't pony just disallow mutating the variable that is the receiver of the call?
hibnico has quit [Quit: hibnico]
<Perelandric> Maybe it's just me, but that behavior just seems terribly confusing.
<jemc> Perelandric: disallowing that wouldn't be as simple as it sounds
<jemc> what if the receiver was a method call that ultimately returns a certain field, and the argument expression calls a method that changes the value of that field internally
<jemc> that the receiver is going to be changed to something else before calling is something the compiler can't really know without digging into both of those methods
<Perelandric> Yes, I see what you're getting at.
<Perelandric> So the order of evaluation is...
<Perelandric> 1) all arguments (including those of chained calls) evaluated left-to-right
<Perelandric> 2) the receiver, which may be an implicit `this`
<Perelandric> 3) the actual calls evaluated left-to-right
TwoNotes has left #ponylang [#ponylang]
<jemc> seems right - probably the easiest way to test would be something like: `(Debug("foo"); foo).go((Debug("bar"); bar), (Debug("baz"); baz))`
<jemc> (or move those parenthesized statements to methods for more clarity, perhaps)
<Perelandric> Yes, it gives `"bar" "baz" "foo"` as we would seem to expect.
<Perelandric> Also works with a nested receiver and call in one of the argument positions.
<Perelandric> Sort of a depth-first situation.
<Perelandric> So I guess it really isn't all that confusing... just a little unfamiliar.
<Perelandric> Thanks for the clarifications. Very helpful!
<jemc> now we just have to figure out how/where to document it...
<jemc> "depth first" is a nice way to think about it
<Perelandric> It also seems that the variables in argument position are resolved to their reference, and not their value.
<Perelandric> This code: `var f = "foo"; foo.go(f).go(f = "bar")` passes "bar" then "foo" instead of "foo" then "foo"
<Perelandric> And this: `foo.go(f).go(f = "bar").go(f = "baz")` passes "bar" "baz" "foo"
srenatus has quit [Quit: Connection closed for inactivity]
<Perelandric> ...I'd have expected the last assignment ("baz") to be resolved as the ultimate value for `.go(f)`
TwoNotes has joined #ponylang
<TwoNotes> Programming in Pony makes you a better programmer in any language.
TwoNotes has quit [Quit: Leaving.]
Matthias247 has joined #ponylang
Candle_ is now known as Candle
jemc has quit [Ping timeout: 250 seconds]
prettyvanilla_ has joined #ponylang
k0nsl_ has joined #ponylang
k0nsl has quit [*.net *.split]
prettyvanilla has quit [*.net *.split]
jemc has joined #ponylang
TwoNotes has joined #ponylang
<TwoNotes> How do I put the contents of a WriteBuffer into the form expected by UDPSocket.write?
<TwoNotes> UDPSocket expects either a String or an Array[U8]
<TwoNotes> But WriteBuffer.done() returns Array[ByteSeq]
<TwoNotes> Is there an easy way to 'flatten' the Array[ByteSeq] into an Array[U8]?
TwoNotes has quit [Quit: Leaving.]
Matthias247 has quit [Read error: Connection reset by peer]
<Perelandric> I know how to create a function that receives an `iso` and then returns it so the caller can regain ownership.
<Perelandric> But is there a way to do the same with a constructor?
<Perelandric> I could have the ctor provide a default init, then create a separate method for the actual init.
<Perelandric> Wondering if there's something better.
mrkishi has quit [Ping timeout: 246 seconds]
mrkishi has joined #ponylang