From 363e32d4557c939c8dbcb069a0a7578b5b594daf Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Thu, 3 Apr 2025 20:52:40 -0500 Subject: [PATCH] Adopt docstring from #1574 --- src/boot/boot.janet | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 30881a9f..7e9543d7 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -1084,8 +1084,14 @@ (map-aggregator ,maptype ,res (,f x ;call-buffer))))))) (defn map - `Map a function over every value in a data structure and - return an array of the results.` + ``` + Map a function `f` over every value in a data structure `ind` + and return an array of results, but only if no `inds` are + provided. Multiple data structures can be handled if each + `inds` is a data structure and `f` is a function of arity + one more than the number of `inds`. The resulting array has + a length that is the shortest of `ind` and each of `inds`. + ``` [f ind & inds] (def res @[]) (map-template :map res f ind inds)