Manfred Nowak:
> _and_ foo() is not marked to have no side effects.
You are right, thank you for the quotation. So I have updated this, because
it's not a bug:
http://d.puremagic.com/issues/show_bug.cgi?id=5399
I'm sure there's a rationale behind that special case in the D specs. Is
someone ab
are there any other cstring -> dstring functions than to!string(char*) ?
something like to!(char[])(char*)
(the memory allocation bothers me)
curious. prints 12, DMD 2.051 linux
On 01/01/2011 06:15 PM, Manfred_Nowak wrote:
Ellery Newcomer wrote:
d code prints 12
prints 16 ( DMD 2.051 on win32)
-manfred
Ellery Newcomer wrote:
> d code prints 12
prints 16 ( DMD 2.051 on win32)
-manfred
Daren Scot Wilson wrote:
> As shown, the "total evil" return statement gets a value from subroutine
> foo().
>From the docs:
| Expression is allowed even if the function specifies a void return
| type. The Expression will be evaluated, but nothing will be returned.
| If the Expression has no sid
Hello. Been trying to link to some C code with gdc on 64 bit, and I've
been racking my brain over the following:
//tok.d
import std.stdio;
struct x {
union _u_{
ulong uq;
struct _s_ {
ushort dw;
uint dd;
};
_s_ s;
};
_u_ u;
http://d.puremagic.com/issues/show_bug.cgi?id=5399
Simen kjaeraas:
> One would expect that to work. If void functions did not allow returning
> the results of functions, the above function would have had to be changed
> to something like this:
>
> ReturnType!Fn wrap( alias Fn )( ParameterTypeTuple!Fn args ) {
> static if ( is( typeof( return
On 1/1/11 10:08 PM, Simen kjaeraas wrote:
This is by design, the feature is made for generic functions. Consider:
ReturnType!Fn wrap( alias Fn )( ParameterTypeTuple!Fn args ) {
return Fn( args );
}
I am not sure if this simple argument is valid – if Fn was of return
type void, you would, type
On Sat, 01 Jan 2011 20:56:20 -, Jonathan M Davis
wrote:
On Saturday 01 January 2011 11:17:36 Alex Khmara wrote:
Please help: is it compiler bug or I'm doing something wrong?
This code:
module properties;
struct PropertyList {
<-->invariant() {
<--><-->assert(1);
<-->}
<-->this(this)
Daren Scot Wilson wrote:
As shown, the "total evil" return statement gets a value from subroutine
foo(). Being somehow so perfect in its evilness, this passes through
the compiler without a burp. The resulting executable returns zero (or
my bash shell defaults to zero when receiving noth
On Saturday 01 January 2011 11:17:36 Alex Khmara wrote:
> Please help: is it compiler bug or I'm doing something wrong?
>
> This code:
>
> module properties;
>
> struct PropertyList {
> <-->invariant() {
> <--><-->assert(1);
> <-->}
>
> <-->this(this) {
> <--><-->_props = [];
> <-->}
>
> <-->s
On Saturday 01 January 2011 07:07:12 spir wrote:
> On Sat, 1 Jan 2011 13:34:47 + (UTC)
>
> useo wrote:
> > Hey guys,
> >
> > I've the following problem... when I write a simple class, for
> > example:
> >
> > ...
> > module myclasses.exampleClass;
> >
> > class exampleClass {
> > void writ
David Nadlinger Wrote:
> On 1/1/11 2:42 PM, David Nadlinger wrote:
> > There has been some discussion on this recently, but for now, rdmd
> > should be the tool to use.
>
> Oh, if you are looking for a dedicated »build tool«, you might also want
> have a look at xfBuild which was created to ma
*the* J switch.
On 1/1/11, Andrej Mitrovic wrote:
> On 1/1/11, Philippe Sigaud wrote:
>> I'm not sure it's doable at
>> compile-time right now: you need to have access to the module code, as
>> text. Do imports work in CT-evaluable functions?
>>
>> Philippe
>>
>
> You're gonna love this:
>
> mod
On 1/1/11, Philippe Sigaud wrote:
> I'm not sure it's doable at
> compile-time right now: you need to have access to the module code, as
> text. Do imports work in CT-evaluable functions?
>
> Philippe
>
You're gonna love this:
module mymodule;
void main()
{
pragma(msg, import(.stringof[7..$
I forgot to mention - it's dmd 2.051
Please help: is it compiler bug or I'm doing something wrong?
This code:
module properties;
struct PropertyList {
<-->invariant() {
<--><-->assert(1);
<-->}
<-->this(this) {
<--><-->_props = [];
<-->}
<-->string[] _props;
}
gives compiler error:
Error: __result = this is not mutable
Error:
On Sat, 1 Jan 2011 13:34:47 + (UTC)
useo wrote:
> Hey guys,
>
> I've the following problem... when I write a simple class, for
> example:
>
> ...
> module myclasses.exampleClass;
>
> class exampleClass {
> void writeHelloWorld() {
> writeln("Hello World");
> }
>
> And import myclasses.exa
> If you want I may add a bug report to Bugzilla that shows this as
> "accepts-invalid":
>
> int foo(int x) {
> return x;
> }
> void main() {
> return foo(1);
> }
Simpler:
int foo() { return 1; }
void main() {
return foo();
}
But maybe this bug report is already present.
Bye,
bear
On 1/1/11 2:42 PM, David Nadlinger wrote:
There has been some discussion on this recently, but for now, rdmd
should be the tool to use.
Oh, if you are looking for a dedicated »build tool«, you might also want
have a look at xfBuild which was created to manage module dependencies
for recompila
On 1/1/11 2:34 PM, useo wrote:
I always have to compile the mainfile-module with "dmd mainfile.d
myclasses/exampleClass.d" because of the obj-files. My projects are
always growing and I don't want list all 100 or more classes/files in
the command line. Is there any possibility to automatically im
Hey guys,
I've the following problem... when I write a simple class, for
example:
...
module myclasses.exampleClass;
class exampleClass {
void writeHelloWorld() {
writeln("Hello World");
}
And import myclasses.exampleClass in the following:
...
module mainfile;
import myclasses.exampleClass;
On Sat, Jan 1, 2011 at 11:14, bearophile wrote:
> %u:
>
>> I would like to perform compile-time reflection on a module (such as
>> enumerating all the classes inside the module) and/or on all modules in the
>> code -- are either of these possible? And if so, how?
>
> You may add your enhancement r
%u:
> I would like to perform compile-time reflection on a module (such as
> enumerating all the classes inside the module) and/or on all modules in the
> code -- are either of these possible? And if so, how?
You may add your enhancement requests here, explaining why you need them:
http://d.purem
Daren Scot Wilson:
> I'm wondering why the following compiles.
It's yet another small compiler bug, fit for Bugzilla.
If you want I may add a bug report to Bugzilla that shows this as
"accepts-invalid":
int foo(int x) {
return x;
}
void main() {
return foo(1);
}
Bye,
bearophile
On 2011-01-01 09:32, Jonathan M Davis wrote:
On Friday 31 December 2010 23:37:17 Daren Scot Wilson wrote:
I'm wondering why the following compiles. I'm using LDC. Perhaps it's a
bug, or there's some subtlety about D. I have deliberately, out of a
combination of idleness and desire for mischi
On Friday 31 December 2010 23:37:17 Daren Scot Wilson wrote:
> I'm wondering why the following compiles. I'm using LDC. Perhaps it's a
> bug, or there's some subtlety about D. I have deliberately, out of a
> combination of idleness and desire for mischief, have main() declared as
> returning
28 matches
Mail list logo