Open flofriday opened 1 year ago
@Jozott00 can you cross off the function you already completed?
Added min, max, abs:
min(-12,-2)
[1,-2,0].min()
max(0.023, 0.23)
[0.2, -0.003, 0.0].max()
(-0.023).abs()
abs(2)
@flofriday should list.reverse()
return a new list, the same list object, or void (with internal list reversion)?
Right now it mutates it self and returns itself
I think it should return a new list
I think is does more sense if it modifies itself... since reverse
is a command. I think python and swift do this and have a extra function reversed
that returns a new reversed list.
I think reversed makes than more sense to implement.
Ok, i added both
I also started adding a stdlib documentation.
Update: The stdlib documentation is now complete and additions to the stdlib should now also be documented there.
I added a lot of string methods and the args
global variable.
This is the issue tracking missing functions for the standard library. We don't aim to have a battery-included standard library but it should be enough to write simple scripts.
write
function to create/update filessplit
method for stringsreverse
method for lists and stringssort
function / method for lists (this one might be difficult since all languages do this with higher order functions so that users can select a key)min
andmax
functions**
or^
power operator for intabs
method for int and floatprint
needs a possibility to not output a newline (maybe we should do it like kotlin withprintln
andprint
)args
variable to access argvlines
method on strings to split them by newlines and return an array of stringsremove
andcontains
on dictsremove
andappendAll
on listssetItem
for Strings, but where it panics if the string that should be set is not exactly one character long.contains
method for strings, lists and dicts.strip
method for strings.joined
method for lists.represent
method for all classesThis issue is dynamic, and new features will be added in the future.