On 2011-06-15 23:29:46 -0400, Charles McAnany mcana...@rose-hulman.edu said:
Ah, so does the compiler figure out which ones are strongly and weakly
pure and then optimize as
appropriate? Is there a way to indicate that a function is strongly
pure? Because it would seem odd
to call a function
Michel Fortin:
Just make sure all the parameters are either const or immutable or
passed by copy and do not contain any pointer or reference. That'll
make the function strongly pure, and the compiler will be able optimize.
I have just done a little test on this, currently DMD calls sqr one
I'm working a small but reasonably interesting D project which I'd like to,
ultimately, open source.
To make it attractive I need to document my class.
Is there anything remotely like Javadoc which works with D?
Lloyd Dupont:
I'm working a small but reasonably interesting D project which I'd like to,
ultimately, open source.
To make it attractive I need to document my class.
Is there anything remotely like Javadoc which works with D?
http://www.digitalmars.com/d/2.0/ddoc.html
I suggest you to
http://stackoverflow.com/questions/6328444/type-classes-in-d
This guy seems to be very optimistic about D's functional possibilities.
Unfortunately, the only answer there right now is a generic ramble
concerning D.
Thanks bearophile!
bearophile wrote in message news:itcs1k$1l8t$1...@digitalmars.com...
Lloyd Dupont:
I'm working a small but reasonably interesting D project which I'd like
to,
ultimately, open source.
To make it attractive I need to document my class.
Is there anything remotely like
I'm trying to build an introspection system for a project I have.
I already have a working template to get members value
=== working members getter ===
Variant GETTER(T, string member)(Object target)
{
T tt = cast(T)target;
if (!tt)
throw new ReflectionException(target is null or not
work with typeinfo!! :)
=
void SETTER(T, string member)(Object target, Variant value)
{
T tt = cast(T)target;
if (!tt)
throw new ReflectionException(target is null or not ~T.stringof
~ value: ~target.toString());
if(!value.convertsTo!( typeof(__traits(getMember, T,
works with typeinfo!
void SETTER(T, string member)(Object target, Variant value)
{
T tt = cast(T)target;
if (!tt)
throw new ReflectionException(target is null or not ~T.stringof
~ value: ~target.toString());
if(!value.convertsTo!( typeof(__traits(getMember, T, member)) ))
I have 2 overload of the opCall() in one of my class.
They cause a compile time error / conflict... any idea on how to solve it?
=
class MemberDesc
{
Variant opCall(Object target)
{
return getter(target);
}
void opCall(T)(Object target, T value)
{
setter(target,
Add a pair of parentheses to the first overload to add an empty template
argument list – currently, template and non-template functions can't be
overloaded.
David
On 6/16/11 2:59 PM, Lloyd Dupont wrote:
I have 2 overload of the opCall() in one of my class.
They cause a compile time error /
Ho thanks, even better than the work around I just found! :)
David Nadlinger wrote in message news:itcvbj$1td2$1...@digitalmars.com...
Add a pair of parentheses to the first overload to add an empty template
argument list – currently, template and non-template functions can't be
overloaded.
On Wed, 15 Jun 2011 23:57:25 +, Justin Whear wrote:
Consider the following:
You have 10 million data points and you need to apply a multipass
algorithm to them. Each pass is like a cellular automata: it can read
from the previous pass but it doesn't know the current values. This
makes
I have a MemberDesc class which describe a class's members.
I fill it with a template method like that (with GETTER and SETTER some
other templated method I wrote)
=
MemberDesc MEMBER(T, string memberName)()
{
TypeInfo ti = typeid( typeof(__traits(getMember, T, memberName)) );
On 06/16/2011 06:22 AM, Lars T. Kyllingstad wrote:
On Wed, 15 Jun 2011 23:57:25 +, Justin Whear wrote:
Consider the following:
You have 10 million data points and you need to apply a multipass
algorithm to them. Each pass is like a cellular automata: it can read
from the previous pass but
On Thu, 16 Jun 2011 06:52:45 -0400, Michel Fortin wrote:
On 2011-06-15 23:29:46 -0400, Charles McAnany mcana...@rose-hulman.edu
said:
Ah, so does the compiler figure out which ones are strongly and weakly
pure and then optimize as
appropriate? Is there a way to indicate that a function is
On 2011-06-07 22:45, Timon Gehr wrote:
Fabian wrote:
- There are no maintained GUI libraries
I don't know about this but I think QtD and DWT are still being maintained?
DWT is still maintained, although very slowly.
--
/Jacob Carlborg
On 2011-06-07 23:02, Fabian wrote:
The community does not grow if people stay away because it is small.
Thank you for your answer. - You've got a big point!
I don't know about this but I think QtD and DWT are still being
maintained?
I can't see any changes on this web page:
On 2011-06-07 23:33, Jonathan M Davis wrote:
On 2011-06-07 14:02, Fabian wrote:
The community does not grow if people stay away because it is small.
Thank you for your answer. - You've got a big point!
I don't know about this but I think QtD and DWT are still being
maintained?
I can't see
On 2011-06-08 22:59, Andrew Wiley wrote:
On Wed, Jun 8, 2011 at 11:54 AM, Fabian contact-...@freenet.de
mailto:contact-...@freenet.de wrote:
Hi
I'm trying to install DWT2 to create GUI applications with D.
I have downloaded DWT2 with TortoiseHg already and I've installed
Ruby
On 2011-06-08 20:54, Fabian wrote:
Hi
I'm trying to install DWT2 to create GUI applications with D.
I have downloaded DWT2 with TortoiseHg already and I've installed Ruby
and Rake. But when I try to build the packages I get the following error
message:
On 2011-06-10 14:07, Robert Clipsham wrote:
On 10/06/2011 08:30, Nick Sabalausky wrote:
Are there any good D2 serialization libs out there that utilize
introspecition (ie, don't have to manually specify all the member of each
type), handle cyclic graphs and have flexible output?
I've never
Ok, I think I get it. That cleared it up. =).
So, if you have a functioned labelled pure, it's your job to not pass it
mutable arguments, but the compiler's job to
make sure it doesn't mutate anything not in the arguments. And that's why a
strongly pure function can call a weakly
pure one - only
On Thu, 16 Jun 2011 17:38:27 +, Charles McAnany wrote:
Ok, I think I get it. That cleared it up. =). So, if you have a
functioned labelled pure, it's your job to not pass it mutable
arguments, but the compiler's job to make sure it doesn't mutate
anything not in the arguments. And that's
On 2011-06-16 10:38, Charles McAnany wrote:
Ok, I think I get it. That cleared it up. =).
So, if you have a functioned labelled pure, it's your job to not pass it
mutable arguments, but the compiler's job to make sure it doesn't mutate
anything not in the arguments. And that's why a strongly
On Thu, 16 Jun 2011 14:33:17 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On 2011-06-16 10:38, Charles McAnany wrote:
Ok, I think I get it. That cleared it up. =).
So, if you have a functioned labelled pure, it's your job to not pass it
mutable arguments, but the compiler's job to make
Hi, all. This is a strange one.
import std.bigint;
import std.algorithm;
void main(){
BigInt[] ar = [BigInt(2), BigInt(1), BigInt(3)];
sort(ar);
}
object.Exception@src\rt\arraycat.d(40): overlapping array copy
Is this a library bug? Or is sort() not supposed to work on this data?
Oh,
On 2011-06-16 11:59, Steven Schveighoffer wrote:
On Thu, 16 Jun 2011 14:33:17 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On 2011-06-16 10:38, Charles McAnany wrote:
Ok, I think I get it. That cleared it up. =).
So, if you have a functioned labelled pure, it's your job to not pass
Charles McAnany:
object.Exception@src\rt\arraycat.d(40): overlapping array copy
Is this a library bug? Or is sort() not supposed to work on this data?
It's a known bug:
http://d.puremagic.com/issues/show_bug.cgi?id=5705
(Is Bugzilla down?)
Bye,
bearophile
On Thu, 16 Jun 2011 16:36:01 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On 2011-06-16 11:59, Steven Schveighoffer wrote:
On Thu, 16 Jun 2011 14:33:17 -0400, Jonathan M Davis
jmdavisp...@gmx.com
wrote:
On 2011-06-16 10:38, Charles McAnany wrote:
Ok, I think I get it. That cleared
MemberDesc MEMBER(T, string memberName)() if(std.traits.hasMember!(T,
memberName))
{
...
}
Lloyd Dupont Wrote:
I have a MemberDesc class which describe a class's members.
I fill it with a template method like that (with GETTER and SETTER some
other templated method I wrote)
=
On 2011-06-16 13:47, Steven Schveighoffer wrote:
On Thu, 16 Jun 2011 16:36:01 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On 2011-06-16 11:59, Steven Schveighoffer wrote:
On Thu, 16 Jun 2011 14:33:17 -0400, Jonathan M Davis
jmdavisp...@gmx.com
wrote:
On 2011-06-16 10:38,
Hi Jesse, this won't work!
It's my fault in not explaining my problem well though...
I forget to mention something...
I'm using property syntax and try to call the method
Say I have
=
private int _foo;
@property public int Foo() { return _foo; }
@property public void Foo(int value) { _foo =
Hi, all. I'm back! I've got an enormous array that I need to store,
preferably in RAM. (It's iterated a bunch.)
I have 16 Gb on my machine, and at any time, about 12 Gb is free.
I'd like to be able to use about 10 Gb for this program. But when I
try to use more than about 800 Mb, I get Memory
On 6/17/11 12:32 AM, Charles McAnany wrote:
Win7 x64, Intel I7 @4.4 GHz, compiling with dmd -O -release -inline.
Regardless whether you are running on x86 or x86_64, DMD is only able to
create 32 bit binaries on Windows.
David
Hi,
I'm new to D and trying to follow Alexandrescu's TDPL code examples I came
across an error on the code below:
class A
{
inout(int) val() inout
{
return _val; // error - see below
}
private int _val;
};
The compiler (dmd v2.052) complains on the marked line with the message
Error: inout on
Hi,
I am trying to instantiate a Tuple that contains an immutable field.
Is there a way to do this with the current implementation? The
compiler gives me this error:
std/typecons.d(383): Error: can only initialize const member
_field_field_0 inside constructor
tuple_test.d(5): Error: template
Hm. I'm not too good on architecture - does that mean it's impossible for an
x32 program to have access to more memory?
Is there, maybe, an x64 C library that I could use to abstract the memory out
(Just a huge array wrapper, basically)? Or, that failing, does GCC
automatically generate x64
On Thu, Jun 16, 2011 at 10:20 PM, Charles McAnany
mcana...@rose-hulman.edu wrote:
Hm. I'm not too good on architecture - does that mean it's impossible for an
x32 program to have access to more memory?
Is there, maybe, an x64 C library that I could use to abstract the memory out
(Just a huge
Claudiu Verdes:
What am I doing wrong? TDPL has a very similar example...
I think this TDPL example is not good. And generally inout is not fully
implemented in D yet.
P.S. Is there a netiquette (a la C++ FAQ lite) about posting on this forum
that I should be aware of?
I think there isn't
Jose Armando Garcia:
I am trying to instantiate a Tuple that contains an immutable field.
Is there a way to do this with the current implementation?
I think this is not yet possible. I am not sure, but maybe even small changes
to conts are needed to fix this problem.
Bye,
bearophile
Jonathan M Davis:
I'm _very_ glad that Don came up with the weakly pure idea, or
pure would have been almost unusable.
I think Don has said this wasn't fully his idea. The D community is good at
creating ideas in group :-)
Bye,
bearophile
It looks like the rt is not calling the postblit constructor when
concatenating arrays. For example, the following code:
import std.stdio;
struct Test
{
this(this) { writeln(copy done); }
void opAssign(Test rhs) { writeln(assignment done); }
~this() { writeln(destructor called); }
}
On Fri, Jun 17, 2011 at 1:05 AM, Jose Armando Garcia jsan...@gmail.com wrote:
tests ~= test;
Btw, if you replace this with 'test[0] = test;' it works as expected.
The postblit ctor and the assignment operator get called and the dtor
is called twice.
44 matches
Mail list logo