-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheffects.affine
More file actions
46 lines (38 loc) · 1.76 KB
/
Copy patheffects.affine
File metadata and controls
46 lines (38 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-License-Identifier: MPL-2.0
// AffineScript Standard Library - Effect Declarations
// Core IO effect - file and console operations
effect IO;
// State effect - mutable references
effect Mut;
// Exception effect - panics and error handling
effect Throws;
// Async effect - promise / suspend semantics. The Deno-ESM backend
// emits native `async`/`await` and the Thenable extern ABI (issue
// #103); the v1 effect-row registry (#196) already reserves `Async`.
// Declared here so the stdlib effect-declarations file is coherent
// with the registry (echidna#62). Tracking-only in v1 (no handler).
effect Async;
// Built-in IO operations
extern fn print(s: String) -> Unit / IO;
extern fn println(s: String) -> Unit / IO;
extern fn read_line() -> String / IO;
extern fn read_file(path: String) -> String / IO;
extern fn write_file(path: String, content: String) -> Unit / IO;
// Built-in State operations
// `make_ref` (not `ref`) because `ref` is a reserved ownership keyword;
// see #135 keyword-as-identifier slice.
extern fn make_ref<T>(x: T) -> Ref<T> / Mut;
extern fn get<T>(r: Ref<T>) -> T / Mut;
extern fn set<T>(r: Ref<T>, x: T) -> Unit / Mut;
// Built-in Exception operations
extern fn panic(msg: String) -> Never / Throws;
extern fn error<T>(msg: String) -> T / Throws;
// Pure operations (no effects)
extern fn int_to_string(n: Int) -> String;
extern fn string_to_int(s: String) -> Option<Int>;
extern fn string_length(s: String) -> Int;
// `string_concat` removed (STDLIB-04c, Refs #330): the canonical surface
// for string concatenation is the `++` operator, lowered directly in
// `Value.binop_string` (interp) and `__as_concat` (Deno codegen). The
// extern was declared but never wired in any backend nor called from
// any stdlib/test/fixture file — dead surface.