// TODO: convert to static method; caller parameter doesn't belong here /// <exception cref="InterpreterError"><paramref name="argspec"/> is invalid.</exception> public ZilFunction([NotNull] string caller, [CanBeNull] ZilAtom name, [CanBeNull] ZilAtom activationAtom, [NotNull][ItemNotNull] IEnumerable <ZilObject> argspec, ZilDecl decl, [ItemNotNull][NotNull] IEnumerable <ZilObject> body) { this.argspec = ArgSpec.Parse(caller, name, activationAtom, argspec, decl); this.body = body.ToArray(); }
protected override ZilResult EvalImpl(Context ctx, LocalEnvironment environment, ZilAtom originalType) => throw new InterpreterError(InterpreterMessages.A_SEGMENT_Can_Only_Be_Evaluated_Inside_A_Structure);
protected override ZilResult EvalImpl(Context ctx, LocalEnvironment environment, ZilAtom originalType) { var result = EvalSequence(ctx, this, environment).ToZilListResult(SourceLine); if (result.ShouldPass()) { return(result); } return(originalType != null?ctx.ChangeType((ZilObject)result, originalType) : result); }
protected override ZilResult EvalImpl(Context ctx, LocalEnvironment environment, ZilAtom originalType) { var result = First.Eval(ctx, environment); if (!result.ShouldPass()) { ctx.MaybeCheckDecl(this, (ZilObject)result, Second, "result of evaluating {0}", First); } return(result); }
public static ZilActivation FromAtom([NotNull] Context ctx, [NotNull] ZilAtom name) { throw new InterpreterError(InterpreterMessages.CHTYPE_To_0_Not_Supported, "ACTIVATION"); }
public ZilActivation(ZilAtom name) { this.name = name; }
public ZilStructuredHash(ZilAtom type, PrimType primType, IStructure primValue) : base(type, primType, primValue) { }
public new static ZilLink FromAtom(Context ctx, ZilAtom atom) { throw new InterpreterError(InterpreterMessages.CHTYPE_To_0_Not_Supported, "LINK"); }
protected ZilHashBase(ZilAtom type, PrimType primType, TPrim primValue) { this.type = type; this.primType = primType; this.primValue = primValue; }
/// <exception cref="InterpreterError"><paramref name="argspec"/> is invalid.</exception> public ZilFunction([CanBeNull] ZilAtom name, [CanBeNull] ZilAtom activationAtom, [NotNull][ItemNotNull] IEnumerable <ZilObject> argspec, ZilDecl decl, [ItemNotNull][NotNull] IEnumerable <ZilObject> body) : this("<internal>", name, activationAtom, argspec, decl, body) { }
public ZilEnvironment(LocalEnvironment env, ZilAtom name) { this.env = new WeakReference <LocalEnvironment>(env); this.name = name; }
public static ZilEnvironment FromAtom([NotNull] Context ctx, [NotNull] ZilAtom atom) { throw new InterpreterError(InterpreterMessages.CHTYPE_To_0_Not_Supported, "ENVIRONMENT"); }
public static ZilAtom FromAtom([NotNull] Context ctx, [NotNull] ZilAtom other) { // we can't construct a new atom since it wouldn't be equal to the old one return(other); }