Implement and document new ldict-map.
This commit is contained in:
		
							parent
							
								
									5533a3256e
								
							
						
					
					
						commit
						bd7421b626
					
				
					 2 changed files with 29 additions and 8 deletions
				
			
		
							
								
								
									
										16
									
								
								doc/utils.md
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								doc/utils.md
									
										
									
									
									
								
							|  | @ -96,6 +96,22 @@ is not already present in the dictionary ```ld```. | |||
| 
 | ||||
| Returns the list of keys stored in given dictionary. | ||||
| 
 | ||||
|     (ldict-map proc ld) | ||||
| 
 | ||||
| * ```proc``` - procedure accepting 1, 2 or 3 arguments | ||||
| * ```ld``` - a ldict instance | ||||
| 
 | ||||
| Returns a new dictionary of the same type with all values processed by | ||||
| given procedure. | ||||
| 
 | ||||
| If it accepts one argument, only the value is passed to it. If it | ||||
| accepts two values, the key and the value is passed to it. And lastly | ||||
| if it accepts three arguments, the key, value and numeric index | ||||
| (starting from 0) are passed to it. | ||||
| 
 | ||||
| In all cases the value the procedure returns is taken as the new value | ||||
| for given key. | ||||
| 
 | ||||
| ### IO | ||||
| 
 | ||||
|     (import util-io) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue