Initial import: Aji 0.1 draft spec and Zig scaffolding
Draft specification, RFCs, reference registries and examples, plus the reference-implementation skeleton: build.zig, diagnostic envelope with error-code registry synced to docs, aji CLI, conformance runner with seed tests, CI and contributor docs.
This commit is contained in:
commit
17a55a7fef
67 files changed
+4197
No files matched your search
@@ -0,0 +1,23 @@
|
||||
module examples.channel_transfer;
|
||||
|
||||
struct Message {
|
||||
id: u64,
|
||||
}
|
||||
|
||||
fn producer(
|
||||
tx: ref<Sender<Island<Message>>>,
|
||||
alloc: cap<mem.alloc>
|
||||
) -> Result<void, ChannelError>
|
||||
effects [mem.alloc]
|
||||
{
|
||||
var message = island.create(alloc, Message { id: 0 })?;
|
||||
|
||||
borrow message as mut root {
|
||||
root.id = 42;
|
||||
}
|
||||
|
||||
channel.send(tx, move message)?;
|
||||
|
||||
// message is MOVED and cannot be used here.
|
||||
return Ok();
|
||||
}
|
||||
Reference in new issue
Block a user