private IErlObject ioProcessPutChars(ErlAtom encoding, ErlString str, IErlObject replyAs) { Node.IoOutput(encoding, str); return(s_ReplyPattern.Subst( new ErlVarBind { { RA, replyAs }, { R, ConstAtoms.Ok } })); }
/// <summary> /// Perform pattern match on this Erlang term, storing matched variables /// found in the pattern into the binding. /// </summary> public bool Match(IErlObject pattern, ErlVarBind binding) { if (binding == null) { return(false); } IErlObject value = binding[Name]; if (value != null) { return(checkType(value) ? value.Match(pattern, binding) : false); } if (!checkType(pattern)) { return(false); } IErlObject term = null; binding[Name] = pattern.Subst(ref term, binding) ? term : pattern; return(true); }
/// <summary> /// Substibute all variables in the given object using provided binding /// and return the resulting object /// </summary> public static IErlObject Subst(this IErlObject o, ErlVarBind binding) { IErlObject term = null; return(o.Subst(ref term, binding) ? term : o); }
/// <summary> /// Perform pattern match on this Erlang term, storing matched variables /// found in the pattern into the binding. /// </summary> public bool Match(IErlObject pattern, ErlVarBind binding) { if (binding == null) return false; IErlObject value = binding[Name]; if (value != null) return checkType(value) ? value.Match(pattern, binding) : false; if (!checkType(pattern)) return false; IErlObject term = null; binding[Name] = pattern.Subst(ref term, binding) ? term : pattern; return true; }