#330
Associative destructuring 2
Difficulty: | Easy |
Topics: | destructuring |
de-structuring these data into chunk or pieces helps you find or use the data you need. Read on Destructuring
(= '("4 Ipsum left" "6 Lorem right" "5 1234 left" "2 221b left" "0 xiv left") (map (fn [mydata] (let [{text :text pos :pos idx :idx} mydata] (str idx " " text " " pos))) __)) | |
(= '("Ipsum 1 :alpha" "Lorem 2 :alpha" "1234 3 :numeric" "221b 4 :alpha-numeric" "xiv 5 :roman") (map (fn [{:keys [text id ttype]}] (str text " " id " " ttype)) __)) |