473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

Hello:

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

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

Any ideas? Anything will do. Don't ask me why this is useful . . . it
just is. :-)
Feb 26 '08 #1
6 896
<je**********@gmail.comwrote in message
news:ac**********************************@41g2000h sc.googlegroups.com...
Hello:

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

public static IEnumerable<TMyMethodName<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
Feb 26 '08 #2
On Feb 25, 6:57*pm, "Michael C" <m...@nospam.comwrote:
<jehugalea...@gmail.comwrote in message

news:ac**********************************@41g2000h sc.googlegroups.com...
Hello:
I need a method that always returns the default value. It is similar
to DefaultIfEmpty.
public static IEnumerable<TMyMethodName<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
Yes . . . boom tish
Feb 26 '08 #3
On Feb 25, 6:42*pm, "jehugalea...@gmail.com" <jehugalea...@gmail.com>
wrote:
Hello:

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

public static IEnumerable<TMyMethodName<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?
Feb 26 '08 #4
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
Feb 26 '08 #5
je**********@gmail.com wrote:
Hello:

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

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

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

--
J.
Feb 26 '08 #6
"K Viltersten" <tm**@viltersten.comwrote in message
news:62*************@mid.individual.net...
>>I need a method that always returns the default value. It is similar to
DefaultIfEmpty.
<snip>
>>
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
Feb 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Koen Van Herck | last post by:
For debugging/logging purposes, I have a function def Log(msg): print '%s.%s: %s' % (cls, method, msg) I call this function from a class method, and I would like to retrieve the name of the...
3
by: Dennis M. Marks | last post by:
I have a problem with the following code. It generates a <FORM><SELECT><OPTION> list. There is no problem in the generating. The problem is in the execution as follows. It works fine in Mac IE...
6
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object...
10
by: eLisHa | last post by:
i have an arraylist that gets it's values dynamiclly from the database, after paging, searching & more in the ASP.net file. What im trying to do, is sort the results that are sorted in the...
0
by: Rob Levine | last post by:
I have been having some serious problems with System.Net.Dns.Resolve. The documentation states: "The Resolve method queries a DNS server for the IP address associated with a host name or IP...
0
by: Sankar | last post by:
Hi all, I need to popup a folder dialog box on an aspx web page. The functionality needed is to select a folder name and assign it to one of the form variables in the web page. I used activex...
5
by: Eric Layman | last post by:
Hi, Many years ago when I first learnt abt web dev in school, I was taught this methodology: <html> blah blabh
1
by: twin2003 | last post by:
need help with inventory part 5 here is what I have to do Modify the Inventory Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next...
1
crystal2005
by: crystal2005 | last post by:
Hi i encounterd some problem when i implement CSS for rounded Corner table. Need help please... :D <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />...
1
by: tikney5 | last post by:
I need to modify my current program so that is uses a class to store and retrieve the employees name, hourly rate, and number of hourse worked. Use a constructor to initialize the employee...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.