Merging array changes from pxt-microbit

This commit is contained in:
Brahma Giri Abhijith Chatra
2017-01-19 11:30:06 -08:00
parent 9c140a5e6f
commit b359411058
3 changed files with 379 additions and 68 deletions

View File

@ -81,7 +81,7 @@ namespace Boolean_ {
}
//%
bool bang(bool v) { return !v; }
bool bang(int v) { return v == 0; }
}
namespace Number_ {
@ -158,13 +158,19 @@ namespace Array_ {
//%
int length(RefCollection *c) { return c->length(); }
//%
void setLength(RefCollection *c, int newLength) { c->setLength(newLength); }
//%
void push(RefCollection *c, uint32_t x) { c->push(x); }
//%
uint32_t pop(RefCollection *c) { return c->pop(); }
//%
uint32_t getAt(RefCollection *c, int x) { return c->getAt(x); }
//%
void removeAt(RefCollection *c, int x) { c->removeAt(x); }
void setAt(RefCollection *c, int x, uint32_t y) { c->setAt(x, y); }
//%
void setAt(RefCollection *c, int x, uint32_t y) { c->setAt(x, y); }
uint32_t removeAt(RefCollection *c, int x) { return c->removeAt(x); }
//%
void insertAt(RefCollection *c, int x, uint32_t value) { c->insertAt(x, value); }
//%
int indexOf(RefCollection *c, uint32_t x, int start) { return c->indexOf(x, start); }
//%