From c30ae87bb26cf1164573a32f0e1b0aae3a773da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAURENS=20J=C3=A9r=C3=B4me?= Date: Fri, 31 May 2024 16:01:01 +0200 Subject: [PATCH 1/2] Documentation of Map.lua --- lua/pl/Map.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/pl/Map.lua b/lua/pl/Map.lua index 572b22ad..0899d2eb 100644 --- a/lua/pl/Map.lua +++ b/lua/pl/Map.lua @@ -37,10 +37,14 @@ local function makelist(t) return setmetatable(t, require('pl.List')) end ---- list of keys. +--- return a List of all keys. +-- @class function +-- @name Map:keys Map.keys = tablex.keys ---- list of values. +--- return a List of all values. +-- @class function +-- @name Map:keys Map.values = tablex.values --- return an iterator over all key-value pairs. @@ -48,7 +52,7 @@ function Map:iter () return pairs(self) end ---- return a List of all key-value pairs, sorted by the keys. +--- return a List of all key-value pairs, sorted by the keys in ascending order. function Map:items() local ls = makelist(tablex.pairmap (function (k,v) return makelist {k,v} end, self)) ls:sort(function(t1,t2) return t1[1] < t2[1] end) From 383e5de976c257bc7840e3e06fc32ab17c03eea8 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Tue, 4 Jun 2024 11:19:00 +0200 Subject: [PATCH 2/2] Update lua/pl/Map.lua --- lua/pl/Map.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pl/Map.lua b/lua/pl/Map.lua index 0899d2eb..06fd0963 100644 --- a/lua/pl/Map.lua +++ b/lua/pl/Map.lua @@ -44,7 +44,7 @@ Map.keys = tablex.keys --- return a List of all values. -- @class function --- @name Map:keys +-- @name Map:values Map.values = tablex.values --- return an iterator over all key-value pairs.