aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-19 04:42:05 +0100
committereunhhu <[email protected]>2026-10-19 04:42:05 +0100
commit096a70a7cd5a5785b1b52aa8512422b30f014c09 (patch)
tree5d0632f6dccfdd5d83da709b2e8212ab9d1a0451 /docs
parent5f223bd45d9279982ec6e4ca334c089c07782639 (diff)
downloadaup-096a70a7cd5a5785b1b52aa8512422b30f014c09.tar.gz
aup-096a70a7cd5a5785b1b52aa8512422b30f014c09.zip
Bytes alone as a state (Pure 028): state x: bytes (= "..." its UTF-8), held as a text state is and written to the module as type 6, its name read as a bytes value and x = ... setting it whole (a string meets bytes), cursors and marks in it, its insert and remove, its start and end refused with a bytes state's diagnostic, a text never set from it; test bytes_state (300 steps of random bytes with 0x00 and 0xff added and cut, started again from the store 15 times, against Python; the same name as a text from the store and by a replace: UTF-8 bytes kept, others anew, and back to bytes what the text held), three diagnostics; the 60 sources the same modules; 002
Diffstat (limited to 'docs')
-rw-r--r--docs/design/002-dsl-direction.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/design/002-dsl-direction.md b/docs/design/002-dsl-direction.md
index d13c595..4f7e855 100644
--- a/docs/design/002-dsl-direction.md
+++ b/docs/design/002-dsl-direction.md
@@ -956,3 +956,25 @@ ys = [4, 5] # let의 리스트를 비우고 �
- 검증: `inner_lists`가 for의 블록, 키 있는 리스트, fn의 for, 보기의 본문에 둔 let 리스트와 `xs = [...]`, `xs = []`를 무작위 100
사건으로 파이썬과 견준다. 진단 하나가 바뀌었다(블록 밖에서 그 리스트를 읽으면 `unknown state`). 그 전에 컴파일되던 소스 60개의
모듈은 바이트까지 같다.
+
+### 바이트 하나인 상태 (Pure 028)
+
+```text
+state pending: bytes # 빈 바이트로 시작한다. state x: bytes = "..."는 그 문자열의 UTF-8로
+input packet = message { data: bytes }
+on packet {
+ pending = pending + packet.data # 읽기는 바이트 값, 쓰기는 통째로
+ require pending.bytes < 65536
+}
+view left = pending # 바이트 보기
+```
+
+- **뜻.** text 상태처럼 담고 저장하지만 UTF-8을 묻지 않는다. 이름은 바이트 값으로 읽힌다(`.bytes`, `[i]`, `[a .. b]`, 비교,
+ 잇기). `x = …`가 바이트를 쓴다. 문자열은 바이트를 만나므로 `x = "ok"`도 된다.
+- **커서가 없다.** `cursor in x`, `mark in x`, `x.insert(…)`, `x.start`는 진단이 나온다. text에 바이트를 넣지도 않는다(`text(b)`로
+ 옮긴다).
+- **이름이 같은 text와 바이트.** 교체와 저장소의 시작에서 정확할 때만 옮긴다: text는 언제나 바이트가 되고, 바이트는 UTF-8일 때만
+ text가 된다(아니면 초기값). Pure의 `values` 기록이 바이트 상태를 적어 손상과 옮김을 가른다.
+- 검증: `bytes_state`가 0x00과 0xff가 든 무작위 바이트를 붙이고 자르며 300걸음을 저장소로 15번 다시 시작하며 파이썬과 견준다. 같은
+ 이름의 text로 저장소에서 시작하고 실행 중에 교체해, UTF-8인 바이트는 남고 아닌 것은 새로 시작하며, 바이트로 돌아오면 text가 가졌던
+ 것을 찾는다. 진단 셋(커서, insert, text에 바이트).