Function

A struct capturing all the aspects of a function necessary to produce a string mixin that re-creates the function (excepting the body).

Members

Functions

argumentMixture
string argumentMixture()

Return the argument list as a string.

argumentMixtureArray
const(string)[] argumentMixtureArray()

Return the argument list as an array of strings.

attributeMixture
string attributeMixture()

Return the attribute list as a string.

attributeMixtureArray
string[] attributeMixtureArray()

Return the attribute list as an array of strings.

mixture
string mixture()

Return mixin code for this Function.

parameterListMixture
string parameterListMixture()

Return the parameter list as a strings.

parameterListMixtureArray
string[] parameterListMixtureArray()

Return the parameter list as an array of strings.

withAttributes
Function withAttributes(uint value)

Return a new Function object with the attributes attribute set to value.

withBody
Function withBody(string value)

Return a new Function object with the body_ attribute set to value.

withName
Function withName(string value)

Return a new Function object with the name attribute set to value.

withParameters
Function withParameters(immutable(Parameter)[] value)

Return a new Function object with the parameters attribute set to value.

withParametersAt
Function withParametersAt(uint index, immutable(Parameter)[] newParameters)

Return a new Function object with newParameters inserted at the specified index in the attributes.

withReturnType
Function withReturnType(string value)

Return a new Function object with the returnType attribute set to value.

withStatic
Function withStatic(bool value)

Return a new Function object with the static_ attribute set to value.

withUdas
Function withUdas(immutable(string)[] value)

Return a new Function object with the udas attribute set to value.

Variables

attributes
ulong attributes;

Function attributes. Initial value: std.traits.functionAttributes!fun

body_
string body_;

Function body. Initial value: ;.

localName
string localName;

A string that evaluates to a symbol representing the function in the local context.

name
string name;

Function name. Initial value: __traits(identifier, fun).

overloadIndex
int overloadIndex;

Index of function in its overload set, if created by functionsOf, or -1.

parameters
Parameter[] parameters;

Function parameters. Initial value: from the refracted function.

returnType
string returnType;

Return type. Initial value: bolts.experimental.refraction.ReturnType!fun.

static_
bool static_;

If true, prefix generated function with static. Initial value: true if the refracted function is a static *member* function inside a struct, class, interface, or union.

udas
string[] udas;

User defined attributes. Initial value: bolts.experimental.refraction.ParameterAttributes!(fun, parameterIndex)...[attributeIndex...]).

Meta