On Thu, 30 Jun 2011 15:52:59 +1200, Joel Christensen wrote:
I'm thinking more about handling binary files. With the C version I
would write a int for how many letters in the string, then put in the
the string along side ([0005][house]). That way I can have any character
at all (though I just
scarrow:
Annoyingly, however, I can't do the following at compile time:
f(Hash(foo));
I'm not sure what the point is in distinguishing between these two cases.
Walter has decided that he doesn't like the D compiler to arbitrary run at
compile time arbitrary long to run code. This is
On Thu, 30 Jun 2011 07:11:44 +0200, scarrow shawn.ba...@gmail.com wrote:
Hey all,
I'd like to embed hashed strings into my code. The C++ version of this
engine
ran an external tool to preprocess the files. In D my strongly pure
function
is only evaluated if I assign it to something like
Yes, portability, I hadn't thought of that.
Shouldn't file.rawWrite((i)[0..1]); have [0..4]? Or am I missing some
thing?
- Joel
On 30-Jun-11 7:53 PM, Ali Çehreli wrote:
On Thu, 30 Jun 2011 15:52:59 +1200, Joel Christensen wrote:
I'm thinking more about handling binary files. With the C
On Fri, 01 Jul 2011 05:28:56 +1200, Joel Christensen wrote:
Shouldn't file.rawWrite((i)[0..1]); have [0..4]? Or am I missing some
thing?
[0..1] follows the regular slicing syntax there: those are element
indexes. Since i is an int*, [0..1] slices the first int. It would be
different if it
Marco Cosentino:
Translated correctly the C callback style into D delegates types with alias.
D has function pointers too.
Managed some segment faluts happened when not using toStringz() with
some strings
For this kind of bugs I suggest to use the D type system in a smarter way. With
Try this:
int
process (jack_nframes_t nframes, void *arg)
-
extern(C) int
process (jack_nframes_t nframes, void *arg)
Now that typedef is deprecated what solution do you suggest instead?
Something like this, I think:
struct ccharPtr {
const char* ptr;
alias ptr this;
}
ccharPtr toStringz2(string s) {
return ccharPtr(toStringz(s));
}
Bye,
bearophile
I'm referring to these two in std.string:
public import std.algorithm : startsWith, endsWith, cmp, count;
public import std.array : join, split;
Because whenever I try to use .count in my code:
import std.stdio;
import std.string;
import std.utf;
void main()
{
writeln(foo.count);
}
On 01.07.2011 01:14, Andrej Mitrovic wrote:
I'm referring to these two in std.string:
public import std.algorithm : startsWith, endsWith, cmp, count;
public import std.array : join, split;
Because whenever I try to use .count in my code:
import std.stdio;
import std.string;
import std.utf;
That makes sense, I understand. But I hate these conflicts. I've got
`alias std.bla.foo foo` scattered in most of my code due to constant
conflicts. :/
I have a parametrized struct (Vector!(T, dim)) that takes two parameters
(Type and a number). And made some Alias with defaults parameters.
In other struct (Matrix!(T, dim)), that uses these struct to represent a
matrix in column-major order. I have a internall alias for Vector using
On 2011-06-30 16:39, Zardoz wrote:
I have a parametrized struct (Vector!(T, dim)) that takes two parameters
(Type and a number). And made some Alias with defaults parameters.
In other struct (Matrix!(T, dim)), that uses these struct to represent a
matrix in column-major order. I have a
On 2011-06-30 16:14, Andrej Mitrovic wrote:
I'm referring to these two in std.string:
public import std.algorithm : startsWith, endsWith, cmp, count;
public import std.array : join, split;
Because whenever I try to use .count in my code:
import std.stdio;
import std.string;
import
On Fri, 01 Jul 2011 01:39:53 +0200, Zardoz luis.panad...@gmail.com wrote:
I have a parametrized struct (Vector!(T, dim)) that takes two parameters
(Type and a number). And made some Alias with defaults parameters.
In other struct (Matrix!(T, dim)), that uses these struct to represent a
matrix
So I thought this would be in Phobos, basically I want to reverse the
polarity of a value in a range.
What I mean is if I have a possible range of 0 .. 127, then the values
of the left would equal the inverted values on the right:
0 - 127
10 - 117
20 - 107
50 - 77
77 - 50
and so on.. Quite easy
Stupid brain, LOL.
auto arr = array(retro(iota(0, 127)));
Problem solved.
Woops, bug, right side not inclusive. Fixed:
auto arr = array(retro(iota(0, 128)));
Andrej Mitrovic Wrote:
I'm referring to these two in std.string:
public import std.algorithm : startsWith, endsWith, cmp, count;
public import std.array : join, split;
I'm not sure why they are public, but selective/named imports have been
publicly imported for some time. Bugzilla 3?? I
I have two functions running concurrently and they share data via a
globally shared array.
Generally one thread modifies an array and potentially changes its
length, the other thread reads from it. I have to avoid too many locks
and message passing wouldn't really work since I need fast access to
20 matches
Mail list logo