aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-27 07:54:35 +0100
committereunhhu <[email protected]>2026-09-27 07:54:35 +0100
commit6d219cbfb8f88aa51ce785ff78c5250d806b67c9 (patch)
treeda3c24044b0374a5cf1285a03fb10b7360b0a3d8 /docs
parent1a72fe031a007323c51f49810dcf6164b8aaaae2 (diff)
downloadaup-6d219cbfb8f88aa51ce785ff78c5250d806b67c9.tar.gz
aup-6d219cbfb8f88aa51ce785ff78c5250d806b67c9.zip
Declare outputs and send them: output ordered = message { ... }
An output is a message the app sends, with fields and groups as a message has; send ordered { item: x, to: { city: y } } gives every field once, in any order, groups in their own braces, and compiles to Pure's SEND. Diagnostics cover a missing field, a group given a value, an unknown field, a mistyped value, a send to a message, a handler for an output, a field given twice and reading an output as a state; kinds in messages now carry their article (an output, a key input).
Diffstat (limited to 'docs')
-rw-r--r--docs/design/001-language-v0.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/design/001-language-v0.md b/docs/design/001-language-v0.md
index 7a5b0d6..0f95500 100644
--- a/docs/design/001-language-v0.md
+++ b/docs/design/001-language-v0.md
@@ -119,6 +119,10 @@ on edit {
읽고, JSON 본문에서는 안의 객체(`{"to": {"city": "Seoul", "zip": 4}}`), 쿼리에서는 경로(`?to.zip=4`)다. 그룹은 겹칠 수
있고, 경로는 31자 이하, 한 메시지의 필드는 그룹 안까지 합쳐 64개 이하다. 모듈에서는 `to.city` 같은 이름의 필드로 펼쳐지므로
실행 비용이 없다.
+- `output 이름 = message { ... }`는 앱이 보내는 메시지다(필드와 그룹은 메시지와 같다). 핸들러에서
+ `send 이름 { 필드: 값, 그룹: { 필드: 값 } }`으로 모든 필드를 한 번씩 주어 보낸다. 보냄은 이벤트의 일부라서 이벤트가
+ 실패하면 보내지 않았고, 호스트는 저장된 보냄만 전한다. 무엇이 받는지는 앱 밖(호스트의 배선)이 정한다. 받는 앱은 같은
+ 메시지를 여러 번 받아도 한 번만 적용한다(Pure `docs/research/078-app-connections.md`). 출력에는 핸들러가 없다.
- `이름[key]`는 그 메시지 키의 문서다. 읽으면 bytes, `.bytes`는 크기(없으면 0)다. 없는 문서를 읽으면 `not_found`.
- `replace(a .. b, 값)`는 문서의 `[a, b)`를 바꾼다. 정수가 아니거나 범위 밖이면 이벤트가 `limit`으로 실패한다.
- `require 조건`이 거짓이면 이벤트가 `limit`으로 실패한다. 크기 정책처럼 저장소의 특수 인자였던 것이 문장 하나가 된다.