Skip to content

Commit

Permalink
Merge pull request #64 from shuoer86/master
Browse files Browse the repository at this point in the history
Fix typos
samuelburnham authored Feb 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 2ed9f99 + 384e2b6 commit f65677c
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -14,6 +14,6 @@ repl : image
@bin/lurk

# Run repl after loading Lurk.
# Slower startup than replx afer image is dumped, but faster for one-off runs.
# Slower startup than replx after image is dumped, but faster for one-off runs.
replx :
@bin/lurkx
4 changes: 2 additions & 2 deletions api/api.lisp
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@

;; Although there are still unhandled edge cases (e.g. function signatures are
;; unrestricted by this type), the intent is that EXPR is a tree of CONS cells
;; terminating in ATOMs. EXPRs need not be balanced or homogenous in shape. A
;; terminating in ATOMs. EXPRs need not be balanced or homogeneous in shape. A
;; single ATOM is a zero-height tree.
(deftype expr () `(satisfies expr-p))

@@ -402,7 +402,7 @@
(values result env ram))))
(t
;; (fn . args)
;; First evaluate FN, then substitue result in new expression to evaluate.
;; First evaluate FN, then substitute result in new expression to evaluate.
(let ((evaled (eval-expr head env)))
(etypecase evaled
(closure (apply-closure evaled rest env)))))))))))
4 changes: 2 additions & 2 deletions spec/v0-1.md
Original file line number Diff line number Diff line change
@@ -32,15 +32,15 @@ Arithmetic operations on two Nums yield Nums and are treated as field operations

Comparisons interpret Nums as signed. The first half ranging from `0` exclusive to `(p - 1)/2` is considered positive. The second half ranging from `(p - 1)/2 + 1` to `p - 1` is considered negative. For every positive `n`, there is a corresponding negative `m`, such that `n + m = 0`. Furthermore, `0` is considered neither positive nor negative, and we have that `0 + 0 = 0`. The result is that the interpretation of signed Nums implied by the definition of < (etc.) is arithmetically consistent.

Arithmetic operations on two U64s yield U64s and are done modulo `2^64`; divison is integer division.
Arithmetic operations on two U64s yield U64s and are done modulo `2^64`; division is integer division.

Arithmetic operations that mix U64 and Num yield Nums and are performed by first coercing the U64 to Num.

### Numeral Parsing

The reader has support for parsing negative Nums `-<n>` and fractional Nums `<n>/<m>`.

A Num preceded by `-` is substracted from `0` at read time.
A Num preceded by `-` is subtracted from `0` at read time.

A Num `<n>` preceded by `/` and another Num `<m>` is calculated at read-time by performing a field-element division. This means that for arithmetic and algebraic purposes, the resulting field elements appear to behave like the corresponding rationals. However, note carefully, that this similarity does not extend to relational comparisons. For example, `(< 1/2 1/3) => t`, since `1/2` is the most negative Num, although this violates expectations if you consider 1/2 to behave like a rational.

0 comments on commit f65677c

Please sign in to comment.