public static ZilObject VALUE(Context ctx, [NotNull] ZilAtom atom, [NotNull] LocalEnvironment env) { var result = env.GetLocalVal(atom) ?? ctx.GetGlobalVal(atom); if (result == null) { throw new InterpreterError( InterpreterMessages._0_Atom_1_Has_No_2_Value, "VALUE", atom.ToStringContext(ctx, false), "local or global"); } return(result); }
public static ZilObject ASSIGNED_P([NotNull] Context ctx, [NotNull] ZilAtom atom, [NotNull] LocalEnvironment env) { return(env.GetLocalVal(atom) != null ? ctx.TRUE : ctx.FALSE); }