MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp
Author Message
jehugaleahsa



Joined: 19 Oct 2007
Posts: 12

PostPosted: Mon Feb 25, 2008 10:42 pm    Post subject: I Need a Name for a Method . . . Better than All-You-Can-Eat Reply with quote

Hello:

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

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

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

Archived from group: microsoft>public>dotnet>languages>csharp
Back to top
View user's profile Send private message
Michael C



Joined: 28 Aug 2007
Posts: 31

PostPosted: Tue Feb 26, 2008 5:57 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

wrote in message @41g2000hsc.googlegroups.com...
> Hello:
>
> I need a method that always returns the default value. It is similar
> to DefaultIfEmpty.
>
> public static IEnumerable MyMethodName()
> {
> while (true)
> {
> yield return default(T);
> }
> }
>
> Any ideas? Anything will do. Don't ask me why this is useful . . . it
> just is. Smile

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

Michael
Back to top
View user's profile Send private message
jehugaleahsa



Joined: 19 Oct 2007
Posts: 12

PostPosted: Mon Feb 25, 2008 11:18 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

On Feb 25, 6:57 pm, "Michael C" wrote:
> wrote in message
>
> @41g2000hsc.googlegroups.com...
>
> > Hello:
>
> > I need a method that always returns the default value. It is similar
> > to DefaultIfEmpty.
>
> > public static IEnumerable MyMethodName()
> > {
> >    while (true)
> >    {
> >        yield return default(T);
> >    }
> > }
>
> > Any ideas? Anything will do. Don't ask me why this is useful . . . it
> > just is. Smile
>
> How about DefaultIfEmpty? boom tish......
>
> Michael

Yes . . . boom tish
Back to top
View user's profile Send private message
jehugaleahsa



Joined: 19 Oct 2007
Posts: 12

PostPosted: Mon Feb 25, 2008 11:35 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

On Feb 25, 6:42 pm, "jehugalea...@gmail.com"
wrote:
> Hello:
>
> I need a method that always returns the default value. It is similar
> to DefaultIfEmpty.
>
> public static IEnumerable MyMethodName()
> {
>     while (true)
>     {
>         yield return default(T);
>     }
>
> }
>
> Any ideas? Anything will do. Don't ask me why this is useful . . . it
> just is. Smile

Horn of Amalthea? Bottomless Well? Pain in the butt?
Back to top
View user's profile Send private message
jehugaleahsa



Joined: 19 Oct 2007
Posts: 12

PostPosted: Mon Feb 25, 2008 11:39 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

On Feb 25, 7:35 pm, "jehugalea...@gmail.com"
wrote:
> On Feb 25, 6:42 pm, "jehugalea...@gmail.com"
> wrote:
>
>
>
>
>
> > Hello:
>
> > I need a method that always returns the default value. It is similar
> > to DefaultIfEmpty.
>
> > public static IEnumerable MyMethodName()
> > {
> >     while (true)
> >     {
> >         yield return default(T);
> >     }
>
> > }
>
> > Any ideas? Anything will do. Don't ask me why this is useful . . . it
> > just is. Smile
>
> 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.
Back to top
View user's profile Send private message
Bill Woodruff



Joined: 19 Feb 2008
Posts: 1

PostPosted: Tue Feb 26, 2008 5:42 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

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
Back to top
View user's profile Send private message
K Viltersten



Joined: 10 Feb 2008
Posts: 1

PostPosted: Tue Feb 26, 2008 12:04 pm    Post subject: SV: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

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

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

What is ment by "boom tish"?


--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy
Back to top
View user's profile Send private message
Jon Skeet [C# MVP]



Joined: 08 Aug 2007
Posts: 266

PostPosted: Tue Feb 26, 2008 12:48 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

jehugaleahsa@gmail.com wrote:
> I need a method that always returns the default value. It is similar
> to DefaultIfEmpty.
>
> public static IEnumerable MyMethodName()
> {
> while (true)
> {
> yield return default(T);
> }
> }
>
> Any ideas? Anything will do. Don't ask me why this is useful . . . it
> just is. Smile

DefaultForever ?

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Back to top
View user's profile Send private message
Lasse_Vågsæther_Karlsen



Joined: 08 Aug 2007
Posts: 12

PostPosted: Tue Feb 26, 2008 9:36 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

jehugaleahsa@gmail.com wrote:
> Hello:
>
> I need a method that always returns the default value. It is similar
> to DefaultIfEmpty.
>
> public static IEnumerable MyMethodName()
> {
> while (true)
> {
> yield return default(T);
> }
> }
>
> Any ideas? Anything will do. Don't ask me why this is useful . . . it
> just is. Smile

Limahl

--
Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Back to top
View user's profile Send private message
jehugaleahsa



Joined: 19 Oct 2007
Posts: 12

PostPosted: Tue Feb 26, 2008 12:39 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

On Feb 26, 12:48 am, Jon Skeet [C# MVP] wrote:
> jehugalea...@gmail.com wrote:
> > I need a method that always returns the default value. It is similar
> > to DefaultIfEmpty.
>
> > public static IEnumerable MyMethodName()
> > {
> >     while (true)
> >     {
> >         yield return default(T);
> >     }
> > }
>
> > Any ideas? Anything will do. Don't ask me why this is useful . . . it
> > just is. Smile
>
> DefaultForever ?
>
> --
> Jon Skeet - http://www.pobox.com/~skeet  Blog:http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

That is pretty much where I went. Smile
Back to top
View user's profile Send private message
Jeroen Mostert



Joined: 20 Dec 2007
Posts: 18

PostPosted: Wed Feb 27, 2008 1:30 am    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

jehugaleahsa@gmail.com wrote:
> Hello:
>
> I need a method that always returns the default value. It is similar
> to DefaultIfEmpty.
>
> public static IEnumerable MyMethodName()
> {
> while (true)
> {
> yield return default(T);
> }
> }
>
This is just a special case of

public static IEnumerable Repeat(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.

--
J.
Back to top
View user's profile Send private message
Michael C



Joined: 28 Aug 2007
Posts: 31

PostPosted: Wed Feb 27, 2008 9:23 pm    Post subject: Re: I Need a Name for a Method . . . Better than All-You-Can Reply with quote

"K Viltersten" wrote in message @mid.individual.net...
>>> I need a method that always returns the default value. It is similar to
>>> DefaultIfEmpty.
>>>
>
>>
>> How about DefaultIfEmpty? boom tish......
>
> What is ment by "boom tish"?

It's the noise they make on TV shows after some tells a really bad joke.

Michael

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Best method Hi I have an access client table. I need to display these clients on a form in a list, filtered by a condition, for user's selection. What is the best/fastest data access method for this kind of scenario? Some vb.net code example should be great. Thanks R

Dispose Method Hi I have this code: conn = new conn.open(); OdbcCommand cmmd = new * from dr = {

WMI method provider Would you like to explain how to create in C# WMI provider class with methods. For the time installer writes to MOF class' properties only. Thanks in advance. Ilya

Control over which IR beaming method used I wrote an application in eVB that beamed Tasks between PPC 2000 devices and used the POOM store to interact with the Tasks list. Worked quite well - I am now trying to migrate this to .Net CF and trying to resolve some problems encountered when using thi

Which Method to Create a Database Do I Use? It appears there are two methods for creating a database as part of an ASP project. I can use the Server Explorer and create a database that I can't easily see as a file, and create a connection. On the other hand, I can right click in the Solution Explor
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group