Mercurial > lasercutter
changeset 4:6533b4ef83ad
added hash-map filters :)
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 20 Aug 2010 01:30:12 -0400 |
parents | e6254010c95a |
children | 8cc418e04b87 |
files | src/laser/rasterize.clj |
diffstat | 1 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/src/laser/rasterize.clj Fri Aug 20 00:49:00 2010 -0400 1.2 +++ b/src/laser/rasterize.clj Fri Aug 20 01:30:12 2010 -0400 1.3 @@ -116,18 +116,22 @@ 1.4 "M101" 1.5 "M3 S1"])) 1.6 1.7 +(defn raster-epilogue [] 1.8 + (str-join \newline 1.9 + ["M63 PO" 1.10 + "M5" 1.11 + "M2"])) 1.12 1.13 1.14 +(defn raster-comment [string] 1.15 + (str "(" (re-gsub #"[()]" "" string) ")")) 1.16 1.17 +(defn filter-keys [fun m] 1.18 + (select-keys m (filter fun (keys m)))) 1.19 1.20 +(defn filter-vals [fun m] 1.21 + (into {} (filter (comp fun val) m))) 1.22 1.23 - 1.24 - 1.25 - 1.26 - 1.27 - 1.28 - 1.29 - 1.30 1.31 1.32