compatibility_v2
Contains a simple compatibility layer for help with converting projects from Catspeak 2 to Catspeak 3. There are many breaking changes between these versions, so sorry!
ยง catspeak_add_constant
function catspeak_add_constant(
name : String,
value : Any,
... : Any,
)๐ Deprecated since 3.0.0Use
Catspeak.interface.exposeConstantinstead.
Permanently adds a new Catspeak constant to the default standard library.
If you want to add a function, use the catspeak_add_function function
instead because it makes sure your value will be callable from within
Catspeak.
Arguments
nameThe name of the constant to add.
valueThe value to add.
...The remaining key-value pairs to add, in the same pattern as the two previous arguments.
ยง catspeak_add_function
function catspeak_add_function(
name : String,
f : Function,
... : Any,
)๐ Deprecated since 3.0.0Use
Catspeak.interface.exposeFunctioninstead.
Permanently adds a new Catspeak function to the default standard library.
Arguments
nameThe name of the function to add.
fThe function to add, will be converted into a method if a script ID is used.
...The remaining key-value pairs to add, in the same pattern as the two previous arguments.
ยง catspeak_compile_buffer
function catspeak_compile_buffer(
buff : ID.Buffer,
consume? : Bool,
offset? : Real,
size? : Real,
) -> Struct.CatspeakProcess๐ Deprecated since 3.0.0Use
Catspeak.parseinstead.
Creates a new Catspeak compiler process for a buffer containing Catspeak code.
Arguments
buffA reference to the buffer containing the source code to compile.
consume(optional)Whether the buffer should be deleted after the compiler process is complete. Defaults to
false.offset(optional)The offset in the buffer to start parsing from. Defaults to 0, the start of the buffer.
size(optional)The length of the buffer input. Any characters beyond this limit will be treated as the end of the file. Defaults to
infinity.
Returns Struct.CatspeakProcess
ยง catspeak_compile_string
function catspeak_compile_string(
src : Any,
) -> Struct.CatspeakProcess๐ Deprecated since 3.0.0Use
Catspeak.parseStringinstead.
Creates a new Catspeak compiler process for a string containing Catspeak
code. This will allocate a new buffer to store the string, if that isn't
ideal then you will have to create and write to your own buffer, then
pass it into the catspeak_compile_buffer function instead.
Arguments
srcThe value containing the source code to compile.
Returns Struct.CatspeakProcess
ยง catspeak_config
function catspeak_config()
-> Struct๐ Deprecated since 3.0.0
Configures various global settings of the Catspeak compiler and runtime.
See the list in scr_catspeak_config for configuration values and their
usages.
Returns Struct
ยง catspeak_create_buffer_from_string
function catspeak_create_buffer_from_string(
src : String,
) -> Id.Buffer๐ Deprecated since 3.0.0
A helper function for creating a buffer from a string.
Arguments
srcThe source code to convert into a buffer.
Returns Id.Buffer
ยง catspeak_execute
function catspeak_execute(
scr : Function,
args? : Array<Any>,
) -> Struct.Future๐ Deprecated since 3.0.0Just invoke your script directly instead:
scr(args)
Creates a new Catspeak runtime process for this Catspeak function. This function is also compatible with GML functions.
Arguments
scrThe GML or Catspeak function to execute.
args(optional)The array of arguments to pass to the function call. Defaults to the empty array.
Returns Struct.Future
ยง catspeak_into_gml_function
function catspeak_into_gml_function(
scr : Function,
) -> Function๐ Deprecated since 3.0.0Use
Catspeak.compileGMLinstead.
Converts a Catspeak function into a GML function which is executed immediately.
Arguments
scrThe Catspeak function to execute.
Returns Function
ยง catspeak_session_extern
function catspeak_session_extern(
scr : Struct.CatspeakFunction,
) -> Function๐ Deprecated since 2.3.3Use
Catspeak.compileGMLinstead.
The old name of catspeak_into_gml_function from the compatibility
runtime for Catspeak.
Arguments
scrThe Catspeak function to execute.
Returns Function
ยง future_all
function future_all(
futures : Array<Struct.Future>,
) -> Struct.Future๐ Deprecated since 3.0.0
Creates a new Future which is accepted only when all other futures in an
array are accepted. If any future in the array is rejected, then the
resulting future is rejected with its value. If all futures are accepted,
then the resulting future is accepted with an array of their values.
Arguments
futuresThe array of futures to await.
Returns Struct.Future
ยง future_any
function future_any(
futures : Array<Struct.Future>,
) -> Struct.Future๐ Deprecated since 3.0.0
Creates a new Future which is accepted if any of the futures in an
array are accepted. If all futures in the array are rejected, then the
resulting future is rejected with an array of their values.
Arguments
futuresThe array of futures to await.
Returns Struct.Future
ยง future_error
function future_error(
value : Any,
) -> Struct.Future๐ Deprecated since 3.0.0
Creates a new Future which is immediately rejected with a value.
If the value itself it an instance of Future, then it is returned
instead.
Arguments
valueThe value to create a future from.
Returns Struct.Future
ยง future_ok
function future_ok(
value : Any,
) -> Struct.Future๐ Deprecated since 3.0.0
Creates a new Future which is immediately accepted with a value.
If the value itself it an instance of Future, then it is returned
instead.
Arguments
valueThe value to create a future from.
Returns Struct.Future
ยง future_settled
function future_settled(
futures : Array<Struct.Future>,
) -> Struct.Future๐ Deprecated since 3.0.0
Creates a new Future which is accepted when all of the futures in an
array are either accepted or rejected.
Arguments
futuresThe array of futures to await.
Returns Struct.Future
ยง is_future
function is_future(
value : Any,
) -> Bool๐ Deprecated since 3.0.0
Returns whether this value represents a future instance.
Arguments
valueThe value to check.
Returns Bool