On Friday, February 15, 2013 20:14:41 Ali Çehreli wrote:
> On 02/15/2013 07:50 PM, Jeremy DeHaan wrote:
> > I know that a module can only be defined once, but I feel like there
> > could be times where it would be helpful to be able to have the same
> > module defined in separate files
>
> Ther
On Saturday, 16 February 2013 at 03:50:12 UTC, Jeremy DeHaan
wrote:
I was actually going to post a similar question, but it looks
like this would be a better place to post!
I know that a module can only be defined once, but I feel like
there could be times where it would be helpful to be able
On Saturday, 16 February 2013 at 02:23:42 UTC, Jos van Uden wrote:
On 5-2-2013 20:45, Jos van Uden wrote:
By the way, I think 'Qznc' may want to have a look at 'The
dining
philosophers':
http://rosettacode.org/wiki/Dining_philosophers
Am I the new rosetta concurency guy? :)
I should find t
On Saturday, 16 February 2013 at 04:14:41 UTC, Ali Çehreli wrote:
On 02/15/2013 07:50 PM, Jeremy DeHaan wrote:
> I know that a module can only be defined once, but I feel
like there
> could be times where it would be helpful to be able to have
the same
> module defined in separate files
There m
Does D have an equivalent to the C marking of volatile?
Currently I'm just going to try removing all variables from the struct,
as it's never declared in D or accessed from within D, and I just want
to avoid cast(void*)s, but I may need to access something like this
sometime in the future.
On Friday, 15 February 2013 at 10:01:35 UTC, Jonathan M Davis
wrote:
On Friday, February 15, 2013 10:51:00 Colin Grogan wrote:
Does anyone here have any alternatives for me so that in my
'engine' or 'main' classes I can simply write:
import utils;
and still have my source files neatly lai
A first revision, do you like the toString?
http://codepad.org/qhH2XpMx
- - - - - - - - - - -
The modified code contains still an enum that gets converted to
char and then to int. I am not going to write code like that in
my own "production code" :-)
- - - - - - - - - - -
To improve this t
On 5-2-2013 20:45, Jos van Uden wrote:
By the way, I think 'Qznc' may want to have a look at 'The dining
philosophers':
http://rosettacode.org/wiki/Dining_philosophers
Instead of using toString() maybe it's better to add a
printTape, and let run() return nothing. I have also converted
UTM to a struct, because for this little program it doesn't
need to be a class (and there is no need of new).
I meant the opposite, sorry:
printTape() ==> toString()
Bye,
bea
Jos van Uden:
The Universal Turing Machine is working.
There are many different ways to solve this Task in D. You can
write a very strongly typed Ada-like program, or a weakly typed
Ruby-like program. Both have advantages and disadvantages (as
years pass I am leaning more toward a stronger
On Friday, 15 February 2013 at 23:41:50 UTC, Steven Schveighoffer
wrote:
In any case, the example was bad, the point that which is
better depends on the situation is still correct.
The compiler has to do something with "afundamental type it can avoid the lowering and just do whatever
assembly
On Tuesday, 4 September 2012 at 22:46:00 UTC, Ivan Agafonov wrote:
I have my library module:
module mylib.vector;
// alias Vector!(float, 4) Vector4f;
struct Vector(T, uint size)
{
T[size] array = 0;
...
}
On 5-2-2013 23:44, bearophile wrote:
Jos van Uden:
Partial translation of the universal_turing_machine-Ruby:
http://codepad.org/nUXLzAg2
I'd have to first read up on the subject.
It's a simple task, just to implement an universal Turing machine. It's a
matter of finding a balance between
One more thing about this. If I leave in the alias in the same
module where the template is defined, and also re-define the same
alias in the other modules that make use out of it, the libraries
will compile OK, but I'll get linking errors when I try to build
an executable and link in the libs.
Steven Schveighoffer:
Actually, I'm not as smart as you think ;)
There needs to be some extra checking, possibly with the carry
flag.
For example:
0x7000 - (-0x7000)
would be less than zero as a resulting integer.
But it would work with shorts or bytes!
I remember a page about s
On Fri, 15 Feb 2013 18:41:51 -0500, Steven Schveighoffer
wrote:
There needs to be some extra checking, possibly with the carry flag.
And further to that point, my generated assembly for a < b also is
similarly flawed, so it still may be better to do opCmp.
-Steve
On Fri, 15 Feb 2013 17:49:53 -0500, monarch_dodra
wrote:
On Friday, 15 February 2013 at 22:06:55 UTC, Steven Schveighoffer wrote:
With opcmp:
int opCmp(int a, int b)
{
return a - b;
}
Genius!
Now I feel bad for every time I've done integral opCmp with double
ternary operators :(
A
On Friday, February 15, 2013 23:49:53 monarch_dodra wrote:
> On Friday, 15 February 2013 at 22:06:55 UTC, Steven Schveighoffer
>
> wrote:
> > With opcmp:
> >
> > int opCmp(int a, int b)
> > {
> >
> > return a - b;
> >
> > }
>
> Genius!
>
> Now I feel bad for every time I've done integral opCm
On Fri, Feb 15, 2013 at 11:49:53PM +0100, monarch_dodra wrote:
> On Friday, 15 February 2013 at 22:06:55 UTC, Steven Schveighoffer
> wrote:
> >With opcmp:
> >
> >int opCmp(int a, int b)
> >{
> > return a - b;
> >}
>
> Genius!
>
> Now I feel bad for every time I've done integral opCmp with doubl
On Friday, 15 February 2013 at 22:06:55 UTC, Steven Schveighoffer
wrote:
With opcmp:
int opCmp(int a, int b)
{
return a - b;
}
Genius!
Now I feel bad for every time I've done integral opCmp with
double ternary operators :(
On Fri, 15 Feb 2013 13:02:39 -0500, Dan wrote:
On Friday, 15 February 2013 at 17:42:30 UTC, Steven Schveighoffer wrote:
On Fri, 15 Feb 2013 12:11:55 -0500, monarch_dodra
wrote:
Also keep in mind that "a < b" is implemented as two calls to
"a.opCmp(b)", and "a.opCmp(b)" is itself usually
They definitely agree that it's a problem. They just don't see
it as having as
high a priority as you do.
For me it is not a priority (anymore). I use C++ again.
It's just a question of how and when.
- Jonathan M Davis
Yes as I said: I count the versions. :)
On Friday, February 15, 2013 16:53:36 Steven Schveighoffer wrote:
> On Fri, 15 Feb 2013 13:14:21 -0500, Dan wrote:
> > When you say things like "Andrei was considering phasing out
> > postblits..." I get nervous. Can we please have some comments from
> > Andrei/Walter about what the plans are? I'm
On Friday, February 15, 2013 22:41:24 Namespace wrote:
> Again: My intention was not const&.
I know. What I'm saying applies in general.
> And you're right, but there was so many discussions about const&
> (since dmd 2.057; also in the last few days) and as every
> discussion here: after page 2 i
On Fri, 15 Feb 2013 13:14:21 -0500, Dan wrote:
When you say things like "Andrei was considering phasing out
postblits..." I get nervous. Can we please have some comments from
Andrei/Walter about what the plans are? I'm not asking for the ultimate
solution - just to know the general directi
Again: My intention was not const&.
And you're right, but there was so many discussions about const&
(since dmd 2.057; also in the last few days) and as every
discussion here: after page 2 is the topic changed.
I'm also very sure that neither Walter nor Andrei see a
(important) reason for some
On Friday, February 15, 2013 21:37:46 Jonathan M Davis wrote:
> On Friday, February 15, 2013 21:16:51 Namespace wrote:
> > > They're not going to do that until they've decided, and AFAIK,
> > > they haven't.
> > > Attempting to essentially confront them and get them to say
> > > what they plan to
>
On Friday, February 15, 2013 21:16:51 Namespace wrote:
> > They're not going to do that until they've decided, and AFAIK,
> > they haven't.
> > Attempting to essentially confront them and get them to say
> > what they plan to
> > do generally doesn't get you anywhere - especially since
> > they're
They're not going to do that until they've decided, and AFAIK,
they haven't.
Attempting to essentially confront them and get them to say
what they plan to
do generally doesn't get you anywhere - especially since
they're unlikely to
say much until they actually are planning to do it, and it's
us
On Friday, February 15, 2013 19:43:07 Namespace wrote:
> > When you say things like "Andrei was considering phasing out
> > postblits..." I get nervous. Can we please have some comments
> > from Andrei/Walter about what the plans are? I'm not asking for
> > the ultimate solution - just to know the
On Friday, February 15, 2013 20:12:08 Dan wrote:
> Granted the no rvalue passing is a pain - but is it a big deal in
> library/generic code?
Yes, it's a big deal. Any place that it's part of an API, it's a big deal. It
forces you to create what are essentially useless variables all over the place
On Friday, February 15, 2013 19:14:21 Dan wrote:
> When you say things like "Andrei was considering phasing out
> postblits..." I get nervous. Can we please have some comments
> from Andrei/Walter about what the plans are? I'm not asking for
> the ultimate solution - just to know the general direct
On Thursday, 14 February 2013 at 19:31:36 UTC, Steven
Schveighoffer wrote:
If it was pass by ref, then rbt.insert(5) would not work. And
in fact, I wouldn't want things passed by ref if the element is
int.
What is the reason for the second objection - is just performance?
Is performance rea
No progress is being made.
So, my questions:
- is this a potential deadlock in rdmd? I believe it attempts
to parallelize the work.
- has anyone experienced this?
I don't remember experiencing this with rdmd, but I have seen
something similar with my scripts that were starting processes
from
When you say things like "Andrei was considering phasing out
postblits..." I get nervous. Can we please have some comments
from Andrei/Walter about what the plans are? I'm not asking for
the ultimate solution - just to know the general direction and
where this issue stands at present. Is there
On Thursday, 14 February 2013 at 20:53:26 UTC, Jonathan M Davis
wrote:
And Walter and Andrei both seem to think that having expensive
postlbits is a
design mistake. The range stuff sort of tries to support it
with the move*
primitives, but Andrei's been wanting to argue for just
assuming that
On Friday, 15 February 2013 at 17:42:30 UTC, Steven Schveighoffer
wrote:
On Fri, 15 Feb 2013 12:11:55 -0500, monarch_dodra
wrote:
Also keep in mind that "a < b" is implemented as two calls to
"a.opCmp(b)", and "a.opCmp(b)" is itself usually implemented
as two calls to "something < something
On Friday, 15 February 2013 at 17:42:30 UTC, Steven Schveighoffer
wrote:
On Fri, 15 Feb 2013 12:11:55 -0500, monarch_dodra
wrote:
Also keep in mind that "a < b" is implemented as two calls to
"a.opCmp(b)", and "a.opCmp(b)" is itself usually implemented
as two calls to "something < something
On Fri, 15 Feb 2013 12:11:55 -0500, monarch_dodra
wrote:
Also keep in mind that "a < b" is implemented as two calls to
"a.opCmp(b)", and "a.opCmp(b)" is itself usually implemented as two
calls to "something < something else" (!)
Huh?
a < b is implemented as a.opCmp(b) < 0, not two calls
On Thursday, 14 February 2013 at 20:33:21 UTC, Ivan Kazmenko
wrote:
Rob T wrote:
When I look at the std.container source code, it seems that
the payload element is passed by value multiple times
unnecessarily, so to minimize copy construction you'll have to
implement element as a class and imp
I use emacs and have command that runs rdmd. Very rarely, as a
guess maybe one in 100 calls to build, rdmd does not make any
progress and I have to kill it. So, a ps -efww shows something
like below and over 15 minutes have passed (normally max time to
build and run is a couple of seconds)
UI
On 2013-02-15 12:04, Colin Grogan wrote:
Ah ok, now I get it.
Note that in Java you declare a package wheres in D you declare a module.
If you have something like this in Java:
// Baz.java
package bar.foo;
You would do this in D:
// Baz.d
module bar.foo.Baz;
--
/Jacob Carlborg
Ok, I had a minute so I tested it out.
I had the following:
src/main.d:
import utils._;
void main(string[] args){
logger l = new logger();
props p = new props();
l.print();
p.print();
}
src/utils/_.d
module utils._;
public import utils.props, utils.l
On Friday, 15 February 2013 at 10:40:57 UTC, Dicebot wrote:
On Friday, 15 February 2013 at 10:31:41 UTC, Colin Grogan wrote:
Ah, ok.
So, I have my structure like so:
$PROJHOME
|-src
|-utils
|- Logger.d // contains "module utils.Logger"
|- Props.d // contains "module
On Friday, 15 February 2013 at 10:31:41 UTC, Colin Grogan wrote:
Ah, ok.
So, I have my structure like so:
$PROJHOME
|-src
|-utils
|- Logger.d // contains "module utils.Logger"
|- Props.d // contains "module utils.Props"
|- utils.d // contains "module u
On Friday, February 15, 2013 11:31:40 Colin Grogan wrote:
> So, I have my structure like so:
>
> $PROJHOME
>
> |-src
> |
> |-utils
> |
>|- Logger.d // contains "module utils.Logger"
>|- Props.d // contains "module utils.Props"
>|- uti
On Friday, 15 February 2013 at 10:01:35 UTC, Jonathan M Davis
wrote:
On Friday, February 15, 2013 10:51:00 Colin Grogan wrote:
Does anyone here have any alternatives for me so that in my
'engine' or 'main' classes I can simply write:
import utils;
and still have my source files neatly lai
On Friday, February 15, 2013 10:51:00 Colin Grogan wrote:
> Does anyone here have any alternatives for me so that in my
> 'engine' or 'main' classes I can simply write:
>
> import utils;
>
> and still have my source files neatly laid out in manageable
> chunks?
The only way that you can hav
I am starting to understand the difficulty with ref being too
restrictive. Some kind of "const ref" in the language would
have helped indeed. But it would probably cause some
allocation difficulties for actual constants... or worse?
Search for 'auto ref' or right after 'rvalue references' an
15-Feb-2013 13:51, Colin Grogan пишет:
[snip]
This is where my problem occurs. To illustrate:
$PROJHOME
|-/src
|- utils
|- Logger.d
|- Properties.d
|- SSHTool.d
|- engine
I want to put Logger.d, Properties.d and SSHTool.d into the
Hi all,
I have a question regarding how to lay out my code.
I wish to have a project directory structure that resembles java
projects (As I'm comfortable working in that sort of environment
For example:
$PROJHOME
|-/src <- Source code
|-/lib <- third party libraries
|-/bin
51 matches
Mail list logo