2) You can import many classes using the '*' syntax.
You don't use the * syntax. Just stop after the module name.
On Tuesday, 31 December 2013 at 06:01:21 UTC, Afshin wrote:
Is it possible to describe modules in terms of packages (as
found in Java)?
The features that Java packages have that I can't seem to get
in D are:
1) You can have classes that are in the same package, but kept
in separate files.
2)
Is it possible to describe modules in terms of packages (as found
in Java)?
The features that Java packages have that I can't seem to get in
D are:
1) You can have classes that are in the same package, but kept in
separate files.
2) You can import many classes using the '*' syntax.
Is this p
Thanks for all your replies, guys! I have done some further
research in the meantime and I have found out that I am, in fact,
an idiot. There is actually a standard library function that does
exactly what I am trying to do! As it turns out,
std.string.split():
1) It automatically discards emp
On 12/30/2013 04:55 PM, Afshin wrote:
Thanks Ali.
I uninstalled 2.63.x.
Installed the 2.64.2.
I compiled and ran the test, and surely enough there were no problems.
However, when I build using Visual D environment, the problem persists.
Microsoft Visual Studio 2010 Ultimate.
Visual D plugin.
Thanks Ali.
I uninstalled 2.63.x.
Installed the 2.64.2.
I compiled and ran the test, and surely enough there were no
problems.
However, when I build using Visual D environment, the problem
persists.
Microsoft Visual Studio 2010 Ultimate.
Visual D plugin.
Thankfully, there is a simple work
On 2013-12-30 23:21, Vladimir Panteleev wrote:
You could try reducing the bug using DustMite, and this helper:
Thanks, DustMite was able to find a reduced test case. It was this
little piece of code:
enum : DWORD
{
DWORD = REG_DWORD
}
--
/Jacob Carlborg
On 12/30/2013 11:50 PM, Meta wrote:
enum factorial5=(function int(a)=>a==0?1:a*__traits(parent,{})(a-1))(5);
(In D, you need to specify the return type for a recursive function
declaration. If one doesn't here, DMD crashes, which is a bug.
https://d.puremagic.com/issues/show_bug.cgi?id=11848)
Thomas Gann:
I've written a Markov bot in D, and I have function whose job
it is to take an input string, convert all newline characters
to spaces and all uppercase letters to lowercase, and then
return an array of words that are generated by splitting the
string up by whitespace.
Take a lo
On Monday, 30 December 2013 at 21:58:29 UTC, Timon Gehr wrote:
On 12/30/2013 10:15 PM, Ilya Yaroshenko wrote:
On Monday, 30 December 2013 at 12:24:28 UTC, lomereiter wrote:
Use Y combinator?
http://forum.dlang.org/thread/mailman.157.1385247528.2552.digitalmars-d-le...@puremagic.com#post-l6rgfq:
On Monday, 30 December 2013 at 22:38:43 UTC, Brad Anderson wrote:
On Monday, 30 December 2013 at 22:30:02 UTC, John Colvin wrote:
On Monday, 30 December 2013 at 22:17:21 UTC, John Colvin wrote:
On Monday, 30 December 2013 at 21:40:58 UTC, Thomas Gann
wrote:
I've written a Markov bot in D, and I
On Monday, 30 December 2013 at 22:30:02 UTC, John Colvin wrote:
On Monday, 30 December 2013 at 22:17:21 UTC, John Colvin wrote:
On Monday, 30 December 2013 at 21:40:58 UTC, Thomas Gann wrote:
I've written a Markov bot in D, and I have function whose job
it is to take an input string, convert al
On Monday, 30 December 2013 at 21:40:58 UTC, Thomas Gann wrote:
I've written a Markov bot in D, and I have function whose job
it is to take an input string, convert all newline characters
to spaces and all uppercase letters to lowercase, and then
return an array of words that are generated by s
On Monday, 30 December 2013 at 22:17:21 UTC, John Colvin wrote:
On Monday, 30 December 2013 at 21:40:58 UTC, Thomas Gann wrote:
I've written a Markov bot in D, and I have function whose job
it is to take an input string, convert all newline characters
to spaces and all uppercase letters to lowe
On Monday, 30 December 2013 at 13:04:38 UTC, Jacob Carlborg wrote:
I've ported one of my projects[1] from D1 to D2 and it works
perfectly fine on Posix. Now when I try to compile the code on
Windows I get a stack overflow. I really suck at Windows
development, I don't even know where to start.
On Monday, 30 December 2013 at 21:15:43 UTC, Ilya Yaroshenko
wrote:
On Monday, 30 December 2013 at 12:24:28 UTC, lomereiter wrote:
Use Y combinator?
http://forum.dlang.org/thread/mailman.157.1385247528.2552.digitalmars-d-le...@puremagic.com#post-l6rgfq:24g5o:241:40digitalmars.com
This is not l
On Monday, 30 December 2013 at 21:40:58 UTC, Thomas Gann wrote:
I've written a Markov bot in D, and I have function whose job
it is to take an input string, convert all newline characters
to spaces and all uppercase letters to lowercase, and then
return an array of words that are generated by s
On 12/30/2013 10:15 PM, Ilya Yaroshenko wrote:
On Monday, 30 December 2013 at 12:24:28 UTC, lomereiter wrote:
Use Y combinator?
http://forum.dlang.org/thread/mailman.157.1385247528.2552.digitalmars-d-le...@puremagic.com#post-l6rgfq:24g5o:241:40digitalmars.com
This is not lambda =(
I want som
On Monday, 30 December 2013 at 21:15:43 UTC, Ilya Yaroshenko
wrote:
I want something like
enum factrorial5 = (a => a == 0 ? 1 : a * __lambda(a-1))(5);
//Recursive pure lambda function
That isn't supported in D. And cases where this would be useful
are too rare to add complexity to the languag
I've written a Markov bot in D, and I have function whose job it
is to take an input string, convert all newline characters to
spaces and all uppercase letters to lowercase, and then return an
array of words that are generated by splitting the string up by
whitespace. Here is the function is qu
On Monday, 30 December 2013 at 12:24:28 UTC, lomereiter wrote:
Use Y combinator?
http://forum.dlang.org/thread/mailman.157.1385247528.2552.digitalmars-d-le...@puremagic.com#post-l6rgfq:24g5o:241:40digitalmars.com
This is not lambda =(
I want something like
enum factrorial5 = (a => a == 0 ? 1
On Monday, 30 December 2013 at 20:04:00 UTC, Carl Sturtivant
wrote:
Apologies, I was perhaps unclear. I'm just wondering if
pragma(mangle) is guaranteed to be implemented, so I can safely
put it in portable D. It's not mentioned in
http://dlang.org/pragma.html
Nature of reference compiler is
On 2013-12-30 17:19, Benjamin Thaut wrote:
Compile in 64-bit and use Visual Studio or Visual Studio Express to
debug the application. If you want to compile in 32-bit you will need to
run cv2pdb on the generated exectuable before debugging with visual
studio. cv2pdb is part of VisualD which I re
On Monday, 30 December 2013 at 17:46:57 UTC, John Colvin wrote:
It's unrelated to the target architecture, it's just for
naming. See dlang.org/abi.html
Apologies, I was perhaps unclear. I'm just wondering if
pragma(mangle) is guaranteed to be implemented, so I can safely
put it in portable D
On Monday, 30 December 2013 at 19:27:43 UTC, Dmitry Olshansky
wrote:
30-Dec-2013 22:08, Benji пишет:
Hello,
when I try to run following code:
import std.stdio;
import std.net.curl;
void main()
{
writeln("dlang.org");
}
I get following error:
Fatal Error while loading
'/usr/lib/x86_64-li
30-Dec-2013 22:08, Benji пишет:
Hello,
when I try to run following code:
import std.stdio;
import std.net.curl;
void main()
{
writeln("dlang.org");
}
I get following error:
Fatal Error while loading '/usr/lib/x86_64-linux-gnu/libphobos2.so.0.64':
The module 'std.regex' is already de
On Mon, Dec 30, 2013 at 06:40:24PM +, Dfr wrote:
>
> Thank you for replies, i think here i can use assoc array, but
> sometimes it is not suitable because it is not preserve order.
Maybe you can use std.container.RedBlackTree instead? That will preserve
order (but at the cost of asymptoticall
On Monday, 30 December 2013 at 18:36:24 UTC, John Colvin wrote:
On Monday, 30 December 2013 at 18:08:42 UTC, Benji wrote:
Hello,
when I try to run following code:
import std.stdio;
import std.net.curl;
void main()
{
writeln("dlang.org");
}
I get following error:
Fatal Error while loa
Thank you for replies, i think here i can use assoc array, but
sometimes it is not suitable because it is not preserve order.
On Monday, 30 December 2013 at 18:19:54 UTC, Dfr wrote:
This simple example:
string[] a;
a[10] = "hello";
Gives me: core.exception.RangeError: Range violation
I k
On Monday, 30 December 2013 at 18:08:42 UTC, Benji wrote:
Hello,
when I try to run following code:
import std.stdio;
import std.net.curl;
void main()
{
writeln("dlang.org");
}
I get following error:
Fatal Error while loading
'/usr/lib/x86_64-linux-gnu/libphobos2.so.0.64':
Th
On Monday, 30 December 2013 at 18:19:54 UTC, Dfr wrote:
This simple example:
string[] a;
a[10] = "hello";
Gives me: core.exception.RangeError: Range violation
I know about this way:
string[] a;
a = new string[11];
a[10] = "hello";
But what if i need do this many times with the same array lik
Dfr:
string[] a;
a[10] = "hello";
Gives me: core.exception.RangeError: Range violation
Because 'a' has length 0, so the position with index 11 doesn't
exists in the array.
By the way, this is not an "appending", it's a (failed)
assignment.
I know about this way:
string[] a;
a = new s
On Monday, 30 December 2013 at 18:19:54 UTC, Dfr wrote:
This simple example:
string[] a;
a[10] = "hello";
Gives me: core.exception.RangeError: Range violation
I know about this way:
string[] a;
a = new string[11];
a[10] = "hello";
But what if i need do this many times with the same array lik
This simple example:
string[] a;
a[10] = "hello";
Gives me: core.exception.RangeError: Range violation
I know about this way:
string[] a;
a = new string[11];
a[10] = "hello";
But what if i need do this many times with the same array like
this:
a[10] = "a";
...
a[1] = "b";
..
a[1000] = "c";
Hello,
when I try to run following code:
import std.stdio;
import std.net.curl;
void main()
{
writeln("dlang.org");
}
I get following error:
Fatal Error while loading
'/usr/lib/x86_64-linux-gnu/libphobos2.so.0.64':
The module 'std.regex' is already defined in './maina'.
Segme
On Monday, 30 December 2013 at 17:33:13 UTC, Carl Sturtivant
wrote:
On Monday, 30 December 2013 at 04:35:34 UTC, Dicebot wrote:
It can be forced by pragma(mangle) though. Updated code: [...]
Never heard of pragma(mangle)! Very useful. What role does it
play in D? Is it guaranteed implemented
On Monday, 30 December 2013 at 04:35:34 UTC, Dicebot wrote:
It can be forced by pragma(mangle) though. Updated code: [...]
Never heard of pragma(mangle)! Very useful. What role does it
play in D? Is it guaranteed implemented on x86 or amd64?
Thanks for the answer, very nice.
Am 30.12.2013 14:04, schrieb Jacob Carlborg:
I've ported one of my projects[1] from D1 to D2 and it works perfectly
fine on Posix. Now when I try to compile the code on Windows I get a
stack overflow. I really suck at Windows development, I don't even know
where to start. Which debugger should I
On 12/29/2013 10:38 PM, Afshin wrote:
module test;
class Foo {
public static ulong next = 0;
public static ulong getNext() {
return next++;
}
}
void main() {
Foo.getNext();
}
/*
The next++ is the culprit.
Using a ++next does not throw an exception.
*/
Must have
I've ported one of my projects[1] from D1 to D2 and it works perfectly
fine on Posix. Now when I try to compile the code on Windows I get a
stack overflow. I really suck at Windows development, I don't even know
where to start. Which debugger should I use that can handle the debug
format DMD is
On Monday, 30 December 2013 at 11:23:39 UTC, Ilya Yaroshenko
wrote:
Hello!
Is there any ability to lambda function call itself?
Is it correct feature for D?
Best Regards,
Ilya
Well it's possible to do this (sort of).
//You could for instance define the Factorial function like this.
int del
Use Y combinator?
http://forum.dlang.org/thread/mailman.157.1385247528.2552.digitalmars-d-le...@puremagic.com#post-l6rgfq:24g5o:241:40digitalmars.com
Hello!
Is there any ability to lambda function call itself?
Is it correct feature for D?
Best Regards,
Ilya
On Monday, 30 December 2013 at 06:52:20 UTC, Ilya Yaroshenko
wrote:
case 1:
delete ar;
case 2:
ar.destroy();
case 3:
GC.free(ar.ptr);
case 4:
ar = null;// (assumed that ar is only one pointer to the same
array)
What is the difference?
How to free memory to the system immediately?
It dep
Answer will make more sense if ar is assumed to be any
heap-allocated object, not just dynamic array.
On Monday, 30 December 2013 at 06:52:20 UTC, Ilya Yaroshenko
wrote:
case 1:
delete ar;
Deprecated. Used to call destructor and GC.free after that
case 2:
ar.destroy();
Current solution
Ilya Yaroshenko:
case 1:
delete ar;
It's deprecated.
case 4:
ar = null;// (assumed that ar is only one pointer to the same
array)
It's the simpler way.
How to free memory to the system immediately?
What is your use case?
Bye,
bearophile
46 matches
Mail list logo