Carp/src
Scott Olsen 4630e0e6a5
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);
```
2021-09-04 15:08:51 +02:00
..
ArrayTemplates.hs fix: #1261 (#1272) 2021-09-04 15:07:52 +02:00
AssignTypes.hs Refactor: clean up Env module, store type environments in modules (#1207) 2021-05-19 19:20:48 +02:00
ColorText.hs chore: Fix hlint warnings (#1086) 2020-12-22 17:44:44 +01:00
Commands.hs fix: make Symbol.prefix work on qualified symbols (#1286) 2021-07-29 08:26:31 +02:00
Concretize.hs fix: Allow types defined in modules to be members (#1303) 2021-09-04 14:27:48 +02:00
Constraints.hs feat: allow C types to satisfy all type constraints (#1306) 2021-09-04 15:08:51 +02:00
Context.hs fix: fix dynamic let bindings recursion and binder leaks (#1281) 2021-07-15 22:45:05 +02:00
Deftype.hs fix: Allow types defined in modules to be members (#1303) 2021-09-04 14:27:48 +02:00
Emit.hs fix: elide void definitions (#1305) 2021-09-04 14:29:44 +02:00
Env.hs fix: fix nested polymorphic types (#1294) 2021-08-10 08:41:20 +02:00
Eval.hs refactor: Cleanup Concretize module (#1283) 2021-08-05 07:36:29 +02:00
EvalError.hs feat: Remove address (#1223) 2021-05-27 22:04:46 +02:00
Expand.hs feat: Remove address (#1223) 2021-05-27 22:04:46 +02:00
Forms.hs refactor: Cleanup Concretize module (#1283) 2021-08-05 07:36:29 +02:00
GenerateConstraints.hs feat: Remove address (#1223) 2021-05-27 22:04:46 +02:00
Infer.hs refactor: Clean up memory management functions (#1240) 2021-06-16 21:41:58 +02:00
Info.hs refactor: Clean up memory management functions (#1240) 2021-06-16 21:41:58 +02:00
InitialTypes.hs fix: support recursive let bindings in static code (Fix 402) (#1230) 2021-06-05 17:45:50 +02:00
Interfaces.hs Refactor: clean up Env module, store type environments in modules (#1207) 2021-05-19 19:20:48 +02:00
Managed.hs feat: 'delete' interface (deciding whether a type is managed or not) (#1061) 2020-12-20 21:21:14 +01:00
Map.hs Refactor: clean up Env module, store type environments in modules (#1207) 2021-05-19 19:20:48 +02:00
Memory.hs refactor: Clean up memory management functions (#1240) 2021-06-16 21:41:58 +02:00
Meta.hs refactor: Context and Qualify (#1170) 2021-02-14 21:53:42 +01:00
Obj.hs fix: fix nested polymorphic types (#1294) 2021-08-10 08:41:20 +02:00
Parsing.hs fix: respect line number in repl (#1282) 2021-07-23 21:24:59 +02:00
Path.hs refactor: Apply Ormolu auto-formatting (#1045) 2020-12-02 16:33:37 +01:00
Polymorphism.hs fix: ensure interface values aren't discarded (#1308) 2021-09-04 14:27:07 +02:00
PrimitiveError.hs Refactor: clean up Env module, store type environments in modules (#1207) 2021-05-19 19:20:48 +02:00
Primitives.hs feat: add machine-info primitive draft (#1269) 2021-07-09 20:45:23 +02:00
Project.hs refactor: use ormolu (#1193) 2021-04-01 09:42:42 +02:00
Qualify.hs fix: support recursive let bindings in static code (Fix 402) (#1230) 2021-06-05 17:45:50 +02:00
Reify.hs Refactor: clean up Env module, store type environments in modules (#1207) 2021-05-19 19:20:48 +02:00
RenderDocs.hs fix: render submodules in html docs (#1242) 2021-06-11 13:02:52 +02:00
Repl.hs fix: respect line number in repl (#1282) 2021-07-23 21:24:59 +02:00
Scoring.hs fix: fix nested polymorphic types (#1294) 2021-08-10 08:41:20 +02:00
Set.hs refactor: Clean up memory management functions (#1240) 2021-06-16 21:41:58 +02:00
StartingEnv.hs feat: add machine-info primitive draft (#1269) 2021-07-09 20:45:23 +02:00
StaticArrayTemplates.hs fix: Unify aupdate and aupdate! with other update functions (#1220) 2021-05-25 12:11:31 +02:00
StructUtils.hs refactor: Clean up memory management functions (#1240) 2021-06-16 21:41:58 +02:00
SumtypeCase.hs fix: Allow types defined in modules to be members (#1303) 2021-09-04 14:27:48 +02:00
Sumtypes.hs fix: Allow types defined in modules to be members (#1303) 2021-09-04 14:27:48 +02:00
SymPath.hs Refactor: clean up Env module, store type environments in modules (#1207) 2021-05-19 19:20:48 +02:00
Template.hs Add Dynamic.hash (#1069) 2020-12-16 15:53:55 +01:00
ToTemplate.hs fix: Handle unit members correctly in array templates (#1058) 2020-12-08 17:29:55 +01:00
TypeError.hs refactor: Cleanup Concretize module (#1283) 2021-08-05 07:36:29 +02:00
TypePredicates.hs refactor: Make Lookup module more focused and DRY (#1054) 2020-12-07 07:06:32 +01:00
Types.hs feat: allow C types to satisfy all type constraints (#1306) 2021-09-04 15:08:51 +02:00
TypesToC.hs Refactor: clean up Env module, store type environments in modules (#1207) 2021-05-19 19:20:48 +02:00
Util.hs refactor: Clean up memory management functions (#1240) 2021-06-16 21:41:58 +02:00
Validate.hs fix: Allow types defined in modules to be members (#1303) 2021-09-04 14:27:48 +02:00