Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
4942896241 | |||
a263017504 | |||
75e98123df |
@@ -5,7 +5,7 @@ is a simple module for defining C code inside Carp code.
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
(load "https://veitheller.de/git/carpentry/inline-c@0.0.1")
|
(load "https://veitheller.de/git/carpentry/inline-c@0.0.3")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -16,7 +16,7 @@ express those things that are just kind of awkward in Carp (like complex
|
|||||||
bit-twiddling) without having to include a helper every time.
|
bit-twiddling) without having to include a helper every time.
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
(load "https://veitheller.de/git/carpentry/inline-c@0.0.1")
|
(load "https://veitheller.de/git/carpentry/inline-c@0.0.3")
|
||||||
|
|
||||||
(inline-c "int count_set_bits(int n) {
|
(inline-c "int count_set_bits(int n) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
(defdynamic *c-counter* 0)
|
(defdynamic *c-counter* 0)
|
||||||
|
|
||||||
(defndynamic inline-c [s]
|
(defndynamic inline-c [s]
|
||||||
(let [f (String.join [(Project.get-config "output-directory")
|
(let [f (String.concat [(Project.get-config "output-directory")
|
||||||
"carp_inline_c_generated" (str *c-counter*) ".h"])]
|
"carp_inline_c_generated" (str *c-counter*) ".h"])]
|
||||||
(do
|
(do
|
||||||
(write-file f s)
|
(write-file f s)
|
||||||
(set! *c-counter* (inc *c-counter*))
|
(set! *c-counter* (inc *c-counter*))
|
||||||
|
Reference in New Issue
Block a user