public class DotNetPad
{
    public static void Main(string[] args)
    {
        Console.WriteLine(DateTime.Now.ToString("yyyyMMdd"));
    }
}

Pasted 2 hours ago

type mnemonic = | Add | Sub  | And | Or | Not
                | Ldc of int | Beq of int
let program = [Ldc 10; Ldc 20; Add]
let opt = match program with
          | [Ldc n; Ldc m; Add] -> [Ldc (n + m)]
          | [Ldc n; Ldc m; Sub] -> [Ldc (n - m)]
          | [Not; Not; Not]     -> [Not]
          | p -> p
printfn "Optimised function %A" opt

Pasted 1 day ago

type mnemonic = Add | Ldc of int
                member this.lines = []
let program = [Ldc 10; Ldc 20; Add]
printfn "%A" program

Pasted 1 day ago

open System
type Numbers = | One = 1
               | Two = 2
               | Three = 3             
printfn "%A" (Enum.GetNames(typeof<Numbers>))

Pasted 2 days ago

open System
type Numbers = | One = 1
               | Two = 2
               | Three = 3             
printfn "%A" (Enum.GetNames(typeof<Numbers>))'

Pasted 2 days ago

type mnemonic = | Add | Sub  | And | Or | Not
                | Ldc of int | Beq of int
let program = [Ldc 10; Ldc 20; Add]
// Peephole optimiser
let opt = match program with
          | [Ldc n; Ldc m; add ] -> [ Ldc (n + m)]
          | p -> p
printfn "Optimised function %A" opt

Pasted 2 days ago


Pasted 2 days ago

public class DotNetPad
{
    public static void Main(string[] args)
    {
        Console.WriteLine(.0m.ToString("G0"));
    }
}

Pasted 2 days ago

public class DotNetPad
{
    public static void Main(string[] args)
    {
        Console.WriteLine(0.1m.ToString("G0"));
    }
}

Pasted 2 days ago

public class DotNetPad
{
    public static void Main(string[] args)
    {
        Console.WriteLine(2.1m.ToString("G0"));
    }
}

Pasted 2 days ago

public class DotNetPad
{
    public static void Main(string[] args)
    {
        Console.WriteLine(2.0m.ToString("G0"));
    }
}

Pasted 2 days ago

public class DotNetPad
{
    public static void Main(string[] args)
    {
        Console.WriteLine(2.0m.ToString());
    }
}

Pasted 2 days ago