Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. If linq is not part of the CLR...

If linq is not part of the CLR...

Scheduled Pinned Locked Moved LINQ
csharpdotnetlinqcomgame-dev
5 Posts 4 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CataclysmicQuantum
    wrote on last edited by
    #1

    ...then why is is part of the C# 3.0 language? Something that is built into the language should not extend beyond the CLI. The language itself needs to be compatible on all platforms, do you know what I am saying? A CTS compliant language like C# should not require assemblies beyond the CLR and CTS.

    The Digital World. It is an amazing place in which we primitive humans interact. Our flesh made this synthetic machine. You see, we are so smart, we know a lot of stuff. We were grown from cells that came from the universe, which the matter and physics I'm typing in it is amazing how the universe is working. Human life is very amazing. How I experience this sh*t its like wow.

    R J 2 Replies Last reply
    0
    • C CataclysmicQuantum

      ...then why is is part of the C# 3.0 language? Something that is built into the language should not extend beyond the CLI. The language itself needs to be compatible on all platforms, do you know what I am saying? A CTS compliant language like C# should not require assemblies beyond the CLR and CTS.

      The Digital World. It is an amazing place in which we primitive humans interact. Our flesh made this synthetic machine. You see, we are so smart, we know a lot of stuff. We were grown from cells that came from the universe, which the matter and physics I'm typing in it is amazing how the universe is working. Human life is very amazing. How I experience this sh*t its like wow.

      R Offline
      R Offline
      Roger Alsing 0
      wrote on last edited by
      #2

      There is more to it.. One side of Linq is the C#3 language support. the stuff that lets you write "from x in list where a = 123 select x" Then there is the Lambdas (delegates + expression trees) which also are refered to as "Linq" in many cases. And then there is Linq to objects, XML, SQL which are "implementations" of the Language support. So Linq to objects, XML and SQL are only implementations and does _not_ need to exist on other platforms. Just like you can use C# on *nix and make GUI:s w/o windows forms So the term "Linq" includes quite a bit of stuff, where the language support is just one of them.

      Blog: http://www.rogeralsing.com Projects: http://www.puzzleframework.com

      1 Reply Last reply
      0
      • C CataclysmicQuantum

        ...then why is is part of the C# 3.0 language? Something that is built into the language should not extend beyond the CLI. The language itself needs to be compatible on all platforms, do you know what I am saying? A CTS compliant language like C# should not require assemblies beyond the CLR and CTS.

        The Digital World. It is an amazing place in which we primitive humans interact. Our flesh made this synthetic machine. You see, we are so smart, we know a lot of stuff. We were grown from cells that came from the universe, which the matter and physics I'm typing in it is amazing how the universe is working. Human life is very amazing. How I experience this sh*t its like wow.

        J Offline
        J Offline
        Judah Gabriel Himango
        wrote on last edited by
        #3

        The CLR is the runtime. Since LINQ just compiles down to regular function calls, no new runtime is needed. The assemblies in LINQ are part of the .NET framework standard libraries, if that's what you mean, which means you can use them from VB.NET, IronRuby, C++/CLI, and all those other languages. For example, C# 3 has some special syntax that let you define queries like this:

        var evenIntegers = from i in ints
                        where i % 2 == 0
                        select i;

        But under the hood, the compiler is just making function calls to standard .NET assemblies:

        Predicate<int> predicate = new Predicate<int>(CompilerGeneratedPredicate);
        IEnumerable<int> eventIntegers = Enumerable.Where(ints, predicate); // something like this, where Enumerable is a class in the standard .NET framework

        bool CompilerGeneratedPredicate(int i)
        {
        return i % 2 == 0;
        }

        That means LINQ is usable from most any .NET language. The syntax will just be different across languages. I don't know whether LINQ is CLS compliant; I would assume it is.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: I'm Offended That You're Offended! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        S 1 Reply Last reply
        0
        • J Judah Gabriel Himango

          The CLR is the runtime. Since LINQ just compiles down to regular function calls, no new runtime is needed. The assemblies in LINQ are part of the .NET framework standard libraries, if that's what you mean, which means you can use them from VB.NET, IronRuby, C++/CLI, and all those other languages. For example, C# 3 has some special syntax that let you define queries like this:

          var evenIntegers = from i in ints
                          where i % 2 == 0
                          select i;

          But under the hood, the compiler is just making function calls to standard .NET assemblies:

          Predicate<int> predicate = new Predicate<int>(CompilerGeneratedPredicate);
          IEnumerable<int> eventIntegers = Enumerable.Where(ints, predicate); // something like this, where Enumerable is a class in the standard .NET framework

          bool CompilerGeneratedPredicate(int i)
          {
          return i % 2 == 0;
          }

          That means LINQ is usable from most any .NET language. The syntax will just be different across languages. I don't know whether LINQ is CLS compliant; I would assume it is.

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: I'm Offended That You're Offended! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

          S Offline
          S Offline
          S Senthil Kumar
          wrote on last edited by
          #4

          Judah Himango wrote:

          I don't know whether LINQ is CLS compliant; I would assume it is.

          Isn't CLS compliance about the public "face" of code - public classes, methods, return types etc.. I can't think of any scenario where a LINQ query would leak out of the body of a method, so I'd say CLS compliance doesn't apply to LINQ.

          Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | My Flickr | WinMacro

          J 1 Reply Last reply
          0
          • S S Senthil Kumar

            Judah Himango wrote:

            I don't know whether LINQ is CLS compliant; I would assume it is.

            Isn't CLS compliance about the public "face" of code - public classes, methods, return types etc.. I can't think of any scenario where a LINQ query would leak out of the body of a method, so I'd say CLS compliance doesn't apply to LINQ.

            Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | My Flickr | WinMacro

            J Offline
            J Offline
            Judah Gabriel Himango
            wrote on last edited by
            #5

            Mmm, sure, it's about public face. But I don't understand - since LINQ stuff can leak out (after all, the basic structure of LINQ is IEnumerable<T>, which is CLS-compliant), it ought to be CLS-compliant. I think it is, but I'm not 100% certain.

            Tech, life, family, faith: Give me a visit. From my latest post: "The world will call you weak, unintelligent, and foolish for following God. Don't worry about them. God's picked the foolish things in order to put the world's wisdom to shame." The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups