refactor(stdlib): de-abbreviate namespaces (Mem/Sys/Net/Collide)
Expand the abbreviated public namespaces to full words, part of the language-wide de-abbreviation pass: Mem -> Memory, Sys -> System, Net -> Network, Collide -> Collision Math stays (universally accepted, like int/bool). Renames the dispatch strings, LSP signatures, docs (dirs, files, frontmatter), and the inventory manifest; behavior is byte-identical (the bare rt_ targets are unchanged). Reseeded; C-free bootstrap fixpoint holds; all suites green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6e6467b515
commit
2f19c8d8e2
50 changed files with 360 additions and 360 deletions
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
id: collide
|
||||
title: Collide
|
||||
id: collision
|
||||
title: Collision
|
||||
order: 6
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: collide-circles
|
||||
name: Collide.circles
|
||||
category: collide
|
||||
id: collision-circles
|
||||
name: Collision.circles
|
||||
category: collision
|
||||
kind: namespace-method
|
||||
tokens: Collide.circles
|
||||
sig: Collide.circles(ax, ay, ar, bx, by, br) -> bool
|
||||
tokens: Collision.circles
|
||||
sig: Collision.circles(ax, ay, ar, bx, by, br) -> bool
|
||||
tip: Do two circles overlap?
|
||||
order: 2
|
||||
ns: Collide
|
||||
ns: Collision
|
||||
member: circles
|
||||
---
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ Returns <code>true</code> when circles centred at <code>(ax, ay)</code> and <cod
|
|||
```ludic
|
||||
program Demo {
|
||||
handler Step phase Update {
|
||||
if Collide.circles(px, py, 8, ex, ey, 8) { collide() }
|
||||
if Collision.circles(px, py, 8, ex, ey, 8) { collide() }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: collide-point_rect
|
||||
name: Collide.point_rect
|
||||
category: collide
|
||||
id: collision-point_rect
|
||||
name: Collision.point_rect
|
||||
category: collision
|
||||
kind: namespace-method
|
||||
tokens: Collide.point_rect
|
||||
sig: Collide.point_rect(px, py, rx, ry, rw, rh) -> bool
|
||||
tokens: Collision.point_rect
|
||||
sig: Collision.point_rect(px, py, rx, ry, rw, rh) -> bool
|
||||
tip: Is a point inside a rectangle?
|
||||
order: 1
|
||||
ns: Collide
|
||||
ns: Collision
|
||||
member: point_rect
|
||||
---
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ Returns <code>true</code> when the point <code>(px, py)</code> lies within the r
|
|||
```ludic
|
||||
program Demo {
|
||||
handler Step phase Update {
|
||||
if Collide.point_rect(mx, my, bx, by, bw, bh) { press() }
|
||||
if Collision.point_rect(mx, my, bx, by, bw, bh) { press() }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: collide-rect_circle
|
||||
name: Collide.rect_circle
|
||||
category: collide
|
||||
id: collision-rect_circle
|
||||
name: Collision.rect_circle
|
||||
category: collision
|
||||
kind: namespace-method
|
||||
tokens: Collide.rect_circle
|
||||
sig: Collide.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool
|
||||
tokens: Collision.rect_circle
|
||||
sig: Collision.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool
|
||||
tip: Does a rectangle overlap a circle?
|
||||
order: 3
|
||||
ns: Collide
|
||||
ns: Collision
|
||||
member: rect_circle
|
||||
---
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ Returns <code>true</code> when the rectangle <code>(rx, ry, rw, rh)</code> overl
|
|||
```ludic
|
||||
program Demo {
|
||||
handler Step phase Update {
|
||||
if Collide.rect_circle(tx, ty, 16, 16, bx, by, 6) { block() }
|
||||
if Collision.rect_circle(tx, ty, 16, 16, bx, by, 6) { block() }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: collide-rects
|
||||
name: Collide.rects
|
||||
category: collide
|
||||
id: collision-rects
|
||||
name: Collision.rects
|
||||
category: collision
|
||||
kind: namespace-method
|
||||
tokens: Collide.rects
|
||||
sig: Collide.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool
|
||||
tokens: Collision.rects
|
||||
sig: Collision.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool
|
||||
tip: Do two rectangles overlap?
|
||||
order: 0
|
||||
ns: Collide
|
||||
ns: Collision
|
||||
member: rects
|
||||
---
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ Returns <code>true</code> when the axis-aligned rectangles <code>(ax, ay, aw, ah
|
|||
```ludic
|
||||
program Demo {
|
||||
handler Step phase Update {
|
||||
if Collide.rects(px, py, 16, 16, ex, ey, 16, 16) { hit() }
|
||||
if Collision.rects(px, py, 16, 16, ex, ey, 16, 16) { hit() }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
id: mem
|
||||
title: Mem
|
||||
id: memory
|
||||
title: Memory
|
||||
order: 6
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: mem-bytes
|
||||
name: Mem.bytes
|
||||
category: mem
|
||||
id: memory-bytes
|
||||
name: Memory.bytes
|
||||
category: memory
|
||||
kind: namespace-method
|
||||
tokens: Mem.bytes
|
||||
sig: Mem.bytes(n) -> ptr
|
||||
tokens: Memory.bytes
|
||||
sig: Memory.bytes(n) -> ptr
|
||||
tip: Allocate n bytes.
|
||||
order: 0
|
||||
ns: Mem
|
||||
ns: Memory
|
||||
member: bytes
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: mem-copy
|
||||
name: Mem.copy
|
||||
category: mem
|
||||
id: memory-copy
|
||||
name: Memory.copy
|
||||
category: memory
|
||||
kind: namespace-method
|
||||
tokens: Mem.copy
|
||||
sig: Mem.copy(dst, src, n) -> void
|
||||
tokens: Memory.copy
|
||||
sig: Memory.copy(dst, src, n) -> void
|
||||
tip: Copy n bytes between buffers.
|
||||
order: 2
|
||||
ns: Mem
|
||||
ns: Memory
|
||||
member: copy
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: mem-fill
|
||||
name: Mem.fill
|
||||
category: mem
|
||||
id: memory-fill
|
||||
name: Memory.fill
|
||||
category: memory
|
||||
kind: namespace-method
|
||||
tokens: Mem.fill
|
||||
sig: Mem.fill(buf, value, n) -> void
|
||||
tokens: Memory.fill
|
||||
sig: Memory.fill(buf, value, n) -> void
|
||||
tip: Set n bytes to a value.
|
||||
order: 3
|
||||
ns: Mem
|
||||
ns: Memory
|
||||
member: fill
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: mem-peek
|
||||
name: Mem.peek
|
||||
category: mem
|
||||
id: memory-peek
|
||||
name: Memory.peek
|
||||
category: memory
|
||||
kind: namespace-method
|
||||
tokens: Mem.peek
|
||||
sig: Mem.peek(buf, i) -> int
|
||||
tokens: Memory.peek
|
||||
sig: Memory.peek(buf, i) -> int
|
||||
tip: Read one byte.
|
||||
order: 4
|
||||
ns: Mem
|
||||
ns: Memory
|
||||
member: peek
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: mem-poke
|
||||
name: Mem.poke
|
||||
category: mem
|
||||
id: memory-poke
|
||||
name: Memory.poke
|
||||
category: memory
|
||||
kind: namespace-method
|
||||
tokens: Mem.poke
|
||||
sig: Mem.poke(buf, i, value) -> void
|
||||
tokens: Memory.poke
|
||||
sig: Memory.poke(buf, i, value) -> void
|
||||
tip: Write one byte.
|
||||
order: 5
|
||||
ns: Mem
|
||||
ns: Memory
|
||||
member: poke
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: mem-words
|
||||
name: Mem.words
|
||||
category: mem
|
||||
id: memory-words
|
||||
name: Memory.words
|
||||
category: memory
|
||||
kind: namespace-method
|
||||
tokens: Mem.words
|
||||
sig: Mem.words(n) -> words
|
||||
tokens: Memory.words
|
||||
sig: Memory.words(n) -> words
|
||||
tip: Allocate n 32-bit words.
|
||||
order: 1
|
||||
ns: Mem
|
||||
ns: Memory
|
||||
member: words
|
||||
---
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
id: net-apply
|
||||
name: Net.apply
|
||||
category: net
|
||||
kind: namespace-method
|
||||
tokens: Net.apply
|
||||
sig: Net.apply(entity, buf) -> int
|
||||
tip: Apply serialized state to an entity.
|
||||
order: 3
|
||||
ns: Net
|
||||
member: apply
|
||||
---
|
||||
|
||||
Reads synced fields from <code>buf</code> into <code>entity</code> — the inverse of <code>Net.serialize</code>.
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
id: net-local_id
|
||||
name: Net.local_id
|
||||
category: net
|
||||
kind: namespace-method
|
||||
tokens: Net.local_id
|
||||
sig: Net.local_id() -> int
|
||||
tip: This peer's own id.
|
||||
order: 8
|
||||
ns: Net
|
||||
member: local_id
|
||||
---
|
||||
|
||||
Returns the network id of the local peer.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
id: net
|
||||
title: Net
|
||||
id: network
|
||||
title: Network
|
||||
order: 6
|
||||
---
|
||||
|
||||
14
docs/language/network/network-apply.md
Normal file
14
docs/language/network/network-apply.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
id: network-apply
|
||||
name: Network.apply
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Network.apply
|
||||
sig: Network.apply(entity, buf) -> int
|
||||
tip: Apply serialized state to an entity.
|
||||
order: 3
|
||||
ns: Network
|
||||
member: apply
|
||||
---
|
||||
|
||||
Reads synced fields from <code>buf</code> into <code>entity</code> — the inverse of <code>Network.serialize</code>.
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: net-is_owner
|
||||
name: Net.is_owner
|
||||
category: net
|
||||
id: network-is_owner
|
||||
name: Network.is_owner
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Net.is_owner
|
||||
sig: Net.is_owner(entity) -> bool
|
||||
tokens: Network.is_owner
|
||||
sig: Network.is_owner(entity) -> bool
|
||||
tip: Does this peer own the entity?
|
||||
order: 7
|
||||
ns: Net
|
||||
ns: Network
|
||||
member: is_owner
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: net-is_server
|
||||
name: Net.is_server
|
||||
category: net
|
||||
id: network-is_server
|
||||
name: Network.is_server
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Net.is_server
|
||||
sig: Net.is_server() -> bool
|
||||
tokens: Network.is_server
|
||||
sig: Network.is_server() -> bool
|
||||
tip: Is this peer the server?
|
||||
order: 6
|
||||
ns: Net
|
||||
ns: Network
|
||||
member: is_server
|
||||
---
|
||||
|
||||
14
docs/language/network/network-local_id.md
Normal file
14
docs/language/network/network-local_id.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
id: network-local_id
|
||||
name: Network.local_id
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Network.local_id
|
||||
sig: Network.local_id() -> int
|
||||
tip: This peer's own id.
|
||||
order: 8
|
||||
ns: Network
|
||||
member: local_id
|
||||
---
|
||||
|
||||
Returns the network id of the local peer.
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: net-owner
|
||||
name: Net.owner
|
||||
category: net
|
||||
id: network-owner
|
||||
name: Network.owner
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Net.owner
|
||||
sig: Net.owner(entity) -> int
|
||||
tokens: Network.owner
|
||||
sig: Network.owner(entity) -> int
|
||||
tip: The peer that owns an entity.
|
||||
order: 4
|
||||
ns: Net
|
||||
ns: Network
|
||||
member: owner
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: net-poll
|
||||
name: Net.poll
|
||||
category: net
|
||||
id: network-poll
|
||||
name: Network.poll
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Net.poll
|
||||
sig: Net.poll(buf, cap) -> int
|
||||
tokens: Network.poll
|
||||
sig: Network.poll(buf, cap) -> int
|
||||
tip: Read an inbound datagram.
|
||||
order: 1
|
||||
ns: Net
|
||||
ns: Network
|
||||
member: poll
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: net-send
|
||||
name: Net.send
|
||||
category: net
|
||||
id: network-send
|
||||
name: Network.send
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Net.send
|
||||
sig: Net.send(peer, buf, len) -> void
|
||||
tokens: Network.send
|
||||
sig: Network.send(peer, buf, len) -> void
|
||||
tip: Put a datagram on the wire.
|
||||
order: 0
|
||||
ns: Net
|
||||
ns: Network
|
||||
member: send
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: net-serialize
|
||||
name: Net.serialize
|
||||
category: net
|
||||
id: network-serialize
|
||||
name: Network.serialize
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Net.serialize
|
||||
sig: Net.serialize(entity, buf) -> int
|
||||
tokens: Network.serialize
|
||||
sig: Network.serialize(entity, buf) -> int
|
||||
tip: Serialize an entity's synced state.
|
||||
order: 2
|
||||
ns: Net
|
||||
ns: Network
|
||||
member: serialize
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: net-set_owner
|
||||
name: Net.set_owner
|
||||
category: net
|
||||
id: network-set_owner
|
||||
name: Network.set_owner
|
||||
category: network
|
||||
kind: namespace-method
|
||||
tokens: Net.set_owner
|
||||
sig: Net.set_owner(entity, peer) -> void
|
||||
tokens: Network.set_owner
|
||||
sig: Network.set_owner(entity, peer) -> void
|
||||
tip: Assign ownership of an entity.
|
||||
order: 5
|
||||
ns: Net
|
||||
ns: Network
|
||||
member: set_owner
|
||||
---
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
id: sys-file_close
|
||||
name: Sys.file_close
|
||||
category: sys
|
||||
kind: namespace-method
|
||||
tokens: Sys.file_close
|
||||
sig: Sys.file_close(file) -> void
|
||||
tip: Close a file.
|
||||
order: 11
|
||||
ns: Sys
|
||||
member: file_close
|
||||
---
|
||||
|
||||
Closes <code>file</code>, flushing any buffered writes.
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
id: sys-stderr
|
||||
name: Sys.stderr
|
||||
category: sys
|
||||
kind: namespace-method
|
||||
tokens: Sys.stderr
|
||||
sig: Sys.stderr() -> ptr
|
||||
tip: The standard error handle.
|
||||
order: 13
|
||||
ns: Sys
|
||||
member: stderr
|
||||
---
|
||||
|
||||
Returns the standard-error file handle, for <code>Sys.file_write</code>.
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
id: sys-stdout
|
||||
name: Sys.stdout
|
||||
category: sys
|
||||
kind: namespace-method
|
||||
tokens: Sys.stdout
|
||||
sig: Sys.stdout() -> ptr
|
||||
tip: The standard output handle.
|
||||
order: 12
|
||||
ns: Sys
|
||||
member: stdout
|
||||
---
|
||||
|
||||
Returns the standard-output file handle, for <code>Sys.file_write</code>.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
id: sys
|
||||
title: Sys
|
||||
id: system
|
||||
title: System
|
||||
order: 6
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-arg
|
||||
name: Sys.arg
|
||||
category: sys
|
||||
id: system-arg
|
||||
name: System.arg
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.arg
|
||||
sig: Sys.arg(i) -> str
|
||||
tokens: System.arg
|
||||
sig: System.arg(i) -> str
|
||||
tip: A command-line argument by index.
|
||||
order: 0
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: arg
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-arg_count
|
||||
name: Sys.arg_count
|
||||
category: sys
|
||||
id: system-arg_count
|
||||
name: System.arg_count
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.arg_count
|
||||
sig: Sys.arg_count() -> int
|
||||
tokens: System.arg_count
|
||||
sig: System.arg_count() -> int
|
||||
tip: The number of command-line arguments.
|
||||
order: 1
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: arg_count
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-env
|
||||
name: Sys.env
|
||||
category: sys
|
||||
id: system-env
|
||||
name: System.env
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.env
|
||||
sig: Sys.env(name) -> str
|
||||
tokens: System.env
|
||||
sig: System.env(name) -> str
|
||||
tip: Read an environment variable.
|
||||
order: 4
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: env
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-exit
|
||||
name: Sys.exit
|
||||
category: sys
|
||||
id: system-exit
|
||||
name: System.exit
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.exit
|
||||
sig: Sys.exit(code) -> void
|
||||
tokens: System.exit
|
||||
sig: System.exit(code) -> void
|
||||
tip: End the process with a status code.
|
||||
order: 2
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: exit
|
||||
---
|
||||
|
||||
14
docs/language/system/system-file_close.md
Normal file
14
docs/language/system/system-file_close.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
id: system-file_close
|
||||
name: System.file_close
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: System.file_close
|
||||
sig: System.file_close(file) -> void
|
||||
tip: Close a file.
|
||||
order: 11
|
||||
ns: System
|
||||
member: file_close
|
||||
---
|
||||
|
||||
Closes <code>file</code>, flushing any buffered writes.
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-file_open
|
||||
name: Sys.file_open
|
||||
category: sys
|
||||
id: system-file_open
|
||||
name: System.file_open
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.file_open
|
||||
sig: Sys.file_open(path, mode) -> ptr
|
||||
tokens: System.file_open
|
||||
sig: System.file_open(path, mode) -> ptr
|
||||
tip: Open a file.
|
||||
order: 6
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: file_open
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-file_read
|
||||
name: Sys.file_read
|
||||
category: sys
|
||||
id: system-file_read
|
||||
name: System.file_read
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.file_read
|
||||
sig: Sys.file_read(file, buf, n) -> int
|
||||
tokens: System.file_read
|
||||
sig: System.file_read(file, buf, n) -> int
|
||||
tip: Read bytes from a file.
|
||||
order: 7
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: file_read
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-file_seek
|
||||
name: Sys.file_seek
|
||||
category: sys
|
||||
id: system-file_seek
|
||||
name: System.file_seek
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.file_seek
|
||||
sig: Sys.file_seek(file, offset, whence) -> int
|
||||
tokens: System.file_seek
|
||||
sig: System.file_seek(file, offset, whence) -> int
|
||||
tip: Move a file's read/write position.
|
||||
order: 9
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: file_seek
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-file_tell
|
||||
name: Sys.file_tell
|
||||
category: sys
|
||||
id: system-file_tell
|
||||
name: System.file_tell
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.file_tell
|
||||
sig: Sys.file_tell(file) -> int
|
||||
tokens: System.file_tell
|
||||
sig: System.file_tell(file) -> int
|
||||
tip: The current file position.
|
||||
order: 10
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: file_tell
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-file_write
|
||||
name: Sys.file_write
|
||||
category: sys
|
||||
id: system-file_write
|
||||
name: System.file_write
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.file_write
|
||||
sig: Sys.file_write(file, buf, n) -> int
|
||||
tokens: System.file_write
|
||||
sig: System.file_write(file, buf, n) -> int
|
||||
tip: Write bytes to a file.
|
||||
order: 8
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: file_write
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-read_char
|
||||
name: Sys.read_char
|
||||
category: sys
|
||||
id: system-read_char
|
||||
name: System.read_char
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.read_char
|
||||
sig: Sys.read_char() -> int
|
||||
tokens: System.read_char
|
||||
sig: System.read_char() -> int
|
||||
tip: Read one byte from standard input.
|
||||
order: 5
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: read_char
|
||||
---
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
id: sys-run
|
||||
name: Sys.run
|
||||
category: sys
|
||||
id: system-run
|
||||
name: System.run
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: Sys.run
|
||||
sig: Sys.run(command) -> int
|
||||
tokens: System.run
|
||||
sig: System.run(command) -> int
|
||||
tip: Run a shell command.
|
||||
order: 3
|
||||
ns: Sys
|
||||
ns: System
|
||||
member: run
|
||||
---
|
||||
|
||||
14
docs/language/system/system-stderr.md
Normal file
14
docs/language/system/system-stderr.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
id: system-stderr
|
||||
name: System.stderr
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: System.stderr
|
||||
sig: System.stderr() -> ptr
|
||||
tip: The standard error handle.
|
||||
order: 13
|
||||
ns: System
|
||||
member: stderr
|
||||
---
|
||||
|
||||
Returns the standard-error file handle, for <code>System.file_write</code>.
|
||||
14
docs/language/system/system-stdout.md
Normal file
14
docs/language/system/system-stdout.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
id: system-stdout
|
||||
name: System.stdout
|
||||
category: system
|
||||
kind: namespace-method
|
||||
tokens: System.stdout
|
||||
sig: System.stdout() -> ptr
|
||||
tip: The standard output handle.
|
||||
order: 12
|
||||
ns: System
|
||||
member: stdout
|
||||
---
|
||||
|
||||
Returns the standard-output file handle, for <code>System.file_write</code>.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# emit_collide.ludic — the Collide.* namespace: 2D overlap tests on plain
|
||||
# emit_collide.ludic — the Collision.* namespace: 2D overlap tests on plain
|
||||
# integer coordinates (pixels or tiles). Rectangles are (x, y, w, h) with the
|
||||
# origin at the top-left; circles are (x, y, r). Squared distances use i64 so a
|
||||
# large coordinate can't overflow. Each returns a bool.
|
||||
|
|
|
|||
|
|
@ -211,13 +211,13 @@ fn emit_ns_call(ns: ptr, meth: ptr, e: Node) -> Val {
|
|||
if is_ease_ns(meth) { return emit_ease_ns(meth, e) }
|
||||
perr(`unknown builtin Ease.{meth}`)
|
||||
}
|
||||
if (ns == "Collide") {
|
||||
if (ns == "Collision") {
|
||||
if is_collide_ns(meth) { return emit_collide_ns(meth, e) }
|
||||
perr(`unknown builtin Collide.{meth}`)
|
||||
perr(`unknown builtin Collision.{meth}`)
|
||||
}
|
||||
if (ns == "Mem") {
|
||||
if (ns == "Memory") {
|
||||
if is_mem_ns(meth) { return emit_mem_ns(meth, e) }
|
||||
perr(`unknown builtin Mem.{meth}`)
|
||||
perr(`unknown builtin Memory.{meth}`)
|
||||
}
|
||||
if (ns == "Color") {
|
||||
if is_colorfn_ns(meth) { return emit_colorfn_ns(meth, e) }
|
||||
|
|
@ -288,7 +288,7 @@ fn emit_ns_call(ns: ptr, meth: ptr, e: Node) -> Val {
|
|||
if (meth == "detach") { bare = "world_detach_dyn" }
|
||||
if (meth == "query_next") { bare = "world_query_next" }
|
||||
}
|
||||
if (ns == "Net") {
|
||||
if (ns == "Network") {
|
||||
if (meth == "send") { bare = "net_send" }
|
||||
if (meth == "poll") { bare = "net_poll" }
|
||||
if (meth == "serialize") { bare = "serialize" }
|
||||
|
|
@ -299,7 +299,7 @@ fn emit_ns_call(ns: ptr, meth: ptr, e: Node) -> Val {
|
|||
if (meth == "is_owner") { bare = "is_owner" }
|
||||
if (meth == "local_id") { bare = "local_id" }
|
||||
}
|
||||
if (ns == "Sys") {
|
||||
if (ns == "System") {
|
||||
if (meth == "arg") { bare = "arg" }
|
||||
if (meth == "arg_count") { bare = "arg_count" }
|
||||
if (meth == "exit") { bare = "exit" }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# emit_mem.ludic — the Mem.* namespace: raw buffers and byte pokes. bytes/words
|
||||
# emit_mem.ludic — the Memory.* namespace: raw buffers and byte pokes. bytes/words
|
||||
# allocate (as the bare builtins do); copy/fill wrap memcpy/memset; peek/poke
|
||||
# read and write one byte. The low-level escape hatch, PICO-8's memcpy/memset/
|
||||
# peek/poke by another name.
|
||||
|
|
|
|||
|
|
@ -3227,10 +3227,10 @@ declare void @win_close()
|
|||
@.str3126 = private unnamed_addr constant [22 x i8] c"unknown builtin List.\00"
|
||||
@.str3127 = private unnamed_addr constant [5 x i8] c"Ease\00"
|
||||
@.str3128 = private unnamed_addr constant [22 x i8] c"unknown builtin Ease.\00"
|
||||
@.str3129 = private unnamed_addr constant [8 x i8] c"Collide\00"
|
||||
@.str3130 = private unnamed_addr constant [25 x i8] c"unknown builtin Collide.\00"
|
||||
@.str3131 = private unnamed_addr constant [4 x i8] c"Mem\00"
|
||||
@.str3132 = private unnamed_addr constant [21 x i8] c"unknown builtin Mem.\00"
|
||||
@.str3129 = private unnamed_addr constant [10 x i8] c"Collision\00"
|
||||
@.str3130 = private unnamed_addr constant [27 x i8] c"unknown builtin Collision.\00"
|
||||
@.str3131 = private unnamed_addr constant [7 x i8] c"Memory\00"
|
||||
@.str3132 = private unnamed_addr constant [24 x i8] c"unknown builtin Memory.\00"
|
||||
@.str3133 = private unnamed_addr constant [6 x i8] c"Color\00"
|
||||
@.str3134 = private unnamed_addr constant [23 x i8] c"unknown builtin Color.\00"
|
||||
@.str3135 = private unnamed_addr constant [5 x i8] c"Time\00"
|
||||
|
|
@ -3398,7 +3398,7 @@ declare void @win_close()
|
|||
@.str3297 = private unnamed_addr constant [17 x i8] c"world_detach_dyn\00"
|
||||
@.str3298 = private unnamed_addr constant [11 x i8] c"query_next\00"
|
||||
@.str3299 = private unnamed_addr constant [17 x i8] c"world_query_next\00"
|
||||
@.str3300 = private unnamed_addr constant [4 x i8] c"Net\00"
|
||||
@.str3300 = private unnamed_addr constant [8 x i8] c"Network\00"
|
||||
@.str3301 = private unnamed_addr constant [5 x i8] c"send\00"
|
||||
@.str3302 = private unnamed_addr constant [9 x i8] c"net_send\00"
|
||||
@.str3303 = private unnamed_addr constant [5 x i8] c"poll\00"
|
||||
|
|
@ -3417,7 +3417,7 @@ declare void @win_close()
|
|||
@.str3316 = private unnamed_addr constant [9 x i8] c"is_owner\00"
|
||||
@.str3317 = private unnamed_addr constant [9 x i8] c"local_id\00"
|
||||
@.str3318 = private unnamed_addr constant [9 x i8] c"local_id\00"
|
||||
@.str3319 = private unnamed_addr constant [4 x i8] c"Sys\00"
|
||||
@.str3319 = private unnamed_addr constant [7 x i8] c"System\00"
|
||||
@.str3320 = private unnamed_addr constant [4 x i8] c"arg\00"
|
||||
@.str3321 = private unnamed_addr constant [4 x i8] c"arg\00"
|
||||
@.str3322 = private unnamed_addr constant [10 x i8] c"arg_count\00"
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ program T {
|
|||
print(Math.floor(Ease.bounce(0.5) * 1000.0)) # 765
|
||||
print(Math.floor(Ease.back(0.5) * 1000.0)) # -88
|
||||
print(Math.floor(Ease.back(1.0) * 1000.0)) # 1000
|
||||
print(Collide.rects(0, 0, 10, 10, 5, 5, 10, 10)) # 1
|
||||
print(Collide.rects(0, 0, 10, 10, 20, 20, 5, 5)) # 0
|
||||
print(Collide.point_rect(5, 5, 0, 0, 10, 10)) # 1
|
||||
print(Collide.point_rect(15, 5, 0, 0, 10, 10)) # 0
|
||||
print(Collide.point_rect(10, 5, 0, 0, 10, 10)) # 0
|
||||
print(Collide.circles(0, 0, 5, 6, 0, 5)) # 1
|
||||
print(Collide.circles(0, 0, 5, 20, 0, 5)) # 0
|
||||
print(Collide.rect_circle(0, 0, 10, 10, 15, 5, 6)) # 1
|
||||
print(Collide.rect_circle(0, 0, 10, 10, 20, 5, 6)) # 0
|
||||
print(Collision.rects(0, 0, 10, 10, 5, 5, 10, 10)) # 1
|
||||
print(Collision.rects(0, 0, 10, 10, 20, 20, 5, 5)) # 0
|
||||
print(Collision.point_rect(5, 5, 0, 0, 10, 10)) # 1
|
||||
print(Collision.point_rect(15, 5, 0, 0, 10, 10)) # 0
|
||||
print(Collision.point_rect(10, 5, 0, 0, 10, 10)) # 0
|
||||
print(Collision.circles(0, 0, 5, 6, 0, 5)) # 1
|
||||
print(Collision.circles(0, 0, 5, 20, 0, 5)) # 0
|
||||
print(Collision.rect_circle(0, 0, 10, 10, 15, 5, 6)) # 1
|
||||
print(Collision.rect_circle(0, 0, 10, 10, 20, 5, 6)) # 0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
program T {
|
||||
entry {
|
||||
let b = Mem.bytes(8)
|
||||
Mem.poke(b, 0, 65)
|
||||
Mem.poke(b, 1, 66)
|
||||
print(Mem.peek(b, 0)) # 65
|
||||
print(Mem.peek(b, 1)) # 66
|
||||
Mem.fill(b, 0, 8)
|
||||
print(Mem.peek(b, 0)) # 0
|
||||
let c = Mem.bytes(8)
|
||||
Mem.poke(b, 3, 99)
|
||||
Mem.copy(c, b, 8)
|
||||
print(Mem.peek(c, 3)) # 99
|
||||
let w = Mem.words(4)
|
||||
let b = Memory.bytes(8)
|
||||
Memory.poke(b, 0, 65)
|
||||
Memory.poke(b, 1, 66)
|
||||
print(Memory.peek(b, 0)) # 65
|
||||
print(Memory.peek(b, 1)) # 66
|
||||
Memory.fill(b, 0, 8)
|
||||
print(Memory.peek(b, 0)) # 0
|
||||
let c = Memory.bytes(8)
|
||||
Memory.poke(b, 3, 99)
|
||||
Memory.copy(c, b, 8)
|
||||
print(Memory.peek(c, 3)) # 99
|
||||
let w = Memory.words(4)
|
||||
w[0] = 12345
|
||||
print(w[0]) # 12345
|
||||
print(Sys.arg_count()) # 1
|
||||
print(System.arg_count()) # 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@
|
|||
"fn-file_stdout",
|
||||
"fn-file_stderr"
|
||||
],
|
||||
"collide": [
|
||||
"collide-rects",
|
||||
"collide-point_rect",
|
||||
"collide-circles",
|
||||
"collide-rect_circle"
|
||||
"collision": [
|
||||
"collision-rects",
|
||||
"collision-point_rect",
|
||||
"collision-circles",
|
||||
"collision-rect_circle"
|
||||
],
|
||||
"color": [
|
||||
"color-rgb",
|
||||
|
|
@ -168,24 +168,24 @@
|
|||
"math-asin",
|
||||
"math-acos"
|
||||
],
|
||||
"mem": [
|
||||
"mem-bytes",
|
||||
"mem-words",
|
||||
"mem-copy",
|
||||
"mem-fill",
|
||||
"mem-peek",
|
||||
"mem-poke"
|
||||
"memory": [
|
||||
"memory-bytes",
|
||||
"memory-words",
|
||||
"memory-copy",
|
||||
"memory-fill",
|
||||
"memory-peek",
|
||||
"memory-poke"
|
||||
],
|
||||
"net": [
|
||||
"net-send",
|
||||
"net-poll",
|
||||
"net-serialize",
|
||||
"net-apply",
|
||||
"net-owner",
|
||||
"net-set_owner",
|
||||
"net-is_server",
|
||||
"net-is_owner",
|
||||
"net-local_id"
|
||||
"network": [
|
||||
"network-send",
|
||||
"network-poll",
|
||||
"network-serialize",
|
||||
"network-apply",
|
||||
"network-owner",
|
||||
"network-set_owner",
|
||||
"network-is_server",
|
||||
"network-is_owner",
|
||||
"network-local_id"
|
||||
],
|
||||
"networking": [
|
||||
"fn-net_send",
|
||||
|
|
@ -273,21 +273,21 @@
|
|||
"kw-ui",
|
||||
"kw-enum"
|
||||
],
|
||||
"sys": [
|
||||
"sys-arg",
|
||||
"sys-arg_count",
|
||||
"sys-exit",
|
||||
"sys-run",
|
||||
"sys-env",
|
||||
"sys-read_char",
|
||||
"sys-file_open",
|
||||
"sys-file_read",
|
||||
"sys-file_write",
|
||||
"sys-file_seek",
|
||||
"sys-file_tell",
|
||||
"sys-file_close",
|
||||
"sys-stdout",
|
||||
"sys-stderr"
|
||||
"system": [
|
||||
"system-arg",
|
||||
"system-arg_count",
|
||||
"system-exit",
|
||||
"system-run",
|
||||
"system-env",
|
||||
"system-read_char",
|
||||
"system-file_open",
|
||||
"system-file_read",
|
||||
"system-file_write",
|
||||
"system-file_seek",
|
||||
"system-file_tell",
|
||||
"system-file_close",
|
||||
"system-stdout",
|
||||
"system-stderr"
|
||||
],
|
||||
"text": [
|
||||
"text-length",
|
||||
|
|
|
|||
|
|
@ -1324,11 +1324,11 @@ program LudicLsp {
|
|||
if (meth == "back") { return "Ease.back(t) -> fixed" }
|
||||
if (meth == "bounce") { return "Ease.bounce(t) -> fixed" }
|
||||
}
|
||||
if (ns == "Collide") {
|
||||
if (meth == "rects") { return "Collide.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool" }
|
||||
if (meth == "point_rect") { return "Collide.point_rect(px, py, rx, ry, rw, rh) -> bool" }
|
||||
if (meth == "circles") { return "Collide.circles(ax, ay, ar, bx, by, br) -> bool" }
|
||||
if (meth == "rect_circle") { return "Collide.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool" }
|
||||
if (ns == "Collision") {
|
||||
if (meth == "rects") { return "Collision.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool" }
|
||||
if (meth == "point_rect") { return "Collision.point_rect(px, py, rx, ry, rw, rh) -> bool" }
|
||||
if (meth == "circles") { return "Collision.circles(ax, ay, ar, bx, by, br) -> bool" }
|
||||
if (meth == "rect_circle") { return "Collision.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool" }
|
||||
}
|
||||
if (ns == "World") {
|
||||
if (meth == "get") { return "World.get(prop_id, field_id, entity) -> int" }
|
||||
|
|
@ -1348,32 +1348,32 @@ program LudicLsp {
|
|||
if (meth == "detach") { return "World.detach(entity, prop_id)" }
|
||||
if (meth == "query_next") { return "World.query_next(query_id, cursor) -> int" }
|
||||
}
|
||||
if (ns == "Net") {
|
||||
if (meth == "send") { return "Net.send(peer, buf, len)" }
|
||||
if (meth == "poll") { return "Net.poll(buf, cap) -> int" }
|
||||
if (meth == "serialize") { return "Net.serialize(entity, buf) -> int" }
|
||||
if (meth == "apply") { return "Net.apply(entity, buf) -> int" }
|
||||
if (meth == "owner") { return "Net.owner(entity) -> int" }
|
||||
if (meth == "set_owner") { return "Net.set_owner(entity, peer)" }
|
||||
if (meth == "is_server") { return "Net.is_server() -> bool" }
|
||||
if (meth == "is_owner") { return "Net.is_owner(entity) -> bool" }
|
||||
if (meth == "local_id") { return "Net.local_id() -> int" }
|
||||
if (ns == "Network") {
|
||||
if (meth == "send") { return "Network.send(peer, buf, len)" }
|
||||
if (meth == "poll") { return "Network.poll(buf, cap) -> int" }
|
||||
if (meth == "serialize") { return "Network.serialize(entity, buf) -> int" }
|
||||
if (meth == "apply") { return "Network.apply(entity, buf) -> int" }
|
||||
if (meth == "owner") { return "Network.owner(entity) -> int" }
|
||||
if (meth == "set_owner") { return "Network.set_owner(entity, peer)" }
|
||||
if (meth == "is_server") { return "Network.is_server() -> bool" }
|
||||
if (meth == "is_owner") { return "Network.is_owner(entity) -> bool" }
|
||||
if (meth == "local_id") { return "Network.local_id() -> int" }
|
||||
}
|
||||
if (ns == "Sys") {
|
||||
if (meth == "arg") { return "Sys.arg(i) -> str" }
|
||||
if (meth == "arg_count") { return "Sys.arg_count() -> int" }
|
||||
if (meth == "exit") { return "Sys.exit(code)" }
|
||||
if (meth == "run") { return "Sys.run(command) -> int" }
|
||||
if (meth == "env") { return "Sys.env(name) -> str" }
|
||||
if (meth == "read_char") { return "Sys.read_char() -> int" }
|
||||
if (meth == "file_open") { return "Sys.file_open(path, mode) -> ptr" }
|
||||
if (meth == "file_read") { return "Sys.file_read(file, buf, n) -> int" }
|
||||
if (meth == "file_write") { return "Sys.file_write(file, buf, n) -> int" }
|
||||
if (meth == "file_seek") { return "Sys.file_seek(file, offset, whence) -> int" }
|
||||
if (meth == "file_tell") { return "Sys.file_tell(file) -> int" }
|
||||
if (meth == "file_close") { return "Sys.file_close(file)" }
|
||||
if (meth == "stdout") { return "Sys.stdout() -> ptr" }
|
||||
if (meth == "stderr") { return "Sys.stderr() -> ptr" }
|
||||
if (ns == "System") {
|
||||
if (meth == "arg") { return "System.arg(i) -> str" }
|
||||
if (meth == "arg_count") { return "System.arg_count() -> int" }
|
||||
if (meth == "exit") { return "System.exit(code)" }
|
||||
if (meth == "run") { return "System.run(command) -> int" }
|
||||
if (meth == "env") { return "System.env(name) -> str" }
|
||||
if (meth == "read_char") { return "System.read_char() -> int" }
|
||||
if (meth == "file_open") { return "System.file_open(path, mode) -> ptr" }
|
||||
if (meth == "file_read") { return "System.file_read(file, buf, n) -> int" }
|
||||
if (meth == "file_write") { return "System.file_write(file, buf, n) -> int" }
|
||||
if (meth == "file_seek") { return "System.file_seek(file, offset, whence) -> int" }
|
||||
if (meth == "file_tell") { return "System.file_tell(file) -> int" }
|
||||
if (meth == "file_close") { return "System.file_close(file)" }
|
||||
if (meth == "stdout") { return "System.stdout() -> ptr" }
|
||||
if (meth == "stderr") { return "System.stderr() -> ptr" }
|
||||
}
|
||||
if (ns == "Save") {
|
||||
if (meth == "write") { return "Save.write()" }
|
||||
|
|
@ -1385,13 +1385,13 @@ program LudicLsp {
|
|||
if (meth == "elapsed") { return "Time.elapsed() -> fixed" }
|
||||
if (meth == "now") { return "Time.now() -> int" }
|
||||
}
|
||||
if (ns == "Mem") {
|
||||
if (meth == "bytes") { return "Mem.bytes(n) -> ptr" }
|
||||
if (meth == "words") { return "Mem.words(n) -> words" }
|
||||
if (meth == "copy") { return "Mem.copy(dst, src, n)" }
|
||||
if (meth == "fill") { return "Mem.fill(buf, value, n)" }
|
||||
if (meth == "peek") { return "Mem.peek(buf, i) -> int" }
|
||||
if (meth == "poke") { return "Mem.poke(buf, i, value)" }
|
||||
if (ns == "Memory") {
|
||||
if (meth == "bytes") { return "Memory.bytes(n) -> ptr" }
|
||||
if (meth == "words") { return "Memory.words(n) -> words" }
|
||||
if (meth == "copy") { return "Memory.copy(dst, src, n)" }
|
||||
if (meth == "fill") { return "Memory.fill(buf, value, n)" }
|
||||
if (meth == "peek") { return "Memory.peek(buf, i) -> int" }
|
||||
if (meth == "poke") { return "Memory.poke(buf, i, value)" }
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue