Visual D evaluate simple functions for information

Rainer Schuetze r.sagitario at gmx.de
Fri Sep 14 08:14:37 UTC 2018


On 13/09/2018 11:26, Josphe Brigmo wrote:
> Suppose one does something like
> 
> baseName(x);
> 
> When highlighting the mouse over x, it VD shows the value of x.
> 
> When highlighting over baseName, it shows the functional information.
> 
> It would be nice if Visual D could evaluate the function at it's value.
> 
> It should be really simple to do:

Interesting idea, but not that simple. The semantic engine used in 
Visual D can actually do some CTFE evaluation, but phobos library 
functions tend to be rather elaborate, so correct execution might not 
always succeed.

I can give it shot when I have some time.


> 
> Check if the argument's value is known, in this case it is, since it 
> shows it to me. Check if the function can then be evaluated, which it 
> can as it is a library function.
> 
> Basically a sort of CTFE for visual D in that it can evaluate functions 
> a compile.
> 
> One thing I hate about D and visual D in general is that I almost always 
> have to create compile time variables just to see what is going on.
> 
> By having such a feature, the computer will do all the work and save 
> significant time(from a few minutes to create the temp variables, re-run 
> the program, then remove them down to basically 0 seconds).
> 
> It would actually be nice if one could see the values in any expression 
> in a chain:
> 
> baseName(dire).stripExtension.toUpper....
> 
> Highlighting any of the functions will not just show documentation 
> information or evaluating known variables but also evaluate the function 
> on those variables if it can.
> 
> It can simply use a thread to try and evaluate the functions. If they 
> are library functions it should not be difficult but also try functions 
> in the user program. If they take too long simply time out. Should solve 
> most of the issues.
> 
> IT would really speed up develop in D.
> Maybe even string mixins could be evaluated this by showing a pop-up 
> scrollable box with the expanded mixin and debug issues.
> 


More information about the Digitalmars-d-ide mailing list