On 13.02.2012 13:50, David Nadlinger wrote:
On 2/13/12 1:13 PM, Alf P. Steinbach wrote:
I am sure that if but the right mindset was brought to bear, the D
community and in particular those with some responsibility for the
toolset and language, could learn as much from my current 2 postings as
I am learning about the tools and language.

Not to be artificially humble, that's not my style. ;-)

Nobody doubts that feedback, especially from people new to the language,
is important. And indeed, the first topic you started is perfectly
appropriate here. However, for beginner questions like your second one,
we have a separate newsgroup, digitalmars.D.learn. Don't forget that
some people are subscribed just to dm.D via the mailing list interface
to keep up to date with D development related things, and basic
questions would only clutter their inbox.

OK, thanks, I'll try that.

However, by looking at the articles in the two groups I don't see much difference or clear trend towards this or that.

Are there group charters?


And not to be artificially restrained, it's not likely that your
question regarding import search paths will fundamentally affect the D
module design, is it? :P

I don't know, but that's the beauty of the newbie perspective.

As a newbie one tries things and asks about things that a person more accustomed to The Usual Ways(TM) just discounts immediately without further reflection -- missing out on the opportunities...

For example, I hope that some good nice person will add the enclosed module to the standard library, so that people accustomed to clean Windows API function names in C++, can have the same in D.


Anyway, as far as the compilation model goes, for everything search path
and linker-related, a useful first-order approximation is just to think
of it as C++. Each import search path (from dmd.conf/sc.ini or the -I
command line switches, plus the working directory) is treated as
possible root, and similar to »#include <foo/bar.h>«, »import foo.bar;«
looks for a foo/bar.d file in any of the import directories.

That's what I did.

I've now additionally added the file to the Visual Studio project, and that worked.


So, if you really want to extend druntime's core package (which you
normally don't, unless you plan on submitting your additions back
upstream), you would put your generated unicode_api.d in a
core/sys/windows directory under one of the import search paths.

OK. So, since I don't know anything about how to "submit additions back upstream", I just enclose it here.

Could the right "upstream" person please grab hold of this and Do What Needs To Be Done(TM)?

I'm assuming that the need for this module or a module like this, is obvious with hindsight (given its existence now). Also, that the ease of accessing the OS API on the most common platform, impacts on the usage share of D. I'll be happy to explain further if desired.


Cheers, hth., & TIA.,

- Alf
module core.sys.windows.unicode_based_api;
import core.sys.windows.windows;

alias SetCurrentDirectoryW SetCurrentDirectory;
alias GetSystemDirectoryW GetSystemDirectory;
alias GetCurrentDirectoryW GetCurrentDirectory;
alias CreateDirectoryW CreateDirectory;
alias CreateDirectoryExW CreateDirectoryEx;
alias RemoveDirectoryW RemoveDirectory;
alias CreateFileW CreateFile;
alias DeleteFileW DeleteFile;
alias FindFirstFileW FindFirstFile;
alias FindNextFileW FindNextFile;
alias GetFileAttributesW GetFileAttributes;
alias CopyFileW CopyFile;
alias MoveFileW MoveFile;
alias LoadLibraryW LoadLibrary;
alias MessageBoxW MessageBox;
alias MessageBoxExW MessageBoxEx;
alias RegDeleteKeyW RegDeleteKey;
alias RegDeleteValueW RegDeleteValue;
alias RegEnumKeyExW RegEnumKeyEx;
alias RegEnumValueW RegEnumValue;
alias RegOpenKeyW RegOpenKey;
alias RegOpenKeyExW RegOpenKeyEx;
alias RegQueryInfoKeyW RegQueryInfoKey;
alias RegQueryValueW RegQueryValue;
alias RegQueryValueExW RegQueryValueEx;
alias RegCreateKeyExW RegCreateKeyEx;
alias RegSetValueExW RegSetValueEx;
alias RegConnectRegistryW RegConnectRegistry;
alias FormatMessageW FormatMessage;
alias GetUserNameW GetUserName;
alias CreateFontW CreateFont;
alias TextOutW TextOut;
alias DefWindowProcW DefWindowProc;
alias GetModuleHandleW GetModuleHandle;
alias LoadIconW LoadIcon;
alias LoadCursorW LoadCursor;
alias ExpandEnvironmentStringsW ExpandEnvironmentStrings;
alias CreateFileMappingW CreateFileMapping;
alias GetOpenFileNameW GetOpenFileName;
alias GetSaveFileNameW GetSaveFileName;
alias GetFileTitleW GetFileTitle;
alias GetObjectW GetObject;
alias LoadMenuW LoadMenu;
alias LoadBitmapW LoadBitmap;
alias PlaySoundW PlaySound;
alias CreateScalableFontResourceW CreateScalableFontResource;
alias SetDlgItemTextW SetDlgItemText;
alias GetDlgItemTextW GetDlgItemText;
alias wsprintfW wsprintf;
alias PeekConsoleInputW PeekConsoleInput;
alias ReadConsoleInputW ReadConsoleInput;
alias WriteConsoleInputW WriteConsoleInput;
alias ReadConsoleOutputW ReadConsoleOutput;
alias WriteConsoleOutputW WriteConsoleOutput;
alias ReadConsoleOutputCharacterW ReadConsoleOutputCharacter;
alias WriteConsoleOutputCharacterW WriteConsoleOutputCharacter;
alias FillConsoleOutputCharacterW FillConsoleOutputCharacter;
alias ScrollConsoleScreenBufferW ScrollConsoleScreenBuffer;
alias GetConsoleTitleW GetConsoleTitle;
alias SetConsoleTitleW SetConsoleTitle;
alias ReadConsoleW ReadConsole;
alias WriteConsoleW WriteConsole;
alias ShellExecuteW ShellExecute;

Reply via email to