Hello Strt,
Lutger Wrote:
On 01/03/2010 04:31 AM, Strt wrote:
How can I generate some sort of call diagram from my D code?
you can compile with (dmd) -profile and run the executable. This
produces a file called trace.log which contains timings for each
function and a call graph. It doesn't
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
#ponce wrote:
> When I started D, it was possible to define a scope class like this.
>
> scope class Something
> {
> // blah
> }
>
> An instance declaration would then _require_ the scope storage class.
>
>
> {
> scope Something myVar;
>//
When I started D, it was possible to define a scope class like this.
scope class Something
{
// blah
}
An instance declaration would then _require_ the scope storage class.
{
scope Something myVar;
// do something with Something
}
Is there a use case for such a feature.?
Alex wrote:
> Is it possible, using templates, tuples, or some other mechanism, to
> implement named variadic arguments in D?
>
> For example, I'd like to be able to do something like...
> foo( 2, &bar, age : 10, status : "down");
>
> and so forth.
Yes, with a small hack.
typedef int age_type;
> Do you need high performance for this code?
> If not, what about using an associative array of Variant[string] as third
> argument? It's not a nice solution.
It's not a nice solution, but that's essentially what Python does in such
situation:
def foo(x, y, **kwds):
# here kwds is a dict of s
Alex Wrote:
> Is it possible, using templates, tuples, or some other mechanism, to
> implement named variadic arguments in D?
Do you need high performance for this code?
If not, what about using an associative array of Variant[string] as third
argument? It's not a nice solution.
Bye,
bearophil