Re: Question re specific implicit type coercion

2021-10-18 Thread Don Allen via Digitalmars-d-learn
On Monday, 18 October 2021 at 15:58:35 UTC, Don Allen wrote: On Monday, 18 October 2021 at 15:34:45 UTC, Paul Backus wrote: On Monday, 18 October 2021 at 15:04:11 UTC, Don Allen wrote: Section 12.17 of the Language Reference does not indicate any circumstance in which a dynamic array, which

Re: Question re specific implicit type coercion

2021-10-18 Thread Don Allen via Digitalmars-d-learn
On Monday, 18 October 2021 at 15:34:45 UTC, Paul Backus wrote: On Monday, 18 October 2021 at 15:04:11 UTC, Don Allen wrote: Section 12.17 of the Language Reference does not indicate any circumstance in which a dynamic array, which the literal is, is implicitly coerced to a pointer. This is a

Question re specific implicit type coercion

2021-10-18 Thread Don Allen via Digitalmars-d-learn
e of you who know D a lot better than I do can tell me what I've missed or gotten wrong, if that is the case. Thanks -- /Don

Re: Metaprogramming with D

2020-06-06 Thread Don via Digitalmars-d-learn
On Sunday, 7 June 2020 at 00:45:37 UTC, Ali Çehreli wrote: False. And again, even if so, that's not because of D, but because of humans. Can you imagine a CTO, say, in Silicon Valley to have guts to bring D instead of C++? With C++, the CTO will never be blamed; but D, he or she can easily be b

Re: What does this compile-time error mean?

2013-02-25 Thread Don
n a CTFE >> function, but >> you can't >> initialize a module-level or static variable (or enum) with >> them, and >> you're >> attempting to initialize maint_cont with a RedBlackTree, >> which is a >> class. It >> won't work

Re: Why is the 'protected' attribute considered useless?

2013-01-30 Thread Don
On Wednesday, 30 January 2013 at 03:38:39 UTC, Chad Joan wrote: I've read more than once now that 'protected' is considered useless in D. Why is this? I've never heard that before. Where have you read that? Several people, including me, have said that 'package' is useless -- could that be wha

Re: Why is null lowercase?

2013-01-25 Thread Don
On Friday, 25 January 2013 at 01:17:44 UTC, Ali Çehreli wrote: On 01/24/2013 12:42 PM, Matthew Caron wrote: >> for not null checks >> >> if ( ptr !is null) ... > > And too much perl has me wanting to write: > > if (ptr is not null) IIRC, the !is operator is thanks to bearophile. No, it's from

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-13 Thread Don Clugston
On 13/11/12 06:51, Rob T wrote: On Monday, 12 November 2012 at 14:28:53 UTC, Andrej Mitrovic wrote: On 11/12/12, Andrej Mitrovic wrote: On 11/12/12, Don Clugston wrote: Yeah. Though note that 1000 bug reports are from bearophile. Actually only around 300 remain open: http

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-12 Thread Don Clugston
On 10/11/12 08:53, Rob T wrote: On Saturday, 10 November 2012 at 06:09:41 UTC, Nick Sabalausky wrote: I've gone ahead and filed a minimized test case, and also included your workaround: http://d.puremagic.com/issues/show_bug.cgi?id=8990 I didn't make that one struct nested since that's not need

Re: vestigial delete in language spec

2012-11-02 Thread Don Clugston
On 01/11/12 22:21, Dan wrote: TDPL states -- However, unlike in C++, clear does not dispose of the object’s own memory and there is no delete operator. (D used to have a delete operator, but it was deprecated.) You still can free memory manually if you really, really know what you’re doing by

Re: Copying with immutable arrays

2012-10-30 Thread Don Clugston
On 29/10/12 07:19, Ali Çehreli wrote: On 10/28/2012 02:37 AM, Tobias Pankrath wrote: > the struct > SwA from above does neither correspond to SA nor to SB, it's imo more > like SC: > > struct SC { > immutable(int)* i; > } Just to confirm, the above indeed works: struct SC { immutabl

Re: __traits(compiles,...) <=> ? is(typeof(...))

2012-10-30 Thread Don Clugston
On 29/10/12 12:03, Jonathan M Davis wrote: On Monday, October 29, 2012 11:42:59 Zhenya wrote: Hi! Tell me please,in this code first and second static if,are these equivalent? with arg = 1, __traits(compiles,"check(arg);") = true, is(typeof(check(arg))) = false. In principle, is(typeof(code))

