On 02/29/2012 08:28 PM, James Miller wrote:
> I understand that Appenders aren't arrays, and should not be used as
> such, but you /can/ use an array as an Appender.
Yes you can but whatever you put() into the array is immediately
popFront()'ed from the array. ;) You must use a temporary surrog
On 1 March 2012 16:15, ixid wrote:
> In C++ this works:
>
> struct test
> {
> unsigned int h : 2;
> };
>
> int main()
> {
> test b;
> b.h = 0;
> for(int i = 0;i < 10;i++)
> ++b.h;
> return 0;
> }
>
> In D this throws an exception as soon as it wrap
On 1 March 2012 15:49, Adam D. Ruppe wrote:
> On Thursday, 1 March 2012 at 02:44:35 UTC, Jonathan M Davis wrote:
>>
>> True, but it can't do all of the other operations that array can do
>> either.
>
>
> Yeah, but the one operation it replaces, ~=, can be done
> on an array.
>
> If you're trying t
On Thursday, 1 March 2012 at 02:07:44 UTC, bioinfornatics wrote:
It is ok i have found a way maybe is not an efficient way but
it works:
https://gist.github.com/1946669
a minor bug exist for parse track line will be fixed tomorrow.
time to
bed
Big thanks to all
You can edit a gist instea
In C++ this works:
struct test
{
unsigned int h : 2;
};
int main()
{
test b;
b.h = 0;
for(int i = 0;i < 10;i++)
++b.h;
return 0;
}
In D this throws an exception as soon as it wraps:
struct test
{
mixin(bitfields!(
On Thursday, 1 March 2012 at 02:44:35 UTC, Jonathan M Davis wrote:
True, but it can't do all of the other operations that array
can do either.
Yeah, but the one operation it replaces, ~=, can be done
on an array.
If you're trying to convert array code to Appender for
speed, most likely you're
On Thursday, March 01, 2012 03:29:06 Adam D. Ruppe wrote:
> On Thursday, 1 March 2012 at 02:23:55 UTC, bearophile wrote:
> > But for me it's weird that Appender doesn't use the D operator
> > to _append_. [...] I suggest to give it both "put" method and
> > "~=" operator.
>
> I agree entirely.
>
On Wednesday, February 29, 2012 21:23:54 bearophile wrote:
> Jonathan M Davis:
> > > put is a function on output ranges, and Appender is an output range.
> >
> > Also, given that it doesn't define ~ (and it wouldn't really make sense
> > for it to), it would be very weird IMHO to define ~=.
>
> I
On Thursday, 1 March 2012 at 02:23:55 UTC, bearophile wrote:
But for me it's weird that Appender doesn't use the D operator
to _append_. [...] I suggest to give it both "put" method and
"~=" operator.
I agree entirely.
Another annoyance is if you have a function that works on
regular arrays
Jonathan M Davis:
> > put is a function on output ranges, and Appender is an output range.
>
> Also, given that it doesn't define ~ (and it wouldn't really make sense for
> it
> to), it would be very weird IMHO to define ~=.
I don't understand why that's weird.
In Java you can't overload an ap
Le jeudi 01 mars 2012 à 01:52 +0100, bioinfornatics a écrit :
> Le mercredi 29 février 2012 à 13:23 +0100, Jesse Phillips a écrit :
> > On Wednesday, 29 February 2012 at 11:51:29 UTC, bioinfornatics
> > wrote:
> > > Le mercredi 29 février 2012 à 12:42 +0100, bioinfornatics a
> > > écrit :
> > >>
On Wednesday, February 29, 2012 20:53:04 Jonathan M Davis wrote:
> On Wednesday, February 29, 2012 20:25:35 bearophile wrote:
> > Do you know why std.array.Appender defines a "put" method instead of
> > overloading the "~=" operator?
>
> put is a function on output ranges, and Appender is an outpu
Luckily you can always use alias this and overload opCatAssign. 'alias
this' is a great tool for customizing APIs. :)
On Wednesday, February 29, 2012 20:25:35 bearophile wrote:
> Do you know why std.array.Appender defines a "put" method instead of
> overloading the "~=" operator?
put is a function on output ranges, and Appender is an output range.
- Jonathan M Davis
Do you know why std.array.Appender defines a "put" method instead of
overloading the "~=" operator?
Bye and thank you,
bearophile
Le mercredi 29 février 2012 à 13:23 +0100, Jesse Phillips a écrit :
> On Wednesday, 29 February 2012 at 11:51:29 UTC, bioinfornatics
> wrote:
> > Le mercredi 29 février 2012 à 12:42 +0100, bioinfornatics a
> > écrit :
> >> Dear,
> >>
> >> I would like to parse this file:
> >> http://genome.ucsc.
On Thursday, March 01, 2012 00:17:55 Robert Clipsham wrote:
> Just as a side note, -profile doesn't work with multi-threaded
> applications, so using some other profiler would probably be a better
> bet anyway.
It doesn't work with 64-bit programs either.
- Jonathan M Davis
On 29/02/2012 21:30, simendsjo wrote:
On Wed, 29 Feb 2012 22:28:29 +0100, Robert Clipsham
wrote:
On 29/02/2012 19:41, simendsjo wrote:
http://www.digitalmars.com/ctg/trace.html
Has someone made some GUI/pretty printing/dump to database or other
tools to make the profile data a bit simpler to
thank you, I'll give it a try.
One of my previous attempts failed because I didn't know what was really
needed to include in the bindings and what was excess. I'm going to post
what I have in a week, hope it works out.
On 1 March 2012 10:05, maarten van damme wrote:
> I've tried porting libcap once but I failed miserably. If I'd succeed in
> porting they wouldn't be of good quality.
Not porting, writing bindings for it. Its pretty easy. just convert
the declarations into D extern (C) { declarations.
By the look
Boom: https://bitbucket.org/stqn/profiled
I've never used it though.
On Wed, 29 Feb 2012 22:28:29 +0100, Robert Clipsham
wrote:
On 29/02/2012 19:41, simendsjo wrote:
http://www.digitalmars.com/ctg/trace.html
Has someone made some GUI/pretty printing/dump to database or other
tools to make the profile data a bit simpler to digest?
If you're on Windows you c
On 29/02/2012 19:41, simendsjo wrote:
http://www.digitalmars.com/ctg/trace.html
Has someone made some GUI/pretty printing/dump to database or other
tools to make the profile data a bit simpler to digest?
If you're on Windows you could try:
http://h3.gd/code/xfProf/
Although I don't believe i
I've tried porting libcap once but I failed miserably. If I'd succeed in
porting they wouldn't be of good quality.
Am 29.02.2012 20:44, schrieb maarten van damme:
hello,
I want to use raw sockets but there is a lack of documentation on how to
use them in D.
Is there somewhere I can read more about them or has someone succesfully
used them?
Thank you,
maarten
Hello,
I would use libpcap for that, since this
http://www.digitalmars.com/ctg/trace.html
Has someone made some GUI/pretty printing/dump to database or other tools
to make the profile data a bit simpler to digest?
hello,
I want to use raw sockets but there is a lack of documentation on how to
use them in D.
Is there somewhere I can read more about them or has someone succesfully
used them?
Thank you,
maarten
On 2/29/12, Andrej Mitrovic wrote:
> Just noticed it doesn't work ok if there's a nested template
> declaration in a struct. It would say "Error: cannot resolve type for
> t.temp(T)".
Correction: it was the unittest block that was problematic. I've filed
it http://d.puremagic.com/issues/show_bug.
On 2/29/12, Philippe Sigaud wrote:
> Nice. What does it give for:
>
> - function overloads (PITA that)?
> - type aliase (alias int Int;)?
> - function aliases or member aliases?
> - inner templates (struct template, etc, not pure template as these are not
> allowed in a struct)?
> - unittests insi
On 02/28/2012 02:12 AM, Dmitry Olshansky wrote:
> On 28.02.2012 2:17, Ali Çehreli wrote:
>> I have played with this optimization recently. (Could be dmd 2.057.) No,
>> dmd did not optimize a straightforward switch statement over a ubyte
>> expression with about two hundred ubyte cases.
>>
> Hate
On 2/29/12, Jacob Carlborg wrote:
> Seems like what I have in my serialization library Orange:
Sweet. I was gonna take a look at Orange for just this purpose. Thanks.
Hi Andrew,
I ran into this problem as well and here is how I fixed/hacked
it:
OSX Lion, and soon to be Mountain Lion, no longer come with GCC
installed for the Command Line (/usr/bin/gcc)
What you need to do is Install Xcode from the app store, which
is free, and then:
* Launch your Xcode
On Monday, 20 February 2012 at 11:18:34 UTC, Tyro[a.c.edwards]
wrote:
...
and I doubt you want me to put all of what "dmd -v" spits out
for this little script.
Thanks,
Andrew
Hi Andrew,
I ran into this problem as well and here is how I fixed/hacked it:
OSX Lion, and soon to be Mountain Lio
On Wed, 29 Feb 2012 19:00:10 +0100, bearophile
wrote:
simendsjo:
Yes. "Using argument types E3" doesn't make much sense when the named
enum
is a complex type.
If this diagnostic bug/enhancement is not in Bugzilla then I suggest you
to add it. Now there are two persons that are quite e
On Wednesday, February 29, 2012 12:15:35 simendsjo wrote:
> .. That is >> enum E : Struct {}
>
> struct S {
> int a;
> }
>
> // ok
> enum E : S {
> a = S(1),
> }
>
> // Error: need member function opCmp() for struct S to compare
> /*
> enum E2 : S {
> a = S(1),
> b = S(2)
> }
> */
>
> struct S2
simendsjo:
> Yes. "Using argument types E3" doesn't make much sense when the named enum
> is a complex type.
If this diagnostic bug/enhancement is not in Bugzilla then I suggest you to add
it. Now there are two persons that are quite efficient at fixing Bugzilla bugs,
but they need to know th
you are right, that was the error.
Thanks.
Kind regards
André
Am 29.02.2012 18:27, schrieb Kevin Cox:
I think you need the -lib in the linker command (too?).
On Feb 29, 2012 12:25 PM, "André" mailto:an...@s-e-a-p.de>> wrote:
Hi,
I use Mono-D and have a hello world example which compil
I think you need the -lib in the linker command (too?).
On Feb 29, 2012 12:25 PM, "André" wrote:
> Hi,
> I use Mono-D and have a hello world example which compiles fine.
> I set the compiler option "-lib" and receives an error "undefined
> reference to `_Dmain'".
>
> Following commands are genera
Hi,
I use Mono-D and have a hello world example which compiles fine.
I set the compiler option "-lib" and receives an error "undefined
reference to `_Dmain'".
Following commands are generated for the build process:
dmd -c "main.d"
-of"/home/user/Dokumente/MonoDevelop/HelloWorld/HelloWorld/obj/
On 2012-02-29 10:58, Andrej Mitrovic wrote:
I've done this a couple of times before but I always had issues, e.g.
functions and property calls would be mixed in. But I think I have a
good go-to function now:
import std.algorithm;
import std.conv;
import std.string;
import std.stdio;
import std.r
On 2012-02-29 14:24:36 +, Philippe Sigaud said:
[snip]
Thanks for the response.
In the meantime, I also hacked together a simple version of what I
needed (see below), but I'll look into the references you provided as
well :)
void forall(alias func, size_t lvl=0, T...)(T args) {
stat
James Miller Wrote:
> On 29 February 2012 20:21, Jos van Uden wrote:
> > On 29-2-2012 7:06, James Miller wrote:
> >>
> >> On 29 February 2012 18:51, jic  wrote:
> >>>
> >>>
> >>> Greetings!
> >>>
> >>> I have this program,
> >>>
> >>> import std.process : system;
> >>> import std.stdio;
> >>> in
> I've done this a couple of times before but I always had issues, e.g.
> functions and property calls would be mixed in. But I think I have a
> good go-to function now:
Nice. What does it give for:
- function overloads (PITA that)?
- type aliase (alias int Int;)?
- function aliases or member ali
> I have a need for a Cartesian product of multiple ranges. I see there's
been a discussion here (Dec 2011) as well as a request posted (#7128). It
seems to me that the request deals with a multidimensional product -- which
is what I need -- while the implementation by Timon Gehr deals only with
th
Hi!
I have a need for a Cartesian product of multiple ranges. I see there's
been a discussion here (Dec 2011) as well as a request posted (#7128).
It seems to me that the request deals with a multidimensional product
-- which is what I need -- while the implementation by Timon Gehr deals
only
On Wed, 29 Feb 2012 13:40:51 +0100, bearophile
wrote:
simendsjo:
Perhaps also the documentation for opCmp should be improved..?
Also, and maybe here DMD has to give better error messages :-)
Bye,
bearophile
Yes. "Using argument types E3" doesn't make much sense when the named enum
is
simendsjo:
> Perhaps also the documentation for opCmp should be improved..?
Also, and maybe here DMD has to give better error messages :-)
Bye,
bearophile
On Wednesday, 29 February 2012 at 11:51:29 UTC, bioinfornatics
wrote:
Le mercredi 29 février 2012 à 12:42 +0100, bioinfornatics a
écrit :
Dear,
I would like to parse this file:
http://genome.ucsc.edu/goldenPath/help/ItemRGBDemo.txt
My problem is:
- need to parse data in csv format
- how mana
Le mercredi 29 février 2012 à 12:42 +0100, bioinfornatics a écrit :
> Dear,
>
> I would like to parse this file:
> http://genome.ucsc.edu/goldenPath/help/ItemRGBDemo.txt
>
> struct Bed{
> stringchrom;// 0
> size_tchromStart; // 1
> size_tchromEnd; // 2
Dear,
I would like to parse this file:
http://genome.ucsc.edu/goldenPath/help/ItemRGBDemo.txt
struct Bed{
stringchrom;// 0
size_tchromStart; // 1
size_tchromEnd; // 2
stringname; // 3
size_tscore;// 4
On Wed, 29 Feb 2012 12:27:32 +0100, simendsjo wrote:
On Wed, 29 Feb 2012 12:15:35 +0100, simendsjo
wrote:
.. That is >> enum E : Struct {}
struct S {
int a;
}
// ok
enum E : S {
a = S(1),
}
// Error: need member function opCmp() for struct S to compare
/*
enum E2 : S {
a
On Wed, 29 Feb 2012 12:15:35 +0100, simendsjo wrote:
.. That is >> enum E : Struct {}
struct S {
int a;
}
// ok
enum E : S {
a = S(1),
}
// Error: need member function opCmp() for struct S to compare
/*
enum E2 : S {
a = S(1),
b = S(2)
}
*/
struct S2 {
int a;
i
.. That is >> enum E : Struct {}
struct S {
int a;
}
// ok
enum E : S {
a = S(1),
}
// Error: need member function opCmp() for struct S to compare
/*
enum E2 : S {
a = S(1),
b = S(2)
}
*/
struct S2 {
int a;
int opCmp(ref const S2 other)
{
return a == other.a
Just noticed there's an std.traits import missing. I hate how D
silently ignores that FunctionTypeOf is left undefined.
I've done this a couple of times before but I always had issues, e.g.
functions and property calls would be mixed in. But I think I have a
good go-to function now:
import std.algorithm;
import std.conv;
import std.string;
import std.stdio;
import std.range;
struct Foo
{
int one = 1;
@prop
On Wed, 29 Feb 2012 07:44:23 +0100, James Miller wrote:
On 29 February 2012 19:30, simendsjo wrote:
On Wed, 29 Feb 2012 05:03:30 +0100, Mike Parker
wrote:
On 2/29/2012 1:10 AM, simendsjo wrote:
On Tue, 28 Feb 2012 16:58:13 +0100, Trass3r wrote:
http://d.puremagic.com/issues/show_bug
On 2/29/12, James Miller wrote:
> Today I Learned that windows has insane escaping.
You won't have to worry about it for long:
https://github.com/D-Programming-Language/phobos/pull/457
57 matches
Mail list logo