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
SilverKe_ has joined #ponylang
nyarum has quit [Quit: Leaving.]
SilverKey has quit [Ping timeout: 252 seconds]
SilverKe_ has quit [Quit: Halted.]
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
copy` has quit [Quit: Connection closed for inactivity]
<SeanTAllen> no
<SeanTAllen> its not
<SeanTAllen> you cant overload a method
<SeanTAllen> case functions compile down to a single match statement
<SeanTAllen> its not a method
<SeanTAllen> i've added an issue to the tutorial: https://github.com/ponylang/pony-tutorial/issues/106
SilverKey has joined #ponylang
jemc has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
amclain has quit [Ping timeout: 260 seconds]
amclain has joined #ponylang
bb010g has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 252 seconds]
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
cquinn has quit [Read error: Connection reset by peer]
cquinn has joined #ponylang
SilverKey has quit [Quit: Halted.]
aturley has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
amclain has quit [Quit: Leaving]
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
aturley has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
aturley has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
aturley has quit [Ping timeout: 244 seconds]
nyarum has joined #ponylang
nyarum has quit [Quit: Leaving.]
aturley has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
gsteed has joined #ponylang
copy` has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
juanjoc has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 268 seconds]
trapped has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
aturley has joined #ponylang
SilverKey has joined #ponylang
jemc has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
amclain has joined #ponylang
juanjoc has quit [Quit: Leaving]
juanjoc has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
copy` has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
nyarum has joined #ponylang
nyarum has quit [Quit: Leaving.]
SilverKey has quit [Quit: Halted.]
trapped has quit [Read error: Connection reset by peer]
SilverKey has joined #ponylang
juanjoc has quit [Quit: Leaving]
<SeanTAllen> Pony Virtual User Group first meeting starts in 20 minutes: https://zoom.us/j/447987409
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
nyarum has joined #ponylang
<nyarum> Guys, who can give details about "trn" rcap? Because this rcap haven't use in std and we can know about this only from tutorial. And after I don't know where I can use that rcap :3
<nyarum> hasn't used*
SilverKey has quit [Quit: Halted.]
<jemc> nyarum: most common use of a `trn` is when you want to create a mutable reference (as `trn`), do some operations to build it up, then convert it to an immutable reference (`val`)
<jemc> because `trn` is write-unique (it's th only reference that can mutate the object), you can drop your `trn` (`consume` it) to guarantee that no writable references exist anymore, and thus get a `val`
<jemc> (to build up the contents through mutation, then produce a `String val`)
<nyarum> Nice case and thank you for example. It is clear for me.
SilverKey has joined #ponylang
<nyarum> And I have another question, about iso rcap.
<nyarum> How I can use it without copy but with print and change value.
<nyarum> ?*
AndChat61364 has joined #ponylang
<jemc> nyarum: by definition, you can't send the same `String iso` to two different actors (or two different places at all, really)
<jemc> `env.out` is an actor, so `env.out.print` is also sending to an actor
<AndChat61364> But we can pass iso via parameter without copy, not?
<jemc> right, but only by consuming it
<jemc> so then you can't use it to send to the second actor
<nyarum> In above code just messaging between two actors. They can consume it every call or I mistake?
<nyarum> just like "test.of(this, consume variable)"
<jemc> nyarum: `test` is one actor, `env.out` is another
<nyarum> Ah, you about print :)
<nyarum> So, I have one right way - copy for print?
<nyarum> Using iso, of course.
<jemc> nyarum: I can think of two different approaches based on how serious this use case actually is
<jemc> 1. if it's not serious, just use @printf to print locally, so you don't have to send to another actor
<jemc> 2. if it is serious, you might think about using a rope data structure https://en.wikipedia.org/wiki/Rope_%28data_structure%29
<jemc> we don't have a rope in the standard library yet, but we've been thinking about adding one
<jemc> but the benefit of a rope is the ability to concatenate strings to eachother without copying/reallocating them - the rope just accumulates a tree of chunks and provides string-like access to that list
<nyarum> jemc: thanks :)
SilverKey has quit [Quit: Halted.]
Matthias247 has joined #ponylang
nyarum has quit [Quit: Leaving.]
gsteed has quit [Quit: Leaving]
SilverKey has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
aturley has quit [Ping timeout: 252 seconds]
polypus74 has joined #ponylang
<polypus74> is there a way of getting a polymorphic numeric literal?
<polypus74> my goal is to have a float on the left hand side call an add function other than the standard lib one
<polypus74> let x: MyType = 3 + MyType
<jemc> polypus74: no, as of now, Pony does not let you bind a different add function than what currently exists for a type
<jemc> however, your example wouldn't work anyway, because Pony needs a way to know what type of literal that `3` is
<jemc> so you'd have to say something like `let x: MyType = U64(3) + MyType`
<jemc> and at that point, you're not saving on verbosity compared to something like `let x: MyType = MyType(3) + MyType`
<jemc> I would note that just changing the order here solves both problems - this would work fine: `let x: MyType = MyType + 3`
<jemc> (assuming you define an appropriate add function for `MyType`, like `fun add(that: U64): MyType => ...`
<polypus74> ok ty. yeah order works for add but i want to support non-commutative ops (-,/) etc
<jemc> yeah, your best bet is to use `MyType(3)`, since you need a hint to tell the type of the literal anyway, as in `U64(3)`
<polypus74> too bad i have to use wrapper, just a little bit more verbose, but not the end of the world. why "as of now"? are there plans for the future which might change things
<jemc> no, as far as I know it's not on any roadmap
<jemc> probably a bad choice of words, but I basically meant to imply that such a thing would not be impossible to support, but we don't support it
<jemc> polypus74: not sure what your use case is for this line of questioning, but if you're just trying to declare a type that acts like a certain numeric type, but the type system sees as distinct and unrelated, this might be a relevant ticket to follow: https://github.com/ponylang/ponyc/issues/317
<polypus74> i guess compiler is not smart enough to guess that it is the only applicable type in the case of a union type. type MyType is (MyBaseType | F64). i've been messing around with this idea without much luck. will have a look at ticket. use case is basically a DSL that compiles down to a DSP signal flow graph
<jemc> "DSL that compiles down to a DSP signal flow graph" >> ah, very cool - sounds similar to a project that's been rattling around in my head for a while but haven't made much progress on due to other priorities - I'd definitely be interested to see what you come up with
<polypus74> right now i'm basically a complete noob so could be a good while but will do :)
<jemc> polypus74: regarding your first sentence - not sure what you ran into but the following does compile fine for me: `let x: (MyBaseType | F64) = 3`