Closed veikman closed 5 years ago
Good catch. I like the change, though the implementation seems a bit more complicated than necessary. I'll merge the PR as a do appreciate the tests, but I'll probably rewrite it a bit.
Sounds like a good plan. I went with the verbose version because it would be easier to add a formal deprecation warning to it. Here’s a terse version.
(defn offset [opt & block] `(:offset ~(if (map? opt) opt {:r opt}) ~@block))
The current offset function supports only one of the three parameters that OpenSCAD can use, and it does so in numeric form. This PR adds support for additional parameters on the pattern of other functions already in scad-clj, using a map of keyword arguments in place of the old number.
I have preserved support for the numeric-only call signature and I have not marked it as deprecated. However, I propose that it should be formally deprecated and eventually removed (in v1.0.0) to control cyclomatic complexity.