Functors () overloading for classes
<p>I do not think this is possible and curious if it is or why it is not:</p>

<pre><code>class A
{

}
</code></pre>

<p>I would like to treat instances of A as functions such as</p>

<pre><code>A a = new A();

a();
or
a(3);
etc...
</code></pre>

<p>This is to treat classes as functions for special cases when it is useful to do so. For example, I'm essentially wrapping a Func object but would love to treat an instance of such a class to act as the Func object itself. This way I don't have to have a "dummy" function to call in the class.</p>

<hr>

<pre><code>    public class Condition
    {
        protected Func&lt;bool&gt; Eval { get; set; }
        protected bool Or = false;

        protected Condition() { }
        public Condition(Func&lt;bool&gt; f, bool Or = false) { Eval = f; this.Or = Or; }
        protected Func&lt;bool&gt; GetEval(Condition c) { return c.Eval; }
        protected bool GetOr(Condition c) { return c.Or; }

    }

    public class ConditionBlock : Condition
    {
        List&lt;Condition&gt; Conditions;

        public ConditionBlock() { Eval = _Eval; }

        public ConditionBlock(List&lt;Condition&gt; Conditions) : this() { this.Conditions = Conditions; }
        public ConditionBlock(Condition[] Conditions) : this() { this.Conditions = new List&lt;Condition&gt;(Conditions); }
        public void Add(Condition c) { if (Conditions == null) Conditions = new List&lt;Condition&gt;(); Conditions.Add(c); }

        private bool _Eval()
        {
            if (Conditions == null || Conditions.Count == 0) return true;

            bool ans = !GetOr(Conditions[0]);
            for (int i = 0; i &lt; Conditions.Count; i++)
                ans = GetOr(Conditions[i]) ? ans | GetEval(Conditions[i])() : ans &amp; GetEval(Conditions[i])();

            return ans;
        }

        public bool _()
        {
            return Eval();
        }
    }
</code></pre>

<p>To initiate the Computation I call the member <em>(), e.g., cblock.</em>(). It would look much nicer if I could call it as cblock(). Effectively a ConditionBlock is a compound function. Would be nice to be able to treat it as such. Using _() is quite ugly as is renaming it to anything else such as cblock.fire(), cblock.eval(), etc...</p>
