<smoon>
for indices? didn't see anything in the docs or the tutorial
<Bombe>
It would be very unusual for an array data type to not support random access.
<smoon>
Sorry, I meant random accessing of a value by index. I noticed `List` had an `index` function, but it doesn't look like `Array` does
<smoon>
but i could be missing something...
<smoon>
ahhh i see, it's called `apply` for the array
<aav>
smoon: and 'apply' is the "default" function. you can call it directly on the object
<smoon>
that makes more sense! thanks aav
Matthias247 has joined #ponylang
<SeanTAllen>
smoon: question. and i want to preface with "this is not a dick RTFM question". i'm working on improving how we teach Pony. What had you done where you ended up with the Array question? Had you looked at the standard library docs either locally or online? Did you know they existed to be looked at? Did you look at them but didn't see an obvious answer in the
<SeanTAllen>
description of Array? I'd love to learn more about your process when you encounter problems while you are learning. So, starting point this question. And if you are game, I'd love if you'd email me when you run into problems learning something with what is giving you trouble and what you have looked at so far to try and solve.
<smoon>
@SeanTAllen Yeah, no problem! I was reading both the Array class and the List class in the reference (http://ponylang.github.io/ponyc/builtin-Array/#array91a-a93), but my brain skipped over the 'apply' function since it didn't seem like an accessor. When I looked at List, it had an 'index' function which jumped out at me.
<smoon>
So it was my lack of knowledge of apply being being the default function of a object
<SeanTAllen>
Yeah, that could be a bad assumption in documentation. I think its something that would make sense to highlight or even better, as it is the "most common thing you would do", it needs to be highlighted in the examples
<SeanTAllen>
Ah
<SeanTAllen>
and array has no descriptive text or examples at all
<SeanTAllen>
yeah that would be a problem
<smoon>
an object* which is probably my fault entirely, I didn't read the tutorial in depth
<SeanTAllen>
smoon: when you hit problems like this, please email me so I can work em out
<SeanTAllen>
no no
<SeanTAllen>
that is not at all your fault
<SeanTAllen>
i thought i had written documentation for array. high level docs
<SeanTAllen>
but there arent any
<SeanTAllen>
that would be a problem
<SeanTAllen>
please do email me when you run into problems like that so i can ask questions
<SeanTAllen>
this already
<SeanTAllen>
BOOM
<SeanTAllen>
there's a thing I thought was documented thta isnt
<SeanTAllen>
thank you smoon!
<smoon>
i think a public wiki like cppreference would be great so people can contribute to the docs as things pop-up