mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 15:43:01 +00:00 
			
		
		
		
	Merge pull request #522 from pyrmont/docs.keep-docstring
Clarify description of keep
This commit is contained in:
		| @@ -945,8 +945,10 @@ | |||||||
|   counter) |   counter) | ||||||
|  |  | ||||||
| (defn keep | (defn keep | ||||||
|   `Given a predicate, take only elements from an array or tuple for |   ``Given a predicate `pred`, return a new array containing the truthy results | ||||||
|   which (pred element) is truthy. Returns a new array of truthy predicate results.` |   of applying `pred` to each element in the indexed collection `ind`. This is | ||||||
|  |   different from `filter` which returns an array of the original elements where | ||||||
|  |   the predicate is truthy.`` | ||||||
|   [pred ind] |   [pred ind] | ||||||
|   (def res @[]) |   (def res @[]) | ||||||
|   (each item ind |   (each item ind | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose