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
<doublec> Perelandric: looking now
<doublec> Perelandric: in the call T.test(), T is the trait. It needs to be an instance of the trait.
<doublec> hmm, that doesn't work either
<doublec> I have to head out - will look again in a bit
montanonic has joined #ponylang
<doublec> Perelandric: this is a cut down version of your issue http://pastebin.com/k25RqxTe
<doublec> Perelandric: unfortunately I don't know why it doesn't work
<doublec> The non generic equivalent works fine
<doublec> huh, in the first paste it says Foo iso is not a subtype of T ref. Where did it get iso from?
montanonic has quit [Ping timeout: 260 seconds]
SilverKey has quit [Quit: Cheerio!]
c355e3b has quit [Quit: Connection closed for inactivity]
<Perelandric> doublec: Thanks for the review. Yeah, I'm confused.
<Perelandric> Just so I understood, I thought `T.test()` would basically call the constructor with no args, and then call `.test()`
<doublec> Perelandric: you're right it does
<Perelandric> OK, good. I double checked with `T.create().test()` just to be sure.
<Perelandric> So maybe I should just file an issue on this one.
<doublec> Perelandric: Yes, I think that's a good idea
<Perelandric> doubled: Super, will do in a few hours. Just about to crash (again).
<Perelandric> Thanks again for the review and confirmation.
Perelandric has quit [Quit: Page closed]
<doublec> np
mcguire has quit [Ping timeout: 244 seconds]
Dyserna__ has joined #ponylang
Dyserna_ has quit [Ping timeout: 244 seconds]
<SeanTAllen> so to anyone who sees the above. There's a problem in that code. You have some type T that you want to be able to call a constructor for and then test() the existence of test() is guaranteed. There's no guarantee that `T` will have a 0 arg constructor.
<SeanTAllen> in the original version there's another issue that I see... MyTrait test returns a MyTrait
<SeanTAllen> I could create a GenericTest of Foo. And the Array would expect a Foo but, Foo can return a Bar or any other MyTrait and be legal, but that wouldn't be legal in GenericTest.
<doublec> SeanTAllen: good catch!
<doublec> SeanTAllen: this adds a constructor but same error http://pastebin.com/zuDKNZKA
<doublec> Oh I'm dumb. I see it.
<doublec> In "let b: T = a", because it's generic code T might not be something that Foo can assign too.
jemc has joined #ponylang
* doublec is too used to template systems that fail only when actually expanded for the failure case
<doublec> The joys of being a polygot programmer - forgetting what works where
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 265 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 250 seconds]
SilverKey has joined #ponylang
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 252 seconds]
SilverKey has quit [Quit: Halted.]
montanonic has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
montanonic has quit [Ping timeout: 252 seconds]
posnea has joined #ponylang
<posnea> not sure if this is the right place to report this, but I am following the ponylang tutorial and it compiled from source fine, but when I try to compile the hello world example I get a "Pass 'Move heap allocations to the stack' is not initialized. Verify if there is a pass dependency cycle. Required Passes: Segmentation fault (core dumped)" error
posnea has quit [Quit: Page closed]
<Candle> doublec: heh, This weekend, I was writing Java, [xml!], Ruby, [graphviz], bash, pony, javascript, [html], [css]. Not the same project mind you...
<doublec> Candle: I remember going from doing a lot of lisp to doing c++. I was constantly writing (if (do this) ...)
<Candle> The java I was writing was a maven plugin to handle pony. Mostly because I thought I knew Maven pretty well, and I was fed up with trying to do pacjage management some other way.
<Candle> package*
<Candle> There are issues with Maven, it doesn't solve every problem, but it has to be better than nothing.
c355e3b has joined #ponylang
<doublec> Candle: did you get it working?
SilverKey has joined #ponylang
<Candle> doublec: Mostly, i need to re-discover my ability to publish to maven central.
<Candle> I'm also hoping that the --path option to ponyc can be specified multiple times!
<Candle> Given I was going to package a library as a zip/tar.gz (decision as to which is to be made) I need to work out where I'm going to unpack said archive so that it can be passed to --path.
<Candle> Finally, I need to document a whole load of decisions I've made, and my rational for choosing that option!
Perelandric has joined #ponylang
<Perelandric> SeanTAllen: Thank you, that makes sense. Though it would seem like making the trait generic would solve it...
<Perelandric> ...by making sure those that implement it return an instance of the same class from `test()`...
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
michael_campbell has joined #ponylang
<SeanTAllen> posnea if you come back and see this, can you report on github?
<SeanTAllen> Perelandric: this is what you want... https://gist.github.com/SeanTAllen/ba0ce66d6396ed9c2e5b2538c1297904
<SeanTAllen> Your array has to have a lower bounds of MyTrait so it can hold any MyTrait
<Perelandric> SeanTAllen: Thank you, though in this case, I actually want it to be an Array of `T`.
<Perelandric> I see that it'll work if I do this: `let a = Array[MyTrait[T]]`
<Perelandric> ...with my generic version of `MyTrait`, though I can't quite comprenend why `T` alone doesn't work since it's already constrained.
<Perelandric> But for now, I'm just happy to get it to compile! :-)
<SeanTAllen> what do you mean by `T` alone Perelandric?
<Perelandric> I mean that if `T` is `Foo`, then the `a` array should be `Array[Foo]`
<SeanTAllen> Can you gist some code to make sure I understand exactly what you mean?
<Perelandric> Absolutely. I'll update my previous gist, and add what I think it should look like expanded.
<Perelandric> Here's the generic version that compiles and creates an instance of `GenericTest[Foo]`
<SeanTAllen> The expanded on has the problem I originally mentioned. That isn't equiv to what you put in the previous gist.
<SeanTAllen> your array there would be Array[MyTrait] not Array[T] for it to work
<SeanTAllen> T is constrained to being of type MyTrait but T is not my trait, it is the type that you supply, Foo, Bar etc
<SeanTAllen> There's definitely some funkiness in there though
<Perelandric> I probably am just not represention the expansion correctly
<Perelandric> In the generic version, I basically just want the array to be whatever `T` was set as.
<Perelandric> So if `T` is `Foo`, as in the main actor, then the array should be `Array[Foo]`
<Perelandric> but whatever uses that generic does need to be constrained by `MyTrait`.
prettyvanilla has quit [Quit: Konversation terminated!]
<Perelandric> I guess maybe `let a = Array[MyTrait[T]]` makes sense instead of `Array[T]` since that matches the return value of `test()`.
<Perelandric> ...though I'd have expected `MyTrait[T]` to be equivalent to `T: MyTrait`. Perhaps not.
<Perelandric> Ignore the last line. I didn't express that clearly.
<Perelandric> ...
<Perelandric> And come to think of it, in my actual code, I don't think `var a = Array[MyTrait[T]]` will work.
<Perelandric> Or at least it'll force me to unpack `T` from `MyTrait`.
<Perelandric> I'd rather just be able to have an Array of `T`.
<Perelandric> ...duh
<Perelandric> In `MyTrait`, the `test()` method needs to return `T` instead of `MyTrait[T]`
prettyvanilla has joined #ponylang
jemc has joined #ponylang
SilverKey has quit [Ping timeout: 250 seconds]
amclain has joined #ponylang
unbalancedparen has joined #ponylang
unbalancedparen has quit [Client Quit]
unbalancedparen has joined #ponylang
jemc has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
runehog has quit [Remote host closed the connection]
mcguire has joined #ponylang
Matthias247 has joined #ponylang
unbalancedparen has quit [Quit: WeeChat 1.4]
unbalancedparen has joined #ponylang
runehog has joined #ponylang
montanonic has joined #ponylang
mcguire has quit [Remote host closed the connection]
montanonic has quit [Ping timeout: 260 seconds]
_andre has quit [Quit: leaving]
mcguire has joined #ponylang
montanonic has joined #ponylang
runehog has quit [Remote host closed the connection]
runehog has joined #ponylang
mcguire has quit [Ping timeout: 276 seconds]
Matthias247 has quit [Read error: Connection reset by peer]