feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune
ludic.base's Queue<T> carries a QueueTag (its name and pending count): queue_new(name), q_push(q, v), q_drain(q), q_clear(q) take no BaseState, and core_undrained(tags) names the given queues still holding facts. A reducer on a package's state can now call that package's verbs (wallet_earn(wallet_st, n)). ludic migrate state --prune (ludicc --migrate-prune) takes out each state parameter a function no longer uses, nor anything it calls, and the argument that fills it - including an argument for a parameter the callee has dropped, which is taken out before the call is checked, so a generic's T is told by the argument that says it. A reducer keeps its state. --dry-run now counts the edits it would make. Every package was moved with it: 608 base_st parameters and their arguments, 1889 edits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8cf4b3fed6
commit
71735b10a2
151 changed files with 58668 additions and 54719 deletions
|
|
@ -1,18 +1,18 @@
|
|||
# system.ludic - the camera as a system: the roll and what has been photographed in its own save
|
||||
# section, by key. The best per subject follows from the frames, as a buyer would judge them.
|
||||
export function photo_config(base_st: mut BaseState, photo_st: mut PhotoState, max: int) -> void {
|
||||
export function photo_config(photo_st: mut PhotoState, max: int) -> void {
|
||||
photo_st.pht_max = Math.max(max, 1)
|
||||
photo_reset(base_st, photo_st)
|
||||
photo_reset(photo_st)
|
||||
}
|
||||
|
||||
export function photo_reset(base_st: mut BaseState, photo_st: mut PhotoState) -> void {
|
||||
export function photo_reset(photo_st: mut PhotoState) -> void {
|
||||
pht_blank(photo_st)
|
||||
photo_st.pht_species_shot = 0
|
||||
photo_st.pht_legend_shot = 0
|
||||
photo_st.pht_cover = -1
|
||||
photo_st.pht_page = 0
|
||||
photo_frame_begin(photo_st)
|
||||
q_clear(base_st, photo_facts(base_st, photo_st))
|
||||
q_clear(photo_facts(photo_st))
|
||||
}
|
||||
|
||||
export function photo_save(photo_st: PhotoState) -> Val {
|
||||
|
|
@ -39,8 +39,8 @@ export function photo_save(photo_st: PhotoState) -> Val {
|
|||
return v
|
||||
}
|
||||
|
||||
export function photo_load(base_st: mut BaseState, photo_st: mut PhotoState, v: Val, version: int) -> void {
|
||||
photo_reset(base_st, photo_st)
|
||||
export function photo_load(photo_st: mut PhotoState, v: Val, version: int) -> void {
|
||||
photo_reset(photo_st)
|
||||
if Value.has(v, "frames") != 0 {
|
||||
let l = Value.get(v, "frames")
|
||||
for i in 0 .. Value.count(l) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue