D language

  • genux
  • Graduate
  • Graduate
  • User avatar
  • Posts: 106
  • Loc: UK

Post 3+ Months Ago

Has anyone tried out D language yet ? I have viewed some of the code and it appears to be a next generation of C++, but also incorporating C# and java into it as well.

Any ideas anyone ?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

Code: [ Select ]
// Nested functions can refer to outer
  // variables like args
  specs argspecs()
  {
    specs* s = new specs;
    // no need for '->'
    s.count = args.length;          // get length of array with .length
    s.allocated = typeof(args).sizeof; // built-in native type properties
    foreach (argv; args)
      s.allocated += argv.length * typeof(argv[0]).sizeof;
    return *s;
  }
  1. // Nested functions can refer to outer
  2.   // variables like args
  3.   specs argspecs()
  4.   {
  5.     specs* s = new specs;
  6.     // no need for '->'
  7.     s.count = args.length;          // get length of array with .length
  8.     s.allocated = typeof(args).sizeof; // built-in native type properties
  9.     foreach (argv; args)
  10.       s.allocated += argv.length * typeof(argv[0]).sizeof;
  11.     return *s;
  12.   }


I hate global variables.

Looks interesting though, I may keep an eye on it.
  • genux
  • Graduate
  • Graduate
  • User avatar
  • Posts: 106
  • Loc: UK

Post 3+ Months Ago

Yeah.. it does look interesting :). I am going to have to install it and have a good play :).. gdc here we come :).

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 51 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.