www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - newCTFE Status November 2017

reply Stefan Koch <uplink.coder googlemail.com> writes:
Hi Guys,

I know there has been a lack of visible activity lately in the 
field of newCTFE.

But fear not, there is progress; even if it is much slower then 
before.

I just implemented support for varadic function templates.

(which produces a curious AST in which you have more arguments 
then parameters ;))

luckily this was easily fixed because dmd provides a way to 
iterate over the expanded parameter tuple. The elusively named 
(Parameter.getNth) function.

which looks like this:

     /***************************************
      * Get nth Parameter, folding in tuples.
      * Returns:
      *      Parameter*      nth Parameter
      *      NULL            not found, *pn gets incremented by 
the number
      *                      of Parameters
      */
     static Parameter getNth(Parameters* parameters, size_t nth, 
size_t* pn = null)
     {
         Parameter param;

         int getNthParamDg(size_t n, Parameter p)
         {
             if (n == nth)
             {
                 param = p;
                 return 1;
             }
             return 0;
         }

         int res = _foreach(parameters, &getNthParamDg);
         return res ? param : null;
     }

Notice how pn is never actually touched!
and therefore will not get incremented.
Nov 18 2017
parent reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Saturday, 18 November 2017 at 13:54:45 UTC, Stefan Koch wrote:
 Hi Guys,

 I know there has been a lack of visible activity lately in the 
 field of newCTFE.

 But fear not, there is progress; even if it is much slower then 
 before.
Great. Is there a checklist for what's left before newCTFE is ready for formal review?
Nov 19 2017
parent Stefan Koch <uplink.coder googlemail.com> writes:
On Sunday, 19 November 2017 at 17:03:32 UTC, Nordlöw wrote:
 On Saturday, 18 November 2017 at 13:54:45 UTC, Stefan Koch 
 wrote:
 Hi Guys,

 I know there has been a lack of visible activity lately in the 
 field of newCTFE.

 But fear not, there is progress; even if it is much slower 
 then before.
Great. Is there a checklist for what's left before newCTFE is ready for formal review?
I guess that would be union and delegate support at the very least. Also the newCTFE-ABI needs to be documented.
Nov 19 2017