flofriday / Moose

🐐 A new fun programming language
MIT License
6 stars 1 forks source link

Stdlib #30

Open flofriday opened 1 year ago

flofriday commented 1 year ago

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.

This issue is dynamic, and new features will be added in the future.

flofriday commented 1 year ago

@Jozott00 can you cross off the function you already completed?

Jozott00 commented 1 year ago

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)
Jozott00 commented 1 year ago

@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

flofriday commented 1 year ago

I think it should return a new list

Jozott00 commented 1 year ago

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.

flofriday commented 1 year ago

I think reversed makes than more sense to implement.

Jozott00 commented 1 year ago

Ok, i added both

flofriday commented 1 year ago

I also started adding a stdlib documentation.

flofriday commented 1 year ago

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.