Skip to content

EVALUATE, INCLUDED, INCLUDE + /mar/fs.hoon#27

Merged
sigilante merged 5 commits intomasterfrom
sigilante/evaluate-include
Apr 15, 2026
Merged

EVALUATE, INCLUDED, INCLUDE + /mar/fs.hoon#27
sigilante merged 5 commits intomasterfrom
sigilante/evaluate-include

Conversation

@sigilante
Copy link
Copy Markdown
Owner

Summary

  • Pass 1: EVALUATE ( addr cnt -- ) — pure string eval from North memory; no I/O needed. Also adds /mar/fs.hoon Clay mark for .fs Forth source files (delegates diff/merge to %txt).
  • Pass 2: INCLUDED ( addr cnt -- ) and INCLUDE <path> — load and eval Forth source files from Clay via synchronous .^ (dotket) scry. INCLUDE is parsing-word sugar that rewrites to S" path" INCLUDED before eval. Desk name injected from q.byk.bowl alongside now/our.

Path convention

INCLUDE /lib/utils        \ loads desk/lib/utils.fs
INCLUDE /examples/sieve   \ loads desk/examples/sieve.fs
S" /lib/utils" INCLUDED   \ stack-based equivalent

Test plan

  • EVALUATE — 4 unit tests in test-north.sh (arith, word definition, output, HEX mode)
  • Full suite: 317 passed, 0 failed
  • INCLUDE / INCLUDED require a running Arvo context — manual ship test after desk commit

🤖 Generated with Claude Code

sigilante and others added 5 commits April 14, 2026 15:30
EVALUATE ( addr cnt -- ) reads a string from North memory and runs it
through parse/eval, inheriting the current interpreter state (dict,
base, stacks).  This lets words build and evaluate Forth source at
runtime.

/mar/fs.hoon is a minimal Clay mark for .fs files (North/Forth source),
delegating diff/merge to %txt.  Required for INCLUDE Clay scries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
INCLUDED ( addr cnt -- ) reads a path string from North memory,
constructs a Clay scry path using our/now/desk from settings, scries
the file as %fs mark (wain), joins lines with spaces, and runs the
result through parse/eval.

INCLUDE <path> is handled in the agent before eval: rewrites
'INCLUDE /lib/utils' to 'S" /lib/utils" INCLUDED' so the path lands
in memory and INCLUDED does the Clay work.  This keeps INCLUDED a
pure lib word while giving INCLUDE standard parsing-word feel at the REPL.

desk is injected from q.byk.bowl alongside now/our before each eval.
split-on-slash helper added to lib for path segment construction.

INCLUDE/INCLUDED require a running Arvo context; not unit-testable
in the shell harness (dotket crashes outside Arvo).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sigilante sigilante merged commit b21b53d into master Apr 15, 2026
1 check passed
@sigilante sigilante deleted the sigilante/evaluate-include branch April 15, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant