No verb can take a BASIC function, and nothing resolves a bare word to one #15

Open
opened 2026-08-02 19:04:21 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md §6 item 40 (at 9151438)

The C half is done: akbasic_runtime_call_function() splits argument binding out of call-site
handling, so a verb can call a BASIC function with values it already has.

What is still not done is the language half: no verb takes a function yet, and nothing resolves
a bare word to a function rather than to a label. That wants
akbasic_environment_get_function() and the precedent of COLLISION 1, BUMPED taking a bare word
by name (src/runtime_sprite.c) -- and a verb that actually needs it, rather than being built on
speculation.

It was rejected for the collision query on the use case rather than on feasibility: the motivating
program wants one answer rather than many, a loop is the idiomatic form in this dialect, and the
language already has a callback shaped the way a BASIC programmer expects -- an interrupt handler
taking a label.

One hazard, if it is ever wired to a collision query. Do not pass the BASIC function through as
an akgl_CollisionVisitFunc: it would run inside the partitioner's cell-chain walk, and the
callback a brick loop wants removes the brick it was just told about, which is
partitioner.remove() rewriting the chain the walk holds a cursor into. Collect the candidates
during the walk, close the walk, then dispatch.

Bounded by the REPL limitation on multi-line DEF bodies: a multi-line body runs only while a
program is running, which is the case a verb is in and not the case a host with a stopped runtime
is in.

Files: src/runtime.c, src/environment.c, src/runtime_sprite.c


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md §6 item 40 (at 9151438) The C half is **done**: `akbasic_runtime_call_function()` splits argument binding out of call-site handling, so a verb can call a BASIC function with values it already has. **What is still not done is the language half:** no verb takes a function yet, and nothing resolves a bare word to a *function* rather than to a label. That wants `akbasic_environment_get_function()` and the precedent of `COLLISION 1, BUMPED` taking a bare word by name (`src/runtime_sprite.c`) -- **and a verb that actually needs it, rather than being built on speculation.** It was rejected for the collision query on the use case rather than on feasibility: the motivating program wants one answer rather than many, a loop is the idiomatic form in this dialect, and the language already has a callback shaped the way a BASIC programmer expects -- an interrupt handler taking a label. **One hazard, if it is ever wired to a collision query.** Do not pass the BASIC function through as an `akgl_CollisionVisitFunc`: it would run inside the partitioner's cell-chain walk, and the callback a brick loop wants **removes the brick it was just told about**, which is `partitioner.remove()` rewriting the chain the walk holds a cursor into. Collect the candidates during the walk, close the walk, then dispatch. Bounded by the REPL limitation on multi-line `DEF` bodies: a multi-line body runs only while a program is running, which is the case a verb is in and not the case a host with a stopped runtime is in. **Files:** `src/runtime.c`, `src/environment.c`, `src/runtime_sprite.c` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 1.0.0 milestone 2026-08-02 19:04:21 -04:00
tachikoma added the api-gapblast-radius:lowstatus::grooming labels 2026-08-02 19:04:21 -04:00
Sign in to join this conversation.