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. The Lounge
  3. Missing Language Feature

Missing Language Feature

Scheduled Pinned Locked Moved The Lounge
htmlcomtoolsquestion
5 Posts 4 Posters 0 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.
  • P Offline
    P Offline
    peterchen
    wrote on last edited by
    #1

    I'm still waiting for a language that allows:

    namespace Foo
    {
    namespace Bar
    {
    class Fuzz
    {
    enum OptionsForGetIt
    {
    Current = 0,
    Default = 1
    }
    public string GetIt(Foo.Bar.AllTheStaticFuzz.OptionsForGetIt opt) { ... }
    }
    }
    }

    namepsace SomethingCompletelyDifferent
    {
    ...
    string s = Foo.Bar.Fuzz.GetIt(Current)
    }

    Seriously.


    We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
    Linkify! || Fold With Us! || sighist

    M S 3 Replies Last reply
    0
    • P peterchen

      I'm still waiting for a language that allows:

      namespace Foo
      {
      namespace Bar
      {
      class Fuzz
      {
      enum OptionsForGetIt
      {
      Current = 0,
      Default = 1
      }
      public string GetIt(Foo.Bar.AllTheStaticFuzz.OptionsForGetIt opt) { ... }
      }
      }
      }

      namepsace SomethingCompletelyDifferent
      {
      ...
      string s = Foo.Bar.Fuzz.GetIt(Current)
      }

      Seriously.


      We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
      Linkify! || Fold With Us! || sighist

      M Offline
      M Offline
      Marc 0
      wrote on last edited by
      #2

      Yeah it sucks, all those namespaces. Importing them all at the top of the file makes a very long intellisense list, and not importing them makes very long code lines. What about namespace/class importing in brackets?

      namespace SomethingCompletelyDifferent
      {
      ...
      using Foo.Bar.Fuzz {
      string s = GetIt(OptionsForGetIt.Current);
      }
      ...
      }

      BTW, in VB.Net (don't laugh people :rolleyes:) you can do Imports Fuzz = Foo.Bar.Fuzz or Imports FB = Foo.Bar You can't do that in C#?


      "..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.." -- Mark McCormick


      || Fold With Us! || Pensieve || VG.Net ||

      R 1 Reply Last reply
      0
      • M Marc 0

        Yeah it sucks, all those namespaces. Importing them all at the top of the file makes a very long intellisense list, and not importing them makes very long code lines. What about namespace/class importing in brackets?

        namespace SomethingCompletelyDifferent
        {
        ...
        using Foo.Bar.Fuzz {
        string s = GetIt(OptionsForGetIt.Current);
        }
        ...
        }

        BTW, in VB.Net (don't laugh people :rolleyes:) you can do Imports Fuzz = Foo.Bar.Fuzz or Imports FB = Foo.Bar You can't do that in C#?


        "..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.." -- Mark McCormick


        || Fold With Us! || Pensieve || VG.Net ||

        R Offline
        R Offline
        Rama Krishna Vavilala
        wrote on last edited by
        #3

        [Marc] wrote:

        You can't do that in C#?

        You can: using Fuzz = Foo.Bar.Fuzz


        Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

        1 Reply Last reply
        0
        • P peterchen

          I'm still waiting for a language that allows:

          namespace Foo
          {
          namespace Bar
          {
          class Fuzz
          {
          enum OptionsForGetIt
          {
          Current = 0,
          Default = 1
          }
          public string GetIt(Foo.Bar.AllTheStaticFuzz.OptionsForGetIt opt) { ... }
          }
          }
          }

          namepsace SomethingCompletelyDifferent
          {
          ...
          string s = Foo.Bar.Fuzz.GetIt(Current)
          }

          Seriously.


          We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
          Linkify! || Fold With Us! || sighist

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          Well, if we stick to namespaces, argument dependent (or Koenig) lookup gives you something similar for C++ - this would (I think) be legal - it compiles, anyway:

          struct string;
          
          namespace Foo 
          { 
            namespace Bar 
            { 
              namespace Fuzz
              {
                enum OptionsForGetIt
                {
                  Current = 0, 
                  Default = 1
                };
                 string* GetIt(OptionsForGetIt opt);
              }
            } 
          }
          
          namespace SomethingCompletelyDifferent
          {
            string* s = GetIt(Foo::Bar::Fuzz::Current);
          }
          
          1 Reply Last reply
          0
          • P peterchen

            I'm still waiting for a language that allows:

            namespace Foo
            {
            namespace Bar
            {
            class Fuzz
            {
            enum OptionsForGetIt
            {
            Current = 0,
            Default = 1
            }
            public string GetIt(Foo.Bar.AllTheStaticFuzz.OptionsForGetIt opt) { ... }
            }
            }
            }

            namepsace SomethingCompletelyDifferent
            {
            ...
            string s = Foo.Bar.Fuzz.GetIt(Current)
            }

            Seriously.


            We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
            Linkify! || Fold With Us! || sighist

            S Offline
            S Offline
            Stuart Dootson
            wrote on last edited by
            #5

            Well, if we stick to namespaces, argument dependent (or Koenig) lookup gives you something similar for C++ - this would (I think) be legal - it compiles, anyway:

            struct string;
            
            namespace Foo 
            { 
              namespace Bar 
              { 
                namespace Fuzz
                {
                  enum OptionsForGetIt
                  {
                    Current = 0, 
                    Default = 1
                  };
                   string* GetIt(OptionsForGetIt opt);
                }
              } 
            }
            
            namespace SomethingCompletelyDifferent
            {
              string* s = GetIt(Foo::Bar::Fuzz::Current);
            }
            
            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