Class ErlObject
Class defines extension methods on types implementing IErlObject interface
and static methods dealing with IErlObject
Inheritance
System.Object
ErlObject
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NFX.Erlang.dll
Syntax
public static class ErlObject
Methods
AsType(IErlObject, Type)
Tries to convert an Erlang term as specified native type.
Throw exception if conversion is not possible
Declaration
public static object AsType(this IErlObject val, Type t)
Parameters
| Type |
Name |
Description |
| IErlObject |
val |
|
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Object |
|
ErlArgs(String, Object[])
Convert C# string to ErlString
Declaration
public static string ErlArgs(this string str, params object[] args)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
| System.Object[] |
args |
|
Returns
| Type |
Description |
| System.String |
|
Substitute variables in the args[0] string
Declaration
public static string Format(ErlList args)
Parameters
Returns
| Type |
Description |
| System.String |
|
IsInt(IErlObject)
Determines if Erlang object is of type ErlByte or ErlLong
Declaration
public static bool IsInt(this IErlObject o)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
IsNull(IErlObject)
Determines if Erlang object is NULL - that is ErlAtom.Undefined or null reference
Declaration
public static bool IsNull(this IErlObject o)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Parse(String, Object[])
Parse a string into an Erlang term
Declaration
public static IErlObject Parse(string fmt, params object[] args)
Parameters
| Type |
Name |
Description |
| System.String |
fmt |
|
| System.Object[] |
args |
|
Returns
Parse<T>(String, Object[])
Parse a string into an Erlang term
Declaration
public static T Parse<T>(string fmt, params object[] args)where T : IErlObject
Parameters
| Type |
Name |
Description |
| System.String |
fmt |
|
| System.Object[] |
args |
|
Returns
Type Parameters
ParseMFA(String, Object[])
Parse a string representation of an Erlang function call
"Module:Function(Arg1, ..., ArgN)" to a 3-element (Module, Function, Arguments) tuple
Declaration
public static Tuple<ErlAtom, ErlAtom, ErlList> ParseMFA(string fmt, params object[] args)
Parameters
| Type |
Name |
Description |
| System.String |
fmt |
|
| System.Object[] |
args |
|
Returns
Subst(IErlObject, ErlVarBind)
Substibute all variables in the given object using provided binding
and return the resulting object
Declaration
public static IErlObject Subst(this IErlObject o, ErlVarBind binding)
Parameters
Returns
To<T>(String, Object[])
Parse a string into an Erlang term
Declaration
public static T To<T>(this string fmt, params object[] args)where T : IErlObject
Parameters
| Type |
Name |
Description |
| System.String |
fmt |
|
| System.Object[] |
args |
|
Returns
Type Parameters
ToErlMFA(String, Object[])
Parse a string representation of an Erlang function call
"Module:Function(Arg1, ..., ArgN)" to a 3-element (Module, Function, Arguments) tuple
Declaration
public static Tuple<ErlAtom, ErlAtom, ErlList> ToErlMFA(this string fmt, params object[] args)
Parameters
| Type |
Name |
Description |
| System.String |
fmt |
|
| System.Object[] |
args |
|
Returns
ToErlObject(Object)
Try to convert .NET native object type to corresponding Erlang term.
Throw exception if conversion is not possible
Declaration
public static IErlObject ToErlObject(this object o)
Parameters
| Type |
Name |
Description |
| System.Object |
o |
|
Returns
ToErlObject(Object, ErlTypeOrder, Boolean)
Try to convert .NET native object type to corresponding Erlang term of given type.
Throw exception if conversion is not possible
Declaration
public static IErlObject ToErlObject(this object o, ErlTypeOrder etp, bool strict = true)
Parameters
| Type |
Name |
Description |
| System.Object |
o |
|
| ErlTypeOrder |
etp |
|
| System.Boolean |
strict |
|
Returns
ToErlObject(String, Object[])
String extension method to parse a string into an Erlang term
Declaration
public static IErlObject ToErlObject(this string fmt, params object[] args)
Parameters
| Type |
Name |
Description |
| System.String |
fmt |
|
| System.Object[] |
args |
|
Returns
ToErlString(String)
Convert C# string to ErlString
Declaration
public static ErlString ToErlString(this string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
Visit<TAccumulate>(IErlObject, TAccumulate, Func<TAccumulate, IErlObject, TAccumulate>)
Execute fun for every nested term
Declaration
public static TAccumulate Visit<TAccumulate>(this IErlObject o, TAccumulate acc, Func<TAccumulate, IErlObject, TAccumulate> fun)
Parameters
| Type |
Name |
Description |
| IErlObject |
o |
|
| TAccumulate |
acc |
|
| System.Func<TAccumulate, IErlObject, TAccumulate> |
fun |
|
Returns
| Type |
Description |
| TAccumulate |
|
Type Parameters
| Name |
Description |
| TAccumulate |
|