Re: How do I translate this bit of code from C(using pointers) to D?

2014-08-27 Thread MacAsm via Digitalmars-d
On Tuesday, 26 August 2014 at 21:29:04 UTC, H. S. Teoh via Digitalmars-d wrote: On Tue, Aug 26, 2014 at 08:58:13PM +, MacAsm via Digitalmars-d wrote: It maybe trivial to most of you but I don't know how do this avoiding string duplications. Can someone help me? [...] in D, I can wrote

Re: Bug or what?

2014-08-27 Thread MacAsm via Digitalmars-d
On Wednesday, 27 August 2014 at 19:51:48 UTC, Phil Lavoie wrote: Ok so me and one of my colleagues have been working on some code at a distance. We both use dmd as the compiler. I am under Windows, she OSX. It is not uncommon that she experiences more strictness in the type system than I do.

How do I translate this bit of code from C(using pointers) to D?

2014-08-26 Thread MacAsm via Digitalmars-d
It maybe trivial to most of you but I don't know how do this avoiding string duplications. Can someone help me? char *str = foobaa; char *p = str; char *prev = NULL; int go(void) { int ch; ch = top(); move(1); return ch; } int top(void) { retun *p; } void back(void) { p =

Re: [OT] Microsoft filled patent applications for scoped and immutable types

2014-08-26 Thread MacAsm via Digitalmars-d
On Tuesday, 26 August 2014 at 19:37:29 UTC, Max Klyga wrote: Microsoft being microsoft again. http://www.freepatentsonline.com/y2014/0196015.html - DECLARATION OF LIFETIME OF RESOURCE REFERENCE This contains description of scoped classes, etc. Is this about C#'s usingw?

Is there a native function to detect if file is UTF encoding?

2014-08-22 Thread MacAsm via Digitalmars-d
To call decode() from std.encoding I need to make sure it is an UTF (may ne ASCII too) otherwise is will skyp over ASCII values. Is there any D native for it or I need to check byte order mark and write one myself?

Shouldn't have IsAlpha() from std.uni has a different name to avoid confusing from std.ascii?

2014-08-21 Thread MacAsm via Digitalmars-d
I'm trying to write in D rather than C++ an application where I do need to write a small parsing library. These two modules part of D standard library (no idea if it's D term to call a library/module part of the language itself) has the same name. Depeding if imported is either std.uni or