On Tuesday, 16 September 2014 at 03:05:57 UTC, Franz wrote:
On Tuesday, 16 September 2014 at 03:03:16 UTC, Franz wrote:
On Tuesday, 16 September 2014 at 02:21:42 UTC, rcor wrote:
I'm back for another round of "is this a bug, or am I doing
something stupid?".
C and D implement interface I, and
On 16/09/14 02:06, AsmMan wrote:
Neither assert or return will help. Check out this code example:
void main() {
f();
}
void f() {
if(!foo)
exit(1);
do_something();
}
If you want to exit the application with exit code 1 then it sounds like
something has gone wrong. In that case,
On 09/15/2014 07:21 PM, rcor wrote:
I'm back for another round of "is this a bug, or am I doing something
stupid?".
C and D implement interface I, and I have an array of each. I'd like to
combine these into one I[], but eventually I'd like to cast an element
back to its original type.
interface
seemingly even weirder:
I[] i0 = [new C, new C];
assert(cast(C) i0[0]); // fine
C[] c = [new C, new C];
I[] i1 = cast(I[]) c;
assert(cast(C) i1[0]); // fails
It works when I create an I[] from a C[] literal, but not when I
cast a previously declared C[] to an I[].
On Tuesday, 16 September 2014 at 03:05:57 UTC, Franz wrote:
Your issue comme from auto.
i is a I[]
I expected i to be an I[], but shouldn't a casting an element of
an I[] to a C return either a C or null?
It is if I do this:
I[] i = [cast(I) new C, new D];
assert(cast(C) i[0]); // fine
C
On Tuesday, 16 September 2014 at 03:03:16 UTC, Franz wrote:
On Tuesday, 16 September 2014 at 02:21:42 UTC, rcor wrote:
I'm back for another round of "is this a bug, or am I doing
something stupid?".
C and D implement interface I, and I have an array of each.
I'd like to combine these into one
On Tuesday, 16 September 2014 at 02:21:42 UTC, rcor wrote:
I'm back for another round of "is this a bug, or am I doing
something stupid?".
C and D implement interface I, and I have an array of each. I'd
like to combine these into one I[], but eventually I'd like to
cast an element back to its
I'm back for another round of "is this a bug, or am I doing
something stupid?".
C and D implement interface I, and I have an array of each. I'd
like to combine these into one I[], but eventually I'd like to
cast an element back to its original type.
interface I {}
class C : I {}
class D : I
On Tue, 16 Sep 2014 01:09:27 +
amparacha via Digitalmars-d-learn
wrote:
first change:
bool function(T)(T val1,T val2) ptr=∁
to
auto ptr = &comp!T;
second change:
int partition(T)(T[]list,bool function(T)(T val1,T val2)ptr,int left,int
right)}
to
int partition(T)(T[]list,bool functio
You can get the code to compile with two changes:
bool function(T)(T val1,T val2) ptr=∁
should be:
bool function(T val1,T val2) ptr=&comp!T;
The function pointer itself isn't a template, so it doesn't need
the (T) parameter. Instead, since it is inside a template, you
can just use the T fr
On Tuesday, 16 September 2014 at 01:11:49 UTC, AsmMan wrote:
In which context do you use a function call without paranteses?
It is really just personal preference, people tend to leave the
parens off when they just add subjective noise. A good rule
though would be to leave the parens off when
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
Can anyone looks at the following code to fix it.I am having
error when using pointers to functions with argument of type
T.This is a small portion of a program doing a generic quick sort
by passing a comparison function as an argument.
import std.stdio;
int main(){
return 0;
}
bool comp(T)(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
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 terminate s
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: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 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 = lpwszUsername.sizeof / WCHAR.sizeof;
> DWORD dUsername2 = 254;
>
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 terminate some phobos
> stuff. So what should I use instead of? or there's no a replacement?
AFAI
btw., thats the only thing I found for the given error... which
is +10years old:
http://forum.dlang.org/thread/ccto20$18bq$1...@digitaldaemon.com
On Monday, 15 September 2014 at 23:36:53 UTC, notna wrote:
Hi all.
...
OUTPUT incl. "ERROR":
-
core.exception.UnicodeE
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" to "3,15" comma?
Hello everyone, I am making a registry of real amoun
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 to exit from a D program since it doesn't terminate
some ph
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?
Hi all.
somehow, for me, the following is against the "DMD philosophy",
because this code builds successfully with DMD and the executable
gives the expected result... but also the below strange
messages...
CODE:
-
module main;
import std.stdio;
import std.c.windows.windows;
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
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 Mon, 15 Sep 2014 22:47:32 +
Cassio Butrico via Digitalmars-d-learn
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 correctly. there is some
> routine that do
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 correctly. there is some
routine that do this?
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?
no. it works the way it's intended to work. given that order of
module
imports is not defined (i.e. reordering imports should not
affect
resulting code), making 'version=' propagating to other modules
will
create disasterous side effects, even weirder than C macro
abusing.
Okay, thanks for th
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 Mon, 15 Sep 2014 21:26:27 +
dcrepid via Digitalmars-d-learn
wrote:
> Could this be considered a defect of design?
no. it works the way it's intended to work. given that order of module
imports is not defined (i.e. reordering imports should not affect
resulting code), making 'version=' prop
On Monday, 15 September 2014 at 13:50:22 UTC, 岩倉 澪 wrote:
Hi all,
I've been reading D Cookbook, in which the author recommends
the use of mixin templates to essentially hold boilerplate code
for classes (page 28). Referencing TDPL reaffirms this
strategy. With this design choice in mind, I wo
On Monday, 15 September 2014 at 20:02:39 UTC, Andrey wrote:
Can I develop commercial application with D programming
language?
Short answer: Yes, you can, you don't need to even think about it.
Long answer: Yes, as long as you conform to the Boost v1.0
license, meaning that if you distribute a
I'm a bit baffled why using something like this doesn't get
recognized by imported modules:
version = Unicode;
I use this to try and alter the way the win32 API headers resolve
certain symbols, but currently the only way to force that version
symbol to be recognized correctly is to define it
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
On Mon, 15 Sep 2014 20:02:37 +, Andrey wrote:
> Can I develop commercial application with D programming language?
There isn't anything in licensing of DMD, GDC, LDC, or the standard
library which would prevent you from using them to create commercial
applications.
On Mon, 15 Sep 2014 20:02:37 +
Andrey via Digitalmars-d-learn
wrote:
> Can I develop commercial application with D programming language?
why not? but better ask your employer, maybe your work contract has
some restrictions.
signature.asc
Description: PGP signature
Can I develop commercial application with D programming language?
On Monday, 15 September 2014 at 12:11:09 UTC, Paul Z. Barsan
wrote:
Variables like CAIRO_HAS_XLIB_SURFACE are platform specific,
xlib and xcb surfaces are for linux, win32 and directfb
surfaces are for windows and so on.. I will search in dubs
documentation how can I specify this sort of vari
Hi all,
I've been reading D Cookbook, in which the author recommends the
use of mixin templates to essentially hold boilerplate code for
classes (page 28). Referencing TDPL reaffirms this strategy. With
this design choice in mind, I would like to be able to use a
mixin template that creates a
Hi Andre,
I've found a solution to the repainting problem. If you tick the
"Disable visual themes" in the compatibility tab of the program
properties (associated with the program icon) the button is only
repainted when the mouse cursor enters and exits the button area.
Regards, -=mike=-
On
On Monday, 15 September 2014 at 12:19:11 UTC, Edwin van Leeuwen
wrote:
Out of curiosity: What does deimos.cairo add to cairoD? More
higher level/d-like API?
Cheers, Edwin
It's the other way around: cairoD adds D-style wrappers but
underneath they use C-style bindings(found in
cairoD/src/
On Monday, 15 September 2014 at 12:11:09 UTC, Paul Z. Barsan
wrote:
On Sunday, 14 September 2014 at 14:37:05 UTC, Robert burner
Schadek wrote:
If you look at deimos.cairo you will see that the latest commit
was made 2 years ago while cairoD was last updated 6 months ago.
I think the latest c
On Sunday, 14 September 2014 at 14:37:05 UTC, Robert burner
Schadek wrote:
use gtkd they have a cairo binding
Well, umm.. the fact is that I want to make my own lightweight
cross-platform widget toolkit from scratch and a gtkd dependency
is a big no-no.
On Sunday, 14 September 2014 at 14:45
45 matches
Mail list logo