Initial Commit
This commit is contained in:
706 files changed
+135430
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#! @file negatable.sakura
|
||||
#! @author John Christman (sorakatadzuma@gmail.com)
|
||||
#! @copyright Malunal Studios, LLC.
|
||||
#! @license MIT
|
||||
#!
|
||||
#! Contains the negatable trait, which asks for the method a prefix `-` calls.
|
||||
|
||||
module core;
|
||||
|
||||
|
||||
#! A type whose values negate, giving another of the type.
|
||||
#!
|
||||
#! `-a` calls `negate`. A type has it by declaring the method. The trait is
|
||||
#! what generic code asks for to negate a value. Numbers are negatable without
|
||||
#! declaring anything.
|
||||
pub trait negatable {
|
||||
#! Negates this value, as `-x` does.
|
||||
#! @param this The value to negate.
|
||||
#! @returns The negated value.
|
||||
def negate(&this): self;
|
||||
}
|
||||
Reference in new issue
Block a user