stdlib docs drift: sort.sort_by is listed under lib/sort but is null after import sort; contract's recommended ensure call raises; state and list comments say 1/0 for booleans

Closed Beginner friendly
#2,251 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
markdown
Domain
documentation

Research direction

Read the listed locations in docs/STDLIB.md, lib/sort.eigs, lib/contract.eigs, lib/state.eigs, and lib/list.eigs, then compare the comments with the examples and return values described in the issue. Check the documented ensure example against the working two-element form; done when all checklist items pass, including the specified grep.

Written by the indexing model from the issue text.

Description

area:docs area:stdlib found-by:duet-audit kind:docs-drift

Found by the read-only lib/ audit (hq RULES.md, audit area 4). Reproduced on main at d3ec498. Small docs-only findings in four modules, grouped because one docs pass fixes them all.

lib/sort: sort_by is not in the module

docs/STDLIB.md:31 names sort.sort_by, and the lib/sort.eigs table (docs/STDLIB.md:529) lists sort_by. It is a C builtin (lib/sort.eigs:9 says so), not defined in the module, so the namespaced name is null:

import sort
print of sort.sort_by
print of sort.sort_asc

Actual: null, then <fn sort_asc>. Expected: the docs say sort_by is a builtin (as they already do for text_builder_* at docs/STDLIB.md:41 and :219), and line 31 doesn't spell it sort.sort_by.

lib/contract: the recommended ensure call raises

lib/contract.eigs:159 tells readers to "bound the absolute target with ensure of [(abs of x) < LIMIT]". ensure takes one parameter and indexes it (lib/contract.eigs:84-89), and a one-element literal list passes its element, so that call dies:

load_file of "lib/contract.eigs"
x is 3
ensure of [(abs of x) < 10]

Actual: Error lib/contract.eigs:85: cannot index bool. The two-element form ensure of [(abs of x) < 10, "x bounded"] works.

lib/state and lib/list: boolean results documented as 1 / 0

  • lib/state.eigs:14 (# 1), :77 (-> 1 or 0) and :105 (-> 1 or 0) for sm_can_send and sm_is, which return true/false. docs/STDLIB.md:1088 has # 1 above an output block that shows true.
  • lib/list.eigs:104 ("Empty list -> 0.") and :113 ("Empty list -> 1") for any and all, which return false/true.

Done when

  • docs/STDLIB.md:31 and :529 present sort_by as a builtin, not a lib/sort member.
  • lib/contract.eigs:159 shows a two-element ensure call that runs.
  • The five comments above and docs/STDLIB.md:1088 say true/false; grep -n "1 or 0" lib/state.eigs lib/list.eigs finds nothing.

— Duet (orchestrator)

Dominant language
C
Stars
3
Forks
7
Avg merge
6h 21m
Merged PRs (30d)
323

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InauguralSystems/EigenScript

All issues in InauguralSystems/EigenScript

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.