Just wondering: If I want a growable binary heap (I'd be open to other
priority queue structures, for that matter ;), is the standard way in D
(w/Phobos) to combine std.container.BinaryHeap with
std.container.Array? Any reason why BinaryHeap can't deal with ordinary
dynamic array appending, or
It seems std.gc is no longer available -- or, rather, that it is now
core.memory? Is there a reason why this page exists, and has a link in
the sidebar?
http://www.digitalmars.com/d/2.0/phobos/std_gc.html
(Yes, the documentation is for core.memory, but the page name/link name
is std.gc.
On 2011-03-06 14:37:19 +0100, Magnus Lie Hetland said:
Just wondering: If I want a growable binary heap (I'd be open to other
priority queue structures, for that matter ;), is the standard way in D
(w/Phobos) to combine std.container.BinaryHeap with std.container.Array?
Another thing ...
On 3/6/11 2:58 PM, Magnus Lie Hetland wrote:
alias Tuple!(real,int) Entry;
Array!Entry Q;
[…]
alias Tuple!(real,int) Entry;
Array!Entry Q;
Is it just me, or is there really no difference between the two snippets? ;)
David
On 2011-03-06 15:00:29 +0100, David Nadlinger said:
On 3/6/11 2:58 PM, Magnus Lie Hetland wrote:
alias Tuple!(real,int) Entry;
Array!Entry Q;
[...]
alias Tuple!(real,int) Entry;
Array!Entry Q;
Is it just me, or is there really no difference between the two snippets? ;)
$(WITTY_REPLY) ;-)
i can't install dmd or gdc in arch linux from AUR
i don't way?
user@domain.invalid Wrote:
I still think I would like it if you could be a little more explicit
about the in/out blocks. Are they always disabled entirely (skipped)
with -release, or just certain things?
Thanks for your help!
-Kai Meyer
By definition, if a pre contract fails, then the
%u wrote:
i can't install dmd or gdc in arch linux from AUR
i don't way?
For gdc, which package exactly are you trying to install? On what
platform (32 or 64 bits)? And what error do you get?
Jerome
--
mailto:jeber...@free.fr
http://jeberger.free.fr
Jabber:
Do you know why final switches disallow case ranges? Case ranges are not
bug-prone:
void main() {
ubyte u;
final switch (u) {
case 0: .. case 100:
break;
case 101: .. case 255:
break;
}
}
DMD 2.052 gives the errors:
test.d(4): Error: case
Can you define an associative array in a way that can be evaluated at compile
time like you can with non-associative arrays?
in dmd:
this the error massage
object.d: Error: module object is in file 'object.d' which cannot be read
import path[0] = /usr/include/d
import path[1] = /usr/include/d/druntime/import
in gdc:
i can't install it and i use this command
yaourt -R gdc
On Sunday 06 March 2011 05:39:14 Magnus Lie Hetland wrote:
It seems std.gc is no longer available -- or, rather, that it is now
core.memory? Is there a reason why this page exists, and has a link in
the sidebar?
http://www.digitalmars.com/d/2.0/phobos/std_gc.html
(Yes, the documentation
Jonathan M Davis:
I'm pretty sure not. I think that it's currently suffering the same fate as
stuff
like classes and is not yet able to be CTFEed. Some day...
This works:
import std.stdio;
string foo(int x) {
auto aa = [1: hello, 2: red];
return aa[x];
}
enum string s = foo(1);
What about:
enum : string[int]
{
aa = [1: blue, 2: red]
}
enum string s = aa[1];
void main()
{
writeln(s);
}
On Sunday 06 March 2011 16:30:00 Andrej Mitrovic wrote:
What about:
enum : string[int]
{
aa = [1: blue, 2: red]
}
enum string s = aa[1];
void main()
{
writeln(s);
}
In both cases, the AA does not exist past compile time. That may be why it
works.
- Jonathan M Davis
On 01/03/2011 23:19, Dan McLeran wrote:
never mind, i got it. i had to pass the switches:
-D -unittest -cov
life is hard. it's even harder when you're dumb.
Would you care to enlighten the rest of us on what code you were using that requires those
extra switches?
Stewart.
On Sunday 06 March 2011 17:48:12 Stewart Gordon wrote:
On 01/03/2011 23:19, Dan McLeran wrote:
never mind, i got it. i had to pass the switches:
-D -unittest -cov
life is hard. it's even harder when you're dumb.
Would you care to enlighten the rest of us on what code you were using
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
On Sunday 06 March 2011 14:05:04 Peter Lundgren wrote:
Can you define an associative array in a way that can be evaluated at
compile time like you can with non-associative arrays?
I'm pretty sure not. I think that it's currently
Peter Lundgren:
If not, then what is the D way to initialize a static field of a struct or
class a
la Java's static initializer blocks? I don't mind constructing the associative
array at run-time if I have to, but I can't afford to do it more than the
once needed.
Is this good enough?
On 3/6/2011 1:11 PM, bearophile wrote:
Do you know why final switches disallow case ranges? Case ranges are not
bug-prone:
void main() {
ubyte u;
final switch (u) {
case 0: .. case 100:
break;
case 101: .. case 255:
break;
}
}
On 3/7/11, Jonathan M Davis jmdavisp...@gmx.com wrote:
Kidding, just kidding..
On Sunday 06 March 2011 18:26:26 Bekenn wrote:
On 3/6/2011 1:11 PM, bearophile wrote:
Do you know why final switches disallow case ranges? Case ranges are not
bug-prone:
void main() {
ubyte u;
final switch (u) {
case 0: .. case 100:
On Sunday 06 March 2011 18:33:04 Andrej Mitrovic wrote:
On 3/7/11, Jonathan M Davis jmdavisp...@gmx.com wrote:
Kidding, just kidding..
That _did_ seem like a rather rude post for you...
- Jonathan M Davis
How do you guys benchmark your D code? I tried using the -profile option, but
was surprised to see wildly varying results (greater than an order of
magnitude difference in Func Time) from one run to the next.
On Sunday 06 March 2011 18:51:04 bearophile wrote:
Bekenn:
Final switch is really just meant to be used with enums; since
enumeration values don't have to cover the whole range of possible base
type values, and enumeration values don't often have a natural ordering,
ranges make little
On 03/07/2011 03:22 AM, Peter Lundgren wrote:
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
On Sunday 06 March 2011 14:05:04 Peter Lundgren wrote:
Can you define an associative array in a way that can be evaluated at
compile time like you can with non-associative arrays?
I'm
== Quote from %u (asm...@hotmail.com)'s article
i can't install it and i use this command
yaourt -R gdc
i mean yaourt -S gdc
27 matches
Mail list logo