0 people like it.

equalstest2

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
#time "on"
module Equals =

    let test () =
        let mutable b = false
        let mutable x, y = 0, 2
        for i = 0 to System.Int32.MaxValue / 2 do
            b <- x = y
            //b <- System.Object.Equals(x,  y)
            //b <- x.Equals(y)
        printfn "%A" b

    test ()
module Equals

from Script
val test : unit -> unit

Full name: Script.Equals.test
val mutable b : bool
val mutable x : int
val mutable y : int
val i : int
namespace System
type Int32 =
  struct
    member CompareTo : value:obj -> int + 1 overload
    member Equals : obj:obj -> bool + 1 overload
    member GetHashCode : unit -> int
    member GetTypeCode : unit -> TypeCode
    member ToString : unit -> string + 3 overloads
    static val MaxValue : int
    static val MinValue : int
    static member Parse : s:string -> int + 3 overloads
    static member TryParse : s:string * result:int -> bool + 1 overload
  end

Full name: System.Int32
field int.MaxValue = 2147483647
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
Raw view Test code New version

More information

Link:http://fssnip.net/7b
Posted:14 years ago
Author:
Tags: