Leftovers from the per-page audit — every item below was reproduced by running it. The cross-cutting defects (lambda syntax, function-type notation, pipe placeholder, auto-import classification, operator precedence) are already fixed in a33359f; these are the ones still open.
reference/grammar.md
- Missing operators from the operator list:
>>, !, ?, ??, ?.
- Missing built-in types:
Bytes, Matrix, RawPtr, Never
- Auto-import list omits
error, datetime, int8…uint64, float32
- "next line starts with
. (method chaining)" continuation rule — a leading . is a parse error. Leading |> does work.
not is listed among the binary operators; it is unary
guide/generics.md
The two bound examples cannot be used as written:
fn show[T: Repr](item: T) — Repr is not auto-derived for a bound. Calling it gives type 'Point' does not implement protocol 'Repr', and built-in types like Int can never satisfy it.
fn compare[T: Ord](a: T, b: T) -> Bool = a < b — declares fine but is uncallable; Int does not implement Ord, and a user type declared : Ord fails in codegen.
The only bounds built-in types actually satisfy are Numeric and Hash. Suggest rewriting both examples against a user-defined protocol (the Serializable shape in protocols.md, which does work).
stdlib pages
- json:
get is described as fetching a nested value — it is flat top-level only. get_int / as_int are described as returning none for a non-integer — they truncate floats (2.7 → some(2)). to_map missing from the function table. JsonPath cannot be written as a type annotation.
- bytes:
set is described as mutating in place — it returns a new Bytes and leaves the original alone even for a var binding (the in-place one is the undocumented set_at). push really takes mut b: Bytes, so it needs a var. The is_empty([]) example does not compile. The whole current surface (read_uint16/32, read_int32, read_float32, write_*, set_*, Endian) is undocumented.
- list:
pop is described as discarding the last element — it returns it. The filter_map example passes int.parse, which returns Result, not Option. list.is_empty([]) needs an annotated empty list.
- map:
map.new() needs a type annotation to compile as shown.
- string:
slice is documented 3-arg; the third parameter has a default, so the 2-arg form works and is undocumented.
- option / result:
option.is_none(none), result.is_err(err(…)) and result.to_err_option(err(…)) all fail to build (filed upstream as almide#899). error.context's error type is fixed to String, not generic as documented, and its example uses result as a variable name, which is a module.
- datetime / matrix: the reference examples contradict their own setup values (a timestamp fixed at 12:00:00 whose
minute is documented as 30; a matrix that is 3×4 in one example and 2×2 in the next).
- testing: omits the built-in
assert, assert_eq, assert_ne (no import needed) — the most-used assertions. assert_some / assert_ok are generic natively; the Option[String] / Result[String, String] restriction the page states is the WASM-only one, and assert_throws has no WASM implementation at all.
Leftovers from the per-page audit — every item below was reproduced by running it. The cross-cutting defects (lambda syntax, function-type notation, pipe placeholder, auto-import classification, operator precedence) are already fixed in a33359f; these are the ones still open.
reference/grammar.md
>>,!,?,??,?.Bytes,Matrix,RawPtr,Nevererror,datetime,int8…uint64,float32.(method chaining)" continuation rule — a leading.is a parse error. Leading|>does work.notis listed among the binary operators; it is unaryguide/generics.md
The two bound examples cannot be used as written:
fn show[T: Repr](item: T)—Repris not auto-derived for a bound. Calling it givestype 'Point' does not implement protocol 'Repr', and built-in types likeIntcan never satisfy it.fn compare[T: Ord](a: T, b: T) -> Bool = a < b— declares fine but is uncallable;Intdoes not implementOrd, and a user type declared: Ordfails in codegen.The only bounds built-in types actually satisfy are
NumericandHash. Suggest rewriting both examples against a user-defined protocol (theSerializableshape in protocols.md, which does work).stdlib pages
getis described as fetching a nested value — it is flat top-level only.get_int/as_intare described as returningnonefor a non-integer — they truncate floats (2.7→some(2)).to_mapmissing from the function table.JsonPathcannot be written as a type annotation.setis described as mutating in place — it returns a newBytesand leaves the original alone even for avarbinding (the in-place one is the undocumentedset_at).pushreally takesmut b: Bytes, so it needs avar. Theis_empty([])example does not compile. The whole current surface (read_uint16/32,read_int32,read_float32,write_*,set_*,Endian) is undocumented.popis described as discarding the last element — it returns it. Thefilter_mapexample passesint.parse, which returnsResult, notOption.list.is_empty([])needs an annotated empty list.map.new()needs a type annotation to compile as shown.sliceis documented 3-arg; the third parameter has a default, so the 2-arg form works and is undocumented.option.is_none(none),result.is_err(err(…))andresult.to_err_option(err(…))all fail to build (filed upstream as almide#899).error.context's error type is fixed toString, not generic as documented, and its example usesresultas a variable name, which is a module.minuteis documented as 30; a matrix that is 3×4 in one example and 2×2 in the next).assert,assert_eq,assert_ne(no import needed) — the most-used assertions.assert_some/assert_okare generic natively; theOption[String]/Result[String, String]restriction the page states is the WASM-only one, andassert_throwshas no WASM implementation at all.