I Need a Name for a Method . . . Better than All-You-Can-Eat

  • Thread starter Thread starter jehugaleahsa
  • Start date Start date
J

jehugaleahsa

Hello:

I need a method that always returns the default value. It is similar
to DefaultIfEmpty.

public static IEnumerable<T> MyMethodName<T>()
{
while (true)
{
yield return default(T);
}
}

Any ideas? Anything will do. Don't ask me why this is useful . . . it
just is. :-)
 
Hello:

I need a method that always returns the default value. It is similar
to DefaultIfEmpty.

public static IEnumerable<T> MyMethodName<T>()
{
while (true)
{
yield return default(T);
}
}

Any ideas? Anything will do. Don't ask me why this is useful . . . it
just is. :-)

How about DefaultIfEmpty? boom tish......

Michael
 
Hello:

I need a method that always returns the default value. It is similar
to DefaultIfEmpty.

public static IEnumerable<T> MyMethodName<T>()
{
    while (true)
    {
        yield return default(T);
    }

}

Any ideas? Anything will do. Don't ask me why this is useful . . . it
just is. :-)

Horn of Amalthea? Bottomless Well? Pain in the butt?
 
Horn of Amalthea? Bottomless Well? Pain in the butt?- Hide quoted text -

- Show quoted text -

amaranthine, boundless, ceaseless, constant, continual, continuous,
countless, deathless, enduring, eternal, everlasting, illimitable,
immeasurable, immortal, incalculable, incessant, indeterminate,
infinite, interminable, limitless, measureless, monotonous,
multitudinous, never-ending, numberless, overlong, perpetual, self-
perpetuating, unbounded, unbroken, undivided, undying, unending,
unfathomable, uninterrupted, unlimited, unsurpassable, untold, without
end

Does my search ever come to an end . . . irony.
 
Jehugathesaurus wrote : "Does my search ever come to an end . . . irony."

That is up to you, but my patience with off-topic posts definitely is finite
: plonk.

bw
 
I need a method that always returns the default value. It is similar
to DefaultIfEmpty.

public static IEnumerable<T> MyMethodName<T>()
{
while (true)
{
yield return default(T);
}
}

Any ideas? Anything will do. Don't ask me why this is useful . . . it
just is. :-)

DefaultForever ?
 
Hello:

I need a method that always returns the default value. It is similar
to DefaultIfEmpty.

public static IEnumerable<T> MyMethodName<T>()
{
while (true)
{
yield return default(T);
}
}

Any ideas? Anything will do. Don't ask me why this is useful . . . it
just is. :-)

Limahl
 
Hello:

I need a method that always returns the default value. It is similar
to DefaultIfEmpty.

public static IEnumerable<T> MyMethodName<T>()
{
while (true)
{
yield return default(T);
}
}
This is just a special case of

public static IEnumerable<T> Repeat<T>(T t) {
while (true) {
yield return t;
}
}

"Repeat" is the name Haskell uses for the function that creates an infinite
list of copies of its argument.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top