Skip to content

Instantly share code, notes, and snippets.

let internal unorderedOptList (ps : Parser<'a, 'u> list) =
fun (stream : CharStream<'u>) ->
let keys = [ 0 .. (ps |> List.length) - 1 ]
let parsers = ref (ps |> List.zip keys |> Map.ofList)
let results = keys |> List.map (fun key -> (key, ref (Reply(None)))) |> Map.ofList
let mutable continueLooping = true
let runParser (key : int) (value : Parser<'a, 'u>) =
let state = stream.State
let result : Reply<'a> = (value stream)
@Mr-Byte
Mr-Byte / gist:4608614
Created January 23, 2013 15:58
C# 5: Works as one would reason. C# 4 and below: All eight planets are Neptune?! This is why C# 5 is the superior version.
using System;
using System.Collections.Generic;
namespace Test
{
class Program
{
static void Main(string[] args)
{
var planets = new[] {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"};
if (isBurning) {
worldObj.setBlockWithNotify(xCoord, yCoord, zCoord, Blocks.tarKilnActive.id)
} else {
worldObj.setBlockWithNotify(xCoord, yCoord, zCoord, Blocks.tarKiln.id)
}