October 18, 2003
"Walter" <walter@digitalmars.com> wrote in message news:bmqatt$2qed$1@digitaldaemon.com...
> > "d.win32.registry" would be a lot easier on my eyes.
>
> What happened was that I'd prefer just 'd', but it wound up causing
problems
> because 'd' was commonly used as a local variable name. 'D' is rarely
used,
> so seemed to make better sense.
>
> Compromises everywhere, sigh <g>.

Does alias work on modules?

import D;
alias D phobos;

phobos.foo();

If not, is there some other local renaming scheme?  I may really want to use variables called D.

Sean


October 18, 2003
"J C Calvarese" <jcc7@cox.net> wrote in message news:bmq3jm$2h8v$1@digitaldaemon.com...
> Walter wrote:
> > http://www.digitalmars.com/d/changelog.html
>
> I downloaded the .zip to view the changelog (since the website hasn't
> been updated yet) and noticed...
>      * Added D.win32.registry.
>
> What happened to . . .
> "By convention, package and module names are all lower case. This is
> because those names have a one-to-one correspondence with the operating
> system's directory and file names, and many file systems are not case
> sensitive. All lower case package and module names will minimize
> problems moving projects between dissimilar file systems."
> (http://www.digitalmars.com/d/module.html)
>
> "d.win32.registry" would be a lot easier on my eyes.

I agree. However Walter's rationale is that this would break existing code where d is used as an identifier.

My opinion is that the language is developing, and it should be able to break anything until 1.0 is released. Also, Walter's argument ignores where people may have used D rather than d as an identifier. Sure. it's less common, but if one can happen, so can the other.

I don't see the point of introducing a glaring and permanent inconsistency just to avoid some reworking of what can only be a small user base (at this time).

Still, it's not my party, I'm just one of the guests ...




October 18, 2003
>That is a problem, I'm not sure what to do about it. One thing I have been looking for is a mapping from Shift-JIS to unicode. Do you have such a table?

Mapping tables between unicode and east-asian encodings can be found here:
ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/
Though marked as OBSOLETE, they're the most reliable tables, i think.

But sadly, on Windows, the codeset for Japanese is NOT Shift-JIS actually.
Microsoft uses their (slightly different) variant of ShiftJIS, called CP932 :P.
The table is:
ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT
or you can do the conversion by single Win32 API call:
WideCharToMultiByte() : convert from UTF-16 to SystemDefaultCodePage(CP_ACP) etc

I've never programmed on linux but on Linux, maybe libiconv:
http://www.gnu.org/software/libiconv/
will do.


October 18, 2003
>That is a problem, I'm not sure what to do about it. One thing I have been looking for is a mapping from Shift-JIS to unicode. Do you have such a table?

A simple way is "WideCharToMultiByte(CP_ACP ... " of Windows.
This API can convert not only SHIFT-JIS but also any multi-byte character
set on another country version Windows.

Thanks.
YT

October 18, 2003
In article <bmqv3a$lok$1@digitaldaemon.com>, Walter says...
>
>
>"Y.Tomino" <demoonlit@inter7.jp> wrote in message news:bmqjsv$4br$1@digitaldaemon.com...
>> >I don't have a good way to test out the unicode identifiers,
>> >anyone using a Japanese unicode text editor or similar want to give it a
>> try?
>>
>> I tried the unicode identifiers as UTF-8.
>> It succeed.
>
>Great!
>
>> But Japanease in string literals have to be SHIFT-JIS(Multi-Byte Encoding)
>> for "printf" and "stdout.writeLine".
>> It's troubled as a result.
>> C and D runtime were not created to use unicode.
>
>That is a problem, I'm not sure what to do about it. One thing I have been looking for is a mapping from Shift-JIS to unicode. Do you have such a table?
>
>> YT
>>
>> ------------------------
>> alias printf $BI=<((B;
>>
>> int main()
>> {
>>  $BI=<((B("$B$3$s$K$A$O(B\n");
>>  return 0;
>> }
>>
>
>

In Japanese, it looks as follows.
win xp
http://hp.vector.co.jp/authors/VA031566/jpstring/jpstring.html


October 18, 2003
Walter wrote:

> "J C Calvarese" <jcc7@cox.net> wrote in message
> news:bmq3jm$2h8v$1@digitaldaemon.com...
> 
>>Walter wrote:
>>
>>>http://www.digitalmars.com/d/changelog.html
>>
>>I downloaded the .zip to view the changelog (since the website hasn't
>>been updated yet) and noticed...
>>     * Added D.win32.registry.
>>
>>What happened to . . .
>>"By convention, package and module names are all lower case. This is
>>because those names have a one-to-one correspondence with the operating
>>system's directory and file names, and many file systems are not case
>>sensitive. All lower case package and module names will minimize
>>problems moving projects between dissimilar file systems."
>>(http://www.digitalmars.com/d/module.html)
>>
>>"d.win32.registry" would be a lot easier on my eyes.
> 
> 
> What happened was that I'd prefer just 'd', but it wound up causing problems
> because 'd' was commonly used as a local variable name. 'D' is rarely used,
> so seemed to make better sense.
> 
> Compromises everywhere, sigh <g>.
> 

Okay, that's a legitimate problem.  Whenever stuff is added to phobos, it could break existing code.  I think there might be a better solution though.

I really feel phobos needs to be in its own package anyways to lessen conflict issues.  Yes, it will break existing code.  Many improvements break existing code.  It should be relatively easy to fix.  (All of my imports are grouped together at the top of my code.  Isn't that how it's usually done?)

Will phobos.win32.registry conflict with anything?  I doubt it.

import phobos.string;
import phobos.stream;
import phobos.windows;
import phobos.win32.registry;

(It seems to me it's a poor convention if the one who established it can't be persuaded to follow it.)


October 18, 2003
"Sean L. Palmer" <palmer.sean@verizon.net> wrote in message news:bmr1an$ogm$1@digitaldaemon.com...
> "Walter" <walter@digitalmars.com> wrote in message news:bmqatt$2qed$1@digitaldaemon.com...
> > > "d.win32.registry" would be a lot easier on my eyes.
> >
> > What happened was that I'd prefer just 'd', but it wound up causing
> problems
> > because 'd' was commonly used as a local variable name. 'D' is rarely
> used,
> > so seemed to make better sense.
> >
> > Compromises everywhere, sigh <g>.
>
> Does alias work on modules?
>
> import D;
> alias D phobos;
>
> phobos.foo();

It should work. But D will still be visible.

> If not, is there some other local renaming scheme?  I may really want to
use
> variables called D.

You still can use variables named D. You just can't write:
    int D;
    D = D.foo();
but will need to write instead:
    int D;
    D = .D.foo();


October 18, 2003
"hideki.i" <hideki.i_member@pathlink.com> wrote in message news:bmrif7$1ect$1@digitaldaemon.com...
> In Japanese, it looks as follows.
> win xp
> http://hp.vector.co.jp/authors/VA031566/jpstring/jpstring.html

Totally cool!


October 18, 2003
Ah, this is what I need. Thanks to you and Y. Tomino!


1 2
Next ›   Last »