On 02/26/2011 01:56 AM, bearophile wrote:
Is this program showing a bug in multiple assignments (DMD 2.052)?
void main() {
int i;
int[2] x;
i, x[i] = 1;
assert(x == [1, 0]); // OK
int j;
int[2] y;
y[j], j = 1;
assert(y == [0, 0]); // Not OK
}
At the
On 02/26/2011 04:26 AM, Steven Schveighoffer wrote:
Let me fix that for you:
func(j++, y[j])
That should be illegal: a statement used as expression, but keeping it's effect
anyway, and not the least kind of, namely an assignment, meaning a change of
the program state.
Denis
--
On Saturday 26 February 2011 00:51:45 spir wrote:
On 02/26/2011 04:26 AM, Steven Schveighoffer wrote:
Let me fix that for you:
func(j++, y[j])
That should be illegal: a statement used as expression, but keeping it's
effect anyway, and not the least kind of, namely an assignment,
I noticed in windows with D you can use .res (eg. dmd main.d smile.res)
files for icons any way. but how do you make icon .res files?
On 2011-02-26 01:28, simendsjo wrote:
C is not my strong side, so I'm having some problems wrapping some code.
I found a couple of sources on this:
1) http://www.digitalmars.com/d/2.0/htomodule.html
2) http://www.digitalmars.com/d/2.0/interfaceToC.html
1)
C's long is the same as D's int.
long
On 2011-02-26 02:35, Jonathan M Davis wrote:
On Friday, February 25, 2011 17:16:31 simendsjo wrote:
On 26.02.2011 02:06, bearophile wrote:
simendsjo:
So.. A long in C is the same as the platform size? And long long doesn't
exist in 64 bit?
In D the size of int/uint is 32 bits and long/ulong
On 2011-02-26 07:20, Tom wrote:
El 25/02/2011 20:07, Jacob Carlborg escribió:
On 2011-02-25 21:11, Tom wrote:
El 24/02/2011 19:40, Tom escribió:
El 24/02/2011 09:51, Jacob Carlborg escribió:
On 2011-02-24 06:48, Tom wrote:
Hi, how can I create an empty element with current D2 std.xml
I'm trying to use the std.regex module but when I run my application I
get an exception. The exception message says:
*+? not allowed in atom
The code I have is:
import std.regex;
void main ()
{
regex(`\.(?=(?:[^\]*\[^\]*\)*(?![^\]*\))`, m);
}
I'm compiling this with DMD 2.052 on Mac OS
On 2011-02-26 01:20:49 +0100, Jonathan M Davis said:
So, using such assertions makes good sense when you control
both the caller and the callee and it's something that should never happen.
Yeah, in my case that's what's going on. I'll only be using the
contracts during testing anyway, and
On 26.02.2011 14:10, Jacob Carlborg wrote:
I'm trying to use the std.regex module but when I run my application I
get an exception. The exception message says:
*+? not allowed in atom
The code I have is:
import std.regex;
void main ()
{
regex(`\.(?=(?:[^\]*\[^\]*\)*(?![^\]*\))`, m);
}
== Quote from Joel Christensen (joel...@gmail.com)'s article
I noticed in windows with D you can use .res (eg. dmd main.d smile.res)
files for icons any way. but how do you make icon .res files?
With a resource compiler. Digital Mars supplies one as part of its C++
utilities package:
On 2011-02-26 12:29, Dmitry Olshansky wrote:
On 26.02.2011 14:10, Jacob Carlborg wrote:
I'm trying to use the std.regex module but when I run my application I
get an exception. The exception message says:
*+? not allowed in atom
The code I have is:
import std.regex;
void main ()
{
On Saturday 26 February 2011 03:24:15 Magnus Lie Hetland wrote:
On 2011-02-26 01:20:49 +0100, Jonathan M Davis said:
So, using such assertions makes good sense when you control
both the caller and the callee and it's something that should never
happen.
Yeah, in my case that's what's
On 02/26/2011 12:24 PM, Magnus Lie Hetland wrote:
However, I could always add a call to my unit test, run it, and see it crash --
and then comment it out. Doesn't seem like the prettiest way to handle things,
but it's OK, I guess together with the idea of making the contracts
super-simple (and
On 2/26/11 1:15 PM, Jonathan M Davis wrote:
[…] And from a perfectly practical standpoint, as soon as your code ends
up in a library, assertions are generally useless anyway,[…]
I don't quite think asserts are useless in libraries. If you need to
care about performance in a library, you hit
On 2011-02-26 13:15:58 +0100, Jonathan M Davis said:
On Saturday 26 February 2011 03:24:15 Magnus Lie Hetland wrote:
OK. I had the impression that using assert() in contracts was standard,
also for API functions. I thought contracts fulfilled a similar sort of
function to assert(), in that
On 2011-02-26 15:20:19 +0100, David Nadlinger said:
On 2/26/11 1:15 PM, Jonathan M Davis wrote:
[...] And from a perfectly practical standpoint, as soon as your code ends
up in a library, assertions are generally useless anyway,[...]
I don't quite think asserts are useless in libraries. If
It's documented here...
http://www.digitalmars.com/d/2.0/phobos/std_cover.html
... but I can't find it in the Phobos source. (Also, I can't import it
-- which is perhaps the most pressing issue :)
It's just that I'm using rdmd (for convenience), but then I don't know
where any coverage
On 02/26/2011 11:49 AM, Jacob Carlborg wrote:
On 2011-02-26 01:28, simendsjo wrote:
C is not my strong side, so I'm having some problems wrapping some code.
I found a couple of sources on this:
1) http://www.digitalmars.com/d/2.0/htomodule.html
2)
On 2/26/11 4:08 PM, Magnus Lie Hetland wrote:
On 2011-02-26 15:20:19 +0100, David Nadlinger said:
On 2/26/11 1:15 PM, Jonathan M Davis wrote:
[...] And from a perfectly practical standpoint, as soon as your code
ends
up in a library, assertions are generally useless anyway,[...]
I don't
On 2011-02-26 12:29, Dmitry Olshansky wrote:
On 26.02.2011 14:10, Jacob Carlborg wrote:
I'm trying to use the std.regex module but when I run my application I
get an exception. The exception message says:
*+? not allowed in atom
The code I have is:
import std.regex;
void main ()
{
On 26.02.2011 17:06, Mike Wey wrote:
On 02/26/2011 11:49 AM, Jacob Carlborg wrote:
On 2011-02-26 01:28, simendsjo wrote:
C is not my strong side, so I'm having some problems wrapping some code.
I found a couple of sources on this:
1) http://www.digitalmars.com/d/2.0/htomodule.html
2)
d coder dlang.co...@gmail.com writes:
Greetings
I tried to initialize a struct member with a function pointer, and
found that DMD2 did not like it. Are not function pointers compile
time constants? And why they should not be?
Regards
- Cherry
I just want to point out that this *should*
On 2011-02-26 16:30:10 +0100, Magnus Lie Hetland said:
It's documented here...
http://www.digitalmars.com/d/2.0/phobos/std_cover.html
... but I can't find it in the Phobos source. (Also, I can't import it
-- which is perhaps the most pressing issue :)
It's just that I'm using rdmd (for
On 26.02.2011 19:52, Jacob Carlborg wrote:
On 2011-02-26 12:29, Dmitry Olshansky wrote:
On 26.02.2011 14:10, Jacob Carlborg wrote:
I'm trying to use the std.regex module but when I run my application I
get an exception. The exception message says:
*+? not allowed in atom
The code I have is:
Jonathan M Davis jmdavisp...@gmx.com writes:
On Friday, February 25, 2011 17:31:36 Ali Çehreli wrote:
On 02/25/2011 05:09 PM, bearophile wrote:
int j;
int[2] y;
y[j] = j = 1;
I think that's undefined behavior in C and C++. It is not defined
whether j's previous or
On 02/26/2011 05:58 PM, simendsjo wrote:
On 26.02.2011 17:06, Mike Wey wrote:
On 02/26/2011 11:49 AM, Jacob Carlborg wrote:
On 2011-02-26 01:28, simendsjo wrote:
C is not my strong side, so I'm having some problems wrapping some
code.
I found a couple of sources on this:
1)
On 27-Feb-11 12:56 AM, J Chapman wrote:
== Quote from Joel Christensen (joel...@gmail.com)'s article
I noticed in windows with D you can use .res (eg. dmd main.d smile.res)
files for icons any way. but how do you make icon .res files?
With a resource compiler. Digital Mars supplies one as
class Class{}
void main()
{
Class myClass;
Class* pClass0 = myClass; // OK
Class* pClass1 = new Class; // Error: cannot implicitly convert [8]
// expression (new Class) of type t.Class
// to test.Class*
Class* pClass2 = (new
On 27-Feb-11 11:24 AM, Joel Christensen wrote:
On 27-Feb-11 12:56 AM, J Chapman wrote:
== Quote from Joel Christensen (joel...@gmail.com)'s article
I noticed in windows with D you can use .res (eg. dmd main.d smile.res)
files for icons any way. but how do you make icon .res files?
With a
Tyro[a.c.edwards] nos...@home.com wrote:
class Class{}
void main()
{
Class myClass;
Class* pClass0 = myClass; // OK
Class* pClass1 = new Class; // Error: cannot implicitly convert [8]
// expression (new Class) of type t.Class
//
On 2/27/2011 8:10 AM, Simen kjaeraas wrote:
Tyro[a.c.edwards] nos...@home.com wrote:
class Class{}
void main()
{
Class myClass;
Class* pClass0 = myClass; // OK
Class* pClass1 = new Class; // Error: cannot implicitly convert [8]
// expression (new Class) of type t.Class
// to test.Class*
Tyro[a.c.edwards] nos...@home.com wrote:
I'm trying to convert some c++ code that defines
T func(par...)
{
Controller * pCtrl = WinGetLongController * (hwnd);
.
.
.
switch(msg)
{
case FirstMatch:
pCtrl = new Controller (hwnd, reinterpret_castCREATESTRUCT *
On 2/27/2011 8:52 AM, Simen kjaeraas wrote:
Tyro[a.c.edwards] nos...@home.com wrote:
I'm trying to convert some c++ code that defines
T func(par...)
{
Controller * pCtrl = WinGetLongController * (hwnd);
.
.
.
switch(msg)
{
case FirstMatch:
pCtrl = new Controller (hwnd,
On Saturday 26 February 2011 11:18:20 Dan Olson wrote:
Jonathan M Davis jmdavisp...@gmx.com writes:
On Friday, February 25, 2011 17:31:36 Ali Çehreli wrote:
On 02/25/2011 05:09 PM, bearophile wrote:
int j;
int[2] y;
y[j] = j = 1;
I think that's undefined
On Saturday 26 February 2011 07:03:29 Magnus Lie Hetland wrote:
On 2011-02-26 13:15:58 +0100, Jonathan M Davis said:
On Saturday 26 February 2011 03:24:15 Magnus Lie Hetland wrote:
OK. I had the impression that using assert() in contracts was standard,
also for API functions. I thought
On 2/27/2011 9:46 AM, Tyro[a.c.edwards] wrote:
On 2/27/2011 8:52 AM, Simen kjaeraas wrote:
Tyro[a.c.edwards] nos...@home.com wrote:
I'm trying to convert some c++ code that defines
T func(par...)
{
Controller * pCtrl = WinGetLongController * (hwnd);
.
.
.
switch(msg)
{
case FirstMatch:
pCtrl
On Saturday 26 February 2011 08:23:41 David Nadlinger wrote:
On 2/26/11 4:08 PM, Magnus Lie Hetland wrote:
On 2011-02-26 15:20:19 +0100, David Nadlinger said:
On 2/26/11 1:15 PM, Jonathan M Davis wrote:
[...] And from a perfectly practical standpoint, as soon as your code
ends
up in a
Apologies for the late reply, but this could help:
As you've already seen in the other replies, the provided sc.ini file is
confounding your attempts at setting the LIB environment variable.
However, OPTLINK's search path for sc.ini includes the current
directory, so if you're reluctant to
On 2/25/2011 7:24 PM, Steven Schveighoffer wrote:
BTW, I think long long is a gnu extension, it's not standard C (I don't
think long long exists in Visual C for instance).
I'm pretty sure it's standard as of C99 (though not yet for C++; that's
coming with C++0x). MSVC does indeed support it.
On 2/26/2011 5:33 PM, Tyro[a.c.edwards] wrote:
Ok, that's essentially what I have, except that I used Controller pCtrl
vice auto. WinGetLong however, is a template that calls
GetWindowLongPtrA() and casts it's result (in this case) to Controller.
GetWindowLongPtrA() returns LONG_PTR (aka int)
41 matches
Mail list logo