www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Weird std.path API?

reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
Seems different functions in std.path do not work together:
```d
import std.path;

// Error: no property `asNormaliedPath` for 
`dirName("/sandbox/onlineapp.d")` of type `string`
auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;
```

Is this known thing or I'm doing something wrong?
Jul 07
next sibling parent reply Anonymouse <zorael gmail.com> writes:
On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote:
 ```d
 import std.path;

 // Error: no property `asNormaliedPath` for 
 `dirName("/sandbox/onlineapp.d")` of type `string`
 auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;
 ```
`asNormalizedPath` is misspelled.
Jul 07
parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote:
 On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote:
 ```d
 import std.path;

 // Error: no property `asNormaliedPath` for 
 `dirName("/sandbox/onlineapp.d")` of type `string`
 auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;
 ```
`asNormalizedPath` is misspelled.
My bad, sorry :) My blurred eyes didn't catch that
Jul 07
next sibling parent user1234 <user1234 12.de> writes:
On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote:
 On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote:
 On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote:
 ```d
 import std.path;

 // Error: no property `asNormaliedPath` for 
 `dirName("/sandbox/onlineapp.d")` of type `string`
 auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;
 ```
`asNormalizedPath` is misspelled.
My bad, sorry :) My blurred eyes didn't catch that
In first place I would have expected the spellcheck to find the error but it looks like that does not work with UFCS. https://issues.dlang.org/show_bug.cgi?id=9997
Jul 07
prev sibling parent reply aberba <karabutaworld gmail.com> writes:
On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote:
 On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote:
 On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote:
 ```d
 import std.path;

 // Error: no property `asNormaliedPath` for 
 `dirName("/sandbox/onlineapp.d")` of type `string`
 auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;
 ```
`asNormalizedPath` is misspelled.
My bad, sorry :) My blurred eyes didn't catch that
I use a plugin called Code Spell Checker in VS code...or maybe spell checker which highlights spelling mistakes in methods and strings.
Jul 08
parent user1234 <user1234 12.de> writes:
On Monday, 8 July 2024 at 07:29:27 UTC, aberba wrote:
 On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote:
 On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote:
 On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote:
 ```d
 import std.path;

 // Error: no property `asNormaliedPath` for 
 `dirName("/sandbox/onlineapp.d")` of type `string`
 auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;
 ```
`asNormalizedPath` is misspelled.
My bad, sorry :) My blurred eyes didn't catch that
I use a plugin called Code Spell Checker in VS code...or maybe spell checker which highlights spelling mistakes in methods and strings.
Does it help in this case ?
Jul 08
prev sibling parent "H. S. Teoh" <hsteoh qfbox.info> writes:
On Sun, Jul 07, 2024 at 02:41:31PM +0000, Andrey Zherikov via
Digitalmars-d-learn wrote:
 Seems different functions in std.path do not work together:
 ```d
 import std.path;
 
 // Error: no property `asNormaliedPath` for
 `dirName("/sandbox/onlineapp.d")` of type `string`
 auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;
 ```
 
 Is this known thing or I'm doing something wrong?
Isn't it supposed to be spelled .asNormalizedPath? T -- IBM = I Blame Microsoft
Jul 07