Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow C types to satisfy all type constraints (#1306)
This commit builds on the emit-c feature by permitting C typed values to be used anywhere in Carp code. For example, if one wants to use the literal C macro `EDOM`: ```clojure (register EDOM C "EDOM") (Int.+ 1 EDOM) => 34 ``` when compiled, this will produce the call: ```c Int__PLUS(1, EDOM) ``` So it provides a quite flexible means of using C macros directly. It is, of course, also radically unsafe. Anyone registering and using values of the C type better be cautious. One can get pretty crazy with this feature: ```clojure (register comment-it C "// commented out;") (Int.+ 1 comment-it) => int _11 = Int__PLUS_(1, // commented out;) int* _12 = &_11; // ref String _13 = IntRef_str(_12); ```
- Loading branch information