Is it possible to write syntax like – ()()?

You can do slightly better than the examples given so far, in fact… you can extend it arbitrarily:

class Test
{
    delegate Hofstadter Hofstadter();

    static void Main()
    {
        // Unfortunately I'm clearly not as smart as the real thing
        Hofstadter douglas = () => null;

        douglas()()()()()()();
    }
}

And here’s another horrible alternative, for extra ASCII art:

class Test
{
    delegate __ ___();
    delegate ___ __(___ _);

    static void Main()
    {
        ___ _ = () => null;

        _ ()((_))();
    }
}

Please never ever, ever do this.

EDIT: One last one – although it’s as much about just replacing things with underscores as anything else, and reusing names wherever possible:

class Test
{
    delegate void _();
    delegate __<_> ___<_>();
    delegate ___<_> __<_>(___<_> ____);

    static ___<_> ____<_>(___<_> ____) { return ____; }
    static __<_> ____<_>() { return ____<_>; }

    static void Main()
    {
        ((__<_>)____)(____<_>)();
    }
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)