louise
The Louise language: compiler, runtime, std, tooling
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#125 · main · 16 min 13 s
0Étoiles
0Forks
40Issues
| 1 | // `Subject` is opaque (ADR 0072): only `process.subject` makes one, so a |
| 2 | // subject's tag always carries messages of its type. `select` relies on it |
| 3 | // within an actor, and distribution across hosts. |
| 4 | |
| 5 | import std/process.{type Pid, type Subject, type proc} |
| 6 | |
| 7 | fn forge :: owner: Pid -> Subject<Int> |
| 8 | { |
| 9 | process.Subject(owner, 1) //~ ERROR E0117 `Subject` is opaque |
| 10 | } |
| 11 | |
| 12 | fn retype :: s: Subject<Int> -> Subject<String> |
| 13 | { |
| 14 | process.Subject(..s) //~ ERROR E0117 `Subject` is opaque |
| 15 | } |
| 16 | |
| 17 | fn read_owner :: s: Subject<Int> -> Pid |
| 18 | { |
| 19 | s.owner //~ ERROR E0117 `Subject` is opaque |
| 20 | } |
| 21 | |
| 22 | fn accessors :: s: Subject<Int> -> (Pid, Int) |
| 23 | { |
| 24 | (process.owner s, process.tag s) |
| 25 | } |
| 26 | |
| 27 | fn made :: -> Subject<Int> / <proc> |
| 28 | { |
| 29 | process.subject () |
| 30 | } |