Repository navigation
CreateFrom
Dennis Corvers edited this page Oct 23, 2026
·
2 revisions
Creates an Enumerable from an object and a custom iterator factory.
values = LuaQ.createFrom(object, iteratorFactory)| Parameter | Type | Description |
|---|---|---|
object |
any | Object passed to the iterator factory. |
iteratorFactory |
function(object) |
Returns the iterator function, iterator state, and initial control value. |
A new Enumerable using the custom iterator.
The factory must return the standard Lua generic-for tuple:
nextFunc, state, initialIndex. Use create for source types already
recognized by LuaQ.
local playerNames = { "Ada", "Bryn" }
local players = LuaQ.createFrom(playerNames, function(names)
return ipairs(names)
end)- Home
- Getting Started
-
Functions
- aggregate
- all
- any
- concat
- contains
- count
- create
- createFrom
- deepCopy
- difference
- elementAt
- elementAtOrDefault
- first
- firstOrDefault
- flatMap
- foreach
- groupBy
- groupByResult
- indexOf
- intersect
- ipairs
- last
- lastOrDefault
- map
- max
- min
- pairs
- sequenceEquals
- single
- singleOrDefault
- sort
- sortBy
- sortByDescending
- sortDescending
- sum
- take
- takeWhile
- thenBy
- thenByDecending
- toLookup
- toMap
- toSet
- toTable
- union
- unique
- where
- zip
- Aliases