s/they/the
The reason I've posted them online is because they snippets are not
that short. And it's much easier to read them from a
syntax-highlighted website than from a plaintext newsgroup reader.
On 05/01/2011 09:09 AM, Andrej Mitrovic wrote:
Yeah it seems a common interface is what I should have used. I've
tried it in numerous ways but I got the interface type wrong
apparently. Thanks Dmitry.
Here's a quick example:
http://codepad.org/RhNiUHU2
To make it more convenient to others, I p
On 05/01/2011 08:04 AM, Dmitry Olshansky wrote:
On 01.05.2011 18:30, Andrej Mitrovic wrote:
I'm not sure how to use those wrappers though. Maybe I'm just doing it
wrong:
http://codepad.org/eHIdhasc
But it seems these wrappers have some problems, the docs say about the
interfaces:
Limitations:
On 05/01/2011 07:30 AM, Andrej Mitrovic wrote:
I'm not sure how to use those wrappers though. Maybe I'm just doing it wrong:
http://codepad.org/eHIdhasc
To make it more convenient to others, I paste Andrej Mitrovic's code:
import std.stdio;
import std.range;
import core.thread;
import std.ran
This is a good point. Further to that, keep in mind locality of
reference, ie the performance impact of data getting pushed out of the
caches. While using machine word size variables for a small number of
variables that really need high performance can give a small speed-up,
using them exte
opSlice isn't supported either. Gah.., so much for this being useful.
I'll have to roll my own.
Now I know why Tango was developed.
Is there a way in today's D to exclude members marked private and
protected from processing in the __traits(allMembers) family of
functions?
I thought if I at least put it in a separate module, trying to get
a private member would fail to compile, but I tried it and it seems
to work anyway... my p
Ashish Myles Wrote:
> foo2 = foo; // allowed immutable RHS ???
Allowing this is a bug. File it in bugzilla.
Unfortunately, lazy objects "mess up" the expected const correctness of Object.
Even if they are logically const, lazy objects can't always be passed as const.
On 01.05.2011 21:40, Andrej Mitrovic wrote:
Btw,
* Limitations:
*
* These interfaces are not capable of forwarding $(D ref) access to elements.
Why not? I can use auto ref to make e.g. an input range interface that
can return ref elements:
http://codepad.org/kmenIDk7
Why aren't the inte
On 01.05.2011 19:31, Peter Alexander wrote:
On 1/05/11 2:53 PM, Dmitry Olshansky wrote:
Ehm.. Well, first things first: you shouldn't use classes for
lightweight & plain data things like vectors. There are structs for
that. In general, structs are value-like objects living on the stack
while cla
Btw,
* Limitations:
*
* These interfaces are not capable of forwarding $(D ref) access to elements.
Why not? I can use auto ref to make e.g. an input range interface that
can return ref elements:
http://codepad.org/kmenIDk7
Why aren't the interfaces defined like that in std.range?
Actually that design of mine was bad because it creates a long chain
of virtual calls since setStep just wraps the buffer object and
creates a new object every time.
Here's an alternate implementation: https://gist.github.com/950647
On 05/01/2011 03:15 PM, Dmitry Olshansky wrote:
On 01.05.2011 16:38, hunt0r wrote:
I was calling it from another module:
in file Test.d:
class Test
{
private:
int x;
void testNonTemplate()
{
}
template test()
{
void test() {x= 100;}
}
public:
int getX() {return x;}
}
In file main.d:
import Test;
Unfortunately as you can see I can't convert a Stride to a
RandomAccessInfinite object, so I've had to use an InputRange
interface (I can also use ForwardRange which is more derived). I'm not
sure why I can't use it (maybe it's that bug again?), because Stride
itself does offer random access.
Yeah it seems a common interface is what I should have used. I've
tried it in numerous ways but I got the interface type wrong
apparently. Thanks Dmitry.
Here's a quick example:
http://codepad.org/RhNiUHU2
I hope those bugs get squashed so I can have more fun with these ranges. :)
On 1/05/11 2:53 PM, Dmitry Olshansky wrote:
Ehm.. Well, first things first: you shouldn't use classes for
lightweight & plain data things like vectors. There are structs for
that. In general, structs are value-like objects living on the stack
while classes are reference-like objects living on the
On 01.05.2011 18:30, Andrej Mitrovic wrote:
I'm not sure how to use those wrappers though. Maybe I'm just doing it wrong:
http://codepad.org/eHIdhasc
But it seems these wrappers have some problems, the docs say about the
interfaces:
Limitations:
These interfaces are not capable of forwarding r
On 5/1/2011 3:53 PM, Dmitry Olshansky wrote:
Ehm.. Well, first things first: you shouldn't use classes for
lightweight & plain data things like vectors. There are structs for
that. In general, structs are value-like objects living on the stack
while classes are reference-like objects living on th
I'm not sure how to use those wrappers though. Maybe I'm just doing it wrong:
http://codepad.org/eHIdhasc
But it seems these wrappers have some problems, the docs say about the
interfaces:
Limitations:
These interfaces are not capable of forwarding ref access to elements.
Infiniteness of the wra
Yes, you were right:
Vector3
{
// ...
/// Binary operator for operator + and -
public Vector3 opBinary(string op) (const ref Vector3 rhs) const if (op
== "+" || op == "-")
{
mixin("return new Vector3(x" ~ op ~ "rhs.x, y" ~ op ~ "rhs.y, z" ~
op ~ "rhs.z);");
}
// ...
}
I removed ref a
On 01.05.2011 17:30, CrypticMetaphor wrote:
Hi, I've been away from D for a while, but now I'm back and I'm stuck
with an compile time error.
I've got a Matrix33 class and a Vector3 class, but something is wrong
with the way I return my Vector3 in my matrix class:
If I do this I get an error
On 1/05/11 2:30 PM, CrypticMetaphor wrote:
Hi, I've been away from D for a while, but now I'm back and I'm stuck
with an compile time error.
I've got a Matrix33 class and a Vector3 class, but something is wrong
with the way I return my Vector3 in my matrix class:
If I do this I get an error:
M
Hi, I've been away from D for a while, but now I'm back and I'm stuck
with an compile time error.
I've got a Matrix33 class and a Vector3 class, but something is wrong
with the way I return my Vector3 in my matrix class:
If I do this I get an error:
Matrix33 mtest = new Matrix33();
mtest.Set
On 01.05.2011 16:38, hunt0r wrote:
I was calling it from another module:
in file Test.d:
class Test
{
private:
int x;
void testNonTemplate()
{
}
template test()
{
void test() {x= 100;}
}
public:
int getX() {return x;}
}
In file main.d:
import
I was calling it from another module:
in file Test.d:
class Test
{
private:
int x;
void testNonTemplate()
{
}
template test()
{
void test() {x= 100;}
}
public:
int getX() {return x;}
}
In file main.d:
import Test;
Test t = new Test;
t.test(); /*ok*/
t.tes
On 01.05.2011 13:37, hunt0r wrote:
hi,
It seems that template members of a class are always public.
having a class like:
class Test
{
private:
int x;
template test(T)
{
void test(T t) {x= 100;}
}
public:
int getX() {return x;}
}
and calling:
Test t = new
On 30.04.2011 19:34, Mariusz Gliwiński wrote:
Hello,
I'm trying to learn high-performance real-time programming.
One of my wonderings are:
Should i use int/uint for all standard arithmetic operations or
int/short/byte (depends on actual case)?
I believe this question has following subquestions
On 01.05.2011 6:33, Andrej Mitrovic wrote:
As an example I have a cyclic buffer (using std.range.Cycle) where I can set
the lower and upper bounds of the buffer. I'd also like to enable a stepping
mode, so I thought first about using std.range.Stride.
The code: http://codepad.org/TR7NDWTC
Thi
hi,
It seems that template members of a class are always public.
having a class like:
class Test
{
private:
int x;
template test(T)
{
void test(T t) {x= 100;}
}
public:
int getX() {return x;}
}
and calling:
Test t = new Test;
t.test();
prints 100 instead of sayin
On 29/04/2011 21:02, Nick Sabalausky wrote:
...
I'm having a rediculously hard time trying to find a CentOS 3 installation
disc image (or any other version before 5.6). This is the closest I've been
able to find:
...
It seems that the older versions that are no longer supported have
generall
31 matches
Mail list logo