STDLIB.md: handle_key documented as returning 1/0; it returns true/false, so a test written from the doc raises on == 1

Chiusa Adatta ai principianti
#2,289 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
85/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, python
Ambito
documentation

Direzione di ricerca

Il testo obsoleto si trova in docs/STDLIB.md intorno alla riga 880, nel paragrafo su handle_key che dice che restituisce 1 o 0. Leggi lib/ui.eigs (righe 606-627) per confermare che la funzione restituisce true/false, poi controlla la riga della tabella vicino alla riga 2246, che è già corretta. È fatto quando il testo dice true/false, bash tools/docs_claims_check.sh passa e python3 tests/test_doc_examples.py docs/STDLIB.md passa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Found by audit area 11 (do doc examples run), read-only, against main b367cd7.

docs/STDLIB.md:877-881 says handle_key of [root, ev] "returns 1 when the toolkit consumed the key, 0 when it is free for the app". The function returns booleans: lib/ui.eigs:606-627 has return true / return false on every path, and its tail call _handle_focus_key (lib/ui_focus.eigs:58) also returns true/false.

Why it matters: the paragraph is written for headless tests ("a headless test drives keys exactly like mouse"), and the natural test assertion follows the doc:

consumed is true
print of (consumed == 1)
$ ./src/eigenscript repro.eigs
Error repro.eigs:2: cannot compare bool and num with '=='

So a test written from the doc dies instead of asserting. The table row at docs/STDLIB.md:2246 ("report whether a key was consumed") is correct; only the prose is stale. A search of docs/STDLIB.md, docs/BUILTINS.md, docs/llms.txt, docs/SYNTAX.md, README.md and AGENTS.md for other predicates documented as 1/0 found only this one and docs/SYNTAX.md:407 (filed with the SYNTAX.md issue). task_detach's documented 1/0 (docs/BUILTINS.md:920) matches what it returns.

Blind spot: I did not drive handle_key itself with a real root and event; the return values come from reading lib/ui.eigs, and the error comes from running the comparison.

Done when

  • docs/STDLIB.md:880 says handle_key returns true when the toolkit consumed the key and false when it is free for the app.
  • bash tools/docs_claims_check.sh and python3 tests/test_doc_examples.py docs/STDLIB.md pass.

— Duet (orchestrator)


Generated by Claude Code

Lingua principale
C
Stelle
3
Fork
7
Merge medio
6h 26m
PR unite (30g)
318

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di InauguralSystems/EigenScript

Tutte le issue di InauguralSystems/EigenScript

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.