dpratt71 said:
W3bbo said:
*snip*
Thanks for the reply, W3bbo. To better explain myself, suppose that you want to define a property which is a collection of "Foo" objects, but you don't want to allow adding or removing items via the property (i.e. the collection is managed internally). In such a case, it would be appropriate for the type of the property to be IEnumerable<Foo>. But that's hard to read. So instead of this:

public class SomeClass
{
    ...
    public IEnumerable<Foo> Foos
    {
        get { ... }
    }
}

I would rather see this:

public class SomeClass
{
    ...
    public Foo* Foos
    {
        get { ... }
    }
}

Of course, as you pointed out, Foo* is currently interpreted as pointer-to-Foo (at least in an unsafe context), which almost certainly precludes using that particular syntax. My overall point is that it would be nice to have some simplified syntax for representing IEnumerable<Foo> (perhaps Foo+).

I do lament the fact that "*" is already taken. The "*" character is used in many programming contexts to represent "0 to n" number of "things".
I'm all for clearer intention... so what if we add new keywords? The compiler is supposed to work for us...

I want syntatic sugar for this...

private void RunMe()
{
if (!InvokeRequired)
{
myLabel.Text = "You pushed the button!";
}
else
{
Invoke(new ThreadStart(RunMe));
}
}