gracelang / language

Design of the Grace language and its libraries
GNU General Public License v2.0
6 stars 1 forks source link

insert (value) at (index) on lists? #166

Closed KimBruce closed 5 years ago

KimBruce commented 6 years ago

There apparently is no insert operation in lists to squeeze in a new element, moving some elements to the right to make room for the new one. It seems odd to me that we have a remove(n) method, but no insert (val) at (m). Obviously not a huge deal, it just seems a bit asymmetric. (Of course we do have at(m) put (val).)

apblack commented 6 years ago

I'ld be happy to have someone implement this. There need to be tests, or course, especially for the boundary cases of m being one beyond the end of the list, and being at the end of the list.

KimBruce commented 6 years ago

Still needs to be written -- I'll take care of it.

apblack commented 5 years ago

This method was added in minigrace commit 4d33d8a