This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/project.janet b/project.janet | |
index f1bd87c..90a6f6e 100644 | |
--- a/project.janet | |
+++ b/project.janet | |
@@ -10,11 +10,11 @@ | |
(declare-executable | |
:name "remark" | |
- :entry "src/remarkable.janet") | |
+ :entry "src/remarkable/init.janet") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn parallel | |
[jobs] | |
(print "Beginning " (length jobs) " jobs...") | |
(let [results-chan (ev/thread-chan 0) | |
res @{}] | |
(each job jobs | |
(ev/thread (fiber/new job) results-chan :n)) | |
(while (< (length res) (length jobs)) | |
(let [[k v] (ev/take results-chan)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### dagbuild.janet | |
### | |
### A module for building files / running commands in an order. | |
### Building blocks for a Make-like build system. | |
### | |
# | |
# DAG Execution | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn group-by | |
``Group elements of `ind` by a function `f` and put the resutls into a table. The keys of | |
the table are the distinct return values of `f`, and the values are arrays of all elements `x` of `ind` | |
such that `(f x)` is equal to the key.`` | |
[f ind] | |
(def ret @{}) | |
(each x ind | |
(def y (f x)) | |
(if-let [arr (get ret y)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import preloader) | |
# Files that a use may want to load | |
(def mod1 (require "mod1")) | |
(def mod2 (require "mod2")) | |
(defn main [& args] | |
(preloader/preload "@mod1" mod1) | |
(preloader/preload "@mod2" mod2) | |
(dofile "some-user-file.janet")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClJ1bm5pbmcgdGVzdCBzdWl0ZSAzIHRlc3RzLi4uCiAgChtbMzJt4pyUG1swbSAocmFuZ2UgMTAp | |
OiB0cnVlChtbMzJt4pyUG1swbSAocmFuZ2UgMSAxMCk6IHRydWUKG1szMm3inJQbWzBtIHppcGNv | |
bGw6IHRydWUKG1szMm3inJQbWzBtIGRlZi06IHRydWUKG1szMm3inJQbWzBtIG1hdGNoIDE6IHRy | |
dWUKG1szMm3inJQbWzBtIG1hdGNoIDI6IHRydWUKG1szMm3inJQbWzBtIG1hdGNoIDM6IHRydWUK | |
G1szMm3inJQbWzBtIHJlZ3Jlc3Npb24gMTogdHJ1ZQobWzMybeKclBtbMG0gc2Nhbi1udW1iZXIg | |
MTogdHJ1ZQobWzMybeKclBtbMG0gc2Nhbi1udW1iZXIgLTE6IHRydWUKG1szMm3inJQbWzBtIHNj | |
YW4tbnVtYmVyIDEuM2U0OiB0cnVlChtbMzJt4pyUG1swbSBpZi1ub3QgMTogdHJ1ZQobWzMybeKc | |
lBtbMG0gaWYtbm90IDI6IHRydWUKG1szMm3inJQbWzBtIGlmLW5vdCAzOiB0cnVlChtbMzJt4pyU | |
G1swbSBpZi1ub3QgNDogdHJ1ZQobWzMybeKclBtbMG0gdW5sZXNzOiB0cnVlChtbMzJt4pyUG1sw | |
bSBsb29wIDpwYWlyczogdHJ1ZQobWzMybeKclBtbMG0gYmFkIGFyaXR5IDE6IHRydWUKG1szMm3i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running test suite 3 tests... | |
✔ (range 10): true | |
✔ (range 1 10): true | |
✔ zipcoll: true | |
✔ def-: true | |
✔ match 1: true | |
✔ match 2: true | |
✔ match 3: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(with [conn (net/connect "127.0.0.1" "8000")] | |
(printf "Connected to %q!" conn) | |
(:write conn "Echo...") | |
(print "Wrote to connection...") | |
(def res (:read conn 1024)) | |
(print "client done") | |
(pp res)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/PKGBUILD b/PKGBUILD | |
index 479ef5e..fc24851 100644 | |
--- a/PKGBUILD | |
+++ b/PKGBUILD | |
@@ -12,6 +12,7 @@ provides=('janet') | |
conflicts=('janet-lang-git') | |
source=("$pkgname-$pkgver.tar.gz::https://github.com/janet-lang/janet/archive/v${pkgver}.tar.gz") | |
sha256sums=('02724d6074a0d6fa53a548e8bdaaf49999f082e30b277c73444900f739a53062') | |
+options=('staticlibs') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### utf8.janet | |
### | |
### Pure janet utf8 utils. You should probably just use C. | |
### | |
(defn utf8-encode | |
"Convert a sequence of codepoints to a string." | |
[x] | |
(def buf @"") |
NewerOlder