ThakeeNathees / pocketlang

A lightweight, fast embeddable scripting language.
https://thakeenathees.github.io/pocketlang/
MIT License
1.52k stars 80 forks source link

[Enhancement] add List.resize(n) #258

Open khchen opened 2 years ago

khchen commented 2 years ago

Add resize method to List class. Example:

l = [1, 2, 3, 4, 5]
print(l)

l.resize(3)
print(l)

l.resize(5)
print(l)

Output:

[1, 2, 3, 4, 5]
[1, 2, 3]
[1, 2, 3, null, null]