Core Reference

compiler generated documentation

#!+ [builtin]

#!- one type to rule them all.
primitive Class;

#!- this type is infered.
primitive auto;

#!- a void type.
primitive void;

#!- integer type.
primitive int;

#!- character type.
primitive char extends int;

#!- float type.
primitive float;

#!- represent duration.
primitive dur;

#!- represent time.
primitive time;

#!- internal time for `now`.
primitive @now extends time;
specialid const now;

#!- internal predicate representation.
specialid const @predicate;

#!- internal base of all objects and structures.
primitive @Compound;
primitive Object extends @Compound;
specialid const this;
primitive bool extends int;
const bool true;
const bool false;
operator bool ! (int);
specialid const maybe;
operator bool @conditional (int);
operator bool @unconditional (int);
operator int + (int, int);
operator int - (int, int);
operator int * (int, int);
operator int / (int, int);
operator int  (int, int);
operator int > (int, int);
operator int >= (int, int);
operator int < (int, int);
operator int <= (int, int);
operator int >> (int, int);
operator int << (int, int);
operator int & (int, int);
operator int | (int, int);
operator int ^ (int, int);
operator bool && (int, int);
operator bool || (int, int);
operator bool == (int, int);
operator bool != (int, int);
operator int => (int, int);
operator int +=> (int, int);
operator int -=> (int, int);
operator int *=> (int, int);
operator int /=> (int, int);
operator int %=> (int, int);
operator int <<=> (int, int);
operator int >>=> (int, int);
operator int &=> (int, int);
operator int |=> (int, int);
operator int ^=> (int, int);
operator int - (int);
operator int ++ (int);
operator int -- (int);
operator int ~ (int);
operator @range (int);
operator int int ++ ();
operator int int -- ();
operator bool @conditional (float);
operator bool @unconditional (float);
operator float + (float, float);
operator float - (float, float);
operator float * (float, float);
operator float / (float, float);
operator float @implicit (float, float);
operator float => (float, float);
operator float +=> (float, float);
operator float -=> (float, float);
operator float *=> (float, float);
operator float /=> (float, float);
operator bool && (float, float);
operator bool || (float, float);
operator bool == (float, float);
operator bool != (float, float);
operator bool > (float, float);
operator bool >= (float, float);
operator bool < (float, float);
operator bool <= (float, float);
operator float - (float);
operator dur :: (int, dur);
operator dur :: (float, dur);
operator bool ! (float);
operator int > (int, float);
operator int >= (int, float);
operator int < (int, float);
operator int <= (int, float);
operator float + (int, float);
operator float * (int, float);
operator float - (int, float);
operator float / (int, float);
operator float => (int, float);
operator float +=> (int, float);
operator float -=> (int, float);
operator float *=> (int, float);
operator float /=> (int, float);
operator float $ (int, float);
operator float @implicit (int, float);
operator bool && (int, float);
operator bool || (int, float);
operator bool == (int, float);
operator bool != (int, float);
operator float + (float, int);
operator float - (float, int);
operator float * (float, int);
operator float / (float, int);
operator float => (float, int);
operator float +=> (float, int);
operator float -=> (float, int);
operator float *=> (float, int);
operator float /=> (float, int);
operator float $ (float, int);
operator bool && (float, int);
operator bool || (float, int);
operator bool == (float, int);
operator bool != (float, int);
operator bool > (float, int);
operator bool >= (float, int);
operator bool < (float, int);
operator bool <= (float, int);
operator bool @conditional (dur);
operator bool @unconditional (dur);
operator dur => (dur, dur);
operator dur +=> (dur, dur);
operator dur -=> (dur, dur);
operator dur *=> (dur, dur);
operator dur /=> (dur, dur);
operator dur + (dur, dur);
operator dur - (dur, dur);
operator dur * (dur, dur);
operator float / (dur, dur);
operator dur / (dur, float);
operator dur *=> (float, dur);
operator dur /=> (float, dur);
operator bool == (dur, dur);
operator bool != (dur, dur);
operator bool > (dur, dur);
operator bool >= (dur, dur);
operator bool < (dur, dur);
operator bool <= (dur, dur);
operator bool @conditional (time);
operator bool @unconditional (time);
operator time => (time, time);
operator time + (time, dur);
operator time * (time, dur);
operator time / (time, dur);
operator dur - (time, time);
operator time *=> (float, time);
operator time /=> (float, time);
operator time => (dur, time);
operator time + (dur, time);
operator time => (dur, @now);
operator bool > (time, time);
operator bool >= (time, time);
operator bool < (time, time);
operator bool <= (time, time);

