kiselgra / c-mera

Next-level syntax for C-like languages :)
Other
405 stars 17 forks source link

Having nil in decl #75

Closed kiselgra closed 7 years ago

kiselgra commented 7 years ago

When generating decl forms we might have conditional declarations such as

(defmacro my-decls (decls &body body)
  (decl ,(loop for d in decls collect (if (keep d) d))))

This works fine, but for the filtered-out declarations a superflous line containing a ';' appears.

This is more easily reproduced by

(decl ((int x)
      nil
      (int y))
lispbub commented 7 years ago

,(remove nil (loop ... )) usually solves that

kiselgra commented 7 years ago

Could have thought of that, sorry.

But thanks for the fix :)