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. What is your language feature wish list?

What is your language feature wish list?

Scheduled Pinned Locked Moved The Lounge
c++questioncsharpwpfai-coding
42 Posts 19 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.
  • N Niels Holst

    There are setwd(path) and getwd(path) functions for setting the working directory (i.e. the folder from which any relative path would be rooted) but there is no way of finding out from where a script was loaded. That makes it cumbersome to distribute R scripts as an assemblage (e.g. a zip file) of interconnected R scripts and data files. The user must be instructed to call setwd(path) in the beginning of the main script with the folder of her choice. The same goes for yourself when you move your assemblage of R files from one folder to another; you always need to update the setwd(path) statement as well.

    T Offline
    T Offline
    tronderen
    wrote on last edited by
    #33

    Sure, I see the usefulness. But I see it as a library extension, not as a language extension.

    N 1 Reply Last reply
    0
    • T tronderen

      Sure, I see the usefulness. But I see it as a library extension, not as a language extension.

      N Offline
      N Offline
      Niels Holst
      wrote on last edited by
      #34

      Oh, now I get it. You are right.

      1 Reply Last reply
      0
      • H honey the codewitch

        What languages, wishlists do you have for your favorite programming languages? C and where applicable, C++: preprocessor definitions that are private to the actual (in this case header) file they are contained in. namespaces that are private to their header. and/or a standard way to separate the implementation of templates into a cpp file a way to predeclare templates (not template instantiations) such that you can access them before they are defined. C#: Mainly I want its code generation to have DSL (domain specific language) capabilities. This means you can create code generation facilities that introduce new keywords into the language, for doing things like AOP and cross-cutting functionality orthogonal to any specific class. The only problem with it is I think it would be overused.

        To err is human. Fortune favors the monsters.

        B Offline
        B Offline
        BernardIE5317
        wrote on last edited by
        #35

        switch( x, y, z )
        {
        case 1, 2, 3:
        break;
        etc.
        }

        T 1 Reply Last reply
        0
        • C Cpichols

          Not at all my favorite language, but I do wish that JavaScript could handle associative arrays (not objects) in foreach loops where keys and values could be easily accessed for each item in the array, and so that it could be done recursively. The workarounds for this are making me bug-eyed.

          J Offline
          J Offline
          Jeremy Falcon
          wrote on last edited by
          #36

          Cpichols wrote:

          I do wish that JavaScript could handle associative arrays (not objects) in foreach loops where keys and values could be easily accessed for each item in the array

          Most times people blame the language when it's really due to them not studying the language.

          const data = [];

          data['a'] = 200;
          data['b'] = 300;

          for (const datum in data) {
          console.info(`${datum}: ${data[datum]}`);
          }

          Cpichols wrote:

          and so that it could be done recursively

          No language I've ever used does recursive traversing of objects automatically in a loop. Why would JavaScript be more difficult to understand?

          Jeremy Falcon

          1 Reply Last reply
          0
          • H honey the codewitch

            What languages, wishlists do you have for your favorite programming languages? C and where applicable, C++: preprocessor definitions that are private to the actual (in this case header) file they are contained in. namespaces that are private to their header. and/or a standard way to separate the implementation of templates into a cpp file a way to predeclare templates (not template instantiations) such that you can access them before they are defined. C#: Mainly I want its code generation to have DSL (domain specific language) capabilities. This means you can create code generation facilities that introduce new keywords into the language, for doing things like AOP and cross-cutting functionality orthogonal to any specific class. The only problem with it is I think it would be overused.

            To err is human. Fortune favors the monsters.

            U Offline
            U Offline
            User 13269747
            wrote on last edited by
            #37

            C:* defer that works just like Go's defer

            • Anonymous functions that don't mark the stack executable[1], so that defer is actually useful.
            • Replace #define with lisp-like macros (now in Nim as well, I believe)
              Lots more, just don't have the time. [1] Current methods to do nested functions using compiler-specific extensions mark the entire stack as executable.
            1 Reply Last reply
            0
            • B BernardIE5317

              switch( x, y, z )
              {
              case 1, 2, 3:
              break;
              etc.
              }

              T Offline
              T Offline
              tronderen
              wrote on last edited by
              #38

              CHILL has that. Or maybe I should say "had" - I don't know if anyone at all are using CHILL nowadays. We (i.e. Norway) used to have half of our land line phones handled by switches programmed in CHILL (ITT System 12 switches) but the land line phone system was closed down last newyear. Now only mobile phones and IP phones are left. Maybe CHILL is where you take your proposal from. You present a simplified view: CHILL offered both '*' for Don't Care and ELSE for All other values than those mentioned explicitly in other switch alternatives. CHILL has a few other properties that goes into my language feature wish list. It is a pity that it never caught on as a general language, it is really well designed. But noone worked for it - not even the creators of the language (The initial C is for CCITT, 'CCITT HIgh Level Language'. CCITT changed name to ITU-T many years ago.). They saw it as a good language for programming phone switches, and didn't care to consider the language for any other use.

              1 Reply Last reply
              0
              • S Single Step Debugger

                In C# and C++ an "in" and "!in" operators. For example, if we have"

                if(var1 == param1 || var1 == param2 || !(var1 == param3))
                {
                //do stuff
                }

                to be able to translate to:

                if(var1 in (param1, param2, !param3))
                {
                //do stuff
                }

                Advertise here – minimum three posts per day are guaranteed.

                E Offline
                E Offline
                englebart
                wrote on last edited by
                #39

                Convert it to a function In(var1, param1,…) Or throw some functor at it like In(var1)(param1,… ) Is(var1).in(param1…) Could be a lot slower, though.

                1 Reply Last reply
                0
                • T tronderen

                  Well, yes, but ... In all the Pascals I have been in touch with, it is implemented as a bit map. A few orders of magnitude lighter, I guess. There are several other Pascal features I certainly would welcome in C#. Such as decent enumerations, as a first class data type - not just symbolic names for integers, that cannot even be used as integers! In particular: The enum we are offered cannot even be used as an array index type. Closely related: I would welcome Pascal style subrange types. Define a type Year = 1900..2050, and assigning a value outside this range to a variable of type Year is caught by the runtime system (or the compiler, if it can be determined statically). Related to this: An array with index type Year, so valid index values run from 1900 to 2050. To go a little beyond Pascal: I wish we had a mechanism for defining incompatible types: If I could define 'new type Speed = float;' and 'new type Volume = float;', variables of type Speed and Volume would be incompatible, and the compiler would give an error if you try to add them (without a proper operator definition for the two types, or an explicit cast).

                  E Offline
                  E Offline
                  englebart
                  wrote on last edited by
                  #40

                  I am rusty in C/C++, but thought typedef would do that for you in C and C++. Need a cast to assign between the typedefs even if they are both native float.

                  1 Reply Last reply
                  0
                  • H honey the codewitch

                    What languages, wishlists do you have for your favorite programming languages? C and where applicable, C++: preprocessor definitions that are private to the actual (in this case header) file they are contained in. namespaces that are private to their header. and/or a standard way to separate the implementation of templates into a cpp file a way to predeclare templates (not template instantiations) such that you can access them before they are defined. C#: Mainly I want its code generation to have DSL (domain specific language) capabilities. This means you can create code generation facilities that introduce new keywords into the language, for doing things like AOP and cross-cutting functionality orthogonal to any specific class. The only problem with it is I think it would be overused.

                    To err is human. Fortune favors the monsters.

                    E Offline
                    E Offline
                    englebart
                    wrote on last edited by
                    #41

                    Java really needs typedef. It could easily be restricted to final classes. Implement it via erasure like other Java generics. typedef String InvoiceId;

                    1 Reply Last reply
                    0
                    • H honey the codewitch

                      What languages, wishlists do you have for your favorite programming languages? C and where applicable, C++: preprocessor definitions that are private to the actual (in this case header) file they are contained in. namespaces that are private to their header. and/or a standard way to separate the implementation of templates into a cpp file a way to predeclare templates (not template instantiations) such that you can access them before they are defined. C#: Mainly I want its code generation to have DSL (domain specific language) capabilities. This means you can create code generation facilities that introduce new keywords into the language, for doing things like AOP and cross-cutting functionality orthogonal to any specific class. The only problem with it is I think it would be overused.

                      To err is human. Fortune favors the monsters.

                      C Offline
                      C Offline
                      Chad3F
                      wrote on last edited by
                      #42

                      C: - A standard (and simple) way to declare a parameter (or local variable) as not-nullable. Clang supports such an extension, as does gcc (but in a less clean way). It would be better to have a portable tag to do it defined in the language standards. Honestly, this should have been done in back in C99, and would have probably stopped many bugs over the last decade or two. - Variable value bound declarations. So if a parameter is declared unsigned int, but really only has a meaningful range of 0-100, it could flag it during compile time that it is an error. Probably more useful to set reasonable bounds on items which could cause integer overflows (or static buffer overflows when still used due to legacy code).. For example:

                      typedef struct
                      {
                      int id;
                      char name[20];
                      } myrecord_t;

                      myrecord_t * alloc_list(__bound__(0, 10000000) unsigned int size)
                      {
                      /* size > 178956970 on 32-bit ===> overflow */
                      return malloc(size * sizeof(myrecord_t));
                      }

                      void safecaller(__bound__(1, 100000) unsigned int size)
                      {
                      /* Okay - [1-1000000] with-in [0, 10000000] bounds */
                      myrecord_t * list = alloc_list(size);

                      /* ... */
                      }

                      void badcaller(unsigned int size)
                      {
                      /* Compile ERROR - default (32-bit) unsigned int not with-in [0, 10000000] bounds */
                      myrecord_t * list = alloc_list(size);

                      /* ... */
                      }

                      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