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
rkallos has joined #ponylang
alxs has joined #ponylang
alxs has quit [Client Quit]
dx_ob has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
Foaly has joined #ponylang
PrsPrsBK has joined #ponylang
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
_whitelogger has joined #ponylang
Foaly has joined #ponylang
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
rjframe has joined #ponylang
dx_ob has quit [Ping timeout: 272 seconds]
dx_ob has joined #ponylang
rjframe has quit [Quit: Leaving]
acarrico has quit [Ping timeout: 252 seconds]
alxs has joined #ponylang
alxs has quit [Client Quit]
dx_ob has quit [Ping timeout: 246 seconds]
dx_ob has joined #ponylang
TwoNotes has joined #ponylang
alxs has joined #ponylang
<TwoNotes> Trying to pass the address of a struct to an FFI. Apparently the rules for doing this have changed. Need example.
dx_ob has quit [Remote host closed the connection]
dx_ob has joined #ponylang
Foaly has joined #ponylang
Foaly has quit [Ping timeout: 272 seconds]
_whitelogger has joined #ponylang
Foaly has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
<vaninwagen> TwoNotes does that contain som useful info for you: https://tutorial.ponylang.io/c-ffi/calling-c.html ?
dx_ob has quit [Ping timeout: 246 seconds]
dx_ob has joined #ponylang
<TwoNotes> vaninwagen It looks like it should. I just have to find what changed since the last time this compiled ok
_whitelogger has joined #ponylang
dx_ob has quit [Remote host closed the connection]
Foaly has quit [Ping timeout: 246 seconds]
acarrico has joined #ponylang
<TwoNotes> I have a class which needs to be sortable. So I declare it "is Comparable[]" and write an 'lt' fun for it. But what goes in the square brackets on Comparable?
<vaninwagen> The type of the argument to `lt` and `eq`
<TwoNotes> So if it is comparable to other objects of the same class, I just put its own name there?
<vaninwagen> Indeed :)
<TwoNotes> It complains that "type argument is outside its constraint". I have no idea what that means
<vaninwagen> Can you share your class on https://playground.ponylang.io ?
<vaninwagen> That would help to help you :)
<vaninwagen> Hmmm... In the docs it expects the thing in brackets to have a caoability that allows for reading (ref, val, iso) hhttps://stdlib.ponylang.io/builtin-Comparable/
<vaninwagen> But yours has it
<vaninwagen> Does it work without?
<vaninwagen> Without the ref
<vaninwagen> TwoNotes: in general a type argument is the thing you put in square brackets - when you implement or instantiate a generic type
<vaninwagen> e.g. Array[U8]
<vaninwagen> Here U8 is the type argument
<vaninwagen> If a type is generic, it has a type parameter, which requires such a type argument. Those type parameters can have constraints, limiting what you can provide as type argument
<vaninwagen> If a type argument is outside its constraint it might not have the required capability or is just the wrong type
<vaninwagen> If you could give the full compiler error you get, we can find out what doesnt fit
<vaninwagen> Long story short, i think you also need to implement the eq method from https://stdlib.ponylang.io/builtin-Equatable because that is also required in order to be sortable
<TwoNotes> I know 'eq' has to be there. I will do that next
<vaninwagen> I assume thats the root cause for your error
<vaninwagen> lt and eq need to be fun box, not fun val
<TwoNotes> ah
<TwoNotes> What about the Movie class itself?
<TwoNotes> Making the Movie class itself 'box' as well as the two comparator funs seems to have fixed it
<TwoNotes> I was never really clear on what 'box' was for
<vaninwagen> box only allows read only access
<vaninwagen> But you can provide it ref or val things
<TwoNotes> I can still have funs that modify the contents?
<vaninwagen> It is mostly used on function detinitions
<vaninwagen> I never made a class itself box
<vaninwagen> Id use val, ref or iso
<vaninwagen> You cannot call modifyibg functions on a box reference
TwoNotes has left #ponylang [#ponylang]
acarrico has quit [Ping timeout: 246 seconds]