提交 26ae35b8 编写于 作者: N ncave 提交者: Kevin Ransom (msft)

Replace hats (#4799)

上级 931f546a
......@@ -40,7 +40,7 @@ let inline isSingleton l =
| _ -> false
let inline isNonNull x = not (isNull x)
let inline nonNull msg x = if isNull x then failwith ("null: " ^ msg) else x
let inline nonNull msg x = if isNull x then failwith ("null: " + msg) else x
let inline (===) x y = LanguagePrimitives.PhysicalEquality x y
//---------------------------------------------------------------------
......
......@@ -25,7 +25,7 @@ let pretty () = true
let tyvar_generator =
let i = ref 0
fun n ->
incr i; n^string !i
incr i; n + string !i
// Carry an environment because the way we print method variables
// depends on the gparams of the current scope.
......@@ -789,19 +789,19 @@ let goutput_mbody is_entrypoint env os (md: ILMethodDef) =
let goutput_mdef env os (md:ILMethodDef) =
let attrs =
if md.IsVirtual then
"virtual "^
(if md.IsFinal then "final " else "")^
(if md.IsNewSlot then "newslot " else "")^
(if md.IsCheckAccessOnOverride then " strict " else "")^
(if md.IsAbstract then " abstract " else "")^
"virtual " +
(if md.IsFinal then "final " else "") +
(if md.IsNewSlot then "newslot " else "") +
(if md.IsCheckAccessOnOverride then " strict " else "") +
(if md.IsAbstract then " abstract " else "") +
" "
elif md.IsNonVirtualInstance then ""
elif md.IsConstructor then "rtspecialname"
elif md.IsStatic then
"static "^
"static " +
(match md.Body.Contents with
MethodBody.PInvoke (attr) ->
"pinvokeimpl(\""^ attr.Where.Name^"\" as \""^ attr.Name ^"\""^
"pinvokeimpl(\"" + attr.Where.Name + "\" as \"" + attr.Name + "\"" +
(match attr.CallingConv with
| PInvokeCallingConvention.None -> ""
| PInvokeCallingConvention.Cdecl -> " cdecl"
......
......@@ -2066,7 +2066,7 @@ let defineDynamicAssemblyAndLog(asmName, flags, asmDir:string) =
asmB
let mkDynamicAssemblyAndModule (assemblyName, optimize, debugInfo, collectible) =
let filename = assemblyName ^ ".dll"
let filename = assemblyName + ".dll"
let asmDir = "."
let asmName = new AssemblyName()
asmName.Name <- assemblyName;
......
......@@ -600,11 +600,11 @@ let linkNativeResources (unlinkedResources:byte[] list) (ulLinkedResourceBaseRV
if outputFilePath = "" then
[ FileSystem.GetTempPathShim() ]
else
[ FileSystem.GetTempPathShim() ; (outputFilePath ^ "\\") ]
[ FileSystem.GetTempPathShim() ; (outputFilePath + "\\") ]
// Get a unique random file
let rec GetUniqueRandomFileName(path) =
let tfn = path ^ System.IO.Path.GetRandomFileName()
let tfn = path + System.IO.Path.GetRandomFileName()
if FileSystem.SafeExists(tfn) then
GetUniqueRandomFileName(path)
else
......@@ -614,7 +614,7 @@ let linkNativeResources (unlinkedResources:byte[] list) (ulLinkedResourceBaseRV
let machine = if 2 = nPEFileType then "X64" else "X86"
let cmdLineArgsPreamble = sprintf "/NOLOGO /READONLY /MACHINE:%s" machine
let cvtres = corSystemDir^"cvtres.exe "
let cvtres = corSystemDir + "cvtres.exe "
let createCvtresArgs path =
let tempObjFileName = GetUniqueRandomFileName(path)
......@@ -624,7 +624,7 @@ let linkNativeResources (unlinkedResources:byte[] list) (ulLinkedResourceBaseRV
for _ulr in unlinkedResources do
let tempResFileName = GetUniqueRandomFileName(path)
resFiles <- tempResFileName :: resFiles ;
cmdLineArgs <- cmdLineArgs ^ " \"" ^ tempResFileName ^ "\""
cmdLineArgs <- cmdLineArgs + " \"" + tempResFileName + "\""
let trf = resFiles
let cmd = cmdLineArgs
cmd,tempObjFileName,trf
......@@ -641,7 +641,7 @@ let linkNativeResources (unlinkedResources:byte[] list) (ulLinkedResourceBaseRV
tempResFiles <- files
(invoc,tmp,files)
let cvtresInvocation = cvtres ^ cmdLineArgs
let cvtresInvocation = cvtres + cmdLineArgs
try
let mutable iFiles = 0
......
......@@ -39,7 +39,7 @@ type Symbols = Symbol list
//---------------------------------------------------------------------
// Output Raw Parser Spec AST
let StringOfSym sym = match sym with Terminal s -> "'" ^ s ^ "'" | NonTerminal s -> s
let StringOfSym sym = match sym with Terminal s -> "'" + s + "'" | NonTerminal s -> s
let OutputSym os sym = fprintf os "%s" (StringOfSym sym)
......@@ -353,7 +353,7 @@ let CompilerLalrParserSpec logf (spec : ProcessedParserSpec) =
stopWatch.Start()
// Augment the grammar
let fakeStartNonTerminals = spec.StartSymbols |> List.map(fun nt -> "_start"^nt)
let fakeStartNonTerminals = spec.StartSymbols |> List.map(fun nt -> "_start" + nt)
let nonTerminals = fakeStartNonTerminals@spec.NonTerminals
let endOfInputTerminal = "$$"
let dummyLookahead = "#"
......@@ -466,7 +466,7 @@ let CompilerLalrParserSpec logf (spec : ProcessedParserSpec) =
let IsStartItem item0 = fakeStartNonTerminalsSet.Contains(ntIdx_of_item0 item0)
let IsKernelItem item0 = (IsStartItem item0 || dotIdx_of_item0 item0 <> 0)
let StringOfSym sym = match sym with PTerminal s -> "'" ^ termTab.OfIndex s ^ "'" | PNonTerminal s -> ntTab.OfIndex s
let StringOfSym sym = match sym with PTerminal s -> "'" + termTab.OfIndex s + "'" | PNonTerminal s -> ntTab.OfIndex s
let OutputSym os sym = fprintf os "%s" (StringOfSym sym)
......
......@@ -466,7 +466,7 @@ let mkTransform g (f:Val) m tps x1Ntys rty (callPattern,tyfringes: (TType list *
let baseName = match vs with [v] -> v.LogicalName | _ -> "arg"
let baseRange = match vs with [v] -> v.Range | _ -> m
tyfringe |> List.mapi (fun i ty ->
let name = baseName ^ string i
let name = baseName + string i
mkCompGenLocal baseRange name ty |> fst)
NewArgs (vs,rebuildTS g m cpi vs))
......@@ -641,14 +641,14 @@ type env =
prefix : string
m : Range.range }
let suffixE env s = {env with prefix = env.prefix ^ s}
let suffixE env s = {env with prefix = env.prefix + s}
let rangeE env m = {env with m = m}
let push b bs = b::bs
let pushL xs bs = xs@bs
let newLocal env ty = mkCompGenLocal env.m env.prefix ty
let newLocalN env i ty = mkCompGenLocal env.m (env.prefix ^ string i) ty
let newLocalN env i ty = mkCompGenLocal env.m (env.prefix + string i) ty
let noEffectExpr env bindings x =
match x with
......
......@@ -132,7 +132,7 @@ let rec AttachRange m (exn:exn) =
| :? System.Reflection.TargetInvocationException -> AttachRange m exn.InnerException
| UnresolvedReferenceNoRange(a) -> UnresolvedReferenceError(a, m)
| UnresolvedPathReferenceNoRange(a, p) -> UnresolvedPathReference(a, p, m)
| Failure(msg) -> InternalError(msg^" (Failure)", m)
| Failure(msg) -> InternalError(msg + " (Failure)", m)
| :? System.ArgumentException as exn -> InternalError(exn.Message + " (ArgumentException)", m)
| notARangeDual -> notARangeDual
......
......@@ -826,7 +826,7 @@ let CreateNewValuesForTLR g tlrS arityM fclassM envPackM =
let wf = Zmap.force f arityM ("createFHat - wf",(fun v -> showL (valL v)))
let fc = Zmap.force f fclassM ("createFHat - fc",nameOfVal)
let envp = Zmap.force fc envPackM ("CreateNewValuesForTLR - envp",string)
let name = f.LogicalName (* ^ "_TLR_" ^ string wf *)
let name = f.LogicalName (* + "_TLR_" + string wf *)
let m = f.Range
let tps,tau = f.TypeScheme
let argtys,res = stripFunTy g tau
......
......@@ -721,7 +721,7 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA
let valu = isStructTy g enclTy
let isCtor = minfo.IsConstructor
if minfo.IsClassConstructor then
error (InternalError (minfo.LogicalName ^": cannot call a class constructor",m))
error (InternalError (minfo.LogicalName + ": cannot call a class constructor", m))
let useCallvirt = not valu && not direct && minfo.IsVirtual
let isProtected = minfo.IsProtectedAccessiblity
let exprTy = if isCtor then enclTy else minfo.GetFSharpReturnTy(amap, m, minst)
......@@ -791,7 +791,7 @@ let BuildNewDelegateExpr (eventInfoOpt:EventInfo option, g, amap, delegateTy, in
if List.exists (isByrefTy g) delArgTys then
error(Error(FSComp.SR.tcFunctionRequiresExplicitLambda(List.length delArgTys),m))
let delArgVals = delArgTys |> List.mapi (fun i argty -> fst (mkCompGenLocal m ("delegateArg"^string i) argty))
let delArgVals = delArgTys |> List.mapi (fun i argty -> fst (mkCompGenLocal m ("delegateArg" + string i) argty))
let expr =
let args =
match eventInfoOpt with
......
......@@ -936,7 +936,7 @@ let CompilePatternBasic
if not (isNil topgtvs) then error(InternalError("Unexpected generalized type variables when compiling an active pattern",m))
let rty = apinfo.ResultType g m resTys
let v,vexp = mkCompGenLocal m ("activePatternResult"^string (newUnique())) rty
let v,vexp = mkCompGenLocal m ("activePatternResult" + string (newUnique())) rty
if topv.IsMemberOrModuleBinding then
AdjustValToTopVal v topv.DeclaringEntity ValReprInfo.emptyValData
let argexp = GetSubExprOfInput subexpr
......
......@@ -1345,10 +1345,10 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) =
// Properties get 'get_X', only if there are no args
// Properties get 'get_X'
match v.ValReprInfo with
| Some arity when arity.NumCurriedArgs = 0 && arity.NumTypars = 0 -> check false ("get_"^v.DisplayName)
| Some arity when arity.NumCurriedArgs = 0 && arity.NumTypars = 0 -> check false ("get_" + v.DisplayName)
| _ -> ()
match v.ValReprInfo with
| Some arity when v.IsMutable && arity.NumCurriedArgs = 0 && arity.NumTypars = 0 -> check false ("set_"^v.DisplayName)
| Some arity when v.IsMutable && arity.NumCurriedArgs = 0 && arity.NumTypars = 0 -> check false ("set_" + v.DisplayName)
| _ -> ()
match TryChopPropertyName v.DisplayName with
| Some res -> check true res
......
......@@ -255,7 +255,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP.
match takesInstanceArg,curriedArgs with
| false,curriedArgs -> [],curriedArgs
| true,(objArg::curriedArgs) -> [objArg],curriedArgs
| true,[] -> wfail(InternalError("warning: unexpected missing object argument when generating quotation for call to F# object member "^vref.LogicalName,m))
| true,[] -> wfail(InternalError("warning: unexpected missing object argument when generating quotation for call to F# object member " + vref.LogicalName,m))
if verboseCReflect then
dprintfn "vref.DisplayName = %A, #objArgs = %A, #curriedArgs = %A" vref.DisplayName objArgs.Length curriedArgs.Length
......@@ -272,7 +272,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP.
// partially applied arguments to 'let' bindings
let topValInfo =
match vref.ValReprInfo with
| None -> error(InternalError("no arity information found for F# value "^vref.LogicalName,vref.Range))
| None -> error(InternalError("no arity information found for F# value " + vref.LogicalName,vref.Range))
| Some a -> a
let expr,exprty = AdjustValForExpectedArity cenv.g m vref vFlags topValInfo
......
......@@ -3113,7 +3113,7 @@ module DebugPrint = begin
let sortCons (cs:(TyconRef * Rational) list) = cs |> List.sortBy (fun (c, _) -> c.DisplayName)
let negvs, posvs = ListMeasureVarOccsWithNonZeroExponents unt |> sortVars |> List.partition (fun (_, e) -> SignRational e < 0)
let negcs, poscs = ListMeasureConOccsWithNonZeroExponents g false unt |> sortCons |> List.partition (fun (_, e) -> SignRational e < 0)
let unparL (uv:Typar) = wordL (tagText ("'" ^ uv.DisplayName))
let unparL (uv:Typar) = wordL (tagText ("'" + uv.DisplayName))
let unconL tc = layoutTyconRef tc
let rationalL e = wordL (tagText(RationalToString e))
let measureToPowerL x e = if e = OneRational then x else x -- wordL (tagText "^") -- rationalL e
......@@ -3532,15 +3532,15 @@ module DebugPrint = begin
| Expr.Op (TOp.ValFieldGetAddr rf, _, [], _) ->
leftL(tagText "&") ^^ (recdFieldRefL rf)
| Expr.Op (TOp.UnionCaseTagGet tycr, _, [x], _) ->
wordL (tagText ("#" ^ tycr.LogicalName ^ ".tag")) ^^ atomL x
wordL (tagText ("#" + tycr.LogicalName + ".tag")) ^^ atomL x
| Expr.Op (TOp.UnionCaseProof c, _, [x], _) ->
wordL (tagText ("#" ^ c.CaseName^ ".cast")) ^^ atomL x
wordL (tagText ("#" + c.CaseName + ".cast")) ^^ atomL x
| Expr.Op (TOp.UnionCaseFieldGet (c, i), _, [x], _) ->
wordL (tagText ("#" ^ c.CaseName ^ "." ^ string i)) --- atomL x
wordL (tagText ("#" + c.CaseName + "." + string i)) --- atomL x
| Expr.Op (TOp.UnionCaseFieldSet (c, i), _, [x;y], _) ->
((atomL x --- (rightL (tagText ("#" ^ c.CaseName ^ "." ^ string i)))) ^^ wordL(tagText ":=")) --- exprL y
((atomL x --- (rightL (tagText ("#" + c.CaseName + "." + string i)))) ^^ wordL(tagText ":=")) --- exprL y
| Expr.Op (TOp.TupleFieldGet (_, i), _, [x], _) ->
wordL (tagText ("#" ^ string i)) --- atomL x
wordL (tagText ("#" + string i)) --- atomL x
| Expr.Op (TOp.Coerce, [typ;_], [x], _) ->
atomL x --- (wordL(tagText ":>") ^^ typeL typ)
| Expr.Op (TOp.Reraise, [_], [], _) ->
......@@ -5958,7 +5958,7 @@ let ExprStats x =
let count = ref 0
let folders = {ExprFolder0 with exprIntercept = (fun _ _ _ -> (count := !count + 1; None))}
let () = FoldExpr folders () x
string !count ^ " TExpr nodes"
string !count + " TExpr nodes"
#endif
//-------------------------------------------------------------------------
......@@ -6649,7 +6649,7 @@ let MakeArgsForTopArgs _g m argtysl tpenv =
let ty = instType tpenv argty
let nm =
match argInfo.Name with
| None -> CompilerGeneratedName ("arg"^ string i^ string j)
| None -> CompilerGeneratedName ("arg" + string i + string j)
| Some id -> id.idText
fst (mkCompGenLocal m nm ty)))
......@@ -6766,7 +6766,7 @@ let AdjustPossibleSubsumptionExpr g (expr: Expr) (suppliedArgs: Expr list) : (Ex
argtysl |> List.mapi (fun i argtys ->
argtys |> List.mapi (fun j (_, argInfo) ->
match argInfo.Name with
| None -> CompilerGeneratedName ("arg" ^ string i ^string j)
| None -> CompilerGeneratedName ("arg" + string i ^string j)
| Some id -> id.idText))
| _ ->
[]
......@@ -7088,18 +7088,18 @@ let LinearizeTopMatch g parent = function
let commaEncs strs = String.concat "," strs
let angleEnc str = "{" ^ str ^ "}"
let angleEnc str = "{" + str + "}"
let ticksAndArgCountTextOfTyconRef (tcref:TyconRef) =
// Generic type names are (name ^ "`" ^ digits) where name does not contain "`".
// Generic type names are (name + "`" + digits) where name does not contain "`".
let path = Array.toList (fullMangledPathToTyconRef tcref) @ [tcref.CompiledName]
textOfPath path
let typarEnc _g (gtpsType, gtpsMethod) typar =
match List.tryFindIndex (typarEq typar) gtpsType with
| Some idx -> "`" ^ string idx // single-tick-index for typar from type
| Some idx -> "`" + string idx // single-tick-index for typar from type
| None ->
match List.tryFindIndex (typarEq typar) gtpsMethod with
| Some idx -> "``" ^ string idx // double-tick-index for typar from method
| Some idx -> "``" + string idx // double-tick-index for typar from method
| None -> warning(InternalError("Typar not found during XmlDoc generation", typar.Range))
"``0" // REVIEW: this should be ERROR not WARNING?
......@@ -7123,19 +7123,19 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty =
| 3 -> "[0:, 0:, 0:]"
| 4 -> "[0:, 0:, 0:, 0:]"
| _ -> failwith "impossible: rankOfArrayTyconRef: unsupported array rank"
typeEnc g (gtpsType, gtpsMethod) (List.head tinst) ^ arraySuffix
typeEnc g (gtpsType, gtpsMethod) (List.head tinst) + arraySuffix
| TType_ucase (UCRef(tcref, _), tinst)
| TType_app (tcref, tinst) ->
if tyconRefEq g g.byref_tcr tcref then
typeEnc g (gtpsType, gtpsMethod) (List.head tinst) ^ "@"
typeEnc g (gtpsType, gtpsMethod) (List.head tinst) + "@"
elif tyconRefEq g tcref g.nativeptr_tcr then
typeEnc g (gtpsType, gtpsMethod) (List.head tinst) ^ "*"
typeEnc g (gtpsType, gtpsMethod) (List.head tinst) + "*"
else
let tyName =
let ty = stripTyEqnsAndMeasureEqns g ty
match ty with
| TType_app (tcref, _tinst) ->
// Generic type names are (name ^ "`" ^ digits) where name does not contain "`".
// Generic type names are (name + "`" + digits) where name does not contain "`".
// In XML doc, when used in type instances, these do not use the ticks.
let path = Array.toList (fullMangledPathToTyconRef tcref) @ [tcref.CompiledName]
textOfPath (List.map DemangleGenericTypeName path)
......
......@@ -1087,8 +1087,8 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, optIm
if isExtrinsic then
let tname = tcref.LogicalName
let text = tname + "." + logicalName
let text = if memberFlags.MemberKind <> MemberKind.Constructor && memberFlags.MemberKind <> MemberKind.ClassConstructor && not memberFlags.IsInstance then text^".Static" else text
let text = if memberFlags.IsOverrideOrExplicitImpl then text^".Override" else text
let text = if memberFlags.MemberKind <> MemberKind.Constructor && memberFlags.MemberKind <> MemberKind.ClassConstructor && not memberFlags.IsInstance then text + ".Static" else text
let text = if memberFlags.IsOverrideOrExplicitImpl then text + ".Override" else text
text
else
List.foldBack (tcrefOfAppTy g >> qualifiedMangledNameOfTyconRef) optIntfSlotTys logicalName
......@@ -2655,7 +2655,7 @@ module EventDeclarationNormalization =
if CompileAsEvent cenv.g bindingAttribs then
let MakeOne (prefix, target) =
let declPattern = RenameBindingPattern (fun s -> prefix^s) declPattern
let declPattern = RenameBindingPattern (fun s -> prefix + s) declPattern
let argName = "handler"
// modify the rhs and argument data
let bindingRhs, valSynData =
......
......@@ -27,7 +27,7 @@ open Microsoft.FSharp.Compiler.PrettyNaming
// ilxgen.fs: GenCoerce (omit unnecessary castclass or isinst instruction)
//
let rec TypeDefinitelySubsumesTypeNoCoercion ndeep g amap m ty1 ty2 =
if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeDefinitelySubsumesTypeNoCoercion), ty1 = "^(DebugPrint.showType ty1),m))
if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeDefinitelySubsumesTypeNoCoercion), ty1 = " + (DebugPrint.showType ty1), m))
if ty1 === ty2 then true
// QUERY : quadratic
elif typeEquiv g ty1 ty2 then true
......@@ -66,7 +66,7 @@ type CanCoerce = CanCoerce | NoCoerce
/// The feasible equivalence relation. Part of the language spec.
let rec TypesFeasiblyEquiv ndeep g amap m ty1 ty2 =
if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeFeasiblySubsumesType), ty1 = "^(DebugPrint.showType ty1),m));
if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeFeasiblySubsumesType), ty1 = " + (DebugPrint.showType ty1), m));
let ty1 = stripTyEqns g ty1
let ty2 = stripTyEqns g ty2
match ty1,ty2 with
......@@ -88,7 +88,7 @@ let rec TypesFeasiblyEquiv ndeep g amap m ty1 ty2 =
/// The feasible coercion relation. Part of the language spec.
let rec TypeFeasiblySubsumesType ndeep g amap m ty1 canCoerce ty2 =
if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeFeasiblySubsumesType), ty1 = "^(DebugPrint.showType ty1),m))
if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeFeasiblySubsumesType), ty1 = " + (DebugPrint.showType ty1), m))
let ty1 = stripTyEqns g ty1
let ty2 = stripTyEqns g ty2
match ty1,ty2 with
......
......@@ -293,7 +293,7 @@ module RecordTypeTest = begin
with
// properties
override x.ToString() = x.instanceField
member x.InstanceProperty = x.instanceField^".InstanceProperty"
member x.InstanceProperty = x.instanceField + ".InstanceProperty"
member x.RecursiveInstance = x.recursiveInstance
member x.RecursiveInstanceMethod() = x.recursiveInstance
member x.MutableInstanceProperty
......@@ -342,7 +342,7 @@ module RecordTypeTest = begin
static member StaticMethod((s1:string),(s2:string)) = Printf.sprintf "AbstractType.StaticMethod(%s,%s)" s1 s2
// private versions of the above
member x.PrivateInstanceProperty = x.instanceField^".InstanceProperty"
member x.PrivateInstanceProperty = x.instanceField + ".InstanceProperty"
member x.PrivateMutableInstanceProperty
with get() = x.mutableInstanceField
and set(v:string) = x.mutableInstanceField <- v
......
......@@ -156,13 +156,13 @@ let DisplaySample (form:Form) (measure, fileName) =
let ShowStatistics count total skills =
let (mean:float) = (total/(float) count ) in
let _ = try if not form.IsDisposed then form.Invoke( new MethodInvoker(
fun _ -> try tip.SetToolTip(labelK1, "Mean: " ^ mean.ToString() ) with e -> LogWarning e
fun _ -> try tip.SetToolTip(labelK1, "Mean: " + mean.ToString() ) with e -> LogWarning e
)) |> ignore with e -> LogWarning e
in
let deltaSquared = skills |> List.fold ( fun acc value -> let delta = (mean-value) in acc + (delta*delta) ) 0.0 in
let sd = Math.Sqrt(deltaSquared / (float count)) in
try if not form.IsDisposed then form.Invoke( new MethodInvoker(
fun _ -> try tip.SetToolTip(labelK2, "Standard Deviation: " ^ sd.ToString() ) with e -> LogWarning e
fun _ -> try tip.SetToolTip(labelK2, "Standard Deviation: " + sd.ToString() ) with e -> LogWarning e
)) |>ignore with e -> LogWarning e |> ignore
in
lock lastFileLock ( fun _ ->
......@@ -275,7 +275,7 @@ let ChangeHandler measure path =
// Check for tracked players file
let trackFile = GetLatestFile path "Track-*.csv" in
let _ = match trackFile with
| Some name -> let title = "Select Tracked Players (" ^ path ^ ")" in
| Some name -> let title = "Select Tracked Players (" + path + ")" in
let form = match formDock.GetChildForm "track" with
| Some child -> child.Text <- title; child
| None -> let child = CreateForm title in
......@@ -292,7 +292,7 @@ let ChangeHandler measure path =
// Check for leader board of players file
let leadFile = GetLatestFile path "Lead-*.csv" in
let _ = match leadFile with
| Some name -> let title = "Bar graph (" ^ path ^ ")" in
| Some name -> let title = "Bar graph (" + path + ")" in
let form = match formDock.GetChildForm "lead" with
| Some child -> child.Text<-title;child.Controls.Clear();child.Menu.MenuItems.Clear();child
| None -> let child = CreateForm title in child.Show();
......@@ -794,15 +794,15 @@ do menuEdit.MenuItems.Add(miEditCopy) |> ignore
do menuEdit.MenuItems.Add(miEditPaste) |> ignore
do miEditCopy.Click.Add( fun _ ->
let levels = (!skillList) |> List.mapi ( fun i x ->
if pins.[i] then ("\t\t<level index=\"" ^ (i+1).ToString() ^ "\">" ^ x.ToString() ^ "</level>\r\n") else "") in
let value = "<view>\r\n" ^
"\t<folder>" ^ (GetRelativePath combos) ^ "</folder>\r\n" ^
"\t<k1>" ^ (!k1).ToString() ^ "</k1>\r\n" ^
"\t<k2>" ^ (!k2).ToString() ^ "</k2>\r\n" ^
"\t<sigma>" ^(!SigmaFactor).ToString() ^ "</sigma>\r\n" ^
"\t<playedStart>" ^ (!gamesPlayedStart).ToString() ^ "</playedStart>\r\n" ^
"\t<playedEnd>" ^ (!gamesPlayedEnd).ToString() ^ "</playedEnd>\r\n" ^
"\t<levels>\r\n" ^ System.String.Join("",levels |> List.toArray) ^ "\t</levels>\r\n" ^
if pins.[i] then ("\t\t<level index=\"" + (i+1).ToString() + "\">" + x.ToString() + "</level>\r\n") else "") in
let value = "<view>\r\n" +
"\t<folder>" + (GetRelativePath combos) + "</folder>\r\n" +
"\t<k1>" + (!k1).ToString() + "</k1>\r\n" +
"\t<k2>" + (!k2).ToString() + "</k2>\r\n" +
"\t<sigma>" + (!SigmaFactor).ToString() + "</sigma>\r\n" +
"\t<playedStart>" + (!gamesPlayedStart).ToString() + "</playedStart>\r\n" +
"\t<playedEnd>" + (!gamesPlayedEnd).ToString() + "</playedEnd>\r\n" +
"\t<levels>\r\n" + System.String.Join("",levels |> List.toArray) + "\t</levels>\r\n" +
"</view>\r\n"
in Clipboard.SetDataObject(value) // Copy xml to clip board
)
......@@ -853,7 +853,7 @@ do miEditPaste.Click.Add( fun _ ->
in
()
with e -> MessageBox.Show("Paste failed: " ^ e.Message) |> ignore
with e -> MessageBox.Show("Paste failed: " + e.Message) |> ignore
in ()
| _ -> ()
)
......@@ -869,11 +869,11 @@ do miHelpAbout.Click.Add( fun _ ->
box.SelectionAlignment <- HorizontalAlignment.Center;
box.SelectedText <- "Experiment Viewer\r\n\r\n";
box.SelectionAlignment <- HorizontalAlignment.Left;
box.SelectedText <- "The starting folder can be specified from the command line or the File Menu.\r\n\r\n" ^
"Once an experiment file has loaded the suggested values for K1 & K2 are viewable by hovering the mouse over the respective labels.\r\n" ^
"The values for K1 & K2 are calculated as the mean and standard deviation of Mu-(n*Sigma).\r\n\r\n" ^
"The setting can be copied and pasted as XML to and from the editable windows using CTRL-C & CTRL-V.\r\n\r\n" ^
"The graphs can be panned by moving the mouse with the left mouse button down, and zoomed with the right mouse button down." ^
box.SelectedText <- "The starting folder can be specified from the command line or the File Menu.\r\n\r\n" +
"Once an experiment file has loaded the suggested values for K1 & K2 are viewable by hovering the mouse over the respective labels.\r\n" +
"The values for K1 & K2 are calculated as the mean and standard deviation of Mu-(n*Sigma).\r\n\r\n" +
"The setting can be copied and pasted as XML to and from the editable windows using CTRL-C & CTRL-V.\r\n\r\n" +
"The graphs can be panned by moving the mouse with the left mouse button down, and zoomed with the right mouse button down." +
"Press F5 to reset the view, and F3 to toggle the grid off and on.";
box.Enabled <- false;
dialog.Controls.Add(box);
......
......@@ -43,7 +43,7 @@ let histcex (sample:float list) edges counts =
//let i2 = Array.FindIndex(edgePairs, (fun (l,u) -> (l <= x && x < u) )) in counts.(i2) <- counts.(i2) + 1
addone tree counts x
) sample
//timer.Stop(); Debug.WriteLine( "Elapsed " ^ timer.ElapsedMilliseconds.ToString() );
//timer.Stop(); Debug.WriteLine( "Elapsed " + timer.ElapsedMilliseconds.ToString() );
let histc (sample:float list ) edges =
let N = List.length edges in
......
......@@ -15,8 +15,8 @@ let WriteEvent (source:string) (message:string) (entryType:EventLogEntryType) =
/// Get exception message details
let rec GetExceptionMessage (e:#Exception) =
(e.GetType()).Name ^ ": " ^ e.Message ^ "\r\n StackTrace: " ^ e.StackTrace ^
if e.InnerException = null then "" else "Inner Exception: " ^ (GetExceptionMessage e.InnerException)
(e.GetType()).Name + ": " + e.Message + "\r\n StackTrace: " + e.StackTrace +
if e.InnerException = null then "" else "Inner Exception: " + (GetExceptionMessage e.InnerException)
/// Log exception message
let LogWarning e =
......
......@@ -66,10 +66,10 @@ let CreateTrajectories (gamertags:string array) table f =
/// Create player check box
let CreatePlayerCheckBox (toolTip:ToolTip) (player:PlayerRecord) eventHandler =
let box = CreateCheckBox player.gamertag player eventHandler in
let tipText = "Mu(" ^ player.mu.ToString() ^ ")"
^ ", TrueSkill(" ^ player.TrueSkill.ToString() ^ ")"
^ ", Level(" ^ (player.Level !k1 !k2 k3).ToString() ^ ")"
^ ", Played(" ^ player.games_played.ToString() ^ ")" in
let tipText = "Mu(" + player.mu.ToString() + ")"
+ ", TrueSkill(" + player.TrueSkill.ToString() + ")"
+ ", Level(" + (player.Level !k1 !k2 k3).ToString() + ")"
+ ", Played(" + player.games_played.ToString() + ")" in
toolTip.SetToolTip(box, tipText);
box
......@@ -266,7 +266,7 @@ let PopulateForm (form:Form) (formDock:FormDockLocation) measure (playedStart,pl
| _ -> () );
);
()
with e -> MessageBox.Show("Paste failed: " ^ e.Message) |> ignore
with e -> MessageBox.Show("Paste failed: " + e.Message) |> ignore
in ()
| _ -> ()
) in
......
......@@ -15,7 +15,7 @@ exception WeekendEx of WeekendDay
if sprintf "%A" (Foo) <> "Foo"
|| sprintf "%A" (Bar 10) <> "Bar 10"
|| sprintf "%A" (FooBaz System.DateTime.Today) <> ("FooBaz " ^ System.DateTime.Today.ToString())
|| sprintf "%A" (FooBaz System.DateTime.Today) <> ("FooBaz " + System.DateTime.Today.ToString())
|| sprintf "%A" (MarkupEx {Body = "<body>"}) <> "MarkupEx {Body = \"<body>\";}"
|| sprintf "%A" (WeekendEx Saturday) <> "WeekendEx Saturday"
then exit 1
......
......@@ -17,7 +17,7 @@ let test =
#if WITHXMLVERIFICATION
let xml = new System.Xml.XmlDocument()
xml.Load(xmlname);
if System.String.Compare(xml.GetElementsByTagName("summary").Item(0).FirstChild.Value, System.Environment.NewLine ^ " I'm an xml comment!" ^ System.Environment.NewLine) = 0 then 0 else 1
if System.String.Compare(xml.GetElementsByTagName("summary").Item(0).FirstChild.Value, System.Environment.NewLine + " I'm an xml comment!" + System.Environment.NewLine) = 0 then 0 else 1
#else
0
#endif
......
......@@ -18,7 +18,7 @@ let test =
#if WITHXMLVERIFICATION
let xml = new System.Xml.XmlDocument()
xml.Load(xmlname);
if System.String.Compare(xml.GetElementsByTagName("summary").Item(0).FirstChild.Value, System.Environment.NewLine ^ " I'm an xml comment!" ^ System.Environment.NewLine) = 0 then 0 else 1
if System.String.Compare(xml.GetElementsByTagName("summary").Item(0).FirstChild.Value, System.Environment.NewLine + " I'm an xml comment!" + System.Environment.NewLine) = 0 then 0 else 1
#else
0
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册