- 신선한 탐사자(fable) 단일 컨텍스트, 지시서 -round10-brief.md §2 레인 A·C 완료, B 부분, D ALL PASS - audit/handtrace-round10-reference-impl/: round7 참조 구현을 현재 계약으로 갱신·재실행 (부수: round7/ref9 _recompute 첫 인자 오류 발견·정정) - base/·인덱스 레이어는 미변경 — 결정은 사용자 배치 회신 뒤 -round10-followup.md로 Co-authored-by: qwreey <me@qwreey.moe> Claude-Session: https://claude.ai/code/session_01546hjsYNLSMZdHdPyTZaGb
31 lines
945 B
Text
31 lines
945 B
Text
--!strict
|
|
-- base/slot-plan.md 확정: updateFn<UD>(item, index, offset, prev, userdata) -> (T|nil, UD?)
|
|
type Element = { tag: string }
|
|
export type SourceN = { Get: (self: SourceN) -> number }
|
|
|
|
local function List<T, UD>(
|
|
updateFn: (item: any, index: number, offset: SourceN, prev: T?, userdata: UD?) -> (T?, UD?)
|
|
) end
|
|
|
|
-- (A) 값 하나만 반환하는 가장 흔한 모양
|
|
List(function(item, index, offset, prev, ud)
|
|
return { tag = "x" } :: Element
|
|
end)
|
|
|
|
-- (B) 두 값 반환
|
|
List(function(item, index, offset, prev, ud)
|
|
return { tag = "x" } :: Element, 42
|
|
end)
|
|
|
|
-- (C) nil만 반환(요소 버리기 — 확정된 정상 경로)
|
|
List(function(item, index, offset, prev, ud)
|
|
return nil
|
|
end)
|
|
|
|
-- (D) 조건 분기 — 한쪽만 반환
|
|
List(function(item, index, offset, prev, ud)
|
|
if index > 1 then return { tag = "x" } :: Element end
|
|
end)
|
|
|
|
-- (E) 아무것도 안 반환
|
|
List(function(item, index, offset, prev, ud) end)
|