Re: long compile time question

2012-10-24 Thread Don Clugston
On 24/10/12 17:39, thedeemon wrote: On Wednesday, 24 October 2012 at 03:50:47 UTC, Dan wrote: The following takes nearly three minutes to compile. The culprit is the line bar ~= B(); What is wrong with this? Thanks, Dan struct B { const size_t SIZE = 1024*64; int[SIZE] x; }

Re: Why are scope variables being deprecated?

2012-10-11 Thread Don Clugston
On 11/10/12 02:30, Piotr Szturmaj wrote: Jonathan M Davis wrote: On Thursday, October 11, 2012 01:24:40 Piotr Szturmaj wrote: Could you give me an example of preventing closure allocation? I think I knew one but I don't remember now... Any time that a delegate parameter is marked as scope, th

Re: "Best" way of passing in a big struct to a function?

2012-10-10 Thread Don Clugston
On 10/10/12 09:12, thedeemon wrote: On Wednesday, 10 October 2012 at 07:28:55 UTC, Jonathan M Davis wrote: Making sure that the aa has been properly initialized before passing it to a function (which would mean giving it at least one value) would make the ref completely unnecessary. - Jonathan

Re: Workarounds for forward reference bugs

2012-10-05 Thread Don Clugston
On 05/10/12 16:33, simendsjo wrote: Are there any known workarounds for forward reference bugs? I see 80 bugs is filed, but I don't want to read all of them to find any workarounds. I cannot find anything on the wiki regarding this. So.. Any good ideas how to get around this? Those "forward re

Re: Is it possible to force CTFE?

2012-10-01 Thread Don Clugston
On 27/09/12 15:01, bearophile wrote: Tommi: 2) Is it possible to specialize a function based on whether or not the parameter that was passed in is a compile time constant? I am interested in this since some years. I think it's useful, but I don't know if it can be implemented. I don't remembe

Re: About std.ascii.toLower

2012-09-27 Thread Don Clugston
On 20/09/12 18:57, Jonathan M Davis wrote: On Thursday, September 20, 2012 18:35:21 bearophile wrote: monarch_dodra: It's not, it only *operates* on ASCII, but non ascii is still a legal arg: Then maybe std.ascii.toLower needs a pre-condition that constraints it to just ASCII inputs, so it'

Re: object.error: Privileged Instruction

2012-09-26 Thread Don Clugston
On 22/09/12 21:49, Jonathan M Davis wrote: On Saturday, September 22, 2012 21:19:27 Maxim Fomin wrote: Privilege instruction is an assembly instruction which can be executed only at a certain executive process context, typically os kernel. AFAIK assert(false) was claimed to be implemented by dmd

Re: function is not function

2012-09-26 Thread Don Clugston
On 21/09/12 21:59, Ellery Newcomer wrote: solution is to use std.traits, but can someone explain this to me? import std.stdio; void main() { auto a = { writeln("hi"); }; pragma(msg, typeof(a)); // void function() pragma(msg, is(typeof(a) == delegate)); // nope!

Re: filter out compile error messages involving _error_

2012-09-10 Thread Don Clugston
On 10/09/12 02:31, Jonathan M Davis wrote: On Monday, September 10, 2012 02:16:19 Timon Gehr wrote: Don has expressed the desire to weed those out completely. If he can do it in a way that leaves in all of the necessary information, then great, but you need to be able to know what the

Re: bigint <-> python long

2012-09-06 Thread Don Clugston
On 05/09/12 21:23, Paul D. Anderson wrote: On Wednesday, 5 September 2012 at 18:13:40 UTC, Ellery Newcomer wrote: Hey. Investigating the possibility of providing this conversion in pyd. Python provides an api for accessing the underlying bytes. std.bigint seemingly doesn't. Am I missing anyth

Re: How to have strongly typed numerical values?

2012-09-05 Thread Don Clugston
On 05/09/12 03:42, bearophile wrote: Nicholas Londey: for example degrees west and kilograms such that they cannot be accidentally mixed in an expression. Using the static typing to avoid similar bugs is the smart thing to do :-) I'd be interested to know if that idea is ever used in real c

Re: CTFE question

