ludic/examples/rejected
Orkuncakilkaya e4265f5fdb feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions
A registry marked `@Machine(Deer.mood)` is the transitions of a machine over that enum field of the
records a state's Table<Deer> holds. Its record has from and to (the enum's variants), on: string (an
action's name, "" for a transition the tick asks), guard: fn(Row<Deer>, reads...) -> bool and
enter: fn(Row<Deer>, reads...) -> void; the states are the enum's variants and the start is the
field's default. The rows are data (an .lres or defs), the names the studio already edits.

Written by the compiler (machines.ludic, machines_write.ludic): for each action an `on` names, a row
reducer in the registry's file (named ..__machine__DeerSteps, so it sits beside the program's own
row reducer on the same action, after it): the row's state, the first transition from it on that
action whose guard passes, the field set, enter run - guards and enters called by name. When a row
leaves a state on a guard alone, `state DeerStepsMachine` (the kept row view) and
deer_steps_tick(m: mut DeerStepsMachine, s: mut Herd, reads...), one transition a row a tick.
Nothing allocates.

The table is the whole machine: the field written anywhere else - an assignment, or a `machine`
block's become over it - is a type error (check_stmt.ludic, ck_machine_write). Guards and enters take
the row first, are the record's module's, keep a row reducer's rules (and may be handed the row);
a guard writes nothing through it. The graph is checked, each error at its row (in the .lres when
the rows are there): a state never reached from the start, a state with no way out, an `on` naming
no action or an action with no @Target, a self-transition with no guard, two ways out of a state on
one trigger behind an unguarded first. Also refused: @Machine off a registry, a field that is not a
plain enum with a default, a @Column field, no table (or two) of the record, a transitions record of
another shape, a machine outside its table's state's module.

