[1]
Yesterday I tried to build a project with dub. dub had downloaded
and installed dmd v2.065. The project and accompanying library
had been built with dmd v2.064. dub said that the project was up
to date and didn't need compiling. However, I got a long long
error message informing me that
Chris:
[2]
Another issue I encountered was when I recompiled the library,
dmd 2.065 gave me an error that a goto statement skipped a
variable. The case is as follows:
if (condition) {
goto Label;
}
auto variable = getVariableValue(); // Only needed, if
condition above not true
// do
On Friday, 14 March 2014 at 10:49:57 UTC, bearophile wrote:
Chris:
[2]
Another issue I encountered was when I recompiled the library,
dmd 2.065 gave me an error that a goto statement skipped a
variable. The case is as follows:
if (condition) {
goto Label;
}
auto variable =
Chris:
Thanks for the answer. Any particular reason why the variable
declaration should not be skipped? Security? Code generation?
In D all variables get initialized at the definition point
(unless you add a = void). A goto skips this initialization,
and this breaks certain safety generates
In D all variables get initialized at the definition point
(unless you add a = void). A goto skips this initialization,
and this breaks certain safety generates D relies on.
Look for @safe functions:
void main() @safe {
int* p = void;
}
test.d(2,10): Error: variable test.main.p void
On Friday, 14 March 2014 at 11:14:15 UTC, bearophile wrote:
Chris:
Thanks for the answer. Any particular reason why the variable
declaration should not be skipped? Security? Code generation?
In D all variables get initialized at the definition point
(unless you add a = void). A goto skips
On Friday, 14 March 2014 at 11:41:49 UTC, Chris wrote:
Interesting, though, that I got away with it until v2.065.
DMD still has quite a lot of accepts-invalid bugs.
On 3/14/2014 7:43 PM, Chris wrote:
[1]
Yesterday I tried to build a project with dub. dub had downloaded and
installed dmd v2.065. The project and accompanying library had been
I'm curious what you mean by this. I don't see any way to get DMD
through dub.
built with dmd v2.064. dub said
On 3/14/2014 7:43 PM, Chris wrote:
[3]
Last but not least, could [2] have triggered the error I got in [1]?
[Part of error message]
source/lib//libdlts.a(regex_770_e66.o): In function
This comes from a Rosettacode entry:
http://rosettacode.org/wiki/First-class_functions#D
import std.stdio, std.math, std.typetuple, std.functional;
enum static sin = (in real x) pure nothrow = std.math.sin(x),
asin = (in real x) pure nothrow = std.math.asin(x),
cos =
On Friday, 14 March 2014 at 14:11:45 UTC, Mike Parker wrote:
On 3/14/2014 7:43 PM, Chris wrote:
[1]
Yesterday I tried to build a project with dub. dub had
downloaded and
installed dmd v2.065. The project and accompanying library had
been
I'm curious what you mean by this. I don't see any
Bauss:
When compiling manual through command line is there anyway to
get the compiling errors? Something like an error.log file or
whatever. Perhaps an argument for the compiler? I checked the
documents but didn't seem like there was anything.
Thanks.
Probably you have to use redirect to
When compiling manual through command line is there anyway to get
the compiling errors? Something like an error.log file or
whatever. Perhaps an argument for the compiler? I checked the
documents but didn't seem like there was anything.
Thanks.
On 03/14/2014 09:37 AM, bearophile wrote:
This comes from a Rosettacode entry:
http://rosettacode.org/wiki/First-class_functions#D
import std.stdio, std.math, std.typetuple, std.functional;
enum static sin = (in real x) pure nothrow = std.math.sin(x),
asin = (in real x) pure
On Friday, 14 March 2014 at 16:58:09 UTC, bearophile wrote:
Bauss:
When compiling manual through command line is there anyway to
get the compiling errors? Something like an error.log file or
whatever. Perhaps an argument for the compiler? I checked the
documents but didn't seem like there
On Friday, 14 March 2014 at 17:10:53 UTC, John Colvin wrote:
On Friday, 14 March 2014 at 16:38:00 UTC, bearophile wrote:
This comes from a Rosettacode entry:
http://rosettacode.org/wiki/First-class_functions#D
import std.stdio, std.math, std.typetuple, std.functional;
enum static sin = (in
On Friday, 14 March 2014 at 16:38:00 UTC, bearophile wrote:
This comes from a Rosettacode entry:
http://rosettacode.org/wiki/First-class_functions#D
import std.stdio, std.math, std.typetuple, std.functional;
enum static sin = (in real x) pure nothrow = std.math.sin(x),
asin = (in
On Friday, 14 March 2014 at 00:07:12 UTC, bearophile wrote:
Justin Whear:
It did change a few versions ago (not sure exactly when). Try
adding
`align(1):` inside the structs before the members.
Yes it's a recent change, the align() on outside is the
alignment of the whole struct, and the
Ali Çehreli:
DMD64 D Compiler v2.066-devel-1a70764 prints the following for
me:
0.500 0.500
0.500 0.500
0.500 0.500
Maybe a bug fixed?
Probably yes, thank for all the answers :-)
Bye,
bearophile
John Colvin:
(You can't define a staticZip in D?)
You can. I hope it will end up in in std.meta, along with a
whole load of other such goodies that I've been working on :)
Is the code for staticZip somewhere online?
Bye,
bearophile
TJB:
Do you have any suggestions for improving the speed in this
situation?
I have never used readExact so far, so I don't have many
suggestions. But try to not pack the struct.
Bye,
bearophile
On Friday, 14 March 2014 at 18:26:36 UTC, bearophile wrote:
TJB:
Do you have any suggestions for improving the speed in this
situation?
I have never used readExact so far, so I don't have many
suggestions. But try to not pack the struct.
Given he's using a raw read, I suspect he doesn't
On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote:
Do you have any suggestions for improving the speed in this
situation?
Thank you!
TJB
I expect you'd get better performance with std.stdio rather than
std.stream. stream is class based and (AFAIK) not as optimized
for performance.
I'd
On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote:
I have a program in C++ that I am translating to D as a way to
investigate and learn D. The program is used to process
potentially hundreds of TB's of financial transactions data so
it is crucial that it be performant. Right now the C++
On Friday, 14 March 2014 at 04:36:27 UTC, ed wrote:
As to whether or not this should work:
int[4] a=[1,2,3,4];
int[2][2] b;
b=a;
is up to the D language gurus. I think it should... but I'm no
language developer, there may be other side-effects I haven't
thought about.
Cheers,
ed
In C,
On 3/22/05, 3:00 PM, AEon wrote:
Jan Knepper wrote:
Testing Modzilla Thunderbird...
AEon
test
On Friday, 14 March 2014 at 19:11:12 UTC, Craig Dillabaugh wrote:
On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote:
I have a program in C++ that I am translating to D as a way to
investigate and learn D. The program is used to process
potentially hundreds of TB's of financial transactions
Hi All,
I would expect both blocks of code below to behave in the same
manner but they don't.
---
void main()
{
int[] a = [1,2,3,4];
int[2][2] b = a; // fine, does an array copy
}
---
void main()
{
int[] a=[1,2,3,4];
int[2][2] b;
b = a; // compile time error
}
---
Is it a
ed:
void main()
{
int[] a = [1,2,3,4];
int[2][2] b = a; // fine, does an array copy
}
Is it a bug or by design?
That looks like a compiler bug. You are supposed to use a cast to
do an assignment like that.
Bye,
bearophile
On Friday, 14 March 2014 at 23:10:57 UTC, bearophile wrote:
ed:
void main()
{
int[] a = [1,2,3,4];
int[2][2] b = a; // fine, does an array copy
}
Is it a bug or by design?
That looks like a compiler bug. You are supposed to use a cast
to do an assignment like that.
Bye,
On Friday, 14 March 2014 at 19:24:21 UTC, Chris Williams wrote:
It looks like you might be right after all about the code being
invalid D. It could be a bug when it compiles without the cast.
I filed a bug report about it, see where it leads :D
Thanks,
ed
A small question about the D type system. Currently this code
doesn't compile:
int[5] foo(int[2] a, int[3] b) {
return a ~ b;
}
void main() {}
test.d(2,12): Error: cannot implicitly convert expression
(cast(int[])a ~ cast(int[])b) of type int[] to int[5]
But I think it's easy to
On Saturday, 15 March 2014 at 00:11:22 UTC, bearophile wrote:
Do you think it's useful/worth supporting code like that?
My expectation would be that your code is implicitly the same as:
int[5] foo(int[2] a, int[3] b) {
int[5] staticArray;
int[] dynamicArray = a ~ b;
staticArray =
On Saturday, 15 March 2014 at 00:11:22 UTC, bearophile wrote:
Do you think it's useful/worth supporting code like that?
Yes, I'm surprised that doesn't currently work. I hate how static
arrays throw away their length at the drop of a hat. In the
meantime, here's a workaround:
T[N + M]
On Saturday, 15 March 2014 at 01:14:02 UTC, Meta wrote:
On Saturday, 15 March 2014 at 00:11:22 UTC, bearophile wrote:
Do you think it's useful/worth supporting code like that?
Yes, I'm surprised that doesn't currently work. I hate how
static arrays throw away their length at the drop of a
On Friday, 14 March 2014 at 17:10:46 UTC, Bauss wrote:
I'm using dmd.exe and not cmd.exe
dmd.exe doesn't have a GUI. You're probably running dmd.exe
inside cmd.exe.
dmd foo.d mylog.txt
Chris Williams:
Short of changing the standard to consider a = b to be
equivalent to a[] = b when both a and b are arrays, I don't
think your code should be handled. And I think such a change
would be dangerous..
I think I was the one that has asked for the systematic
introduction of such
37 matches
Mail list logo