2012-09-03 Thread Don Clugston
On 28/08/12 19:40, Philippe Sigaud wrote: On Tue, Aug 28, 2012 at 2:07 PM, Chris Cain wrote: On Tuesday, 28 August 2012 at 11:39:20 UTC, Danny Arends wrote: Ahhh I understand... As a follow up, is it then possible to 'track' filling a large enum / immutable on compile time by outputting a ms

Re: BitArray/BitFields - Review

2012-07-31 Thread Don Clugston
On 29/07/12 23:36, bearophile wrote: Era Scarecrow: >>> Another commonly needed operation is a very fast bit count. There are very refined algorithms to do this. Likely similar to the hamming weight table mentioned in TDPL. Combined with the canUseBulk I think I could make it fairly fast.

Re: FYI my experience with D' version

2012-07-30 Thread Don Clugston
On 30/07/12 14:32, Jacob Carlborg wrote: On 2012-07-30 12:30, torhu wrote: version is good for global options that you set with -version on the command line. And can also be used internally in a module, but doesn't work across modules. But it seems you have discovered this the hard way alread

Re: cast from void[] to ubyte[] in ctfe

2012-07-16 Thread Don Clugston
On 13/07/12 12:52, Johannes Pfau wrote: Am Fri, 13 Jul 2012 11:53:07 +0200 schrieb Don Clugston : On 13/07/12 11:16, Johannes Pfau wrote: Casting from void[] to ubyte[] is currently not allowed in CTFE. Is there a special reason for this? I don't see how this cast can be dangerous?

Re: cast from void[] to ubyte[] in ctfe

2012-07-13 Thread Don Clugston
On 13/07/12 11:16, Johannes Pfau wrote: Casting from void[] to ubyte[] is currently not allowed in CTFE. Is there a special reason for this? I don't see how this cast can be dangerous? CTFE doesn't allow ANY form of reinterpret cast, apart from signed<->unsigned. In particular, you can't do an

Re: stdarg x86_64 problems...

2012-07-12 Thread Don Clugston
On 12/07/12 11:12, John Colvin wrote: When I compile the following code with -m32 and -m64 i get a totally different result, the documentation suggests that they should be the same... import core.stdc.stdarg, std.stdio; void main() { foo(0,5,4,3); } void foo(int dummy, ...) { va_list

Re: A little story

2012-06-26 Thread Don Clugston
On 25/06/12 14:24, bearophile wrote: Dmitry Olshansky: Except for the fact, that someone has to implement it. I am not seeing one of the posts of this thread. So I'll answer here. The good thing regarding the run-time overflow integral tests is that they are already implemented and available

Re: floats default to NaN... why?

2012-06-05 Thread Don Clugston
On 14/04/12 16:52, F i L wrote: On Saturday, 14 April 2012 at 10:38:45 UTC, Silveri wrote: On Saturday, 14 April 2012 at 07:52:51 UTC, F i L wrote: On Saturday, 14 April 2012 at 06:43:11 UTC, Manfred Nowak wrote: F i L wrote: 4) use hardware signalling to overcome some of the limitations impr

Re: pure functions calling impure functions at compile-time

2012-05-24 Thread Don Clugston
On 23/05/12 11:41, bearophile wrote: Simen Kjaeraas: Should this be filed as a bug, or is the plan that only pure functions be ctfe-able? (or has someone already filed it, perhaps) It's already in Bugzilla, see issue 7994 and 6169. It's just happening because the purity checking is currentl

Re: Limit number of compiler error messages

2012-05-22 Thread Don Clugston
On 20/05/12 00:38, cal wrote: Is there a way to limit the dmd compiler to outputting just the first few errors it comes across? No, but the intention of DMD is to generate only one error per bug in your code. If you are seeing a large number of useless errors, please report it in bugzilla. h

Re: Strange measurements when reproducing issue 5650

2012-04-25 Thread Don Clugston
On 25/04/12 10:34, SomeDude wrote: Discussion here: http://d.puremagic.com/issues/show_bug.cgi?id=5650 On my Windows box, the following program import std.stdio, std.container, std.range; void main() { enum int range = 100; enum int n = 1_000_000; auto t = redBlackTree!int(0); for (int i = 0

Re: Why has base class protection been deprecated?

2012-04-24 Thread Don Clugston
On 24/04/12 15:29, David Bryant wrote: Because it doesn't make sense. All classes are derived from Object. That _has_ to be public, otherwise things like == wouldn't work. Does the same apply for interfaces? I'm specifically implementing an interface with non-public visibility. This shouldn't

