Re: How to invert bool false/true in alias compose?

2019-12-06 Thread Marcone via Digitalmars-d-learn
On Saturday, 7 December 2019 at 04:05:23 UTC, mipri wrote: On Saturday, 7 December 2019 at 04:00:53 UTC, Marcone wrote: import std; alias cmd = compose!(to!bool, wait, spawnShell, to!string); void main(){ writeln(cmd("where notepad.exe")); } Result: C:\Windows\System32\notepad.exe C

Re: How to invert bool false/true in alias compose?

2019-12-06 Thread mipri via Digitalmars-d-learn
On Saturday, 7 December 2019 at 04:00:53 UTC, Marcone wrote: import std; alias cmd = compose!(to!bool, wait, spawnShell, to!string); void main(){ writeln(cmd("where notepad.exe")); } Result: C:\Windows\System32\notepad.exe C:\Windows\notepad.exe false The result show "false" becaus

Re: How to invert bool false/true in alias compose?

2019-12-06 Thread Timon Gehr via Digitalmars-d-learn
On 07.12.19 05:00, Marcone wrote: import std; alias cmd = compose!(to!bool, wait, spawnShell, to!string); void main(){ writeln(cmd("where notepad.exe")); } Result: C:\Windows\System32\notepad.exe C:\Windows\notepad.exe false The result show "false" because good spawnshell command retu

How to invert bool false/true in alias compose?

2019-12-06 Thread Marcone via Digitalmars-d-learn
import std; alias cmd = compose!(to!bool, wait, spawnShell, to!string); void main(){ writeln(cmd("where notepad.exe")); } Result: C:\Windows\System32\notepad.exe C:\Windows\notepad.exe false The result show "false" because good spawnshell command return 0 and 0 to bool is false. Bu