Software / code / prosody
Comparison
util/array.lua @ 1934:e14cf28396a8
util.array: Oh no it isn't!
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 08 Oct 2009 18:41:30 +0100 |
| parent | 1922:d5fe0f9b377a |
| child | 2923:b7049746bd29 |
comparison
equal
deleted
inserted
replaced
| 1933:3884a0aac4d7 | 1934:e14cf28396a8 |
|---|---|
| 109 | 109 |
| 110 --- | 110 --- |
| 111 | 111 |
| 112 -- Setup methods from array_base | 112 -- Setup methods from array_base |
| 113 for method, f in pairs(array_base) do | 113 for method, f in pairs(array_base) do |
| 114 local method = method; -- Yes, this is necessary :) | |
| 115 local base_method = f; | 114 local base_method = f; |
| 116 -- Setup global array method which makes new array | 115 -- Setup global array method which makes new array |
| 117 array[method] = function (old_a, ...) | 116 array[method] = function (old_a, ...) |
| 118 local a = new_array(); | 117 local a = new_array(); |
| 119 return base_method(a, old_a, ...); | 118 return base_method(a, old_a, ...); |