On Sat, 06 Aug 2011 22:53:31 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
Feel free to create a feature request on it. It may even get the language
changed. However, having more than one invariant complicates things a
bit,
since right now, it's easy for the runtime to just call the
On Fri, 05 Aug 2011 18:43:27 +0200, Kai Meyer k...@unixlords.com wrote:
On 08/05/2011 03:02 AM, Pelle wrote:
Don't declare variables until you need them, just leave bytes_read and
bytes_max here.
Is there a performance consideration? Or is it purely a style or
D-Factor suggestion?
Just
I wonder why there isn't any sleep method in std.concurrency.
I know there is one in core.thread, but I try to avoid using
core modules.
Maybe a sleep method is just not needed in std.concurrency?
If I were to make a program that would constantly have about
60 working threads. Some kind of
On Monday 08 August 2011 07:01:11 BizarreCake wrote:
I wonder why there isn't any sleep method in std.concurrency.
I know there is one in core.thread, but I try to avoid using
core modules.
Maybe a sleep method is just not needed in std.concurrency?
If I were to make a program that would
I'm writing here because I haven't been able to create a smaller example
and I'm not sure what to search for in bugzilla.
DMD adds a storage identifier twice when writing .di files.
This is my code:
///
static @property isGUIThread() {
return cast(bool)IsGUIThread(false);
}
On Monday 08 August 2011 09:42:15 simendsjo wrote:
I'm writing here because I haven't been able to create a smaller example
and I'm not sure what to search for in bugzilla.
DMD adds a storage identifier twice when writing .di files.
This is my code:
///
static @property
On 08.08.2011 09:47, Jonathan M Davis wrote:
On Monday 08 August 2011 09:42:15 simendsjo wrote:
I'm writing here because I haven't been able to create a smaller example
and I'm not sure what to search for in bugzilla.
DMD adds a storage identifier twice when writing .di files.
This is my code:
On Monday, August 08, 2011 12:54:00 AM, simendsjo wrote:
On 08.08.2011 09:47, Jonathan M Davis wrote:
http://d.puremagic.com/issues/show_bug.cgi?id=6360
Thanks. The annoying thing is that I have to manually modify the import
library :|
Could spend the time fixing dmd instead of working
On 08.08.2011 09:57, Brad Roberts wrote:
On Monday, August 08, 2011 12:54:00 AM, simendsjo wrote:
On 08.08.2011 09:47, Jonathan M Davis wrote:
http://d.puremagic.com/issues/show_bug.cgi?id=6360
Thanks. The annoying thing is that I have to manually modify the import library
:|
Could spend
On 06.08.2011 22:53, Jonathan M Davis wrote:
On Saturday 06 August 2011 22:40:15 simendsjo wrote:
On 04.08.2011 11:32, simendsjo wrote:
I would like to use a template mixin to add some fields to a struct, but
I'd also like the template to add additional invariant checks without
having to
On 08.08.2011 10:01, simendsjo wrote:
On 08.08.2011 09:47, Jonathan M Davis wrote:
On Monday 08 August 2011 09:42:15 simendsjo wrote:
I'm writing here because I haven't been able to create a smaller example
and I'm not sure what to search for in bugzilla.
DMD adds a storage identifier twice
I cannot find any string format() method in phobos.
Having to do:
auto a = appender!string();
formattedWrite(a, , ...);
a.data
seems unnecessary in many cases.
On Mon, 08 Aug 2011 14:37:26 +0300, simendsjo simend...@gmail.com wrote:
I cannot find any string format() method in phobos.
What's wrong with format() from std.string?
--
Best regards,
Vladimirmailto:vladi...@thecybershadow.net
On 08.08.2011 13:37, Vladimir Panteleev wrote:
On Mon, 08 Aug 2011 14:37:26 +0300, simendsjo simend...@gmail.com wrote:
I cannot find any string format() method in phobos.
What's wrong with format() from std.string?
Thanks, that was the function I was looking for. I just expected it to
On 08.08.2011 13:41, simendsjo wrote:
On 08.08.2011 13:37, Vladimir Panteleev wrote:
On Mon, 08 Aug 2011 14:37:26 +0300, simendsjo simend...@gmail.com
wrote:
I cannot find any string format() method in phobos.
What's wrong with format() from std.string?
Thanks, that was the function I
Is it possible to run unittests in libraries?
The following doesn't work:
l.d
===
module l;
import std.stdio;
int f() { return 1; } // just to make sure it's actually compiled in
unittest {
writeln(Unittest from lib);
assert(false);
}
t.d
===
import l;
import std.stdio;
void main() {
On 08.08.2011 14:07, simendsjo wrote:
On 08.08.2011 13:41, simendsjo wrote:
On 08.08.2011 13:37, Vladimir Panteleev wrote:
On Mon, 08 Aug 2011 14:37:26 +0300, simendsjo simend...@gmail.com
wrote:
I cannot find any string format() method in phobos.
What's wrong with format() from
On Mon, 08 Aug 2011 04:01:17 -0400, simendsjo simend...@gmail.com wrote:
On 08.08.2011 09:47, Jonathan M Davis wrote:
On Monday 08 August 2011 09:42:15 simendsjo wrote:
I'm writing here because I haven't been able to create a smaller
example
and I'm not sure what to search for in bugzilla.
I use absolute paths in a build script, and Ddoc uses the full path in a
comment in the generated files. This makes version control very
difficult as all developers has to use the same location (and possibly
operating system). Is there a way to avoid this without changing by
build script?
On 08.08.2011 15:33, Steven Schveighoffer wrote:
On Mon, 08 Aug 2011 04:01:17 -0400, simendsjo simend...@gmail.com wrote:
On 08.08.2011 09:47, Jonathan M Davis wrote:
On Monday 08 August 2011 09:42:15 simendsjo wrote:
I'm writing here because I haven't been able to create a smaller
example
simendsjo:
Is this by design, or just an implementation oddity?
Or a design oddity?
Bye,
bearophile
I need to interface with an application that has an IDispatch
(activex/ole/automation) interface. I can find some threads from 2006
about how painful that was. I'm suspecting that in the intervening 5
years progress has been made, but I'm having trouble finding it. The
manual says D
On 08.08.2011 15:46, Jason King wrote:
I need to interface with an application that has an IDispatch
(activex/ole/automation) interface. I can find some threads from 2006
about how painful that was. I'm suspecting that in the intervening 5
years progress has been made, but I'm having trouble
On 08/08/2011 12:33 AM, Pelle wrote:
On Fri, 05 Aug 2011 18:43:27 +0200, Kai Meyer k...@unixlords.com wrote:
On 08/05/2011 03:02 AM, Pelle wrote:
Don't declare variables until you need them, just leave bytes_read and
bytes_max here.
Is there a performance consideration? Or is it purely a
I have a problem I'd really like to use Strides for to simplify my code.
Currently, I do this:
foreach(n; 0..chunks)
comp_arr[n] = values[(n * step_size) + n]
if(!all_same(comp_arr, comp_arr[0]))
It would eliminate an entire 2 lines of code for each time I want
I have a problem I'd really like to use Strides for to simplify my code.
Currently, I do this:
foreach(n; 0..chunks)
comp_arr[n] = values[(n * step_size) + n]
if(!all_same(comp_arr, comp_arr[0]))
It would eliminate an entire 2 lines of code for each time I want
strides, to be able to do
Hi Sean,
This doesn't work when passing a delegate as func, however. Is there a way to
circumvent this?
I tried this with a delegate and a function template, it seems to work:
import std.typecons;
void bar(T)(ref T elem)
{
elem = elem+1;
}
void main()
{
auto data = tuple([0,1,2,3],
Hi,
I'm receiving this error with dmd 2.054:
tmp.d(7): Error: no [] operator overload for type Tuple!(int,short) for
the following test case
import std.typecons;
void main() {
auto x = 1;
Tuple!(int,short) a;
a[0] = 1;
a[x] = 2;
}
If I use a value instead of a variable ie. a[1] = 2; it compiles
Hmm, I just saw your question on SO. Is that nearer to what you ask?
It uses a anonymous template function:
import std.typecons;
void act(alias fun, T...)(ref Tuple!T data)
{
foreach(index, range; data.expand)
foreach(ref element; range)
fun(element);
}
void main()
{
Hi Chris,
import std.typecons;
void main() {
auto x = 1;
Tuple!(int,short) a;
a[0] = 1;
a[x] = 2;
}
If I use a value instead of a variable ie. a[1] = 2; it compiles fine.
The index need to be a compile-time constant, you cannot index a tuple
with a runtime value.
Try using
enum x = 1;
On Mon, 08 Aug 2011 14:17:28 -0400, Kai Meyer k...@unixlords.com wrote:
I am playing with threading, and I am doing something like this:
file.rawRead(bytes);
auto tmpTask = task!do_something(bytes.idup);
task_pool.put(tmpTask);
Is there a way to avoid the idup (or can
On 08.08.2011 23:27, Christian Manning wrote:
Hi,
I'm receiving this error with dmd 2.054:
tmp.d(7): Error: no [] operator overload for type Tuple!(int,short) for
the following test case
import std.typecons;
void main() {
auto x = 1;
Tuple!(int,short) a;
a[0] = 1;
a[x] = 2;
}
If I use a value
Philippe Sigaud wrote:
Hi Chris,
import std.typecons;
void main() {
auto x = 1;
Tuple!(int,short) a;
a[0] = 1;
a[x] = 2;
}
If I use a value instead of a variable ie. a[1] = 2; it compiles fine.
The index need to be a compile-time constant, you cannot index a tuple
with a runtime
On Mon, 08 Aug 2011 15:47:36 -0400, Christian Manning
cmanning...@gmail.com wrote:
Philippe Sigaud wrote:
Hi Chris,
import std.typecons;
void main() {
auto x = 1;
Tuple!(int,short) a;
a[0] = 1;
a[x] = 2;
}
If I use a value instead of a variable ie. a[1] = 2; it compiles fine.
The index
On Mon, 08 Aug 2011 15:55:38 -0400, Steven Schveighoffer wrote:
On Mon, 08 Aug 2011 15:47:36 -0400, Christian Manning
cmanning...@gmail.com wrote:
[...]
auto x = 1;
Tuple!(int, short) a;
a[0] = 1;
switch(x)
{
case 0:
a[0] = 2;
break;
case 1:
a[1] = 2;
Those
On Mon, 08 Aug 2011 20:32:03 +, Ali Çehreli wrote:
the point is, the compiler has no idea what the lvalue expression's
type should be when you do:
a[x] = 1;
is it short or int?
so the compiler must *know* what type x is at compile time in order for
this to be valid.
I think
On Mon, Aug 8, 2011 at 21:55, Steven Schveighoffer schvei...@yahoo.com wrote:
You still can do it, but you have to do it by still using compile-time
constants as indexes:
auto x = 1;
Tuple!(int, short) a;
a[0] = 1;
switch(x)
{
case 0:
a[0] = 2;
break;
case 1:
a[1] = 2;
Philippe Sigaud wrote:
On Mon, Aug 8, 2011 at 21:55, Steven Schveighoffer schvei...@yahoo.com
wrote:
You still can do it, but you have to do it by still using compile-time
constants as indexes:
auto x = 1;
Tuple!(int, short) a;
a[0] = 1;
switch(x)
{
case 0:
a[0] = 2;
break;
case
On 08/08/2011 12:55 PM, Jonathan M Davis wrote:
I have a problem I'd really like to use Strides for to simplify my code.
Currently, I do this:
foreach(n; 0..chunks)
comp_arr[n] = values[(n * step_size) + n]
if(!all_same(comp_arr, comp_arr[0]))
It would eliminate an entire 2 lines of code for
On 08/08/2011 12:55 PM, Jonathan M Davis wrote:
I have a problem I'd really like to use Strides for to simplify my code.
Currently, I do this:
foreach(n; 0..chunks)
comp_arr[n] = values[(n * step_size) + n]
if(!all_same(comp_arr, comp_arr[0]))
It would eliminate an entire 2 lines
On Mon, 08 Aug 2011 18:33:55 -0400, Kai Meyer k...@unixlords.com wrote:
On 08/08/2011 12:55 PM, Jonathan M Davis wrote:
I have a problem I'd really like to use Strides for to simplify my
code.
Currently, I do this:
foreach(n; 0..chunks)
comp_arr[n] = values[(n * step_size) + n]
Hi, all.
I installed dmd_2.054-0_amd64.deb on Ubuntu 11.04, and the compiler
seems to work fine, but I can't execute its output. Here's what I'm
doing: (ls to show directory contents)
$ dmd testFile.d
$ ./testFile
bash: ./testFile: Permission denied
testFile.d is the Hello world program
On Mon, 08 Aug 2011 18:33:55 -0400, Kai Meyer k...@unixlords.com wrote:
On 08/08/2011 12:55 PM, Jonathan M Davis wrote:
I have a problem I'd really like to use Strides for to simplify my
code.
Currently, I do this:
foreach(n; 0..chunks)
comp_arr[n] = values[(n * step_size) + n]
On 8/8/11, Steven Schveighoffer schvei...@yahoo.com wrote:
I like this idea. I think it belongs in phobos somewhere, if not already.
-Steve
Allow me to +1 on that, I've had a need for this (but now I can't
remember why, hah!).
Do you know the cause of the large (something like 3 times, latest dmd, -O
-release -inline) difference in performance in this program from using a tuple
or a struct with the same fields (the two alternative lines near the top)?
http://codepad.org/dLLdgrq8
I have tried in various ways to
On Mon, Aug 8, 2011 at 4:30 PM, Charles McAnany mcana...@rose-hulman.eduwrote:
Hi, all.
I installed dmd_2.054-0_amd64.deb on Ubuntu 11.04, and the compiler
seems to work fine, but I can't execute its output. Here's what I'm
doing: (ls to show directory contents)
$ dmd testFile.d
$
Sorry, wasn't me...
Oops, sorry.
I like this idea. I think it belongs in phobos somewhere, if not already.
I remember getting the idea in one of the articles written to win an
iPad2 a few months ago.
Philippe
I have the following (sort of) situation:
interface Handle
{ }
class A(T...) : Handle
{
T[0] m_one;
T[1] m_two;
etc..
T[0] getOne() { return m_one; }
}
class B
{
Handle[] m_array;
}
The reason I want to inherit A from Handle is so I don't have to keep using the
48 matches
Mail list logo