Minor tweaks and a new deque operator

This commit is contained in:
2021-07-20 14:48:53 -04:00
parent 08ca274444
commit 2930953569
10 changed files with 81 additions and 120 deletions

View File

@@ -1,30 +1,8 @@
////////////////////////////////////////////////////////////
//
// TABLE
//
// This module contains a library of lua functions
// for manipulating tables. Some of the functions only
// work on vectors (ie, tables with integer keys starting
// at one). When a function only works on vectors, it
// is noted.
//
// QUEUE
//
// This module contains a library of lua functions for
// manipulating queues. Queues are represented as a table
// with a "head" and a "tail", and with integer-keyed values.
// For example:
//
// {
// "tail": 100,
// "head": 103,
// 100: "a",
// 101: "b",
// 102: "c"
// }
//
// Values are pushed onto the head, and values are popped
// from the tail.
// for manipulating tables. It also provides a library
// of useful classes based on tables.
//
////////////////////////////////////////////////////////////
@@ -80,7 +58,7 @@ int table_count(lua_State *L);
int table_clear(lua_State *L);
//
// Create and return an empty queue. Queues are implemented
// Create and return an empty deque. Queues are implemented
// as tables which are used as dynamically-expandable circular
// buffers.
//
@@ -107,6 +85,15 @@ int deque_popr(lua_State *L);
int deque_nthl(lua_State *L);
int deque_nthr(lua_State *L);
//
// Search a deque for a value.
//
// Search starts on the specified end and indices are relative
// to specified end.
//
int deque_findl(lua_State *L);
int deque_findr(lua_State *L);
//
// Return the number of values in the deque.
//