On 10/15/2014 09:35 PM, MachineCode wrote:
Is there one function in the Phobos library to check if give an array is
equal to first elements in another array? e.g, f(a, b) the entire b
array must match to first elements in a and then return true otherwise
false, ie:
a[0 .. b.length] == b
On 10/15/2014 08:18 PM, dysmondad wrote:
Since I've added this call, my program will sometimes but not always
either generate a core dump or a seg fault. It seems that the issue is
with the const char * parameter.
I don't have a good grasp of the difference between the way D and C work
for
On 10/16/2014 12:18 PM, dysmondad wrote:
Since I've added this call, my program will sometimes but not always
either generate a core dump or a seg fault. It seems that the issue is
with the const char * parameter.
I don't have a good grasp of the difference between the way D and C work
for char
On 10/16/2014 4:54 PM, Mike Parker wrote:
On 10/16/2014 12:18 PM, dysmondad wrote:
Since I've added this call, my program will sometimes but not always
either generate a core dump or a seg fault. It seems that the issue is
with the const char * parameter.
I don't have a good grasp of the
I am trying to implement a groupBy function that groups by the
return type of a predicate. Currently I have to define the
returntype of the predicate for it to compile. Is there a way to
get the return type at compile time and use it.
The code:
V[K] groupBy( alias func, K, V )( V values )
{
On Wednesday, 15 October 2014 at 21:28:05 UTC, Nils Boßung wrote:
On Wednesday 15 October 2014 22:13, John Colvin wrote:
On Wednesday, 15 October 2014 at 19:29:27 UTC, Jack Applegame
wrote:
I don't understand why this code doesn't compile:
http://dpaste.dzfl.pl/dfd8df7f80ad
that should be
This works:
import std.range;
auto groupBy(alias func, R)(R values)
if (isInputRange!R)
{
alias K = typeof(func(values.front));
alias V = ElementType!R[];
V[K] grouped;
foreach(value; values) grouped[func(value)] ~= value;
return grouped;
}
unittest {
struct Test {
On Thursday, 16 October 2014 at 08:18:02 UTC, Atila Neves wrote:
This works:
import std.range;
auto groupBy(alias func, R)(R values)
if (isInputRange!R)
{
alias K = typeof(func(values.front));
alias V = ElementType!R[];
V[K] grouped;
foreach(value; values)
On Wednesday, 15 October 2014 at 16:11:22 UTC, Steven
Schveighoffer wrote:
*snip*
You might of missed Adam's response up there:
But the best way is to explicitly pass all the file names to
the compiler:
dmd yourfile.d file2.d folder/file3.d and so on...
Doing that will serve you best in
On Thursday, 16 October 2014 at 10:59:29 UTC, Rei Roldan wrote:
On Wednesday, 15 October 2014 at 16:11:22 UTC, Steven
Schveighoffer wrote:
*snip*
You might of missed Adam's response up there:
But the best way is to explicitly pass all the file names to
the compiler:
dmd yourfile.d
On 10/16/14 6:59 AM, Rei Roldan wrote:
On Wednesday, 15 October 2014 at 16:11:22 UTC, Steven Schveighoffer wrote:
*snip*
You might of missed Adam's response up there:
But the best way is to explicitly pass all the file names to the
compiler:
dmd yourfile.d file2.d folder/file3.d and so
On Wednesday, 15 October 2014 at 21:15:14 UTC, Nordlöw wrote:
Comint exited abnormally with code 1 at Wed Oct 15 23:14:37
I'm stuck. Need help.
I will give it a try
On Thursday, 16 October 2014 at 13:56:18 UTC, Robert burner
Schadek wrote:
I'm stuck. Need help.
I will give it a try
Thank you.
Hi,
I'm using structs to describe my functions:
struct example
{
string name;
uint someValue;
}
module mod.example1;
@example(example1, 1)
void myFunction()
{
// do something
}
module mod.example2;
@example(example2, 2)
void myFunction()
{
// do something
}
I'm using the struct to
I have some string *str* of unicode characters. The question is
how to check if I have valid unicode code point starting at code
unit *index*?
I need it because I try to write parser that operates on string
by *code unit*. If more precisely I trying to write function
*matchWord* that should
On Thu, 16 Oct 2014 18:39:48 +
nrgyzer via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
But it always stats that 'cmodule' has no members. Does anyone
know how to solve the problem?
there is no non-hackish solution, afaik. there is no even hackish, but
reliable one.
On Thursday, 16 October 2014 at 18:39:50 UTC, nrgyzer wrote:
Hi,
I'm using structs to describe my functions:
struct example
{
string name;
uint someValue;
}
module mod.example1;
@example(example1, 1)
void myFunction()
{
// do something
}
module mod.example2;
@example(example2, 2)
void
On Tuesday, 14 October 2014 at 20:08:03 UTC, Brad Anderson wrote:
On Tuesday, 14 October 2014 at 20:05:07 UTC, Brad Anderson
wrote:
https://github.com/D-Programming-Language/phobos/blob/master/std/json.d#L579
Oops. Linked the the parser section. I actually don't see any
unicode escape
On 16/10/14 20:46, Uranuz via Digitalmars-d-learn wrote:
I have some string *str* of unicode characters. The question is how to check if
I have valid unicode code point starting at code unit *index*?
[...]
You cannot do that without decoding. Cheking whether utf-x is valid and decoding
are
On 10/16/2014 12:43 PM, spir via Digitalmars-d-learn wrote:
denis
spir is back! :)
On 10/16/2014 11:46 AM, Uranuz wrote:
I have some string *str* of unicode characters. The question is how to
check if I have valid unicode code point starting at code unit *index*?
It is easy if I
Any way of using dub (on Windows or OSX). I've been trying it
lately, but not much success.
1. (In the command prompt or Terminal), I create a new folder.
2. Run 'dub init' in the new folder
3. I copy the dependency from a lib/app into the dub.json file.
4. Then I just enter 'dub'
In Windows I
I'm a newbie to programming and have been looking into the D lang
as a general purposing language to learn, yet the D overview
indicates that java would be a better language to learn for your
first programming language. Why? Looks like D is easier than
Java...
On 10/16/2014 03:26 PM, RBfromME wrote:
I'm a newbie to programming and have been looking into the D lang as a
general purposing language to learn, yet the D overview indicates that
java would be a better language to learn for your first programming
language. Why? Looks like D is easier
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote:
I'm a newbie to programming and have been looking into the D
lang as a general purposing language to learn, yet the D
overview indicates that java would be a better language to
learn for your first programming language. Why? Looks
On Monday, 25 August 2014 at 18:10:33 UTC, Gary Willoughby wrote:
class Foo
{
private int foo;
mixin Proxy!(foo);
this(int x)
{
this.foo = x;
}
}
Apparently Proxy
On Thu, 16 Oct 2014 22:43:11 +
Brad Anderson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
also shows just how old the Overview is (where do you even get a
BASIC compiler these days?).
voila: http://www.freebasic.net/
;-)
signature.asc
Description: PGP signature
On Thursday, 16 October 2014 at 22:42:21 UTC, Ali Çehreli wrote:
On 10/16/2014 03:26 PM, RBfromME wrote:
I'm a newbie to programming and have been looking into the D
lang as a
general purposing language to learn, yet the D overview
indicates that
java would be a better language to learn for
On Fri, 17 Oct 2014 00:52:14 +
MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I don't understand. If at least it were C but java? why not D
itself?
C is *awful* as beginner's language. never ever let people start with
C if you don't hate 'em.
as for D...
RBfromME:
I'm a newbie to programming and have been looking into the D
lang as a general purposing language to learn, yet the D
overview indicates that java would be a better language to
learn for your first programming language. Why? Looks like D
is easier than Java...
Python is probably
On Thursday, 16 October 2014 at 07:55:24 UTC, Mike Parker wrote:
On 10/16/2014 4:54 PM, Mike Parker wrote:
On 10/16/2014 12:18 PM, dysmondad wrote:
Since I've added this call, my program will sometimes but not
always
either generate a core dump or a seg fault. It seems that the
issue is
with
On Friday, 17 October 2014 at 01:14:34 UTC, bearophile wrote:
Python is probably a better first language than Java. D is a
little too much complex as first language.
The IDE support is probably a bit better with Java/C# and using a
statically typed language as your first language has
While d can be complex, there's nothing preventing you from starting out
simple and not using all features at first.
I don't understand why it's not suitable for a beginner if you use this
approach...
2014-10-17 6:51 GMT+02:00 via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com:
On
32 matches
Mail list logo