gc1thread1
thread2
thread3
gc2thread4
thread5
when the gc1 cycles it does not block the gc2 threads. Would that be of any use?
Or possible. And only use communication like between two processes, some
interprocess communication message passing thing.
I mean the entire
With one exception yes, i want all 3 test pass with your fix to implicit
cast.
You know, we are trying to write generic code.
Thanks!
On Sat, 27 Mar 2010 22:21:46 +0200, bearophile
wrote:
Are you trying to do this?
import std.stdio: writeln;
struct Vector(T) {
this(T m) { mm = m; }
Is it possible to have multiple gc
so:
> With this in mind, just one thing bugs me.
>
>
> import std.stdio;
>
> struct vector(T) {
> this(T m) { mm = m; }
> vector!T opBinary(string s)(T m) if(s=="*") {
> return vector!T(mm * m);
> }
> T mm;
> }
>
> void test(T)() {
> vector!T v =
Le 27/03/10 18:18, so a écrit :
With this in mind, just one thing bugs me.
import std.stdio;
struct vector(T) {
this(T m) { mm = m; }
vector!T opBinary(string s)(T m) if(s=="*") {
return vector!T(mm * m);
}
T mm;
}
void test(T)() {
vector!T v = vector!T(0.5);
vector!T u = v * 0.3;
writeln
tried the your approach it worked but compile cpp applications fails.
[Sanity Checks - fails]
i found my way arround it by installing cross32-gcc
and adding
CC=/usr/bin/i686-unknown-linux-gnu-gcc
to the dmd.conf file
I have added the procedure to Wiki4D
http://www.prowiki.org/wiki4d/wiki.cgi?D__T
Oh... wait a second.
In http://www.digitalmars.com/d/2.0/float.html :
"Regardless of the type of the operands, floating point constant folding
is done in real or greater precision. It is always done following IEEE 754
rules and round-to-nearest is used.
Floating point constants are internal
I think you would end up creating a scalar class/struct with operator
overloading to get the behavior you are looking for. I realize that is
more overhead than what you would want but I don't see another way.
so wrote:
> In C++!
>
> I have a type defined in the core library like..
> typedef float
Is this program expected to terminate?
D 2.042
module test;
import std.regex;
import std.stdio;
void main(){
foreach(m; match("hello world",`.*`)){
writefln("%s[%s]%s",m.pre,m.hit,m.post);
}
}
so:
> When i have the code :
> scalar m = 0.5fp;
>
> I want compiler to implicitly cast it to typeof(scalar).
> so when the scalar is float, m will be 0.5f.
I am starting to understand, sorry if I am a dumb bear :-) Programming in C++/D
is usually much less hard than understanding humans.
I thin
On Sat, 27 Mar 2010 15:54:19 +0200, Bill Baxter wrote:
Note that 'real' is a built in type in D. It's an 80-bit float on x86
procs and 64-bit elsewhere.
So .5L is like cast(real).5. Not the solution you were looking for.
--bb
That "r for real!" was joke.
What i mean is a literal/template/p
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Don wrote:
> div0 wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>
> Same as bug 3285 / bug 3516?
No, they are for structs, not classes.
I had a bit more of a play, and it seems that the scope object is on the
stack, so it's memory is re
On Fri, 26 Mar 2010 06:35:29 +0100, Paul D. Anderson
wrote:
I want to initialize an immutable struct but I'm encountering two
difficulties and I can't find the answer in the documentation. (Wouldn't
it be nice if someone wrote a book?)
You mean like this?
http://www.amazon.com/dp/032163536
On Sat, 27 Mar 2010 12:20:38 +0200, so wrote:
I haven't seen a single C++ library able to do this properly. (I would
just copy it!)
This is one of the reasons why something like
std::numeric_limits::function() exists.
Which makes a generic and *clean* numeric code in C++ nonexistent.
Don!
Note that 'real' is a built in type in D. It's an 80-bit float on x86
procs and 64-bit elsewhere.
So .5L is like cast(real).5. Not the solution you were looking for.
--bb
2010/3/27 so :
> On Sat, 27 Mar 2010 15:28:22 +0200, bearophile
> wrote:
>
>> so:
>>>
>>> One thing i can think of now is a
On Sat, 27 Mar 2010 15:28:22 +0200, bearophile
wrote:
so:
One thing i can think of now is adding another float literal, maybe 'r',
for "real"!,
See here, Unfortunately it's called "L" not "r":
http://www.digitalmars.com/d/2.0/lex.html
FloatSuffix:
f
F
RealSuffix:
so:
> One thing i can think of now is adding another float literal, maybe 'r',
> for "real"!,
See here, Unfortunately it's called "L" not "r":
http://www.digitalmars.com/d/2.0/lex.html
FloatSuffix:
f
F
RealSuffix:
L
bearophile
On Sat, 27 Mar 2010 13:52:28 +0200, bearophile
wrote:
Can you explain better what the problem is and what kind of solution you
would like?
Bye,
bearophile
One thing i can think of now is adding another float literal, maybe 'r',
for "real"!,
Which means you are free to cast this to any
On Sat, 27 Mar 2010 13:32:24 +0200, Robert Clipsham
wrote:
On 27/03/10 10:20, so wrote:
In C++!
I have a type defined in the core library like..
typedef float scalar;
//typedef double scalar; // <-- whole framework is now double precision
alias float scalar;
//alias double scalar;
Next
On Sat, 27 Mar 2010 13:52:28 +0200, bearophile
wrote:
so:
Since D is superb, i like to know how you do it in D.
If you got a better idea in C++, i would like to hear that too!
You know there are float literal too, in C++/D, like: 5.5f
I don't think D can help you more than C++ here.
Can yo
so:
> Since D is superb, i like to know how you do it in D.
> If you got a better idea in C++, i would like to hear that too!
You know there are float literal too, in C++/D, like: 5.5f
I don't think D can help you more than C++ here.
Can you explain better what the problem is and what kind of solu
On 27/03/10 10:20, so wrote:
In C++!
I have a type defined in the core library like..
typedef float scalar;
//typedef double scalar; // <-- whole framework is now double precision
alias float scalar;
//alias double scalar;
Next i instantiate vectors, matrices etc... from templates.
typedef
In C++!
I have a type defined in the core library like..
typedef float scalar;
//typedef double scalar; // <-- whole framework is now double precision
Next i instantiate vectors, matrices etc... from templates.
typedef vector_t vector;
typedef matrix_t matrix;
Until now everything cool, here pa
23 matches
Mail list logo