当前位置: 首页>>代码示例>>C#>>正文


C# IPersistentMap.valAt方法代码示例

本文整理汇总了C#中IPersistentMap.valAt方法的典型用法代码示例。如果您正苦于以下问题:C# IPersistentMap.valAt方法的具体用法?C# IPersistentMap.valAt怎么用?C# IPersistentMap.valAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPersistentMap的用法示例。


在下文中一共展示了IPersistentMap.valAt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EmitMethods

        private static void EmitMethods(TypeBuilder proxyTB, 
            List<MethodSignature> sigs,
            Dictionary<string,List<MethodSignature>> overloads,
            Dictionary<string,FieldBuilder> varMap,
            IPersistentMap exposesMethods)
        {
            foreach (MethodSignature sig in sigs)
            {
                FieldBuilder regularFB = varMap[sig.Name];
                FieldBuilder overloadFB = null;
                if (overloads.ContainsKey(sig.Name))
                    overloadFB = varMap[OverloadName(sig)];

                switch (sig.Source)
                {
                    case "super":
                        EmitForwardingMethod(proxyTB, false, regularFB, overloadFB, sig,
                            delegate(ILGen gen)
                            {
                                gen.EmitLoadArg(0);                             // gen.Emit(OpCodes.Ldarg_0);
                                for (int i = 0; i < sig.ParamTypes.Length; i++)
                                    gen.EmitLoadArg(i + 1);                     // gen.Emit(OpCodes.Ldarg, (i + 1));
                                gen.Emit(OpCodes.Call, sig.Method);             // not gen.EmitCall(sig.Method) -- we need call versus callvirt
                            });
                        break;
                    case "interface":
                        EmitForwardingMethod(proxyTB, false, regularFB, overloadFB, sig,
                            delegate(ILGen gen)
                            {
                                EmitUnsupported(gen, sig.Name);
                            });
                        break;
                    default:
                        EmitForwardingMethod(proxyTB, sig.IsStatic, regularFB, overloadFB, sig,
                            delegate(ILGen gen)
                            {
                                EmitUnsupported(gen, sig.Name);
                            });
                        break;
                }
            }

            if (exposesMethods != null)
            {
                foreach (MethodSignature sig in sigs)
                {
                    if (sig.Source == "super")
                    {
                        Symbol name = Symbol.intern(sig.Name);
                        if (exposesMethods.containsKey(name))
                            CreateSuperCall(proxyTB, (Symbol)exposesMethods.valAt(name), sig.Method);
                    }
                }
            }
        }
开发者ID:ragnard,项目名称:clojure-clr,代码行数:55,代码来源:GenClass.cs

示例2: GetLocation

 static bool GetLocation(IPersistentMap spanMap, Keyword key, out int val)
 {
     object oval = spanMap.valAt(key);
     if (oval != null && oval is int)
     {
         val = (int)oval;
         return true;
     }
     val = -1;
     return false;
 }
开发者ID:rvedam,项目名称:clojure-clr,代码行数:11,代码来源:Compiler.cs

示例3: read

 public static Object read(PushbackTextReader r, IPersistentMap opts)
 {
     return read(r, !opts.containsKey(EOF), opts.valAt(EOF), false, opts);
 }
开发者ID:EricThorsen,项目名称:clojure-clr,代码行数:4,代码来源:EdnReader.cs

示例4: MaybeAddDebugInfo

 public Expression MaybeAddDebugInfo(Expression expr, IPersistentMap spanMap)
 {
     if (_isDebuggable && spanMap != null & _docInfo != null)
     {
         int startLine;
         int startCol;
         int finishLine;
         int finishCol;
         if (Compiler.GetLocations(spanMap, out startLine, out startCol, out finishLine, out finishCol))
             return AstUtils.AddDebugInfo(expr,
                 _docInfo,
                 new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.StartLineKey), (int)spanMap.valAt(RT.StartColumnKey)),
                 new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.EndLineKey), (int)spanMap.valAt(RT.EndColumnKey)));
     }
     return expr;
 }
开发者ID:clojure,项目名称:clojure-clr,代码行数:16,代码来源:GenContext.cs

示例5: MaybeReflectionWarn

 private static void MaybeReflectionWarn(IPersistentMap spanMap, MethodBase method, string methodName)
 {
     if ( method == null && RT.booleanCast(RT.WARN_ON_REFLECTION.deref()) )
         RT.errPrintWriter().WriteLine(string.Format("Reflection warning, {0}:{1} - call to {2} can't be resolved.\n",
             Compiler.SOURCE_PATH.deref(), spanMap != null ? (int)spanMap.valAt(RT.START_LINE_KEY, 0) : 0, methodName));
 }
开发者ID:101v,项目名称:clojure-clr,代码行数:6,代码来源:HostExpr.cs

示例6: MaybeAddDebugInfo

 internal static Expression MaybeAddDebugInfo(Expression expr, IPersistentMap spanMap, bool isDebuggable)
 {
     if ( isDebuggable && spanMap != null & Compiler.DocInfo() != null)
     {
         int startLine;
         int startCol;
         int finishLine;
         int finishCol;
         if (GetLocations(spanMap, out startLine, out startCol, out finishLine, out finishCol))
             return AstUtils.AddDebugInfo(expr,
                 Compiler.DocInfo(),
                 new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.START_LINE_KEY), (int)spanMap.valAt(RT.START_COLUMN_KEY)),
                 new Microsoft.Scripting.SourceLocation(0, (int)spanMap.valAt(RT.END_LINE_KEY), (int)spanMap.valAt(RT.END_COLUMN_KEY)));
     }
     return expr;
 }
开发者ID:christianblunden,项目名称:clojure-clr,代码行数:16,代码来源:Compiler.cs


注:本文中的IPersistentMap.valAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。