tomhrr / dale

Lisp-flavoured C
BSD 3-Clause "New" or "Revised" License
1.02k stars 48 forks source link

added range macros #159

Closed porky11 closed 7 years ago

porky11 commented 7 years ago

I added some macros for generating sequences of numbers at compile-time. One of them is an extended mfor (see #125) and useful to generate loops over fixed-size types. If macros can dispatch on arrays (#104), this way a generic macro for iterating over arrays can be written (which makes it easier to iterate over fixed-size types in general, since they mostly use array as data) Examples of usage of in-range can be found in my linear-algebra lib (#146)

tomhrr commented 7 years ago

Thanks for this. It's being merged for range and range-fn: in-range will be removed, and a new mfor added that uses eval-macro-call on its list argument.