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
dougmacdoug has quit [Quit: dougmacdoug]
inara has quit [Quit: Leaving]
inara has joined #ponylang
nisanharamati has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 260 seconds]
jemc has joined #ponylang
gokr has quit [Quit: Leaving.]
jemc has quit [Ping timeout: 264 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 256 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 268 seconds]
gokr has joined #ponylang
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
dipin has quit [Quit: dipin]
vaninwagen has joined #ponylang
hardliner66 has joined #ponylang
khan has quit [Quit: khan]
codec1 has joined #ponylang
mahmudov has quit [Remote host closed the connection]
mahmudov has joined #ponylang
ficl has joined #ponylang
khan_ has joined #ponylang
_andre has joined #ponylang
codec1 has quit [Quit: Leaving.]
codec1 has joined #ponylang
codec1 has quit [Quit: Leaving.]
vaninwagen has quit [Ping timeout: 268 seconds]
vaninwagen has joined #ponylang
gokr has quit [Ping timeout: 264 seconds]
gokr1 has joined #ponylang
codec1 has joined #ponylang
codec1 has quit [Client Quit]
codec1 has joined #ponylang
codec1 has quit [Quit: Leaving.]
jemc has joined #ponylang
vaninwagen has quit [Ping timeout: 264 seconds]
dipin has joined #ponylang
dipin has quit [Client Quit]
codec1 has joined #ponylang
codec1 has quit [Client Quit]
codec1 has joined #ponylang
khan_ has quit [Quit: khan_]
khan has joined #ponylang
TheNet has joined #ponylang
dougmacdoug has joined #ponylang
Pyrrh has joined #ponylang
gokr1 has quit [Ping timeout: 255 seconds]
khan has quit [Quit: khan]
khan has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
khan has quit [Remote host closed the connection]
TheNet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheNet has joined #ponylang
<dougmacdoug> quick ? what are the default capabilities when I dont type any for methods on classes and then arguments when an arg is a class
<dougmacdoug> fun ?a? method(a : MyClass ?b?) (a=??? b=???)
khan has joined #ponylang
<SeanTAllen> fun box method
<SeanTAllen> the others depend on the class
<SeanTAllen> by default it is ref
<SeanTAllen> but if i do
<SeanTAllen> class val Foo
<SeanTAllen> when defining it then the default capability is val
mahmudov has quit [Ping timeout: 256 seconds]
hardliner66 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
gokr has joined #ponylang
codec1 has joined #ponylang
gokr has quit [Ping timeout: 260 seconds]
mson has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
<dougmacdoug> if I do fun method(a: MyClass val) does that mean I can only receive instances that are already val, or does that simply mean, inside this method I am only going to read so I only need a read handle to the instance
ficl has quit [Ping timeout: 268 seconds]
<SeanTAllen> it has to be a val.
<SeanTAllen> you can't accept `refs`
<SeanTAllen> if you want to accept ref and val, that's what box is for.
nisanharamati has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
Sargun has quit [Ping timeout: 248 seconds]
Sargun has joined #ponylang
user10032 has joined #ponylang
codec1 has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
TheNet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dougmacdoug> is there a standard for docstrings to document arguments to methods and returns (ie javadoc @return @param)
TheNet has joined #ponylang
_andre has quit [Quit: leaving]
xllndr has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
mson has quit [Quit: Connection closed for inactivity]
acarrico has quit [Ping timeout: 246 seconds]
mahmudov has joined #ponylang
<jemc> dougmacdoug: no, there's currently not a standard for a parseable format
<dougmacdoug> ok, thx
nisanharamati has quit []
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
codec1 has joined #ponylang
xllndr has quit [Quit: Leaving]
khan has quit [Quit: khan]
acarrico has joined #ponylang
<krig> for anyone who is interested, my pony talk at linux.conf.au is now up: https://www.youtube.com/watch?v=e0197aoljGQ
<krig> apologies in advance for any mistakes, misrepresentations or misattributions etc.
gokr has joined #ponylang
<SeanTAllen> @krig can you open a PR for that to the Planet Pony section of the website?
acarrico has quit [Ping timeout: 252 seconds]
acarrico has joined #ponylang
<krig[m]> SeanTAllen (IRC): will do!
<dougmacdoug> can i make a nested array like this: let array2 : Array[Array[U8]] = Array[Array[U8]](16)
<dougmacdoug> and if so, how can i initialize the first row
<SeanTAllen> are you asking how you can do some sort of matrix support?
<dougmacdoug> right, multidimensional array
<SeanTAllen> there's no native multidimensional array support
<SeanTAllen> initialize could mean a number of things there... here is one possible thing it might mean:
<SeanTAllen> actually sorry tht is wrong
<SeanTAllen> you want insert not update, because nothing has been initialized yet
codec1 has quit [Read error: Connection reset by peer]
<SeanTAllen> if you dont want sparse arrays you could do this: https://playground.ponylang.org/?gist=3b666a2527966da47cea8baa8f90402d
<dougmacdoug> ok.. i'll try it out, i can always use flat arrays..
acarrico has quit [Ping timeout: 240 seconds]
user10032 has quit [Quit: Leaving]
<dougmacdoug> i still cant ever seem to get from ref to val :( .. I have an Array[U8] ref and I want to print it..
<SeanTAllen> yes
<SeanTAllen> thats not allowed
<SeanTAllen> that would be unsafe
<SeanTAllen> ref is any number of aliases
<SeanTAllen> turning one of those aliases into an immutable doesnt make it immutable
<SeanTAllen> you have an unknown number of other aliases potentially out there
<dougmacdoug> sure but at least i should be able to create an immutable copy
<dougmacdoug> which i dont know how to do
<SeanTAllen> where are you getting hung up?
<SeanTAllen> what have you tried?
<SeanTAllen> what are you doing where you have a mutable thing and want to get an immutable copy?
<dougmacdoug> i created an array and put data in it now i want to print it.. we're talking hello world + 1 level here
<SeanTAllen> so there are a lot of ways you can do that for a more "real world" scenario, but here's one possible way to do that:
<SeanTAllen> inside of the recover block, my array is mutable, then i recover to an immutable version.
<SeanTAllen> because of how recover works, that is, you can alias anything that is mutable and defined outside the block, that is safe
<SeanTAllen> basically the "mutability" can't escape my recover block
<SeanTAllen> Here's another approach dougmacdoug: https://playground.ponylang.org/?gist=1f6851ca82924f1cca910e4ace166bdd
<SeanTAllen> I used the `trn` reference capability which allows me to have a mutable thing that i can consume to a val. Its rare I would want to have that, but its basically the same as the first example, just slightly different approach.
<dougmacdoug> ok.. i think the 2nd one is exactly what i was looking for.. i had tried recover and consume a few ways earlier but I had bumbled a couple places it seems..
<dougmacdoug> awesome! thanks!
<SeanTAllen> recover is often much more powerful than `trn` i almost never use transition
<SeanTAllen> also, sometimes you dont need to copy...
<SeanTAllen> Now this one dougmacdoug, this would give you trouble its an array of String ref.
<SeanTAllen> arg still wrong link
<SeanTAllen> here we go
<dougmacdoug> yeah thats the error i was wrestling this afternoon
<SeanTAllen> but...
<SeanTAllen> and I'm good
<SeanTAllen> OR
<SeanTAllen> I could call `string` because `string` on `String` calls `clone`
<SeanTAllen> now
<SeanTAllen> ready for the fun part to put this altogether?
<SeanTAllen> you want to copy from Mutable array to an immutable
<SeanTAllen> when copying into your immutable array, it will need to be mutable in order to get the values in
<dougmacdoug> ready as i'll ever be
<SeanTAllen> you can't do that with recover
<SeanTAllen> because you would need access to your String ref from outside the recover (see above)
<SeanTAllen> BUT...
<SeanTAllen> you can copy into a new trn or iso and turn that into a val.
<SeanTAllen> i'll paste a playground link in a minute
<SeanTAllen> did ^ that make sense?
<dougmacdoug> ~~
<dougmacdoug> I get the basics of the capabilities .. the hard part right now is figuring out how to do things I take for granted with data
<SeanTAllen> this is slightly hokey as you would do something with the final immutable array but you get the idea: https://playground.ponylang.org/?gist=c9a72d512fe6002d67ef158de35593cb
<SeanTAllen> in particular with what i asked about "does that make sense"
<SeanTAllen> did you get why i can't use recover in that last example to populate my "immutable array"?
<dougmacdoug> rgr.. so typically consume is used like an arg or return .. I am assuming once I call consume I can no longer access trns_x
<SeanTAllen> correct
<SeanTAllen> consume destroys the alias
<SeanTAllen> an in destroying it
<SeanTAllen> i can assign to any other type (that is if i consume a `trn` or an `iso`)
<dougmacdoug> so when you do recover you dont need to copy correct
<SeanTAllen> generally people think of consume as "iso" to "val" or "trn" to "val"
<SeanTAllen> but i can do this...
<SeanTAllen> i think the right way to think about recover is...
<SeanTAllen> "this is a safe block"
<SeanTAllen> as in
<SeanTAllen> "no external mutable references are allowed in here"
<SeanTAllen> so i can have a mutable thing in my recover block, do mutable things to it and then recover to a val.
<SeanTAllen> and we know it is safe to do
<SeanTAllen> because recover says so
<dougmacdoug> ok.. i will tool around with it for awhile until i get stuck again x.x
<dougmacdoug> thanks..
<SeanTAllen> you're welcome
TheNet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dougmacdoug has quit [Quit: dougmacdoug]