Make a function available under different names.

00004 0 at 0.0
Sat Jul 29 16:08:55 UTC 2023


And here is my latest evolution of the code I've shared 
previously.

```
module utilities;

import std.stdio : write;

string returnExecutableName(string[] arguments, bool 
debugging=false) {
	if (debugging == true){
		write("Debug mode is enabled.\n");
		write(" Executable_Name: " ~ arguments[0] ~ "\n");
	}
	return arguments[0];
}

auto debugExecutableName(string[] arguments){
	return returnExecutableName(arguments, true);
}
alias printExecutableName = debugExecutableName;
alias getExecutableName = debugExecutableName;

```

### Possible new syntax for D Alias?

In this recent version of my code I noticed that it would be nice 
to have a new syntax for `alias` declaration.

#### Syntax I would need in D language.

`alias printExecutableName = getExecutableName = 
debugExecutableName;`

In this syntax it would be easier to **declare multiple alias** 
that point to the same origin.


Not sure if it would be a good idea, but an idea nonetheless.




More information about the Digitalmars-d-learn mailing list