#!- the base of all functions.
primitive function;

#!- the base of decayed operators.
primitive operator extends function;

#!- the base of function pointers.
class funptr extends Object {
  fun void default();
}
operator funptr @scan ();
operator => (@Any, function);
operator => (@Any, funptr);
operator @=> (function, funptr);
operator @implicit (function, funptr);
operator @implicit (operator, funptr);
operator @=> (function, function);
operator function @partial ();
operator Class @partial ();
primitive @error;
operator => (Object, Object);
operator bool == (Object, Object);
operator bool != (Object, Object);
operator bool $ (Object, Object);
operator bool @unconditional (Object);
operator bool @conditional (Object);
operator bool ! (Object);
operator @Compound @scan ();
const float samplerate;
const float pi;
const dur d_zero;
const dur samp;
const dur ms;
const dur second;
const dur minute;
const dur hour;
const time t_zero;
primitive None;
specialid const None;
operator None => (None, None);
class union extends Object {
  const int index;
  fun bool is(int member);
  operator auto new:[ T ](int size, int id, T value);
}
operator @dot (union, @Any);
union Option :[ A ] {
  None none;
  A val;
};
class Array:[ T ] extends Object {
  funptr static A map_t:[ A ](T elem);
  funptr static Option:[ A ] compactmap_t:[ A ](T elem);
  funptr static A fold_t:[ A ](T elem, A acc);
  funptr static bool filter_t(T elem);
  fun bool remove(int index);
  fun bool insert(int index, T data);
  fun int size();
  fun int depth();
  fun int cap();
  fun T random();
  fun A[] map:[ A ](map_t:[ A ] data);
  fun A[] compactMap:[ A ](compactmap_t:[ A ] data);
  fun T[] filter(filter_t data);
  fun int count(filter_t data);
  fun A foldl:[ A ](fold_t:[ A ] data, A initial);
  fun A foldr:[ A ](fold_t:[ A ] data, A initial);
}
operator => (Array, Array);
operator @implicit (Array, Array);
operator << (Array, @Any);
operator >> (@Any, Array);
operator $ (Array, Array);
operator int @slice (int, Array);
operator @array (int, Array);
operator Array void @each_init ();
operator Array int @each ();
operator Array @each_val ();
operator Array int @each_idx ();
operator Array @scan ();
class Event extends Object {
  fun void signal();
  fun void broadcast();
}
operator int => (Event, @now);
class UGen extends Object {
  fun UGen chan(int arg0);
  fun int op();
  fun int op(int arg0);
  fun float last();
}
operator UGen ~> (UGen, UGen);
operator UGen ~< (UGen, UGen);
operator UGen :~> (UGen, UGen);
operator UGen :~< (UGen, UGen);
operator UGen[] ~> (UGen[], UGen[]);
operator UGen[] ~< (UGen[], UGen[]);
operator UGen[] :~> (UGen[], UGen[]);
operator UGen[] :~< (UGen[], UGen[]);
operator UGen[] ~> (UGen, UGen[]);
operator UGen[] ~< (UGen, UGen[]);
operator UGen[] :~> (UGen, UGen[]);
operator UGen[] :~< (UGen, UGen[]);
operator UGen ~> (UGen[], UGen);
operator UGen ~< (UGen[], UGen);
operator UGen :~> (UGen[], UGen);
operator UGen :~< (UGen[], UGen);
const UGen blackhole;
const UGen dac;
const UGen adc;
class Ptr:[ A ] {
}
operator Ptr @scan ();
operator :=> (@Any, Ptr);
operator @implicit (@Any, Ptr);
operator $ (@Any, Ptr);
operator * (Ptr);
operator Ptr => (Ptr, Ptr);
operator spork (@Any);
operator fork (@Any);
operator new (@Any);
class string extends Object {
  fun int size();
  fun string upper();
  fun string lower();
  fun string ltrim();
  fun string rtrim();
  fun string trim();
  fun string insert(int pos, string str);
  fun string replace(int pos, string str);
  fun string replace(int pos, int n, string str);
  fun int find(char c);
  fun int find(char c, int pos);
  fun int find(string str);
  fun int find(string str, int pos);
  fun int rfind(char c);
  fun int rfind(char c, int pos);
  fun int rfind(string str);
  fun int rfind(string str, int pos);
  fun void erase(int start, int length);
  fun void save(string path);
  fun static string load(string path);
  fun int atoi();
  fun float atof();
}
operator @array (int, string);
operator bool == (string, string);
operator bool != (string, string);
operator string @slice (int, string);
specialid const __func__;
class Shred extends Object {
  const int cancel;
  fun void exit();
  fun bool running();
  fun bool done();
  fun int id();
  fun static Shred fromId(int xid);
  fun void yield();
  fun int args();
  fun string arg(int n);
  fun string name();
  fun string path();
  fun string dir();
  fun string code_name();
  fun string code_path();
  fun string code_dir();
  fun void set_cancel(int n);
  fun void test_cancel();
  fun void lock();
  fun void unlock();
  fun float get_now();
  fun UGen get_blackhole();
}
specialid const me;
class Fork extends Shred {
  const int is_done;
  const Event ev;
  fun void join();
  fun void test_cancel();
}
class TypedFork:[ A ] extends Fork {
  const A retval;
}
class Gain extends UGen {
  fun float gain();
  fun float gain(float arg0);
}
class Impulse extends UGen {
  fun float next();
  fun float next(float arg0);
}
class FullRect extends UGen {
}
class HalfRect extends UGen {
}
class Step extends UGen {
  fun float next();
  fun float next(float arg0);
}
class ZeroX extends UGen {
}
class UsrUGen extends UGen {
  fun int default_tick();
}
operator UsrUGen ~=> (function, UsrUGen);

