Пример #1
0
 /// <inheritdoc/>
 public override GraceObject Respond(EvaluationContext ctx,
                                     GraceObject self,
                                     MethodRequest req)
 {
     MethodHelper.CheckNoInherits(ctx, req);
     return(method(ctx, req, (T)self));
 }
Пример #2
0
 /// <inheritdoc/>
 public override GraceObject Respond(
     EvaluationContext ctx,
     GraceObject self,
     MethodRequest req
     )
 {
     checkAccessibility(ctx, req);
     MethodHelper.CheckNoInherits(ctx, req);
     MethodNode.CheckArgCount(ctx, req.Name, req.Name,
                              0, false,
                              req[0].Arguments.Count);
     if (cell.Value == GraceObject.Uninitialised)
     {
         ErrorReporting.RaiseError(ctx, "R2008",
                                   new Dictionary <string, string> {
             { "name", req.Name },
             { "receiver", self.ToString() }
         },
                                   "UninitialisedReadError: Cannot read from " + req.Name
                                   );
     }
     return(cell.Value);
 }
Пример #3
0
        /// <inheritdoc/>
        /// <remarks>This method uses the indexer on the LocalScope
        /// object the method was requested on.</remarks>
        public override GraceObject Respond(EvaluationContext ctx, GraceObject self, MethodRequest req)
        {
            checkAccessibility(ctx, req);
            MethodHelper.CheckNoInherits(ctx, req);
            MethodNode.CheckArgCount(ctx, req.Name, req.Name,
                                     0, false,
                                     req[0].Arguments.Count);
            LocalScope s    = self as LocalScope;
            string     name = req.Name;

            if (s[name] == GraceObject.Uninitialised ||
                s[name] == null)
            {
                ErrorReporting.RaiseError(ctx, "R2008",
                                          new Dictionary <string, string> {
                    { "name", name },
                    { "receiver", ToString() }
                },
                                          "UninitialisedReadError: Cannot read from «" + name + "»"
                                          );
            }
            return(s[name]);
        }