Jeff Merrick wrote:
> On page 22 of TDPL, we have the following code:
>
> import std.contracts, std.stdio;
> void main(string[] args) {
> // ...
> for (double x; readf(" %s ", &x) == 1; ) {
> // ...
> }
> // ...
> }
>
> Using DMD v2.047, I get the following error on the readf call:
>
On page 22 of TDPL, we have the following code:
import std.contracts, std.stdio;
void main(string[] args) {
// ...
for (double x; readf(" %s ", &x) == 1; ) {
// ...
}
// ...
}
Using DMD v2.047, I get the following error on the readf call:
Error: undefined identifier readf, did you
Jonathan M Davis wrote:
> div0 wrote:
>
>>>
> [... snip of UTF-8 stuff ...]
>>
>
> The UTF char stuff is all painfully complicated, and I _think_ that I more
> or less understand it, but I suspect that I don't understand it all that
> well. It would be nice if the there were a page in the docs s
Tomek Sowiński wrote:
> There's a better way:
>
> void assert_(string file = __FILE__, uint line = __LINE__)(bool pred, lazy
> string msg = null) {
> version(unittest)
> if (!pred)
> throw new AssertError(msg, file, line);
> }
>
> If unittesting is off, it is inlined a
On page 231, TDPL states that a class can introduce any number of alias
this declarations.
http://www.digitalmars.com/d/2.0/class.html#AliasThis states that there
is only one allowed per class.
A quick test shows that dmd agrees with the latter.
Which one is right?
div0:
> and now with 2.047 I've been
> bitten by the removal of struct initialisers.
What do you mean?
Bye,
bearophile
Simen kjaeraas wrote:
> "dmd a b -unittest" works. "dmd b a -unittest" does not.
This may explain a problem that I hit recently.
I had had all of a program's code in a single file. Then I started
pulling classes to their respective source files one by one. As I did
that, of course I compiled
Dnia 23-06-2010 o 07:05:42 dennis luehring napisał(a):
Am 22.06.2010 23:07, schrieb Tomek Sowiñski:
Yes, why? It could be implemented in object.d in a similar fashion as
std.contracts.enforce. Does it do anything special that a library
function
couldn't?
Tomek
what about static assert?
Dnia 22-06-2010 o 23:55:29 Michal Minich
napisał(a):
On Tue, 22 Jun 2010 17:30:23 -0400, Steven Schveighoffer wrote:
On Tue, 22 Jun 2010 17:07:02 -0400, Tomek Sowiński wrote:
Yes, why? It could be implemented in object.d in a similar fashion as
std.contracts.enforce. Does it do anything
Using v2.0.47, I get a linker error during compilation w/ the following code.
import time = core.sys.posix.sys.time;
int
main( string[] argv )
{
time.timeval x[4];// < the static array of
timevals is the problem
retu
On 22/06/2010 23:05, Jonathan M Davis wrote:
Oh my, you caveman! ;) I'd have to go look at all of the changelogs to even
have a clue of what's been changed since then. Oh well, I guess that it
means that you don't have to worry about stuff changing on you each upgrade
by sticking to the same vers
On Wed, 23 Jun 2010 00:30:40 +0200, Ali Çehreli wrote:
dcoder wrote:
> So, I moved the initialization to inside the main function, and now
it works.
> Great. I think we need to put this question in the FAQ.
For future reference, if it really needs to be global:
uint[string] mywords;
s
I get the same error.
Fix:
The following code works allright on MacOS X 10.6.4 / DMD v2.047:
module fork;
import core.sys.posix.unistd,
core.thread,// added
std.stdio;
void main()
{
auto pid = fork();
if( pid> 0 ) {
thread_attachThis();// adde
Correction:
Of course, you shouldn't call thread_attachThis() for the parent thread. It's
already been attached since the D runtime created it. (In fact, the
documentation says: "If [thread_attachThis()] is called for a thread which is
already registered, the result is undefined." My bad.)
B
On Wed, 23 Jun 2010 00:41:45 -0700, Ali Çehreli wrote:
> Ali Çehreli wrote:
>> dcoder wrote:
>>
>> > So, I moved the initialization to inside the main function, and now
>> it works.
>> > Great. I think we need to put this question in the FAQ.
>>
>> For future reference, if it really needs to
Ali Ãehreli:
> Could someone please verify whether the above is really necessary?
An initialization inside some runtime function/initializator is necessary
unless the AA is an enum.
> Is it
> actually a dmd bug that we need to use 'static this()' to initialize an
> associative array?
Accord
On 06/23/2010 09:41 AM, Ali Çehreli wrote:
Ali Çehreli wrote:
dcoder wrote:
> So, I moved the initialization to inside the main function, and now
it works.
> Great. I think we need to put this question in the FAQ.
For future reference, if it really needs to be global:
uint[string] mywords;
s
Ali Çehreli wrote:
dcoder wrote:
> So, I moved the initialization to inside the main function, and now
it works.
> Great. I think we need to put this question in the FAQ.
For future reference, if it really needs to be global:
uint[string] mywords;
static this()
{
mywords = [ "Hello"
Ellery Newcomer wrote:
> On 06/22/2010 05:36 PM, Ali Çehreli wrote:
>> Jonathan M Davis wrote:
>> > Steven Schveighoffer wrote:
>>
>> >> all calls to assert are removed by the compiler in release mode. I
>> don't
>> >> think there's a way to implement that via a library (it would be nice
>> >>
19 matches
Mail list logo