Commit Graph

5 Commits

Author SHA1 Message Date
cf258b9074 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.
2016-05-19 14:11:48 -05:00
ef3aa07d84 Add API to get the type of object in a slot. 2016-02-19 07:18:00 -08:00
a447b66380 Make slots available to the API outside of foreign methods.
At any point in time, the user can call wrenEnsureSlots() which will
implicitly create a fiber and point to its stack if needed.
2015-12-28 07:49:47 -08:00
6f37d379f4 Add C API functions for working with lists:
- wrenEnsureSlots()
  Lets you go the foreign slot stack to make room for a temporary work
  area.

- wrenSetSlotNewList()
  Creates a new empty list and stores it in a slot.

- wrenInsertInList()
  Takes a value from one slot and inserts it into the list in another.

Still need more functions like getting elements from a list, removing,
etc. but this at least lets you create, populate, and return lists from
foreign methods.
2015-12-16 16:28:26 -08:00
7fcdcf2f1a wrenReturn___() -> wrenSlotSet___().
This turns those functions into general-purpose functions for writing
raw C values into slots on the foreign call stack.

Writing a return just means writing a value to slot 0.
2015-12-16 13:00:13 -08:00