API reference
Amethyst ships three libraries:
| Library | Contents | Linked | Status |
|---|---|---|---|
Amethyst.Runtime |
Types and attributes the compiler relies on: Symbol, Range, compiler attributes, control-flow exceptions |
Always | Implemented; the compiler doesn’t emit most attributes yet |
Amethyst.Core |
Extensions to the .NET class library: the Enumerable[T] mixin, Kernel methods, String extensions |
By default | Partially implemented |
Amethyst.Test |
An RSpec-inspired testing framework with matchers | am add Amethyst.Test |
Proposed |
The compiler uses Symbol, Range and the control-flow exceptions in the code it emits,
and reads AmethystName, AmethystLibrary and AmethystPreferred from referenced
libraries. It doesn’t yet apply the other compiler attributes to the code it emits.
am build and am run copy Amethyst.Runtime.dll and Amethyst.Core.dll next to the
compiled program.
The base protocols and mixins (Comparable, Hashable, Equatable, DynamicMessages)
are described in the standard library specification.
Reading signatures
Section titled “Reading signatures”Signatures are written in Amethyst syntax. Every member is also callable from C# under its .NET name, following the naming rules:
| Amethyst | .NET |
|---|---|
each_with_index |
EachWithIndex |
valid? |
IsValid |
save! |
Save |
Enumerable[T] |
Enumerable<T> |