Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.12.2]

### Changed
- `json` bumped to 0.7.2, which uses the public Map API for JSON Patch
diffing. The Map reference helpers now come from core. web builds again
with Carp core's open-addressing Map.

## [0.12.1]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ kqueue/epoll.
## Installation

```clojure
(load "git@github.com:carpentry-org/web@0.12.1")
(load "git@github.com:carpentry-org/web@0.12.2")
```

## Usage

Define handler functions and register them with `defserver`:

```clojure
(load "git@github.com:carpentry-org/web@0.12.1")
(load "git@github.com:carpentry-org/web@0.12.2")

(defn hello [req params]
(Response.text @"Hello, world!"))
Expand Down
2 changes: 1 addition & 1 deletion examples/todo/server.carp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; in-tree load so CI compiles this example; outside the repo use
; (load "git@github.com:carpentry-org/web@0.12.1")
; (load "git@github.com:carpentry-org/web@0.12.2")
(load "../../web.carp")
(load "git@github.com:carpentry-org/orm@0.5.2" "backends/sqlite3.carp")

Expand Down
2 changes: 1 addition & 1 deletion gendocs.carp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ register them as routes on an [`App`](./App.html), and start serving with

### HTTP Example
```
(load \"git@github.com:carpentry-org/web@0.12.1\")
(load \"git@github.com:carpentry-org/web@0.12.2\")

(defn hello [req params]
(Response.text @\"Hello, world!\"))
Expand Down
27 changes: 3 additions & 24 deletions web.carp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Events support.
## Installation

```
(load \"git@github.com:carpentry-org/web@0.12.1\")
(load \"git@github.com:carpentry-org/web@0.12.2\")
```

## Usage

```
(load \"git@github.com:carpentry-org/web@0.12.1\")
(load \"git@github.com:carpentry-org/web@0.12.2\")

(defn hello [req params]
(Response.text @\"Hello, world!\"))
Expand All @@ -36,7 +36,7 @@ Events support.

(load "git@github.com:carpentry-org/http@0.7.1")
(load "git@github.com:carpentry-org/socket@0.2.5")
(load "git@github.com:carpentry-org/json@0.7.1")
(load "git@github.com:carpentry-org/json@0.7.2")
(load "git@github.com:carpentry-org/file@0.4.1")
(load "git@github.com:carpentry-org/log@0.2.0")
(load "git@github.com:carpentry-org/utf8.carp@0.2.0")
Expand Down Expand Up @@ -286,27 +286,6 @@ Returns 20 raw bytes.")
40-character lowercase hex string.")
(defn sha1-hex [key msg] (hex-encode &(sha1 key msg))))

(defmodule Map
(doc update-value! "calls `f` with a reference to the value at key `k`.
Does nothing if the key is not found. The reference allows mutation through
FFI functions (e.g. reading into a stream's buffer).")
(defn update-value! [m k f]
(let [idx (Int.positive-mod (hash k) @(n-buckets m))]
(let [bucket (Array.unsafe-nth (buckets m) idx)
i (Bucket.find bucket k)]
(when (>= i 0)
(~f (Pair.b (Array.unsafe-nth (Bucket.entries bucket) i)))))))

(doc value-ref! "calls `f` with a reference to the value at key `k` and
returns whatever `f` returns. If the key is missing, returns `default`.")
(defn value-ref! [m k f default]
(let [idx (Int.positive-mod (hash k) @(n-buckets m))]
(let [bucket (Array.unsafe-nth (buckets m) idx)
i (Bucket.find bucket k)]
(if (>= i 0)
(~f (Pair.b (Array.unsafe-nth (Bucket.entries bucket) i)))
default)))))

(relative-include "src/fstat_mtime.h")
(private web-fstat-mtime)
(hidden web-fstat-mtime)
Expand Down
Loading