jump to navigation

Request For Comment: NomNom May 15, 2008

Posted by Brent in technology, what "you do here".
Tags: , , , , ,
trackback

using System;

namespace Silly
{
/// <summary>
/// Wrapper to facilitate the nom-nom-nom anti-pattern
/// </summary>
/// <typeparam name=”T”></typeparam>
public static class NomNom<T>
{
public static void Nom<WTF>(Func<WTF> action)
{
try { action(); }
catch { } // this is the om nom nom nom pattern
}

public static void Nom<WTF>(Action<WTF> action, WTF input)
{
try { action(input); }
catch { }
}
}
}

private static void TestSilly()
{
NomNom<int>.Nom<int>(OMGBOOMZ(), -1);
}

private static Action<int> OMGBOOMZ()
{
return x => { –x; List<int> xx = new List<int>(); xx[x]++; };
}

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: