I need to use delete as the method name. But now it's still a keyword, right?

zoujiaqing zoujiaqing at gmail.com
Wed May 18 02:12:42 UTC 2022


https://dlang.org/changelog/2.100.0.html#deprecation_delete

My code:

```D
import std.stdio;

class HttpClient
{
	string get(string url)
	{
		return "";
	}

	string delete(string url)
	{
		return "";
	}
}

void main()
{
	auto http = new HttpClient;
	
	string content = 
http.get("https://forum.dlang.org/group/general");
	string content = 
http.delete("https://forum.dlang.org/newpost/general?");
}
```

error message
```bash
% dub build --compiler=dmd
Performing "debug" build using dmd for x86_64.
test ~master: building configuration "application"...
source/app.d(10,9): Error: no identifier for declarator `string`
source/app.d(10,9): Error: declaration expected, not `delete`
source/app.d(14,1): Error: unmatched closing brace
dmd failed with exit code 1.
```

I wonder when I can use it. Because this will cause a software 
naming problem.


More information about the Digitalmars-d-learn mailing list