Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
691 lines (641 sloc) 19.6 KB
# CORE.setting
#
# Copyright 2009-2010, Larry Wall
#
# You may copy this software under the terms of the Artistic License,
# version 2.0 or later.
my module CORE;
my class Parcel { }
constant Nil = Parcel;
my enum Bool <False True>;
my enum Order < Increase Same Decrease >;
my enum TrigBase <Radians Degrees Gradians Circles>;
my role Stash { }
my role Role does Stash { }
my role Package does Stash { }
my role Module does Stash { }
my role Class does Module { }
my role List { }
my role Iterable { }
# XXX does this mean anything?
my role Matcher { }
my class Cursor { }
my class Grammar is Cursor { }
my class CallFrame { } # or is this a role?
my class P6opaque { }
my class Mu { }
my class Any { }
my class Cool { }
my class Junction { }
my class junction { }
my class Whatever { }
my class WhateverCode { }
my class HyperWhatever { }
my class Capture { }
my class Iterator does List { }
my class LoL { }
my class Match { }
my class Signature { }
my class Parameter { }
my class Proxy { }
my class Scalar { }
my class Array does Iterable { }
my class Hash does Iterable { }
my class KeyHash does Iterable { }
my class KeySet does Iterable { }
my class KeyBag does Iterable { }
my class KeyWeight does Iterable { }
my class Pair { }
my class PairMap { }
my class Enum { }
my class EnumMap { }
my class Seq { }
my class SeqIter does List { }
my class Range { }
my class RangeIter does List { }
my class Set { }
my class Bag { }
my class Mapping { }
my class Sink { }
my class Undef { }
my class Code { }
my class Block { }
my class Routine { }
my class Sub { }
my class Macro { }
my class Method { }
my class Submethod { }
my class Regex { }
my class Attribute { }
my role Stringy { }
my class Str { }
my class Cat { }
my class Blob { }
my class Char { }
my class AnyChar { }
my class CharLingua { }
my class Byte { }
my class Codepoint { }
my class Grapheme { }
my class StrPos { }
my class StrLen { }
my class Version { }
my role Numeric { }
my role Real { }
my class Num {
# for now, limit denominator to one quintillion to fit in Rat64.
our constant pi is export = 3.14159_26535_89793_238; # 46_26433_83279_50288;
our constant e is export = 2.71828_18284_59045_235; # 36_02874_71352_66249;
our constant i is export = 1i;
}
import Num <pi e i>;
my class num { }
my class num16 { }
my class num32 { }
my class num64 { }
my class num128 { }
my class Complex { }
my class complex { }
# (eventually these should be instantiated generics, complex:of(num64) and such)
my class complex16 { }
my class complex32 { }
my class complex64 { }
my class complex128 { }
my role Integral { }
my class Int { }
my class int { }
my class int1 { }
my class int2 { }
my class int4 { }
my class int8 { }
my class int16 { }
my class int32 { }
my class int64 { }
my class int128 { }
my role Rational { }
my class Rat { }
my class FatRat { }
my class rat { }
my class rat8 { }
my class rat16 { }
my class rat32 { }
my class rat64 { }
my class rat128 { }
my class UInt { }
my class uint { }
my class uint1 { }
my class uint2 { }
my class uint4 { }
my class uint8 { }
my class uint16 { }
my class uint32 { }
my class uint64 { }
my class uint128 { }
my role Buf { }
my class buf { }
my class buf1 { }
my class buf2 { }
my class buf4 { }
my class buf8 { }
my class buf16 { }
my class buf32 { }
my class buf64 { }
my class utf8 { }
my class utf16 { }
my class utf32 { }
my class Bit { }
my class bit { }
my class bool { }
my class Exception { }
my class Failure { ... }
my role X { }
my role X::Comp { ... }
my class X::ControlFlow { ... }
my class X::AdHoc is Exception { ... }
my class X::Method::NotFound is Exception { ... }
my class X::Method::InvalidQualifier is Exception { ... }
my class X::Comp::AdHoc { ... }
my role X::OS { ... }
my role X::IO does X::OS { }
my class X::IO::Rename does X::IO is Exception { ... }
my class X::IO::Copy does X::IO is Exception { ... }
my class X::IO::Mkdir does X::IO is Exception { ... }
my class X::IO::Chdir does X::IO is Exception { ... }
my class X::IO::Dir does X::IO is Exception { ... }
my class X::IO::Cwd does X::IO is Exception { ... }
my class X::IO::Rmdir does X::IO is Exception { ... }
my class X::IO::Unlink does X::IO is Exception { ... }
my class X::IO::Chmod does X::IO is Exception { ... }
my role X::Comp is Exception { ... }
my class X::Comp::AdHoc is X::AdHoc does X::Comp { ... }
my role X::Syntax does X::Comp { }
my role X::Pod { }
my class X::NYI is Exception { ... }
my class X::Comp::NYI is X::NYI does X::Comp { }
my class X::OutOfRange is Exception { ... }
my class X::Buf::AsStr is Exception { ... }
my class X::Buf::Pack is Exception { ... }
my class X::Buf::Pack::NonASCII is Exception { ... }
my class X::Signature::Placeholder does X::Comp { ... }
my class X::Placeholder::Block does X::Comp { ... }
my class X::Placeholder::Mainline is X::Placeholder::Block { ... }
my class X::Undeclared does X::Comp { ... }
my class X::Attribute::Undeclared is X::Undeclared { ... }
my class X::Redeclaration does X::Comp { ... }
my class X::Import::Redeclaration does X::Comp { ... }
my class X::Phaser::Multiple does X::Comp { ... }
my class X::Obsolete does X::Comp { ... }
my class X::Parameter::Default does X::Comp { ... }
my class X::Parameter::Placeholder does X::Comp { ... }
my class X::Parameter::Twigil does X::Comp { ... }
my class X::Parameter::MultipleTypeConstraints does X::Comp { ... }
my class X::Parameter::WrongOrder does X::Comp { ... }
my class X::Signature::NameClash does X::Comp { ... }
my class X::Method::Private::Permission does X::Comp { ... }
my class X::Method::Private::Unqualified does X::Comp { ... }
my class X::Bind is Exception { ... }
my class X::Bind::NativeType does X::Comp { ... }
my class X::Bind::Slice is Exception { ... }
my class X::Bind::ZenSlice is X::Bind::Slice { ... }
my class X::Value::Dynamic does X::Comp { ... }
my class X::Syntax::Name::Null does X::Syntax { ... }
my class X::Syntax::UnlessElse does X::Syntax { ... }
my class X::Syntax::Reserved does X::Syntax { ... }
my class X::Syntax::P5 does X::Syntax { ... }
my class X::Syntax::NegatedPair does X::Syntax { ... }
my class X::Syntax::Variable::Numeric does X::Syntax { ... }
my class X::Syntax::Variable::Match does X::Syntax { ... }
my class X::Syntax::Variable::Twigil does X::Syntax { ... }
my class X::Syntax::Variable::IndirectDeclaration does X::Syntax { ... }
my class X::Syntax::Augment::WithoutMonkeyTyping does X::Syntax { ... }
my class X::Syntax::Augment::Role does X::Syntax { ... }
my class X::Syntax::Argument::MOPMacro does X::Syntax { ... }
my class X::Does::TypeObject is Exception { ... }
my class X::Role::Initialization is Exception { ... }
my class X::Syntax::Comment::Embedded does X::Syntax { ... }
my class X::Syntax::Pod::BeginWithoutIdentifier does X::Syntax does X::Pod { ... }
my class X::Syntax::Pod::BeginWithoutEnd does X::Syntax does X::Pod { ... }
my class X::Syntax::Confused does X::Syntax { ... }
my class X::Syntax::Malformed does X::Syntax { ... }
my class X::Syntax::Missing does X::Syntax { ... }
my class X::Syntax::SigilWithoutName does X::Syntax { ... }
my class X::Syntax::Self::WithoutObject does X::Syntax { ... }
my class X::Syntax::VirtualCall does X::Syntax { ... }
my class X::Syntax::NoSelf does X::Syntax { ... }
my class X::Syntax::Number::RadixOutOfRange does X::Syntax { ... }
my class X::Syntax::Regex::Adverb does X::Syntax { ... }
my class X::Syntax::Signature::InvocantMarker does X::Syntax { ... }
my class X::Syntax::Extension::Category does X::Syntax { ... }
my class X::Syntax::InfixInTermPosition does X::Syntax { ... }
my class X::Attribute::Package does X::Comp { ... }
my class X::Attribute::NoPackage does X::Comp { ... }
my class X::Declaration::Scope does X::Comp { ... }
my class X::Declaration::Scope::Multi is X::Declaration::Scope { ... }
my class X::Anon::Multi does X::Comp { ... }
my class X::Anon::Augment does X::Comp { ... }
my class X::Augment::NoSuchType does X::Comp { ... }
my class X::Routine::Unwrap is Exception { ... }
my class X::Constructor::Positional is Exception { ... }
my class X::Hash::Store::OddNumber is Exception { ... }
my class X::Package::Stubbed does X::Comp { ... }
my class X::Phaser::PrePost is Exception { ... }
my class X::Str::Numeric is Exception { ... }
my class X::Str::Match::x is Exception { ... }
my class X::Str::Trans::IllegalKey is Exception { ... }
my class X::Str::Trans::InvalidArg is Exception { ... }
my class X::Sequence::Deduction is Exception { ... }
my class X::ControlFlow is Exception { ... }
my class X::ControlFlow::Return is X::ControlFlow { ... }
my class X::Composition::NotComposable does X::Comp { ... }
my class X::TypeCheck is Exception { ... }
my class X::TypeCheck::Binding is X::TypeCheck { ... }
my class X::TypeCheck::Return is X::TypeCheck { ... }
my class X::TypeCheck::Assignment is X::TypeCheck { ... }
my class X::TypeCheck::Splice is X::TypeCheck does X::Comp { ... }
my class X::Assignment::RO is Exception { ... }
my class X::NoDispatcher is Exception { ... }
my class X::Localizer::NoContainer is Exception { ... }
my class X::Mixin::NotComposable is Exception { ... }
my class X::Inheritance::Unsupported does X::Comp { ... }
my class X::Export::NameClash does X::Comp { ... }
my class X::HyperOp::NonDWIM is Exception { ... }
my class X::Set::Coerce is Exception { ... }
my role X::Temporal is Exception { }
my class X::Temporal::InvalidFormat does X::Temporal { ... }
my class X::Temporal::Truncation does X::Temporal { ... }
my class X::DateTime::TimezoneClash does X::Temporal { ... }
my class X::Eval::NoSuchLang is Exception { ... }
my class X::Import::MissingSymbols is Exception { ... }
my class X::Numeric::Real is Exception { ... }
my class X::PseudoPackage::InDeclaration does X::Comp { ... }
my class Backtrace { ... }
my role Ordered { }
my role Callable { }
my role Positional { }
my role Associative { }
my role Abstraction { }
my role Integral { }
my role AttributeDeclarand { }
my role ContainerDeclarand { }
my subset Comparator of Code where { .signature === :(Any, Any --> Int ) };
my subset KeyExtractor of Code where { .signature === :(Any --> Any) };
my subset OrderingPair of Pair where { .left ~~ KeyExtractor && .right ~~ Comparator };
my subset Ordering of Mu where Signature | KeyExtractor | Comparator | OrderingPair | Whatever;
my class Instant { }
my class Duration { }
my class Date { }
my class DateTime { }
my class IO { }
my class Path { }
my class KitchenSink { }
my proto WHAT {*}
my proto WHERE {*}
my proto HOW {*}
my proto WHICH {*}
my proto VAR {*}
my proto WHO {*}
my proto WHENCE {*}
my proto fail {*}
my proto temp {*}
my proto let {*}
my proto any {*}
my proto all {*}
my proto none {*}
my proto one {*}
my proto not {*}
my proto so {*}
my proto next {*}
my proto last {*}
my proto redo {*}
my proto succeed {*}
my proto goto {*}
my proto die {*}
my proto exit {*}
my proto warn {*}
my proto note {*}
my proto caller {*}
my proto callframe {*}
my proto EVAL {*}
my proto evalfile {*}
my proto callsame {*}
my proto callwith {*}
my proto nextsame {*}
my proto nextwith {*}
my proto lastcall {*}
my proto defined {*}
my proto notdef {*}
my proto undefine {*}
my proto item {*}
my proto list {*}
my proto flat {*}
my proto lol {*}
my proto eager {*}
my proto hyper {*}
my proto race {*}
my proto cat {*}
my proto classify {*}
my proto categorize {*}
my proto quotemeta {*}
my proto chr {*}
my proto ord {*}
my proto chrs {*}
my proto ords {*}
my proto chop {*}
my proto chomp {*}
my proto trim {*}
my proto trim-leading {*}
my proto trim-trailing {*}
my proto index {*}
my proto rindex {*}
my proto substr {*}
my proto substr-rw {*}
my proto join {*}
my proto split {*}
my proto comb {*}
my proto pack {*}
my proto unpack {*}
my proto uc {*}
my proto lc {*}
my proto tc {*}
my proto tclc {*}
my proto tcuc {*}
my proto wordcase {*}
my proto normalize {*}
my proto nfc {*}
my proto nfd {*}
my proto nfkc {*}
my proto nfkd {*}
my proto samecase {*}
my proto sameaccent {*}
my proto chars {*}
my proto graphs {*}
my proto codes {*}
my proto bytes {*}
my proto say {*}
my proto print {*}
my proto gist {*}
my proto open {*}
my proto close {*}
my proto printf {*}
my proto sprintf {*}
my proto unlink {*}
my proto link {*}
my proto symlink {*}
my proto elems {*}
my proto end {*}
my proto grep {*}
my proto map {*}
my proto first {*}
my proto reduce {*}
my proto sort {*}
my proto min {*}
my proto max {*}
my proto minmax {*}
my proto uniq {*}
my proto push {*}
my proto rotate {*}
my proto reverse {*}
my proto flip {*}
my proto take {*}
my proto take-rw {*}
my proto splice {*}
my proto slurp {*}
my proto get {*}
my proto lines {*}
my proto getc {*}
my proto prompt {*}
my proto chdir {*}
my proto chmod {*}
my proto zip {*}
my proto each {*}
my proto roundrobin {*}
my proto return {*}
my proto return-rw {*}
my proto leave {*}
my proto make {*}
my proto pop {*}
my proto shift {*}
my proto unshift {*}
my proto keys {*}
my proto values {*}
my proto hash {*}
my proto kv {*}
my proto key {*}
my proto value {*}
my proto pairs {*}
my proto invert {*}
my proto pair {*}
my proto enum {*}
my proto set {*}
my proto bag {*}
my proto sign {*}
my proto abs {*}
my proto floor {*}
my proto ceiling {*}
my proto round {*}
my proto truncate {*}
my proto is-prime {*}
my proto expmod {*}
my proto exp {*}
my proto log {*}
my proto log10 {*}
my proto sqrt {*}
my proto roots {*}
my proto rand {*}
my proto srand {*}
my proto pick {*}
my proto roll {*}
my proto cis {*}
my proto unpolar {*}
my proto sin {*}
my proto cos {*}
my proto tan {*}
my proto asin {*}
my proto acos {*}
my proto atan {*}
my proto sec {*}
my proto cosec {*}
my proto cotan {*}
my proto asec {*}
my proto acosec {*}
my proto acotan {*}
my proto sinh {*}
my proto cosh {*}
my proto tanh {*}
my proto asinh {*}
my proto acosh {*}
my proto atanh {*}
my proto sech {*}
my proto cosech {*}
my proto cotanh {*}
my proto asech {*}
my proto acosech {*}
my proto acotanh {*}
my proto atan2 {*}
my proto today {*}
my proto gmtime {*}
my proto localtime {*}
my proto times {*}
my proto gethost {*}
my proto getpw {*}
my proto chroot {*}
my proto getlogin {*}
my proto shell {*}
my proto run {*}
my proto runinstead {*}
my proto fork {*}
my proto wait {*}
my proto kill {*}
my proto sleep {*}
my proto dir {*}
my proto mkdir {*}
my proto rmdir {*}
my proto socket {*}
my proto listen {*}
my proto accept {*}
my proto connect {*}
my proto bind {*}
my proto postfix:<i> ($x) {*}
my proto infix:<.> ($x,$y) {*}
my proto postfix:['->'] ($x) {*}
my proto postfix:<++> ($x) {*}
my proto postfix:«--» ($x) {*}
my proto prefix:<++> ($x) {*}
my proto prefix:«--» ($x) {*}
my proto infix:<**> ($x,$y) {*}
my proto prefix:<!> ($x) {*}
my proto prefix:<+> ($x) {*}
my proto prefix:<-> ($x) {*}
my proto prefix:<~~> ($x) {*}
my proto prefix:<~> ($x) {*}
my proto prefix:<??> ($x) {*}
my proto prefix:<?> ($x) {*}
my proto prefix:<~^> ($x) {*}
my proto prefix:<+^> ($x) {*}
my proto prefix:<?^> ($x) {*}
my proto prefix:<^^> ($x) {*}
my proto prefix:<^> ($x) {*}
my proto prefix:<||> ($x) {*}
my proto prefix:<|> ($x) {*}
my proto infix:<*> ($x,$y) {*}
my proto infix:</> ($x,$y) {*}
my proto infix:<div> ($x,$y) {*}
my proto infix:<%> ($x,$y) {*}
my proto infix:<mod> ($x,$y) {*}
my proto infix:<+&> ($x,$y) {*}
my proto infix:« << » ($x,$y) {*}
my proto infix:« >> » ($x,$y) {*}
my proto infix:<~&> ($x,$y) {*}
my proto infix:<?&> ($x,$y) {*}
my proto infix:« ~< » ($x,$y) {*}
my proto infix:« ~> » ($x,$y) {*}
my proto infix:« +< » ($x,$y) {*}
my proto infix:« +> » ($x,$y) {*}
my proto infix:<+> ($x,$y) {*}
my proto infix:<-> ($x,$y) {*}
my proto infix:<+|> ($x,$y) {*}
my proto infix:<+^> ($x,$y) {*}
my proto infix:<~|> ($x,$y) {*}
my proto infix:<~^> ($x,$y) {*}
my proto infix:<?|> ($x,$y) {*}
my proto infix:<?^> ($x,$y) {*}
my proto infix:<x> ($x,$y) {*}
my proto infix:<xx> ($x,$y) {*}
my proto infix:<~> ($x,$y) {*}
my proto infix:<&> ($x,$y) {*}
my proto infix:<|> ($x,$y) {*}
my proto infix:<^> ($x,$y) {*}
my proto infix:« <=> » ($x,$y) {*}
my proto infix:<leg> ($x,$y) {*}
my proto infix:<cmp> ($x,$y) {*}
my proto infix:<..> ($x,$y) {*}
my proto infix:<^..> ($x,$y) {*}
my proto infix:<..^> ($x,$y) {*}
my proto infix:<^..^> ($x,$y) {*}
my proto infix:<==> ($x,$y) {*}
my proto infix:<!=> ($x,$y) {*}
my proto infix:« < » ($x,$y) {*}
my proto infix:« <= » ($x,$y) {*}
my proto infix:« > » ($x,$y) {*}
my proto infix:« >= » ($x,$y) {*}
my proto infix:<~~> ($x,$y) {*}
my proto infix:<!~> ($x,$y) {*}
my proto infix:<=~> ($x,$y) {*}
my proto infix:<eq> ($x,$y) {*}
my proto infix:<ne> ($x,$y) {*}
my proto infix:<lt> ($x,$y) {*}
my proto infix:<le> ($x,$y) {*}
my proto infix:<gt> ($x,$y) {*}
my proto infix:<ge> ($x,$y) {*}
my proto infix:<=:=> ($x,$y) {*}
my proto infix:<===> ($x,$y) {*}
my proto infix:<eqv> ($x,$y) {*}
my proto infix:<before> ($x,$y) {*}
my proto infix:<after> ($x,$y) {*}
my proto infix:<&&> ($x,$y) {*}
my proto infix:<||> ($x,$y) {*}
my proto infix:<^^> ($x,$y) {*}
my proto infix:<//> ($x,$y) {*}
my proto infix:<min> ($x,$y) {*}
my proto infix:<max> ($x,$y) {*}
my proto infix:<?? !!> ($x,$y) {*}
my proto infix:<!!> ($x,$y) {*}
my proto infix:<?> ($x,$y) {*}
my proto infix:<ff> ($x,$y) {*}
my proto infix:<^ff> ($x,$y) {*}
my proto infix:<ff^> ($x,$y) {*}
my proto infix:<^ff^> ($x,$y) {*}
my proto infix:<fff> ($x,$y) {*}
my proto infix:<^fff> ($x,$y) {*}
my proto infix:<fff^> ($x,$y) {*}
my proto infix:<^fff^> ($x,$y) {*}
my proto infix:<=> ($x,$y) {*}
my proto infix:<:=> ($x,$y) {*}
my proto infix:<::=> ($x,$y) {*}
my proto infix:<.=> ($x,$y) {*}
my proto infix:« => » ($x,$y) {*}
my proto prefix:<so> ($x) {*}
my proto prefix:<not> ($x) {*}
my proto infix:<,> ($x,$y) {*}
my proto infix:<:> ($x,$y) {*}
my proto infix:<X> ($x,$y) {*}
my proto infix:<Z> ($x,$y) {*}
my proto infix:<minmax> ($x,$y) {*}
my proto infix:<...> ($x,$y) {*}
my proto infix:<and> ($x,$y) {*}
my proto infix:<andthen> ($x,$y) {*}
my proto infix:<or> ($x,$y) {*}
my proto infix:<orelse> ($x,$y) {*}
my proto infix:<xor> ($x,$y) {*}
my proto infix:« <== » ($x,$y) {*}
my proto infix:« ==> » ($x,$y) {*}
my proto infix:« <<== » ($x,$y) {*}
my proto infix:« ==>> » ($x,$y) {*}
my proto sub infix:<∈>($, $ --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<(elem)>($a, $b --> Bool) {*}
my proto sub infix:<∉>($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<∋>($, $ --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<(cont)>($a, $b --> Bool) {*}
my proto sub infix:<∌>($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<∪>(Any $a, Any $b --> Set) is equiv(&infix:<|>) is export {*}
my proto sub infix:<(|)>($a, $b --> Set) is equiv(&infix:<|>) is export {*}
my proto sub infix:<∩>(Any $a, Any $b --> Set) is equiv(&infix:<&>) is export {*}
my proto sub infix:<(&)>($a, $b --> Set) is equiv(&infix:<&>) is export {*}
my proto sub infix:<(-)>(Any $a, Any $b --> Set) is equiv(&infix:<^>) is export {*}
my proto sub infix:<(^)>(Any $a, Any $b --> Set) is equiv(&infix:<^>) is export {*}
my proto sub infix:<⊆>($, $ --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:['(<=)']($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<⊈>($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<⊂>($, $ --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:['(<)']($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<⊄>($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<⊇>($, $ --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:['(>=)']($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<⊉>($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<⊃>($, $ --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:['(>)']($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my proto sub infix:<⊅>($a, $b --> Bool) is equiv(&infix:<==>) is export {*}
my package PROCESS {
my %ENV is export;
}
{YOU_ARE_HERE};