Re: Why has base class protection been deprecated?

2012-04-24 Thread Don Clugston
On 24/04/12 14:22, David Bryant wrote: With the dmd 2.059 I have started getting the error 'use of base class protection is deprecated' when I try to implement an interface with private visibility, ie: interface Interface { } class Class : private Interface { } $ dmd test.d test.d(4): use of b

Re: log2 buggy or is a real thing?

2012-04-04 Thread Don Clugston
On 04/04/12 13:46, bearophile wrote: Do you know why is this program: import std.stdio; void main() { real r = 9223372036854775808UL; writefln("%1.19f", r); } Printing: 9223372036854775807.800 Instead of this? 9223372036854775808.000 Bye, bearophile

Re: log2 buggy or is a real thing?

2012-04-04 Thread Don Clugston
On 04/04/12 18:53, Timon Gehr wrote: On 04/04/2012 05:15 PM, Don Clugston wrote: I don't think so. For 80-bit reals, every long can be represented exactly in an 80 bit real, as can every ulong from 0 up to and including ulong.max - 1. The only non-representable built-in integer is ulon

Re: log2 buggy or is a real thing?

2012-04-04 Thread Don Clugston
On 04/04/12 13:40, bearophile wrote: Jonathan M Davis: This progam: import std.math; import std.stdio; import std.typetuple; ulong log2(ulong n) { return n == 1 ? 0 : 1 + log2(n / 2); } void print(ulong value) { writefln("%s: %s %s", value, log2(value), std.math.

Re: Comparison issue

2012-03-20 Thread Don Clugston
On 19/03/12 15:45, H. S. Teoh wrote: On Mon, Mar 19, 2012 at 08:50:02AM -0400, bearophile wrote: James Miller: writeln(v1 == 1); //false writeln(v1 == 1.0); //false writeln(v1 == 1.0f); //false writeln(v1+1 == 2.0f); //true Maybe I'd like to deprecate a

Re: Vector Swizzling in D

2012-03-15 Thread Don Clugston
On 14/03/12 18:46, Boscop wrote: On Wednesday, 14 March 2012 at 17:35:06 UTC, Don Clugston wrote: In the last bit of code, why not use CTFE for valid(string s) instead of templates? bool valid(string s) { foreach(c; s) { if (c < 'w' || c > 'z') return false; } retur

Re: Vector Swizzling in D

2012-03-14 Thread Don Clugston
On 14/03/12 15:57, Boscop wrote: Hi everyone, I wrote a blog post for people who know a bit of D and want to dig deeper, it shows different approaches to get vector swizzling syntax in D: http://boscop.tk/blog/?p=1 There is nothing revolutionary involved but it might still be useful to someone

Re: About CTFE and pointers

2012-02-24 Thread Don Clugston
ot;oogle")); } It gives at run-time: core.exception.RangeError@test(6): Range violation ---- \test.d(6): bool test.strPrefix(const(char[]), const(char[]), const(int), const(int)) So it seems that Don, when he has implemented the last parts of the

Re: Everything on the Stack

2012-02-21 Thread Don Clugston
On 21/02/12 12:12, Timon Gehr wrote: On 02/21/2012 11:27 AM, Daniel Murphy wrote: scope/scoped isn't broken, they're just not safe. It's better to have an unsafe library feature than an unsafe language feature. scope is broken because it is not enforced by the means of flow-analysis. As a re

Re: Flushing denormals to zero

2012-02-17 Thread Don Clugston
On 17/02/12 09:09, Mantis wrote: 17.02.2012 4:30, bearophile пишет: After seeing this interesting thread: http://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x Do you know if there's a simple way to perform _MM_SET_FLUSH_ZERO_MODE in D? According

Re: Hex floats

2012-02-17 Thread Don Clugston
On 16/02/12 17:36, Timon Gehr wrote: On 02/16/2012 05:06 PM, Don Clugston wrote: On 16/02/12 13:28, Stewart Gordon wrote: On 16/02/2012 12:04, Don Clugston wrote: On 15/02/12 22:24, H. S. Teoh wrote: What's the original rationale for requiring that hex float literals must always ha

Re: Hex floats

2012-02-16 Thread Don Clugston
On 16/02/12 13:28, Stewart Gordon wrote: On 16/02/2012 12:04, Don Clugston wrote: On 15/02/12 22:24, H. S. Teoh wrote: What's the original rationale for requiring that hex float literals must always have an exponent? For example, 0xFFi obviously must be float, not integer, so why doe

Re: Hex floats

2012-02-16 Thread Don Clugston
On 15/02/12 22:24, H. S. Teoh wrote: What's the original rationale for requiring that hex float literals must always have an exponent? For example, 0xFFi obviously must be float, not integer, so why does the compiler (and the spec) require an exponent? The syntax comes from C99.

Re: Compiler error with static vars/functions

2012-02-10 Thread Don Clugston
On 10/02/12 16:08, Artur Skawina wrote: On 02/10/12 15:18, Don Clugston wrote: On 09/02/12 23:03, Jonathan M Davis wrote: On Thursday, February 09, 2012 14:45:43 bearophile wrote: Jonathan M Davis: Normally, it's considered good practice to give modules names which are all lowe

Re: Compiler error with static vars/functions

2012-02-10 Thread Don Clugston
On 09/02/12 23:03, Jonathan M Davis wrote: On Thursday, February 09, 2012 14:45:43 bearophile wrote: Jonathan M Davis: Normally, it's considered good practice to give modules names which are all lowercase (particularly since some OSes aren't case-sensitive for file operations). That's just a

Re: dmd & gdc

2012-01-27 Thread Don Clugston
On 26/01/12 18:59, xancorreu wrote: Al 26/01/12 18:43, En/na H. S. Teoh ha escrit: On Thu, Jan 26, 2012 at 06:06:38PM +0100, xancorreu wrote: [...] I note that gdc is completely free software but dmd runtime is not. You mean free as in freedom, not as in price. Yes, both I don't what that

Re: Constant function/delegate literal

2012-01-17 Thread Don Clugston
On 15/01/12 20:35, Timon Gehr wrote: On 01/14/2012 07:13 PM, Vladimir Matveev wrote: Hi, Is there a reason why I cannot compile the following code: module test; struct Test { int delegate(int) f; } Test s = Test((int x) { return x + 1; }); void main(string[] args) { return; } dmd 2.057 say

Re: CTFE and cast

2012-01-13 Thread Don Clugston
On 13/01/12 10:01, k2 wrote: > When replace typedef to enum, it became impossible to compile a certain > portion. > > dmd v2.057 Windows > > enum HANDLE : void* {init = (void*).init} > > pure HANDLE int_to_HANDLE(int x) > { > return cast(HANDLE)x;

Re: C++ vs D aggregates

2011-12-03 Thread Don
On 03.12.2011 20:14, Dejan Lekic wrote: I recently stumbled on this thread: http://stackoverflow.com/ questions/5666321/what-is-assignment-via-curly-braces-called-and-can-it- be-controlled The important part is this: 8< - begin - The Standard says in section §8.5.1/1,

Re: -release compiler switch and associative arrays

2011-10-11 Thread Don
On 09.10.2011 13:24, Graham Cole wrote: I understand from the documentation that the "-release" compiler switch turns off "array bounds checking for system and trusted functions". Is it correct that the following code should seg fault when compiled with "-release" ? string[string] h; h["abc"]

How to get WinDbg to show a call stack on Windows 7?

2011-09-12 Thread Don
I've set up a Windows 7 machine for working on DMD but I can't get windbg to work properly. Specifically, when I try to debug DMD itself, I don't get a call stack; I only see the current function. Everything else seems OK. Has anyone else experienced this? Any ideas?

Re: How do "pure" member functions work?

2011-08-24 Thread Don
Simen Kjaeraas wrote: On Mon, 22 Aug 2011 22:19:50 +0200, Don wrote: BTW: The whole "weak pure"/"strong pure" naming was just something I came up with, to convince Walter to relax the purity rules. I'd rather those names disappeared, they aren't very helpful.

Re: How do "pure" member functions work?

2011-08-22 Thread Don
Timon Gehr wrote: On 08/21/2011 09:10 PM, Don wrote: bearophile wrote: Sean Eskapp: Oh, I see, thanks! This isn't documented in the function documentation! D purity implementation looks like a simple thing, but it's not simple, it has several parts that in the last months have b

Re: How do "pure" member functions work?

2011-08-21 Thread Don
bearophile wrote: Sean Eskapp: Oh, I see, thanks! This isn't documented in the function documentation! D purity implementation looks like a simple thing, but it's not simple, it has several parts that in the last months have be added to the language and compiler, and we are not done yet, th

Re: (int << ulong) == int ?

2011-08-09 Thread Don
Jonathan M Davis wrote: On Tuesday 09 August 2011 09:32:41 Don wrote: Jonathan M Davis wrote: On Monday 08 August 2011 00:33:31 Dmitry Olshansky wrote: Just lost the best part of an hour figuring the cause of this small problem, consider: void main() { uint j = 42; ulong k

Re: (int << ulong) == int ?

2011-08-09 Thread Don
Jonathan M Davis wrote: On Monday 08 August 2011 00:33:31 Dmitry Olshansky wrote: Just lost the best part of an hour figuring the cause of this small problem, consider: void main() { uint j = 42; ulong k = 1< I would not expect that type of integer being used to give the numb

Re: Need OMF MySQL lib that actually f^*&^ works...

2011-07-22 Thread Don
Nick Sabalausky wrote: Anyone have a known-working Windows OMF library for MySQL? Static or dynamic, I don't care. I've tried fucking everything and I can't get the dang thing to work. Static was a total no-go. With dynamic, using implib I got it to link, but calling any of it resulted in an Ac

Re: This seems like what could be a common cause of bugs

2011-07-22 Thread Don
Andrej Mitrovic wrote: This is just an observation, not a question or anything. void main() { enum width = 100; double step = 1 / width; writeln(step); // 0 } I've just had this bug in my code. I forgot to make either width or 1 a floating-point type. IOW, I didn't do this: void

Re: Constructor call must be in a constructor

2011-07-07 Thread Don
Jesse Phillips wrote: Loopback Wrote: Hi! While implementing and overloading several different operators for my structure I've got stuck with an error. As noticed in the attachment, in my opBinaryRight function I mimic the opBinary (left) operator by instantiating the structure itself to avoi

Re: A different vector op

2011-07-06 Thread Don
bearophile wrote: Currently this is not allowed, but do you desire a feature like this? struct Foo { int x, y; int[100] array; } void main() { auto foos = new Foo[100]; foos[].y += 10; // *** } Bye, bearophile An interesting use case: void main() { cdouble[100] foos; f

Re: + operators

2011-06-12 Thread Don
Jonathan M Davis wrote: On 2011-06-12 02:37, bearophile wrote: Jonathan M Davis: Certainly, once range propagation has been fully implemented, this particular will work without needing any casts, but as soon as the compiler doesn't know what the values of x and y are, I believe that it would st

Re: DMD Backend: Deciding instructions to use/avoid?

2011-06-10 Thread Don
Nick Sabalausky wrote: "Nick Sabalausky" wrote in message news:isoltk$1ehd$1...@digitalmars.com... "Don" wrote in message news:isoh6c$15jb$1...@digitalmars.com... Nick Sabalausky wrote: So my main question: Does DMD do anything like, say, detecting the CPU at compile ti

Re: Is it reasonable to learn D

2011-06-08 Thread Don
f the compiler is very slow More and more people are contributing patches so development has definitely become faster. Also Don has more or less taken over development of the CTFE functionality. Nice trend. - Only a small community => no real German community There is no separate German c

Re: DMD Backend: Deciding instructions to use/avoid?

2011-06-08 Thread Don
Nick Sabalausky wrote: So my main question: Does DMD do anything like, say, detecting the CPU at compile time and then enabling instructions only available on that CPU and up? Or does it do anything like always assuming the target CPU has SSE2? Anything like that that could cause differences be

Re: how to get the local?

2011-06-01 Thread Don
Lloyd Dupont wrote: I tried to add that to my D file === public import std.c.windows.windows; extern(Windows) { int GetUserDefaultLocaleName(LPWSTR lpLocaleName, int cchLocaleName); } === Try: extern(Windows) { int GetUserDefaultLocaleNameW(LPWSTR lpLocaleName, int cchLocaleName); } and

Re: github: What to do when unittests fail?

2011-05-29 Thread Don
Dmitry Olshansky wrote: On 24.05.2011 1:33, Andrej Mitrovic wrote: I've cloned Phobos just a few minutes ago, and I've tried to build it with unittests, I'm getting these: Warning: AutoImplement!(C_6) ignored variadic arguments to the constructor C_6(...) --- std.socket(316) broken test --

Re: Cannot interpret struct at compile time

2011-05-09 Thread Don
Robert Clipsham wrote: Hey all, I was wondering if anyone could enlighten me as to why the following code does not compile (dmd2, latest release or the beta): Added as bug 5969.

Re: expression templates

2011-05-02 Thread Don
Mr enuhtac wrote: Hello everyone, I'm new to D and this list (although I've had a look onto D a few years ago). I hope you guys can help me with my questions. At the moment I'm trying to implement some expression template stuff. My first goal is to encode an expression into a type representin

Re: opDollar()

2011-05-02 Thread Don
Dmitry Olshansky wrote: On 26.03.2011 11:03, Caligo wrote: "In the expression a[, ...,], if $ occurs in, it is rewritten as a.opDollar!(i)()." -- TDPL, pg 380 Is that correct? if so, could some one give an example code? I don't understand the need for the parameter. Also, what is the signatu

Re: Matrix creation quiz

2011-04-30 Thread Don
bearophile wrote: Pedro Rodrigues: The fact that 'i' and 'j' are deduced to type 'uint' in the second version. That's the kind of bug that would keep me up at night. Almost right answer. i and j are size_t, that is not uint in 64 bit compilations. Unsigned numbers cause the (i-j) sub-express

Re: Which import lib holds lrintf()?

2011-04-28 Thread Don
Andrej Mitrovic wrote: I have a hunch that this function is only available on Linux. If that's so it should maybe be put in a version(linux) statement. But I just found lrint is in std.math as well so I can actually use that. There should be no reason to use anything from c.math.

Re: Next Release

2011-04-20 Thread Don
Jonathan M Davis wrote: Greetings All It has been 2 months since we had release 2.052. Just wondering when is the 2.053 release planned? There isn't really a release schedule. A release kind of just happens when Walter decides that it's time or when someone else on the dev team

Re: Assertion failure: '!vthis->csym' on line 703 in file 'glue.c'

2011-03-28 Thread Don
nrgyzer wrote: Hey guys, I got "Assertion failure: '!vthis->csym' on line 703 in file 'glue.c'" after I add "LinkList!(uint) myList;" to my source file. I figured out that the same bug was already reported on http://lists.puremagic.com/ pipermail/digitalmars-d-bugs/2010-October/019237.html Ticke

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-25 Thread Don
spir wrote: On 03/25/2011 12:08 PM, Regan Heath wrote: On Wed, 23 Mar 2011 21:16:02 -, Jonathan M Davis wrote: There are tasks for which you need to be able to lex and parse D code. To 100% correctly remove unit tests would be one such task. Is that last bit true? You definitely need to

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Don
Jonathan M Davis wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Stri

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Don
Jonathan M Davis wrote: On Saturday 19 March 2011 18:04:57 Don wrote: Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well.

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Don
Jonathan M Davis wrote: On Saturday 19 March 2011 17:11:56 Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come

Want to help DMD bugfixing? Write a simple utility.

2011-03-19 Thread Don
would like to do something really useful. -Don

Re: BigInt problem

2011-02-18 Thread Don
tsukikage wrote: Please see source in attachment. The output is M2 M3 M5 M7 M13 M17 M19 M31 M61 M89 M107 M127 M521 M607 M1279 M2203 M2281 M3217 M4253 M4423 *** M9689*** M9941 M11213 M19937 *** M21701*** M23209 It missed 2 Mersenne Primes 9689 & 21701. Is it my program bug or bigint broken?

Re: github syntax hilighting

2011-01-28 Thread Don
Jacob Carlborg wrote: On 2011-01-26 20:30, Jonathan M Davis wrote: On Wednesday, January 26, 2011 11:21:55 Brad Roberts wrote: On 1/26/2011 7:13 AM, Steven Schveighoffer wrote: Anyone have any clue why this file is properly syntax-aware: https://github.com/D-Programming-Language/druntime/blob

Re: array of elements of various sybtypes

2011-01-28 Thread Don
spir wrote: Hello, This fails: class T0 {} class T1 : T0 {} class T2 : T0 {} unittest { auto t1 = new T1(); auto t2 = new T2(); T0[] ts = [t1, t2]; } Error: cannot implicitly convert expression (t1) of type __trials__.T0 to __trials__.T2 Error: cannot implicitly convert expressio

Re: Assertion failure: '!cases' on line 2620 in file 'statement.c'

2011-01-14 Thread Don
%u wrote: == Quote from Don (nos...@nospam.com)'s article Yay for first time compiling dmd :) Sorry you had to do that! Had to learn that once anyway :) Maybe I'll even be able to take a stab at fixing bugs someday.. Added your bug as: http://d.puremagic.com/issues/show_bug.cgi?id=5453

Re: Assertion failure: '!cases' on line 2620 in file 'statement.c'

2011-01-13 Thread Don
%u wrote: == Quote from Don (nos...@nospam.com)'s article It's in a switch statement somewhere. It sounds as though this is a bug which involves multiple files, so it'll be difficult to reduce it. If you're able to compile DMD, change this line in statement.c

Re: Assertion failure: '!cases' on line 2620 in file 'statement.c'

2011-01-13 Thread Don
%u wrote: == Quote from Don (nos...@nospam.com)'s article %u wrote: Should I post it as a bug, even though I have no code to accompany it? I have no clue as to where to start my directed search for a minimal case. Can you post the entire source code? It's important that it be reprod

Re: Assertion failure: '!cases' on line 2620 in file 'statement.c'

2011-01-12 Thread Don
%u wrote: Should I post it as a bug, even though I have no code to accompany it? I have no clue as to where to start my directed search for a minimal case. Can you post the entire source code? It's important that it be reproducible. It doesn't need to be minimal - someone else can reduce it.

Re: DMD2 out parameters

2010-12-23 Thread Don
Pete wrote: Ok, i've done some more investigating and it appears that in DMD2 a float NaN is 0x7FE0 (in dword format) but when it initialises a float 'out' parameter it initialises it with 0x7FA0H. This causes an FPU trap which is where the time is going. This looks like a bug to me. Can

Re: double -> double[]... | feature or bug?

2010-12-23 Thread Don
bearophile wrote: spir: While I understand some may consider this a nice feature, for me this is an enormous bug. A great way toward code obfuscation. I like D among other reasons because it's rather clear compared to other languages of the family. The main problem here is that I have never

Re: Why does this floating point comparison fail?

2010-12-16 Thread Don
Jonathan M Davis wrote: Maybe I'm just totally missing something, but this seems really wrong to me. This program: import std.stdio; void main() { writeln(2.1); writeln(2.1 == 2.1); writeln(3 * .7); writeln(2.1 == 3 * .7); auto a = 2.1; auto b = 3 * .7; writeln(a);

Re: Ddoc doesn't support documentation for mixined code?

2010-12-10 Thread Don
Alex Moroz wrote: Hi, As of present Ddoc doesn't seem to process documenatation for code that is inserted with mixins. Bug 2440?

Re: casting int to uint and vice versa - performance

2010-12-03 Thread Don
spir wrote: On Fri, 03 Dec 2010 17:49:47 -0500 "Steven Schveighoffer" wrote: just that i + i generates different instructions than ui + ui where int i; uint ui; Not really important, because I'm currently interested in cast only. Thank you. That is odd, I would think that i+i generates the

Re: Crash in struct opAssign

2010-12-02 Thread Don
Adam Burton wrote: olivier wrote: Hi, This program, compiled with dmd 1.065 under Linux, crashes: void main() { Num a = 1; } struct Num { int[] d; Num opAssign( int v ) { d.length = 1; d[0] = v; return *this; } } It looks like d is not initialized before opAssign() is called. It doesn't cr

Re: bigint

2010-11-29 Thread Don
Kagamin wrote: Don Wrote: Why are they templated to begin with? Just for the heck of it? bool opEquals(ref const BigInt y) const bool opEquals(long y) const No, because then it fails for ulong. It's those bloody C implicit conversions. hmm... works for me: --- struct A {

Re: bigint

2010-11-28 Thread Don
Kagamin wrote: Matthias Walter Wrote: bool opEquals(Tdummy=void)(ref const BigInt y) const bool opEquals(T: int)(T y) const The only working sigature for array-of-structs-comparison to work is bool opEquals(ref const BigInt y) const But this removes the ability to compare against ints. Why

Re: Internal error: e2ir.c 4629

2010-11-27 Thread Don
Trass3r wrote: If this isn't in bugzilla, please file a bug report. http://d.puremagic.com/issues/query.cgi It probably has the same root cause as bug 4066.

Re: public imports and template functions

2010-11-24 Thread Don
Jonathan M Davis wrote: Am I correct in my understanding that if you wish a template function which is imported from another module to compile correctly without requiring other imports in the module that your using the function in that the module with the template function needs to publically i

  1   2   3   >