Add support for retrieving list values from a slot

This PR adds support for retrieving list information from a slot. Rather
than take the whole list, two different methods are provided for
retrieving a) the length of the list, and b) a specific value in the
list.
This commit is contained in:
Damien Radtke
2016-05-19 14:11:48 -05:00
parent befe90501b
commit cf258b9074
5 changed files with 49 additions and 1 deletions
+6
View File
@@ -345,6 +345,12 @@ double wrenGetSlotDouble(WrenVM* vm, int slot);
// foreign class.
void* wrenGetSlotForeign(WrenVM* vm, int slot);
// Returns the size of the list stored in [slot].
int wrenGetSlotListSize(WrenVM* vm, int slot);
// Reads a value from the list in [slot].
WrenValue* wrenGetSlotListValue(WrenVM* vm, int slot, int index);
// Reads a string from [slot].
//
// The memory for the returned string is owned by Wren. You can inspect it