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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jehugaleahsa@gmail.com

    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<TMy MethodName<T>()
    {
    while (true)
    {
    yield return default(T);
    }
    }

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

    #2
    Re: I Need a Name for a Method . . . Better than All-You-Can-Eat

    <jehugaleahsa@g mail.comwrote in message
    news:ac0cc09e-7810-4027-ae40-4a2bc04f2ae4@41 g2000hsc.google groups.com...
    Hello:
    >
    I need a method that always returns the default value. It is similar
    to DefaultIfEmpty.
    >
    public static IEnumerable<TMy MethodName<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


    Comment

    • jehugaleahsa@gmail.com

      #3
      Re: I Need a Name for a Method . . . Better than All-You-Can-Eat

      On Feb 25, 6:57 pm, "Michael C" <m...@nospam.co mwrote:
      <jehugalea...@g mail.comwrote in message
      >
      news:ac0cc09e-7810-4027-ae40-4a2bc04f2ae4@41 g2000hsc.google groups.com...
      >
      Hello:
      >
      I need a method that always returns the default value. It is similar
      to DefaultIfEmpty.
      >
      public static IEnumerable<TMy MethodName<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

      Comment

      • jehugaleahsa@gmail.com

        #4
        Re: I Need a Name for a Method . . . Better than All-You-Can-Eat

        On Feb 25, 6:42 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
        wrote:
        Hello:
        >
        I need a method that always returns the default value. It is similar
        to DefaultIfEmpty.
        >
        public static IEnumerable<TMy MethodName<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?

        Comment

        • Bill Woodruff

          #5
          Re: I Need a Name for a Method . . . Better than All-You-Can-Eat

          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


          Comment

          • Jeroen Mostert

            #6
            Re: I Need a Name for a Method . . . Better than All-You-Can-Eat

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

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

            Comment

            • Michael C

              #7
              Re: I Need a Name for a Method . . . Better than All-You-Can-Eat

              "K Viltersten" <tmp1@vilterste n.comwrote in message
              news:62hng2F22t avgU1@mid.indiv idual.net...
              >>I need a method that always returns the default value. It is similar to
              >>DefaultIfEmpt y.
              >>>
              <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


              Comment

              Working...