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

Cerrado Apto para principiantes
#2,289 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
85/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bash, python

Línea de trabajo

El texto desactualizado está en docs/STDLIB.md alrededor de la línea 880, en el párrafo de handle_key que dice que devuelve 1 o 0. Lee lib/ui.eigs (líneas 606-627) para confirmar que la función devuelve true/false y luego revisa la fila de la tabla cerca de la línea 2246, que ya es correcta. Está terminado cuando el texto dice true/false, bash tools/docs_claims_check.sh pasa y python3 tests/test_doc_examples.py docs/STDLIB.md pasa.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C
Estrellas
3
Forks
7
Merge medio
6 h 26 min
PR fusionados (30 d)
318

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de InauguralSystems/EigenScript

Todos los issues de InauguralSystems/EigenScript

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.