I'm working on small compiler to understand these stuff and maybe
get involved with the D compiler. I wrote a front-end to a C-like
language and now I'm working on the code generator. To be more
specific, in the register allocation phase. I was using a old and
one where I put everything on stac
On Thursday, 4 September 2014 at 20:33:45 UTC, Nordlöw wrote:
On Thursday, 4 September 2014 at 20:25:52 UTC, monarch_dodra
wrote:
In the case of D, it's a C compatibility thing. Other
languages I don't know.
FYI,
auto x = 1 < 2 < 3;
as C++ is accepted (but warned about) by GCC as
x.cpp:
On Sunday, 7 September 2014 at 21:06:48 UTC, zuzuleinen wrote:
Hello,
First, here is my Linkedin profile
http://www.linkedin.com/in/andreiboar in order to make an image
of my professional background. I do realise here are really
good programmers for which this background might sound like a
j
what's an unicode alphabetic character? I misunderstood
isAlpha(), I used to think it's to validate letters like a, b, è,
é .. z etc but isAlpha('º') from std.uni module return true. How
can I validate only the letters of an unicode alphabet in D or
should I write one?
I know I can do:
bool
On Friday, 12 September 2014 at 04:04:22 UTC, Ali Çehreli wrote:
On 09/11/2014 08:04 PM, AsmMan wrote:
> what's an unicode alphabetic character?
Alphabetic is defined as Lu + Ll + Lt + Lm + Lo + Nl +
Other_Alphabetic, all of which are explained here:
http://www.unicode.org/Public/5.1.0/uc
On Friday, 12 September 2014 at 07:57:43 UTC, Ali Çehreli wrote:
On 09/11/2014 11:38 PM, AsmMan wrote:
> If I want ASCII and latin only alphabet which range should I
use?
> ie, how should I rewrite is_id() function?
This seems to be it:
import std.stdio;
import std.uni;
void main()
{
alia
Thanks Ali, I think I get close:
bool is_id(dchar c)
{
return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= 0xc0
&& c <= 0x0d || c >= 0xd8 && c <= 0xf6 || c >= 0xf8 && c <= 0xff;
}
this doesn't include some math symbols. like c >= 0xc0 did.
On Saturday, 13 September 2014 at 17:31:18 UTC, ketmar via
Digitalmars-d-learn wrote:
On Sat, 13 Sep 2014 17:09:56 +
WhatMeWorry via Digitalmars-d-learn
wrote:
I guess I was expecting them to be equivalent. I can
understand why both lengths are zero. But what is
emptyStr.ptr doing wit
On Saturday, 13 September 2014 at 23:21:09 UTC, David Nadlinger
wrote:
On Saturday, 13 September 2014 at 22:41:39 UTC, AsmMan wrote:
D string are actullay C-strings?
No. But string *literals* are guaranteed to be 0-terminated for
easier interoperability with C code.
David
ah makes sense.
On Monday, 15 September 2014 at 20:45:38 UTC, Ali Çehreli wrote:
On 09/15/2014 01:02 PM, Andrey wrote:
Can I develop commercial application with D programming
language?
Here is a short list of companies that do that:
http://wiki.dlang.org/Current_D_Use
Ali
Good list.
On Monday, 15 September 2014 at 22:45:50 UTC, Cassio Butrico
wrote:
how to transform decial point "3.15" to "3,15" comma?
Hello everyone, I am making a registry of real amounts,
and need trasformar fractional numbers,
so print coretamente.
there is some routine that do this?
Is the , (comma)
On Monday, 15 September 2014 at 23:17:51 UTC, AsmMan wrote:
On Monday, 15 September 2014 at 22:45:50 UTC, Cassio Butrico
wrote:
how to transform decial point "3.15" to "3,15" comma?
Hello everyone, I am making a registry of real amounts,
and need trasformar fractional numbers,
so print coretame
Someone said somewhere that call std.c.process.exit() isn't the
proper way to exit from a D program since it doesn't terminate
some phobos stuff. So what should I use instead of? or there's no
a replacement?
On Monday, 15 September 2014 at 23:57:59 UTC, Ali Çehreli wrote:
On 09/15/2014 04:36 PM, notna wrote:
> WCHAR lpwszUsername[254];
> debug writefln("lpwszUsername.sizeof is %s,
WCHAR.sizeof is
> %s", lpwszUsername.sizeof, WCHAR.sizeof);
> // DWORD dUsername2 = lpwszUser
On Monday, 15 September 2014 at 23:43:47 UTC, Cassio Butrico
wrote:
On Monday, 15 September 2014 at 23:24:13 UTC, AsmMan wrote:
On Monday, 15 September 2014 at 23:17:51 UTC, AsmMan wrote:
On Monday, 15 September 2014 at 22:45:50 UTC, Cassio Butrico
wrote:
how to transform decial point "3.15" t
On Monday, 15 September 2014 at 23:52:25 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Mon, Sep 15, 2014 at 11:36:54PM +, AsmMan via
Digitalmars-d-learn wrote:
Someone said somewhere that call std.c.process.exit() isn't
the proper
way to exit from a D program since it doesn't
On Monday, 15 September 2014 at 23:42:02 UTC, notna wrote:
how about "return"? :)
there is also "assert"... and pls note, scope could also be
your friend :O
On Monday, 15 September 2014 at 23:36:56 UTC, AsmMan wrote:
Someone said somewhere that call std.c.process.exit() isn't
the proper way
In which context do you use a function call without paranteses?
(considering the function doesn't has arguments or they're
default, of couse)
I want to know when/why should I use or if it depends only to
programmer's coding style..
f / baa.foo
versus
f() / baa.foo()
personally, to me, whi
On Thursday, 18 September 2014 at 06:09:54 UTC, Algo wrote:
void main()
{
import std.utf;
decode("dlang", 1);
}
Error: template std.utf.decode cannot deduce function from
argument types !()(string, int), candidates are:
D:\msc\D\dmd2\windows\bin\..\..\src\phobos\std\utf.d(924):
std.u
On Thursday, 18 September 2014 at 16:51:06 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 18 Sep 2014 16:31:08 +
Ilya Yaroshenko via Digitalmars-d-learn
wrote:
"one ring to rule them all"
UTF-8 = Lord of the encodings.
i want 42th symbol from the string. what? what do you mean
saying
On Thursday, 18 September 2014 at 16:49:14 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 18 Sep 2014 16:24:17 +
Ilya Yaroshenko via Digitalmars-d-learn
wrote:
You can choice encoding for console in Linux
yes. and i chose koi8. yet many utilities tend to ignore my
locale
when reading
On Saturday, 20 September 2014 at 18:59:03 UTC, Nordlöw wrote:
Is there a reason why popFront doesn't automatically return
what front does?
If so I'm still missing a combined variant of pop and popFront
in std.range.
Why isn't such a common operation in Phobos already?
So far I know isn't c
On Saturday, 20 September 2014 at 15:28:54 UTC, seany wrote:
consider this:
import std.conv, std.algorithm;
import core.vararg;
import std.stdio, std.regex;
void main()
{
string haystack = "ID : generateWorld;
Position : { &
I'd like to copy an array string into a appender!string() but I
can't see how to do this without loop myself over the string
array. Is there a native function or should I write it myself?
On Sunday, 21 September 2014 at 23:41:58 UTC, AsmMan wrote:
I'd like to copy an array string into a appender!string() but I
can't see how to do this without loop myself over the string
array. Is there a native function or should I write it myself?
call:
auto app = appender!string();
s
On Monday, 22 September 2014 at 00:09:22 UTC, Vladimir Panteleev
wrote:
On Sunday, 21 September 2014 at 23:48:59 UTC, AsmMan wrote:
On Sunday, 21 September 2014 at 23:41:58 UTC, AsmMan wrote:
I'd like to copy an array string into a appender!string() but
I can't see how to do this without loop m
On Monday, 22 September 2014 at 00:30:44 UTC, Vladimir Panteleev
wrote:
On Monday, 22 September 2014 at 00:18:03 UTC, AsmMan wrote:
this give undefined identifier: 'put' error. (std.array is
already included, buffer.put(string) doesn't give same error)
You need to import std.range.
Thanks, I
I have this array:
static immutable string[] months = ["jan", "fev", ...];
I need to pass it into canFind(). But it doesn't works with
immutables so I need to cast it like in canFind(cast(string[])
months, month) to work. There's a reason related to design why it
doesn't work with immutables
On Tuesday, 23 September 2014 at 03:34:22 UTC, Ali Çehreli wrote:
If it still doesn't work for you please show us a minimal
program that demonstrates the problem.
Ali
Ok, the case is the follow, I updated my dmd compiler some days
ago (after my mono crashed and I lost some of D files, I pos
Does D has C#'s string.Empty?
On Thursday, 25 September 2014 at 06:41:03 UTC, SlomoTheBrave
wrote:
On Thursday, 25 September 2014 at 05:29:37 UTC, AsmMan wrote:
Does D has C#'s string.Empty?
string.init ?
string a;
a = string.init;
assert( a == "");
does the job for the type string at least.
Thank
On Thursday, 25 September 2014 at 12:43:57 UTC, Steven
Schveighoffer wrote:
On 9/25/14 2:41 AM, SlomoTheBrave wrote:
On Thursday, 25 September 2014 at 05:29:37 UTC, AsmMan wrote:
Does D has C#'s string.Empty?
string.init ?
string a;
a = string.init;
assert( a == "");
d
On Friday, 26 September 2014 at 00:53:24 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 26 Sep 2014 00:24:27 +
AsmMan via Digitalmars-d-learn
wrote:
It made me a bit confusing. How is the implementation of string
comparasion in D?
"" has length of 0. null has length
for debugging purposes, I need to get the caller name. Is it
possible? if so, how do I do this?
void foo()
{
baa();
}
void baa()
{
wrilten(caller_name()); // foo
}
I know I could create an extra parameter and pass the current
function name as argument but it isn't a possibility for now.
Thanks guys!
I know I can combine it by making an extra variable plus a
property like this:
class Foo
{
private int a_;
void do_something1()
{
a_ = baa();
}
void do_something2()
{
if(cond) a_ = baa2();
}
@property int a()
{
return a;
}
}
This is the C#'s to do which I'm
On Friday, 26 September 2014 at 18:18:45 UTC, Steven
Schveighoffer wrote:
On 9/26/14 1:36 PM, "Marc =?UTF-8?B?U2Now7x0eiI=?=
" wrote:
Alternatively, you could create a union with a private and a
public
member with the same types, but I wouldn't recommend it.
Besides, the
members would need t
Why it does works:
void f(out int c)
{
if(some_cond)
c = 10;
}
but it doesn't?
void f(out int c = 1)
{
if(some_cond)
c = 10;
}
it give compiler error:
Error: constant 1 is not an lvalue
My question is why it doesn't works and if there's a workaround
I had just forget out and ref are same as pointers... thanks guys
I'd like to check if a function got CTFE, ie, the compiler was
able to replace my foo(s); by the computed value at compile-time.
I'm trying to convert the binary executable to assembly by using
objconv tool but I'm finding it very diffucult to find anything
in there, since some converters I've
On Thursday, 2 October 2014 at 18:02:30 UTC, Adam D. Ruppe wrote:
On Thursday, 2 October 2014 at 17:56:29 UTC, AsmMan wrote:
I'd like to check if a function got CTFE, ie, the compiler was
able to replace my foo(s); by the computed value at
compile-time.
You have to explicitly force ctfe with
On Thursday, 2 October 2014 at 18:17:12 UTC, anonymous wrote:
On Thursday, 2 October 2014 at 17:56:29 UTC, AsmMan wrote:
I'd like to check if a function got CTFE, ie, the compiler was
able to replace my foo(s); by the computed value at
compile-time.
I'm trying to convert the binary executable
Which practice do you use: if you need only one or two functions
from a module:
import myModule : func, func2;
or (import whole module, assuming no function name conflits of
course)
import myModule;
any words why one over the other are welcome.
I like the first one why it explicitly show w
On Tuesday, 7 October 2014 at 23:41:14 UTC, Joel wrote:
I have a program that runs at Windows 7 login, each time. But
it had been opening with a command prompt, so I got rid of the
prompt and now it some times crashes. I've noticed it before,
using 'write' without the prompt.
Can you post the
What I imagine as solution (I know it won't work this way, but
to give you a better idea):
for(int i = 0; i < #threads; i++){
runInThread(generateTerrain(...));
}
Are you looking for parallel?
http://dlang.org/library/std/parallelism/parallel.html
46 matches
Mail list logo