Thanks Jonathan and Teoh. I just have to pass the var args in my function to
writefln and Variadic templates is the right solution for me.
--
Thanks,
Sarath
8<8<
import std.datetime : benchmark;
import std.stdio : writefln;
struct A(int r, int c){
public:
alias float[r * c] Data;
Data _data;
auto opBinary(A a){
float t;
foreach(i; 0..r*c)
foreach(j; 0..r*c)
t += this[i,j]
On Fri, Feb 24, 2012 at 05:22:58AM +, Sarath Kumar wrote:
> Hi,
>
> Is there an equivalent to vfprintf(const char *fmt, , va_list ap) in D?
[...]
You don't need one. You can just write:
void myWritelnWrapper(T...)(T args) {
... // insert your own processing here,
On Thursday, February 23, 2012 21:38:27 Jonathan M Davis wrote:
> On Friday, February 24, 2012 05:22:58 Sarath Kumar wrote:
> > Hi,
> >
> > Is there an equivalent to vfprintf(const char *fmt, , va_list ap) in D?
>
> If you're dealing with C variadics, then your going to need to use C
> functions.
On Friday, February 24, 2012 05:22:58 Sarath Kumar wrote:
> Hi,
>
> Is there an equivalent to vfprintf(const char *fmt, , va_list ap) in D?
If you're dealing with C variadics, then your going to need to use C
functions. D doesn't just recreate C functions (at least, the standard library
doesn't
On 2/23/2012 5:03 PM, John Burton wrote:
I'm trying to use the d3d11 bindings in
http://www.dsource.org/projects/bindings/wiki/DirectX to call
direct3d11 functions from my D program.
I've managed to get the code to compiler but when it links I get
this error -
Error 42 Symbol Undefined _D3D11Cr
Hi,
Is there an equivalent to vfprintf(const char *fmt, , va_list ap) in D?
--
Thanks,
Sarath
On Fri, Feb 24, 2012 at 05:17:27AM +0100, Chris Pons wrote:
[...]
> It's hard for me to imagine myself going back to C++ at this point
> because of the amount of great features in D. :)
Yeah I starting using D recently, and now I just can't convince myself
to start another C/C++ project. It's just
On Thursday, February 23, 2012 20:21:57 H. S. Teoh wrote:
> I'm trying to test if a bug has been fixed in the latest Phobos git
> repository, but I'm having trouble convincing gdc to *not* use the
> default installation of Phobos. What option do I need on the commandline
> to tell it to use a diffe
I'm trying to test if a bug has been fixed in the latest Phobos git
repository, but I'm having trouble convincing gdc to *not* use the
default installation of Phobos. What option do I need on the commandline
to tell it to use a different path to Phobos? -I only appends include
paths *after* the def
Thanks for the response. There are a lot of great features to D
that really excites me about using this language. Unittest is
definitely one of them.
It's hard for me to imagine myself going back to C++ at this
point because of the amount of great features in D. :)
On Thu, Feb 23, 2012 at 09:28:07PM -0500, Jonathan M Davis wrote:
> On Friday, February 24, 2012 03:12:08 Chris Pons wrote:
[...]
> > Also, what should be in a unit test? Test cases to make sure
> > certain functions/classes are working as you intend them to?
Pretty much. The idea is to put stuff
On Thursday, February 23, 2012 21:47:26 Kevin Cox wrote:
> It still doesn't run them when I do a full rebuild. In the build output I
> see -unittest in the command line. It is really weird. I haven't looked
> at it too closly. For now I am just compiling from the command line.
Well, I'm afraid
On 24 February 2012 12:06, H. S. Teoh wrote:
> On Fri, Feb 24, 2012 at 04:06:52AM +1300, James Miller wrote:
>> On 23 February 2012 13:15, BLM wrote:
>> > After messing around for a while, I figured out what is making DMD choke
>> > on my
>> > file. The methods were defined in the base class usi
On Feb 23, 2012 6:50 PM, "Vadim" wrote:
>
> I am looking for the details on D Garbage Collection implementation. I
will much appreciate if someone suggests the answers or give some links to
existing documentation clarifying the following points:
>
> 1. Is it Mark-n-Sweep or copy or generational co
On 24 February 2012 12:03, John Burton wrote:
> I'm trying to use the d3d11 bindings in
> http://www.dsource.org/projects/bindings/wiki/DirectX to call
> direct3d11 functions from my D program.
>
> I've managed to get the code to compiler but when it links I get
> this error -
>
> Error 42 Symbol
On 24 February 2012 12:49, Vadim wrote:
> I am looking for the details on D Garbage Collection implementation. I will
> much appreciate if someone suggests the answers or give some links to
> existing documentation clarifying the following points:
>
> 1. Is it Mark-n-Sweep or copy or generational
On Feb 23, 2012 9:41 PM, "Jonathan M Davis" wrote
> There may very well be further problems due to what the IDE is doing
(such as
> not doing a full recompile when you enable -unittest), but the unit tests
> won't print anything out on success regardless unless you use print
statements
> in them
On Thursday, February 23, 2012 21:38:43 Kevin Cox wrote:
> I am having the same problem with visual d plugin for monodevelop. When I
> compile from the command line the tests run.
>
> A possibly related problem is that some files do not get recompiled when
> changed unless I do a rebuild.
There m
I am having the same problem with visual d plugin for monodevelop. When I
compile from the command line the tests run.
A possibly related problem is that some files do not get recompiled when
changed unless I do a rebuild.
On Feb 23, 2012 8:38 PM, "Jonathan M Davis" wrote:
> On Friday, February
On Friday, February 24, 2012 03:12:08 Chris Pons wrote:
> Ok, thanks.
>
> I haven't run into version(...) yet. Would I be correct if I
> assumed that this version of void main: void main() {} would only
> run if -unittest was in the command line?
Yes.
version(symbol)
means that anything within
Ok, thanks.
I haven't run into version(...) yet. Would I be correct if I
assumed that this version of void main: void main() {} would only
run if -unittest was in the command line?
Also, what should be in a unit test? Test cases to make sure
certain functions/classes are working as you inten
On Friday, February 24, 2012 02:11:50 Chris Pons wrote:
> I am following the book "The D Programming Language" and am at
> the portion about functions and unittest. For some reason I
> cannot get unittest to do anything noticeable.
If the unit tests pass, they don't print anything unless you add s
I am following the book "The D Programming Language" and am at
the portion about functions and unittest. For some reason I
cannot get unittest to do anything noticeable.
I right clicked on my Project > Properties > Command Line and
under additional options added -unittest (--main gave me an er
On Thursday, 23 February 2012 at 19:26:31 UTC, James Miller wrote:
I find that when learning a complicated system or library, the
best
way is to write out the code examples, compile them, then change
things until they break, fix it, then make more changes.
Eventually
you end up with the worst
grumph. is it not possible to fix the packages in repo?
On 02/23/2012 05:17 PM, bioinfornatics wrote:
get latest ldc build here:
http://koji.fedoraproject.org/koji/buildinfo?buildID=299767
install it with yum install after dowloading these rpm
Thanks for your reply. You're right about the statement. But I still
think something's wrong. For example, even this program produces the
errors:
import std.stdio;
mixin template helpMe()
{
writeln("Satisfying!");
}
does it do that if you replace the statement with a declaration?
like this:
On Thu, Feb 23, 2012 at 05:27:03PM -0500, Zach the Mystic wrote:
> On 2/21/12 2:53 PM, Ali Çehreli wrote:
> >According to the docs, template mixins can have only declarations but
> >helpMe above has a statement.
> >
> >http://dlang.org/template-mixin.html
> >
> >Ali
> >
>
> Thanks for your reply.
I am looking for the details on D Garbage Collection
implementation. I will much appreciate if someone suggests the
answers or give some links to existing documentation clarifying
the following points:
1. Is it Mark-n-Sweep or copy or generational collector or simple
reference counting? Or an
Le jeudi 23 février 2012 à 17:11 -0600, Ellery Newcomer a écrit :
> On 02/23/2012 05:08 PM, bioinfornatics wrote:
> > Le jeudi 23 février 2012 à 16:29 -0600, Ellery Newcomer a écrit :
> >> looking for core.stuff
> >>
> >> I would have thought they would be in ldc-druntime-devel, but they don't
> >>
On 02/23/2012 05:08 PM, bioinfornatics wrote:
Le jeudi 23 février 2012 à 16:29 -0600, Ellery Newcomer a écrit :
looking for core.stuff
I would have thought they would be in ldc-druntime-devel, but they don't
seem to be, and I can't find them elsewhere
in ldc-druntime-devel see above command
Le jeudi 23 février 2012 à 16:29 -0600, Ellery Newcomer a écrit :
> looking for core.stuff
>
> I would have thought they would be in ldc-druntime-devel, but they don't
> seem to be, and I can't find them elsewhere
in ldc-druntime-devel see above command
$ rpm -ql ldc-druntime-devel
/usr/include
On Fri, Feb 24, 2012 at 04:06:52AM +1300, James Miller wrote:
> On 23 February 2012 13:15, BLM wrote:
> > After messing around for a while, I figured out what is making DMD choke on
> > my
> > file. The methods were defined in the base class using template mixins, and
> > apparently DMD doesn't l
I'm trying to use the d3d11 bindings in
http://www.dsource.org/projects/bindings/wiki/DirectX to call
direct3d11 functions from my D program.
I've managed to get the code to compiler but when it links I get
this error -
Error 42 Symbol Undefined _D3D11CreateDeviceAndSwapChain@48
I have copied th
looking for core.stuff
I would have thought they would be in ldc-druntime-devel, but they don't
seem to be, and I can't find them elsewhere
On 2/21/12 2:53 PM, Ali Çehreli wrote:
According to the docs, template mixins can have only declarations but
helpMe above has a statement.
http://dlang.org/template-mixin.html
Ali
Thanks for your reply. You're right about the statement. But I still
think something's wrong. For example, even
On Thu, 23 Feb 2012, H. S. Teoh wrote:
> On Thu, Feb 23, 2012 at 08:53:00PM +0100, Artur Skawina wrote:
> > On 02/23/12 20:37, simendsjo wrote:
> > > Hmm. Didn't my previous post make it to the newsgroup? Is visible at
> > > my end.
> >
> > The mailing list gets stuck sometimes and does not forwa
On Thu, Feb 23, 2012 at 08:53:00PM +0100, Artur Skawina wrote:
> On 02/23/12 20:37, simendsjo wrote:
> > Hmm. Didn't my previous post make it to the newsgroup? Is visible at
> > my end.
>
> The mailing list gets stuck sometimes and does not forward messages
> for hours. Your question made it, but
On Thursday, February 23, 2012 21:17:46 mist wrote:
> But is there any way to actually say D compiler that I want this
> function to accept only pure delegates?
Mark the delegate type that it accepts as pure.
- Jonathan M Davis
But is there any way to actually say D compiler that I want this
function to accept only pure delegates?
Le 23/02/2012 21:00, mist a écrit :
Hello!
I have been asked few question recently from a Haskell programmer about
D2 and, after experimenting a bit, have found that I really can't
provide a good answe myself, as I am not getting a design limititations
(if any).
Here is the snippet, it is prett
Hello!
I have been asked few question recently from a Haskell programmer
about D2 and, after experimenting a bit, have found that I really
can't provide a good answe myself, as I am not getting a design
limititations (if any).
Here is the snippet, it is pretty self-descriptive:
http://codepa
On 02/23/12 20:37, simendsjo wrote:
> Hmm. Didn't my previous post make it to the newsgroup? Is visible at my end.
The mailing list gets stuck sometimes and does not forward messages for hours.
Your question made it, but the later post only arrived here minutes ago...
artur
On Thu, 23 Feb 2012 18:42:51 +0100, Artur Skawina
wrote:
On 02/23/12 11:35, simendsjo wrote:
Say i have a c function (didn't include first format argument for
simplicity)
void print(...);
I wrap it up:
extern(System) void print(...);
And then I try to wrap it up in some safer D way:
void
Le jeudi 23 février 2012 à 19:46 +0100, Mike Wey a écrit :
> On 02/23/2012 05:27 PM, bioinfornatics wrote:
> > dear,
> > for set soname with:
> > - gdc: -Xlinker -soname myLib.so.1
> > - ldc2: -soname myLib.so.1
> > - dmd: ?
> >
> > someone know how set soname with dmd ?
> >
>
> dmd -L-soname=myli
I find that when learning a complicated system or library, the best
way is to write out the code examples, compile them, then change
things until they break, fix it, then make more changes. Eventually
you end up with the worst code ever known to man and a thorough
understanding of the system at han
On 23 February 2012 13:15, BLM wrote:
> After messing around for a while, I figured out what is making DMD choke on my
> file. The methods were defined in the base class using template mixins, and
> apparently DMD doesn't like it when mixins, inheritance, overloading, and
> aliases
> are all in t
On 02/23/12 11:35, simendsjo wrote:
> Say i have a c function (didn't include first format argument for simplicity)
>
> void print(...);
> I wrap it up:
> extern(System) void print(...);
>
> And then I try to wrap it up in some safer D way:
> void print(Args...)(Args args)
> {
> print(args);
On 23 February 2012 23:35, simendsjo wrote:
> Say i have a c function (didn't include first format argument for
> simplicity)
>
> void print(...);
> I wrap it up:
> extern(System) void print(...);
>
> And then I try to wrap it up in some safer D way:
> void print(Args...)(Args args)
> {
> print
On Thu, Feb 23, 2012 at 10:20:58PM +1300, James Miller wrote:
> On 23 February 2012 15:55, H. S. Teoh wrote:
> > On Wed, Feb 22, 2012 at 09:32:55PM -0500, Kevin wrote:
> > [...]
> >> Thanks for all the help. Although you guys should be careful
> >> because if you keep giving such in depth answers
On Thu, Feb 23, 2012 at 11:42:35AM +0100, Magnus Lie Hetland wrote:
> I think I've stumbled across a DbC bug. In an out-block, I have the
> assertion `assert(id < objs.length);`. Now, if I don't have an
> in-block, this fails. However, if I add an in-block (with basically
> any code that isn't opti
On 02/23/2012 05:27 PM, bioinfornatics wrote:
dear,
for set soname with:
- gdc: -Xlinker -soname myLib.so.1
- ldc2: -soname myLib.so.1
- dmd: ?
someone know how set soname with dmd ?
dmd -L-soname=mylib.so.1
--
Mike Wey
dear,
for set soname with:
- gdc: -Xlinker -soname myLib.so.1
- ldc2: -soname myLib.so.1
- dmd: ?
someone know how set soname with dmd ?
On Thu, 23 Feb 2012 02:33:04 +0100, DNewbie wrote:
> Here is a simple service in D
> http://my.opera.com/run3/blog/2012/02/23/windows-services-in-d It's
> basically c translated to d.
Hey, thanks for this. I ended up doing the same thing (translating an
existing service from C++). But my code is
Good points on why an explicit range distinction is desired; I
probably should have looked harder at how std.container worked.
I'm also probably spoiled/unlearning from C#'s IEnumerable
syntactic sugar (foreach over enumerator, LINQ) which handles
most of these considerations for you. You could
I'm working on IPC's. I already figured out that the implementation depends on
the operation system. Is there any solution to support both - windows & posix
systems? I'm developing on a win-machine and don't want to re-write my app on
linux. As I saw on dlang.org, std.process of Phobos (prerelease)
On Thu, 23 Feb 2012 11:35:32 +0100, simendsjo wrote:
Say i have a c function (didn't include first format argument for
simplicity)
void print(...);
I wrap it up:
extern(System) void print(...);
And then I try to wrap it up in some safer D way:
void print(Args...)(Args args)
{
print(arg
I think I've stumbled across a DbC bug. In an out-block, I have the
assertion `assert(id < objs.length);`. Now, if I don't have an
in-block, this fails. However, if I add an in-block (with basically any
code that isn't optimized away, or so it seems), the assertion
succeeds. (Before this was an
Say i have a c function (didn't include first format argument for
simplicity)
void print(...);
I wrap it up:
extern(System) void print(...);
And then I try to wrap it up in some safer D way:
void print(Args...)(Args args)
{
print(args); // only the first argument is printed
}
void print(.
You are right, coffimplib with -e switch does it.
On 23 February 2012 15:55, H. S. Teoh wrote:
> On Wed, Feb 22, 2012 at 09:32:55PM -0500, Kevin wrote:
> [...]
>> Thanks for all the help. Although you guys should be careful because
>> if you keep giving such in depth answers I might start asking stupid
>> questions just to learn the language in
61 matches
Mail list logo