ludic schema's code section gains `machines` (registry, record, field, enum, table, start, states,
actions, tick, module, at); ludic deps names a machine's reducer `reducer Deer in Herd.deer on Spook
(machine DeerSteps)`. vocab @Machine; docs annot-machine, kw-machine; LANGUAGE.md "A machine as
data"; examples actions/machine (+ deer_steps.lres) and ten rejects; test.ludic feat, reject and
schema cases (not run); changes/machines.md. Reseeded; bootstrap-cfree fixpoint holds (317642
lines); Maroon Lake's `ludic build --check` is clean against this tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:37:37 +03:00
..
closed_kit feat(lang): open registry - other modules' defs, in an order imports cannot change 2026-09-25 04:28:34 +03:00
craft_kit feat(lang): def REGISTRY from "file.lres" - a game fills an open registry from its own file 2026-09-25 07:22:05 +03:00
data feat(lang): L9 resource files - registry ... from 2026-09-24 14:00:20 +03:00
exported_events feat(lang): a module's private records and events are its own 2026-09-25 11:02:48 +03:00
exported_kinds feat(lang): a module's private records and events are its own 2026-09-25 11:02:48 +03:00
exported_twins feat(lang): a module's private names are its own 2026-09-25 07:08:05 +03:00
hidden_kit feat(lang): open registry - other modules' defs, in an order imports cannot change 2026-09-25 04:28:34 +03:00
i18n_keys i18n 26.9, error mode: English left is an error under a lang line (a template's words, a text attribute's, a choice that reads as words, a @Text row's English), ludic deps still counting english_left; hole counts and undescribed splits stay warnings. ludic.ui's own words are keys - ui_tk(ui_st, k"ui.right_click", plain) for the key field's Right / Middle / Left click and press a key..., its plain text for a program with no translator; the examples' en.po / tr.po carry ui.*, i18n_ui checks clean, rejected/i18n_keys/english_left holds the error, data_missing counts 2; LANGUAGE.md and the changeset; on lang/foundations 2288feeb; reseeded, bootstrap-cfree fixpoint holds 2026-09-30 02:45:15 +03:00
layer_cycle feat(lang): layers - module flow in layer app uses base, items 2026-09-25 12:54:15 +03:00
layer_reach feat(lang): layers - module flow in layer app uses base, items 2026-09-25 12:54:15 +03:00
permap_maps @Asset(kind, map): a path under each map's directory - ludicc --check looks for it in every map (a @PerMap row's in its own, a game-wide row's in all), unless @Asset(kind, map, optional); the schema marks it scope map; reseeded 2026-09-29 22:13:14 +03:00
port_clock feat(lang): ports - port Clock { ... } in a module, bind Clock { ... } in the app 2026-09-25 04:20:12 +03:00
private_bank wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
private_kit feat(lang): L5 generic records and functions 2026-09-24 02:21:15 +03:00
row_reducer_owner/herd feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
state_component_ro feat(lang): 0.S - components take states in their header; migrate writes them, never inside a name, never outside the programs given, never into a package's state 2026-09-25 17:11:15 +03:00
uses_cycle feat(lang): module NAME uses A, B - a module reaches only the modules it names 2026-09-25 04:06:45 +03:00
uses_pkg_mech wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
uses_r3d_mech feat(lang): packages count under uses; a port of defaults may go unbound 2026-09-25 05:36:11 +03:00
uses_valley feat(lang): module NAME uses A, B - a module reaches only the modules it names 2026-09-25 04:06:45 +03:00
alias_arity.ludic feat(lang): L6 namespaces declared in Ludic - alias 2026-09-24 02:40:57 +03:00
alias_twice.ludic feat(lang): L6 namespaces declared in Ludic - alias 2026-09-24 02:40:57 +03:00
bad_recipes.lres feat(lang): def REGISTRY from "file.lres" - a game fills an open registry from its own file 2026-09-25 07:22:05 +03:00
bind_missing_fn.ludic fix(lang): the action drain is the program's; --check runs every check a build makes; a registry key named count is refused; name lookups are tables 2026-09-25 23:34:43 +03:00
builtin_call_name.ludic checker: a function named like a built-in a call always takes is refused at its declaration - function words(st, k) compiled and every call became words(n) with a pointer for n (invalid IR, far from the cause); the table is selfhost/check/check_builtins.ludic, emit_call's built-ins no find_fn guard lets a declared function take, and ludic-dev syntax --check holds it to emit_call both ways; every other built-in (buffer, floats, double, ...) yields to a declared function in the checker as it already did in codegen. string_temps' keep and cross_heap_test's keep renamed (hand, keep_cell); rejected/builtin_call_name and functions/builtin_yield with their cases (added, not run); reseeded, bootstrap-cfree fixpoint holds 2026-09-30 01:10:24 +03:00
builtin_name.ludic fix(lang): a function named like a compiler built-in is refused; reseed 2026-09-24 22:09:29 +03:00
component_no_template.ludic feat(lang): UI components as files - component Name { ... } beside Name.xml and Name.lss 2026-09-24 16:50:12 +03:00
default_missing.ludic feat(lang): L11 views and templates - the UI is markup, not code 2026-09-24 15:58:47 +03:00
default_unknown.ludic feat(lang): L11 views and templates - the UI is markup, not code 2026-09-24 15:58:47 +03:00
dispatch_unknown.ludic feat(lang): 0.R1 - actions and reducers 2026-09-25 19:13:46 +03:00
duplicate_const.ludic feat(lang): a name is defined once, a local once per block, and a result is always returned 2026-09-23 23:55:20 +03:00
duplicate_property.ludic feat(lang): a name is defined once, a local once per block, and a result is always returned 2026-09-23 23:55:20 +03:00
engine_alias_name.ludic fix(lang): a function named like an engine namespace method's target is refused 2026-09-25 05:14:45 +03:00
every_error.ludic feat(lang): L4 type checker between parse and emit 2026-09-24 01:34:49 +03:00
exported_events.ludic feat(lang): a module's private records and events are its own 2026-09-25 11:02:48 +03:00
exported_kinds.ludic feat(lang): a module's private records and events are its own 2026-09-25 11:02:48 +03:00
exported_twins.ludic feat(lang): a module's private names are its own 2026-09-25 07:08:05 +03:00
float_into_int.ludic feat(lang): L4 type checker between parse and emit 2026-09-24 01:34:49 +03:00
fn_type_mismatch.ludic wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
friend_scope.ludic wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
generic_arity.ludic feat(lang): L5 generic records and functions 2026-09-24 02:21:15 +03:00
generic_mismatch.ludic feat(lang): L5 generic records and functions 2026-09-24 02:21:15 +03:00
generic_unbound.ludic feat(lang): L5 generic records and functions 2026-09-24 02:21:15 +03:00
layer_cycle.ludic feat(lang): layers - module flow in layer app uses base, items 2026-09-25 12:54:15 +03:00
layer_reach.ludic feat(lang): layers - module flow in layer app uses base, items 2026-09-25 12:54:15 +03:00
long_into_int.ludic fix(lang): a template inside another's hole, and integer literals past 2^31 - 1 2026-09-25 08:10:46 +03:00
machine_ambiguous.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_field_written.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_guard_writes.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_no_way_out.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_not_enum.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_not_registry.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_on_no_target.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_on_unknown.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_self_no_guard.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
machine_unreachable.ludic feat(lang): 27.1 - a state machine as data: @Machine(Record.field) on a registry of transitions 2026-09-30 16:37:37 +03:00
math_into_text.ludic fix(check): a Math.* call has the type the emitter gives it 2026-09-28 14:12:28 +03:00
missing_return.ludic feat(lang): a name is defined once, a local once per block, and a result is always returned 2026-09-23 23:55:20 +03:00
module_let_alias.ludic feat(lang): 0.S - a reference out of a read-only state is read-only (named so), a program's type named like the runtime's is refused (PadButton), tests for both, the migrate case covers lets; changeset 2026-09-25 16:17:03 +03:00
module_let_write.ludic wip(0.S1, 0.S2): state records, mut and read-only state parameters, entry injection, module var refused; ludic migrate state 2026-09-25 13:45:09 +03:00
module_var.ludic wip(0.S1, 0.S2): state records, mut and read-only state parameters, entry injection, module var refused; ludic migrate state 2026-09-25 13:45:09 +03:00
mut_not_state.ludic wip(0.S1, 0.S2): state records, mut and read-only state parameters, entry injection, module var refused; ludic migrate state 2026-09-25 13:45:09 +03:00
node_bad.ludic attributes: @Material(field) resolved as @Node is; @OneOf on a string field takes words, and every registry row's value is checked against them - words on another field, or constants on a string, is an error; reseeded 2026-09-29 19:13:32 +03:00
param_twice.ludic fix(migrate): 0.R4 - --prune keeps a state declared after a plain parameter; a parameter named twice is refused 2026-09-26 05:32:08 +03:00
permap_prefix.ludic tests: the map-scoped tables' example and rejected fixtures 2026-09-29 21:03:56 +03:00
permap_ref_int.ludic tests: the map-scoped tables' example and rejected fixtures 2026-09-29 21:03:56 +03:00
permap_unit.ludic tests: the map-scoped tables' example and rejected fixtures 2026-09-29 21:03:56 +03:00
pkg_export_clash.ludic fix(lang): 0.R4 - ludic.ui's UiAct is its own, and a name that meets a package's export says whose it is 2026-09-26 06:57:35 +03:00
port_missing.ludic feat(lang): ports - port Clock { ... } in a module, bind Clock { ... } in the app 2026-09-25 04:20:12 +03:00
port_new.ludic feat(lang): packages count under uses; a port of defaults may go unbound 2026-09-25 05:36:11 +03:00
port_private.ludic feat(lang): ports - port Clock { ... } in a module, bind Clock { ... } in the app 2026-09-25 04:20:12 +03:00
port_twice.ludic feat(lang): ports - port Clock { ... } in a module, bind Clock { ... } in the app 2026-09-25 04:20:12 +03:00
port_unbound.ludic feat(lang): ports - port Clock { ... } in a module, bind Clock { ... } in the app 2026-09-25 04:20:12 +03:00
port_var_args.ludic wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
positional_after_named.ludic feat(lang): L11 views and templates - the UI is markup, not code 2026-09-24 15:58:47 +03:00
private_generic.ludic feat(lang): L5 generic records and functions 2026-09-24 02:21:15 +03:00
private_module.ludic wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
record_as_text.ludic feat(lang): L4 type checker between parse and emit 2026-09-24 01:34:49 +03:00
record_mixup.ludic feat(lang): L4 type checker between parse and emit 2026-09-24 01:34:49 +03:00
redeclared_local.ludic feat(lang): a name is defined once, a local once per block, and a result is always returned 2026-09-23 23:55:20 +03:00
reducer_not_action.ludic feat(lang): 0.R1 - actions and reducers 2026-09-25 19:13:46 +03:00
reducer_two_states.ludic feat(lang): 0.R5 - a reducer writes one state and may read others, declared between its state and the action 2026-09-26 18:23:48 +03:00
ref_unknown.ludic attributes: a target the program does not have at all (an @Ref registry, an @Tint / @OneOf constant) is a warning and "unresolved" in the schema, not an error - a package names the game's registry without importing it; a name of another kind is still an error; reseeded 2026-09-29 19:10:45 +03:00
registry_closed.ludic feat(lang): open registry - other modules' defs, in an order imports cannot change 2026-09-25 04:28:34 +03:00
registry_count_key.ludic fix(lang): the action drain is the program's; --check runs every check a build makes; a registry key named count is refused; name lookups are tables 2026-09-25 23:34:43 +03:00
registry_extend_field.ludic feat(lang): def REGISTRY from "file.lres" - a game fills an open registry from its own file 2026-09-25 07:22:05 +03:00
registry_field.ludic feat(lang): L8 registries by declaration - registry and def 2026-09-24 13:34:51 +03:00
registry_hidden.ludic feat(lang): open registry - other modules' defs, in an order imports cannot change 2026-09-25 04:28:34 +03:00
registry_twice.ludic feat(lang): L8 registries by declaration - registry and def 2026-09-24 13:34:51 +03:00
registry_unknown.ludic feat(lang): L8 registries by declaration - registry and def 2026-09-24 13:34:51 +03:00
resource_field.ludic feat(lang): L9 resource files - registry ... from 2026-09-24 14:00:20 +03:00
resource_missing.ludic feat(lang): L9 resource files - registry ... from 2026-09-24 14:00:20 +03:00
row_reducer_column.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
row_reducer_no_target.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
row_reducer_not_verb.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
row_reducer_owner.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
row_reducer_params.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
row_reducer_reach.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
row_reducer_table.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
row_reducer_writes_state.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
rowverb_no_row.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
runtime_type_clash.ludic feat(lang): 0.S - a reference out of a read-only state is read-only (named so), a program's type named like the runtime's is refused (PadButton), tests for both, the migrate case covers lets; changeset 2026-09-25 16:17:03 +03:00
state_alias_readonly.ludic feat(lang): 0.S - a reference out of a read-only state is read-only (named so), a program's type named like the runtime's is refused (PadButton), tests for both, the migrate case covers lets; changeset 2026-09-25 16:17:03 +03:00
state_component_ro.ludic feat(lang): 0.S - components take states in their header; migrate writes them, never inside a name, never outside the programs given, never into a package's state 2026-09-25 17:11:15 +03:00
state_mut_arg.ludic wip(0.S1, 0.S2): state records, mut and read-only state parameters, entry injection, module var refused; ludic migrate state 2026-09-25 13:45:09 +03:00
state_readonly.ludic wip(0.S1, 0.S2): state records, mut and read-only state parameters, entry injection, module var refused; ludic migrate state 2026-09-25 13:45:09 +03:00
target_twice.ludic feat(lang): 27.3 - a reducer on a table's row: reducer T in S.table on A, @Target, Row<T>, @RowVerb, @Column 2026-09-30 16:14:59 +03:00
text_plus_number.ludic feat(lang): L4 type checker between parse and emit 2026-09-24 01:34:49 +03:00
unknown_field_type.ludic fix(check): 0.R4 - a misspelled type in a parameter, a result or a field is refused where it is written 2026-09-26 05:58:35 +03:00
unknown_name.ludic fix(lang): the action drain is the program's; --check runs every check a build makes; a registry key named count is refused; name lookups are tables 2026-09-25 23:34:43 +03:00
unknown_type.ludic fix(check): 0.R4 - a misspelled type in a parameter, a result or a field is refused where it is written 2026-09-26 05:58:35 +03:00
uses_cycle.ludic feat(lang): module NAME uses A, B - a module reaches only the modules it names 2026-09-25 04:06:45 +03:00
uses_missing.ludic feat(lang): module NAME uses A, B - a module reaches only the modules it names 2026-09-25 04:06:45 +03:00
uses_package.ludic feat(lang): packages count under uses; a port of defaults may go unbound 2026-09-25 05:36:11 +03:00
uses_render3d.ludic feat(lang): packages count under uses; a port of defaults may go unbound 2026-09-25 05:36:11 +03:00
view_untyped.ludic wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
view_without_ui.ludic wip(0.S3): ui blocks, scene on enter/exit, hooks, machines over a state's field, namespace and engine-system injection; a reference out of a read-only state or a module let is read-only; deps counts writes into another module's state; the rejected examples hold states 2026-09-25 14:49:03 +03:00
wrong_arity.ludic feat(lang): L4 type checker between parse and emit 2026-09-24 01:34:49 +03:00