#!- Ref: take a reference from a variable.
#!- used just as the variable it reference.
#!- can only be used as argument.
#!- and cannot be returned.
class Ref:[ A ] {
  #!- a pointer to the referenced variable.
}

#!- internal `Ref` type creation.
operator Ref @scan ();

#!- allow member access.
operator @dot (@Compound, @Any);

#!- Operators class types.
operator bool == (Class, Class);
operator bool != (Class, Class);
operator bool >= (Class, Class);
operator bool > (Class, Class);
operator bool <= (Class, Class);
operator bool < (Class, Class);

#!- Allow binary call to constructors.
operator => (@Any, Class);

#!- internal constructor operator.
operator @ctor (@Any);

#!- Allow enum for array size
operator @implicit (Class, int);

#!- allow static access.
operator @dot (Class, @Any);

#!- Deep Equality fallback
operator bool ?= (@Any, @Any);

#!- Deep Inequality fallback
operator bool <> (@Any, @Any);

#!- Deep Equality
operator bool ?= (@Compound, @Compound);

#!- Deep Inequality
operator bool <> (@Compound, @Compound);
class Dict:[ Key, Val ] extends Object {
  fun bool remove(Key key);
}
operator Dict @scan ();
operator Dict int @each ();
operator Dict void @each_init ();
operator Dict @each_val ();
operator Dict @each_idx ();
fun int hash(int key);
fun int hash(Object key);
fun int hash(float key);
fun int hash(time key);
fun int hash(dur key);
fun int hash(string key);

#!- a type for *pretty print*.
primitive @Gack;

#!- @Gack implicit cast
operator @implicit (@Gack, @Any);
class Sift extends Shred {
}

#!- This operator expands too
#!- spork {
#!-   while(true) {
#!-     lhs.last() => rhs;
#!-     samp => now;
#!-   }
#!- }
operator Sift |> (UGen, function);
operator Sift |> (Sift, function);
operator Sift |> (UGen, funptr);
operator Sift |> (Sift, funptr);

#!- Definition of the basic locale
fun float BasicLocale(string str);
enum @hidden_enum { @hidden_enum }
built with mdr and mdBook
You'll find the source here, Luke! note: privacy guards may interfere with the playground