On Wednesday, 18 September 2013 at 21:13:27 UTC, mrd wrote:
This bug reproducible also without a template:
http://pastebin.com/QPvCFYL1
$ ./bug
works:
Inside of body: value=1 type=ulong
Inside of out contract: value=1 type=ulong result=[1]
not works:
Inside of body: value=300 type=ulong
Inside
On 09/17/2013 07:26 PM, H. S. Teoh wrote:
> On Wed, Sep 18, 2013 at 04:12:01AM +0200, John Colvin wrote:
>> On Wednesday, 18 September 2013 at 01:24:37 UTC, Ali Çehreli wrote:
>>> As far as I know, static foreach is only for tuples (or TypeTuples)
>>
>> TypeTuples are tuples. Sortof. We really ne
On Thursday, 19 September 2013 at 06:39:09 UTC, Ivan Kazmenko
wrote:
On Thursday, 19 September 2013 at 01:41:15 UTC, mrd wrote:
$ ./bug
body, value=2
out contract, value=0
Why argument "value" in contract isn't equal 2 ?
Why should it be? value is a mutable argument, and the out
contract ev
On Thursday, 19 September 2013 at 06:39:09 UTC, Ivan Kazmenko
wrote:
On Thursday, 19 September 2013 at 01:41:15 UTC, mrd wrote:
$ ./bug
body, value=2
out contract, value=0
Why argument "value" in contract isn't equal 2 ?
Why should it be? value is a mutable argument, and the out
contract ev
On Wednesday, 18 September 2013 at 22:20:45 UTC, H. S. Teoh wrote:
On Wed, Sep 18, 2013 at 10:46:18PM +0200, Namespace wrote:
D's Array length is currently of type size_t, which means on
32 bit
it's an uint and on 64 bit an ulong. This is difficult: What
if I
want to give the length of an array
On Thursday, 19 September 2013 at 11:10:08 UTC, bearophile wrote:
Namespace:
So to!int is safer but slower and a cast would be unsafe but
faster?
Right.
Bye,
bearophile
Thanks!
Namespace:
So to!int is safer but slower and a cast would be unsafe but
faster?
Right.
Bye,
bearophile
On Thursday, 19 September 2013 at 07:46:41 UTC, Ali Çehreli wrote:
I have just published two chapters that present tuples and
TypeTuple sufficiently-completely and sufficiently-consistently
(of course, according to me ;) ):
Tuples:
http://ddili.org/ders/d.en/tuples.html
More Templates:
Hello all,
This is a query that relates to my Dgraph library:
https://github.com/WebDrake/Dgraph
When simulating graphs/networks, very often you want the vertices or edges to
have certain properties. For example, the edges may have weights, or the
vertices may be coloured.
The current imple
On 19/09/13 17:21, Dicebot wrote:
+1 Why do you need to use tuples and manually force them into struct behavior
instead of simply using structs?
I guess I was thinking it'd be more finnicky to do something like
struct EdgeProperties { double weight; }
struct VertexProperties { size_t co
Short question in case anyone knows the answer straight away:
How do I sort text so that non-ascii characters like "á" are
treated in the same way as "a"?
Now I'm getting this:
[wow, ara, ába, marca]
===> sort(listAbove);
[ara, marca, wow, ába]
I'd like to get:
[ ába, ara, marca, wow]
Th
On Thursday, 19 September 2013 at 14:56:08 UTC, Artur Skawina
wrote:
I'm not sure i understand your problem, but you could use
structs. ie:
struct VertexProperties {
size_t color;
string name;
}
You can get the field names and types at CT and work with that.
+1 Why do you n
On 09/19/13 16:40, Joseph Rushton Wakeling wrote:
> alias EdgeProperties = Tuple!(double, "weight");
>
> alias VertexProperties = Tuple!(size_t, "colour", string, "name");
>
> So then, you'd be able to extract the list of variable names and types at
> compile time and use them to create
On 19/09/13 16:55, Artur Skawina wrote:
I'm not sure i understand your problem, but you could use structs. ie:
struct VertexProperties {
size_t color;
string name;
}
You can get the field names and types at CT and work with that.
Yes, that's a good suggestion. I guess I
On Thursday, 19 September 2013 at 15:18:11 UTC, Chris wrote:
Short question in case anyone knows the answer straight away:
How do I sort text so that non-ascii characters like "á" are
treated in the same way as "a"?
Now I'm getting this:
[wow, ara, ába, marca]
===> sort(listAbove);
[ara, m
On Thursday, 19 September 2013 at 15:34:28 UTC, monarch_dodra
wrote:
On Thursday, 19 September 2013 at 15:18:11 UTC, Chris wrote:
Short question in case anyone knows the answer straight away:
How do I sort text so that non-ascii characters like "á" are
treated in the same way as "a"?
Now I'm
Chris:
How do I sort text so that non-ascii characters like "á" are
treated in the same way as "a"?
The correct solution is a well implemented, well updated and well
debugged Unicode Collation Algorithm, as already answered.
But if an approximation is enough then you could translate to D
thi
On Thursday, 19 September 2013 at 15:42:52 UTC, bearophile wrote:
Chris:
How do I sort text so that non-ascii characters like "á" are
treated in the same way as "a"?
The correct solution is a well implemented, well updated and
well debugged Unicode Collation Algorithm, as already answered.
B
On 09/19/13 17:22, Joseph Rushton Wakeling wrote:
> On 19/09/13 16:55, Artur Skawina wrote:
>> I'm not sure i understand your problem, but you could use structs. ie:
>>
>> struct VertexProperties {
>>size_t color;
>>string name;
>> }
>>
>> You can get the field names and typ
Multi-part question:
1) Why does the last line fail? If cast to immutable how is it
different than z? I know it is related to the ref. I'm using ref
because I think it is likely more efficient - so assume the
char[16] were really char[1024].
2) If I got rid of the ref, how many copies of the
On 09/19/2013 08:18 AM, Chris wrote:
Short question in case anyone knows the answer straight away:
How do I sort text so that non-ascii characters like "á" are treated in
the same way as "a"?
Now I'm getting this:
[wow, ara, ába, marca]
===> sort(listAbove);
[ara, marca, wow, ába]
I'd like
On Thursday, 19 September 2013 at 16:47:13 UTC, Daniel Davidson
wrote:
Multi-part question:
1) Why does the last line fail? If cast to immutable how is it
different than z? I know it is related to the ref. I'm using
ref because I think it is likely more efficient - so assume the
char[16] were
This doesn't seem to be a D problem. I re-implemented it in C and got
the same error.
On 09/18/2013 02:00 PM, Charles Hixson wrote:
I'm trying to use SQLite3 in D, but am getting a segmentation fault
when I attempt to replace the exec statement with a prepare
statement. What am I doing wrong
On Thursday, 19 September 2013 at 16:50:32 UTC, Namespace wrote:
cast(immutable)data) is not an lvalue, it's a rvalue. ref
accepts only lvalues.
Thanks... about the other questions?
On Thursday, 19 September 2013 at 07:45:44 UTC, monarch_dodra
wrote:
On Thursday, 19 September 2013 at 06:39:09 UTC, Ivan Kazmenko
wrote:
On Thursday, 19 September 2013 at 01:41:15 UTC, mrd wrote:
Why argument "value" in contract isn't equal 2 ?
Why should it be?
I actually disagree though:
On 19-9-2013 17:18, Chris wrote:
Short question in case anyone knows the answer straight away:
How do I sort text so that non-ascii characters like "á" are treated in the same way as
"a"?
Now I'm getting this:
[wow, ara, ába, marca]
===> sort(listAbove);
[ara, marca, wow, ába]
I'd like to
Ali Çehreli wrote:
> On 09/16/2013 01:24 PM, Marek Janukowicz wrote:
>
> >static string[string] columns () {
> // ...
> >}
>
> Although the function itself is static, it returns a dynamic value.
>
> > foreach( attr, col; columns() ) {
> >__traits(getMember, me, attr) =
On Thursday, 19 September 2013 at 18:44:54 UTC, Jos van Uden
wrote:
On 19-9-2013 17:18, Chris wrote:
Short question in case anyone knows the answer straight away:
How do I sort text so that non-ascii characters like "á" are
treated in the same way as "a"?
Now I'm getting this:
[wow, ara, áb
On 09/19/13 20:01, Ivan Kazmenko wrote:
> On Thursday, 19 September 2013 at 07:45:44 UTC, monarch_dodra wrote:
>> On Thursday, 19 September 2013 at 06:39:09 UTC, Ivan Kazmenko wrote:
>>> On Thursday, 19 September 2013 at 01:41:15 UTC, mrd wrote:
Why argument "value" in contract isn't equal 2 ?
You're right about the finalize, but changing the line to:
rc=sqlite3_prepare(db, toStringz(sql), cast(int)sql.length +
1000, &stmt, null);
results in the compile time error:
sqlitetest.d(39): Error: function etc.c.sqlite3.sqlite3_prepare
(sqlite3* db, const(char)* zSql, int nByte, sqli
On Thursday, September 19, 2013 18:47:12 Daniel Davidson wrote:
> Multi-part question:
>
> 1) Why does the last line fail? If cast to immutable how is it
> different than z? I know it is related to the ref. I'm using ref
> because I think it is likely more efficient - so assume the
> char[16] were
On Thu, Sep 19, 2013 at 12:46:39AM -0700, Ali Çehreli wrote:
> On 09/17/2013 07:26 PM, H. S. Teoh wrote:
>
> > On Wed, Sep 18, 2013 at 04:12:01AM +0200, John Colvin wrote:
> >> On Wednesday, 18 September 2013 at 01:24:37 UTC, Ali Çehreli wrote:
> >>> As far as I know, static foreach is only for tu
Jonathan M Davis:
All in all, I think that it's pretty much always a bad idea to
have a struct
with const or immutable members. It's just begging for
problems. Tail-const or
tail-immutable is fine, because the members themselves aren't
const or
immutable (just what they refer to), but having t
On Thu, Sep 19, 2013 at 09:12:10PM +0200, Marek Janukowicz wrote:
> Ali Çehreli wrote:
[...]
> > As far as I know, static foreach is only for tuples (or TypeTuples).
> > If you can generate the AA as a tuple, then the foreach will be
> > evaluated at compile time.
>
> I read your articles about tu
On 09/19/2013 12:12 PM, Marek Janukowicz wrote:
> (why is your book not linked on dlang.org?
It will appear there once the translation is complete.
> how do I create a tuple at compile time if I'm getting
> information I want to put into it in a foreach? All the
> examples I found create a tupl
On Thursday, 19 September 2013 at 20:05:34 UTC, Jonathan M Davis
wrote:
As soon as you have a const or immutable member in a struct,
you can't ever
assign anything to it, even if all of its other members are
mutable (you could
assign the individual, mutable members but not the whole
struct). Th
On Wednesday, 11 September 2013 at 17:09:12 UTC, Brad Roberts
wrote:
Please file a bug for this. http://d.puremagic.com/issues/
http://d.puremagic.com/issues/show_bug.cgi?id=11071
Hello all.
I try to use NVI and failed with a snippet from TDPL:
interface Transmogrifier
{
final void thereAndBack()
{
transmogrify();
untransmogrify();
}
private:
void transmogrify();
void untransm
if I use protected instead of private in interface like:
interface Transmogrifier
{
final void thereAndBack()
{
transmogrify();
untransmogrify();
}
protected:
void transmogrify();
void untransmogrify()
I would like to know if there are any obvious show-stoppers with
using OpenMP and Cilk Plus with D through C interface? In the
simplest case I have an array float[N] and I want to pass it to C
function, which will modify it using OpenMP and Cilk Plus.
On 09/19/2013 10:31 PM, Alexandr Druzhinin wrote:
> if I use protected instead of private in interface like:
private member functions are non-virtual.
> interface Transmogrifier
> {
> final void thereAndBack()
> {
> transmogrify();
> untransmogrify();
> }
>
>
On 09/19/2013 12:53 PM, H. S. Teoh wrote:
> I hope you're
> thoroughly confused and utterly perplexed by now
No, because you explained it very well. :)
> readers should instead be directed to std.traits
Indeed, I will add some :) of this information to the Traits chapter
which comes later in
On 09/19/2013 04:32 AM, Dicebot wrote:
> Some obvious catches:
Thank you. I have made those changes except the following one.
> Variadic template arg chapter should probably mention "variadic args of
> length 1" idiom used to have parameter accepting types, values and
> aliases at once.
Could
43 matches
Mail list logo