On 11/6/13, 6:43 AM, Timon Gehr wrote:
On 11/06/2013 04:34 AM, Tyro[17] wrote:
I’m sure the following table is missing a few items but am unclear
what they are. For starters these <>, <>=, >>>, , !<>, !<>=
belong on the table but I’m not sure where. I am also not sure if
these ..., @, # belong t
On 2013-11-08 01:57, DDD wrote:
I was watching a dconf talk about porting C# code to D. One thing that
came up was there isn't anything like C# streams for D. Walter said he
thinks iterators (unless I remember wrong) is superior. The speaker
agreed but said it isn't a drop in replacement so that
On 2013-11-08 04:22, Lionello Lunesu wrote:
However, sometimes it's useful to have polymorphism for accessing
streams, especially when porting C#/java code to D. In that case it
would be pretty trivial to port the base classes to D and implement them
using the D ranges.
For that, there's Tango
On Friday, 8 November 2013 at 05:10:57 UTC, Ross Hays wrote:
Okay here is something I was hoping for some general
clarification on related to this and maybe you can help me sort
some things out.
The opDispatch method has a template parameter of string
fieldName. In C++, templates are actually
When a template argument is only one token long (ie: one number, one type,
one string, one name), the parenthesis are optional and can be omitted.
On Friday, 8 November 2013 at 05:46:29 UTC, ProgrammingGhost
wrote:
I'm a D noob. ".map!(a => a.length)" seems like the lambda is
passed into the template. ".map!split" just confuses me. What
is split? I thought only types can be after "!". I would guess
split is a standard function but then s
Am 08.11.2013 06:19, schrieb Ellery Newcomer:
hello all.
I have a class member function that essentially looks like this:
ThisNode* _InsertAllBut(int value) {
ThisNode* node = MallocAllocator.allocate!(ThisNode)(1);
node.value = value;
node_count++;
return node;
}
I compil
On Fri, Nov 8, 2013 at 5:55 AM, Ross Hays wrote:
> And let me say that I really do like that this works in D. I can't imagine
> doing anything like this in C++ (which is what I used primarily in the
> past).
>
> The only reason I joke about it being useless is it really only supports
> vectors of
I'm a D noob. ".map!(a => a.length)" seems like the lambda is
passed into the template. ".map!split" just confuses me. What is
split? I thought only types can be after "!". I would guess split
is a standard function but then shouldn't it be map!(split)?
const wordCount = file.byLine()
hello all.
I have a class member function that essentially looks like this:
ThisNode* _InsertAllBut(int value) {
ThisNode* node = MallocAllocator.allocate!(ThisNode)(1);
node.value = value;
node_count++;
return node;
}
I compile it on x86_64 and the compiler inserts a gc alloca
Okay here is something I was hoping for some general
clarification on related to this and maybe you can help me sort
some things out.
The opDispatch method has a template parameter of string
fieldName. In C++, templates are actually compiled so each
different use of a template class is compil
And let me say that I really do like that this works in D. I
can't imagine doing anything like this in C++ (which is what I
used primarily in the past).
The only reason I joke about it being useless is it really only
supports vectors of length 2 or 3 (technically 1 as well but that
is not rea
Boom, that last few were the issues. I elected to just move the
return for the setter onto a separate line, mostly because the
idea of auto returning different types seem foreign to me... I
have used auto plenty in C++11, but never like that and it just
throws me off. But fixing those other mis
On Friday, 8 November 2013 at 04:38:23 UTC, Ross Hays wrote:
Thank you
No problem. I'm glad we're making progress on it. And don't feel
bad about mistakes while learning. They happen. Embrace them
because they happen to all of us at first especially when we're
juggling learning new syntaxes
On Thursday, 7 November 2013 at 14:27:55 UTC, Adam Ryczkowski
wrote:
Is this simple enough to explain me what I need to do? I'm new
to the D language.
do you really need that pi exapmle? i see it's the only exapmle
which fails to build, others works fine.
Sorry, I forgot to mention in that post that you have
"toOffset" in your template constraint, which means it will
also never match. You'll have to define it or replace it with
`fieldName[0] - 'x';`
Also, you might not want to do `fieldName[0 .. 1]` because
that's a slice (which is just anothe
On Friday, 8 November 2013 at 04:28:31 UTC, Ross Hays wrote:
class Vector(int N, T) if (N <= 3) {
T[N] data;
this()
{
data[] = 0;
}
@property ref T opDispatch(string fieldName, Args ...)(Args
args)
if (Args.length < 2 && fieldName.length == 1 &&
toOffset(f
On Friday, 8 November 2013 at 04:28:31 UTC, Ross Hays wrote:
Strange. I'm getting a different error, but I'm still running
2.063.2.
The error I get is
`Error: cannot resolve type for t.opDispatch!("x")`
What version are you running?
I just updated to 2.064.2
In any case, the reason apparentl
Strange. I'm getting a different error, but I'm still running
2.063.2.
The error I get is
`Error: cannot resolve type for t.opDispatch!("x")`
What version are you running?
I just updated to 2.064.2
In any case, the reason apparently is multifold:
1. Apparently the proper error message isn't s
On 11/5/13, 11:36 PM, Jonathan M Davis wrote:
On Tuesday, November 05, 2013 22:34:49 Tyro[17] wrote:
I’m sure the following table is missing a few items but am unclear
what they are. For starters these <>, <>=, >>>, , !<>, !<>=
belong on the table but I’m not sure where.
I'm not quite sure whe
On Friday, 8 November 2013 at 04:06:22 UTC, Chris Cain wrote:
So fix 2 and 3 and it works for getting x.
Also, define `toOffset` in the template constraint.
On Friday, 8 November 2013 at 03:42:12 UTC, Ross Hays wrote:
I am actually a little curious why my original approach did not
work at all. Using some of what you provided and some of what I
had I get the following:
import std.stdio;
import std.string;
class Vector(int N, T) if (N <= 3) {
T
On Friday, 8 November 2013 at 03:35:34 UTC, Ross Hays wrote:
Awesome that seems to do what I was going for. I had tried a
similar approach with @property dispatch and the subtraction of
'x', but I had left out the static if and had the opDispatch
returning a ref of the entry in the array (so th
I am actually a little curious why my original approach did not
work at all. Using some of what you provided and some of what I
had I get the following:
import std.stdio;
import std.string;
class Vector(int N, T) if (N <= 3) {
T[N] data;
this()
{
data[] = 0;
}
@pr
Awesome that seems to do what I was going for. I had tried a
similar approach with @property dispatch and the subtraction of
'x', but I had left out the static if and had the opDispatch
returning a ref of the entry in the array (so there would just be
the one @property still) but that resulted
On 11/8/13, 8:57, DDD wrote:
I was watching a dconf talk about porting C# code to D. One thing that
came up was there isn't anything like C# streams for D. Walter said he
thinks iterators (unless I remember wrong) is superior. The speaker
agreed but said it isn't a drop in replacement so that is
On Friday, 8 November 2013 at 02:48:31 UTC, Chris Cain wrote:
Minor tweaks might be necessary, but that should get you
started.
Actually, I refactored it a little bit to make it better
(original code was just a bit too messy for my taste):
---
struct Vector(int N, T) if (N <= 3) {
private
On Friday, 8 November 2013 at 02:13:01 UTC, Ross Hays wrote:
My end goal is to be able to instantiate a vector with a syntax
like...
`Vector!(2, float) vec = new Vector!(2, float)();`
...
Any suggestions?
Greetings,
This works:
---
import std.stdio;
struct Vector(int N, T) if (N <= 3) {
I have been playing around with a vector implementation that I am
trying to write in D, and have been having problems getting
something to work (it probably isn't even possible).
My end goal is to be able to instantiate a vector with a syntax
like...
`Vector!(2, float) vec = new Vector!(2, float)
I was watching a dconf talk about porting C# code to D. One thing
that came up was there isn't anything like C# streams for D.
Walter said he thinks iterators (unless I remember wrong) is
superior. The speaker agreed but said it isn't a drop in
replacement so that is an issue if you want to por
On 11/07/2013 09:02 PM, Benjamin Thaut wrote:
Am 07.11.2013 20:28, schrieb Mike Wey:
On 11/07/2013 06:16 PM, Benjamin Thaut wrote:
I don't know how other apps do this, but afaik giving each app there own
private copy can still cause problems.
If a dll with the same name as the one you are tryin
On 2013-11-07 21:03, Benjamin Thaut wrote:
Well it is for me. As the dlls are named the same the 64-bit executable
attempts to load the 32-bit dll first (because its the first one to be
found in the PATH)
No flag available for ignoring DLL's of the wrong architecture?
--
/Jacob Carlborg
On 2013-11-07 16:12, Benjamin Thaut wrote:
Woudln't it be necessary to copy the other gtk assets there too? Like
the fonts etc?
I have no idea. Just give it a try and copy the DLL's. In any case,
wouldn't the assets be the same for 32 and 64bit if they are the same
version.
--
/Jacob Carlb
Am 07.11.2013 20:15, schrieb Mike Wey:
On 11/07/2013 11:45 AM, Benjamin Thaut wrote:
Having both the 32 and 64 bits versions of GTK in your PATH doesn't seem
to be causing any problems for me.
Well it is for me. As the dlls are named the same the 64-bit executable
attempts to load the 32-bit
Am 07.11.2013 20:28, schrieb Mike Wey:
On 11/07/2013 06:16 PM, Benjamin Thaut wrote:
I don't know how other apps do this, but afaik giving each app there own
private copy can still cause problems.
If a dll with the same name as the one you are trying to load is already
in memory, Windows will us
On Thursday, 7 November 2013 at 18:19:35 UTC, ChrisG wrote:
On Thursday, 7 November 2013 at 09:51:38 UTC, Namespace wrote:
Dgame use the SDL also and needed therefore (as you do) shared
and unique pointers (mostly shared). So I wrote my own
versions and like to share them with you, maybe it h
On 11/07/2013 06:16 PM, Benjamin Thaut wrote:
Am 07.11.2013 16:58, schrieb Alexandr Druzhinin:
07.11.2013 22:53, Alexandr Druzhinin пишет:
07.11.2013 22:12, Benjamin Thaut пишет:
Am 07.11.2013 15:58, schrieb Jacob Carlborg:
On 2013-11-07 11:45, Benjamin Thaut wrote:
I'm wondering what's the
On 11/07/2013 11:45 AM, Benjamin Thaut wrote:
I'm wondering what's the correct way to handle multiple gtk
installations on windows? When developing I most likely will have at
least two at all times, the 32-bit version and the 64-bit version.
When they are both added to the PATH they will obviousl
On Thursday, 7 November 2013 at 17:31:45 UTC, Baz wrote:
On Monday, 4 November 2013 at 19:50:22 UTC, Baz wrote:
On Monday, 4 November 2013 at 18:00:17 UTC, Baz wrote:
On Monday, 4 November 2013 at 16:42:42 UTC, Jacob Carlborg
wrote:
On 2013-11-04 16:09, Baz wrote:
On Saturday, 26 October 2013
On Thursday, 7 November 2013 at 09:51:38 UTC, Namespace wrote:
Dgame use the SDL also and needed therefore (as you do) shared
and unique pointers (mostly shared). So I wrote my own versions
and like to share them with you, maybe it helps you.
Surface with shared SDL_Surface:
https://github.
On Thursday, 7 November 2013 at 01:09:45 UTC, Chris Cain wrote:
On Thursday, 7 November 2013 at 00:07:25 UTC, ChrisG wrote:
My question is: what's the status of D's struct Unique? It
looks like struct RefCounted is current, but I can't tell with
Unique. There's several comments in the source th
On 11/07/2013 12:07 AM, H. S. Teoh wrote:
// This is possibly the single nastiest bit of syntax in all of D:
static if (is(func X == __parameters)) {
// Quick, without looking at the docs: what does X refer
// to?
Nothing.
On Monday, 4 November 2013 at 19:50:22 UTC, Baz wrote:
On Monday, 4 November 2013 at 18:00:17 UTC, Baz wrote:
On Monday, 4 November 2013 at 16:42:42 UTC, Jacob Carlborg
wrote:
On 2013-11-04 16:09, Baz wrote:
On Saturday, 26 October 2013 at 16:36:35 UTC,
TheFlyingFiddle wrote:
Is there a way to
Am 07.11.2013 16:58, schrieb Alexandr Druzhinin:
07.11.2013 22:53, Alexandr Druzhinin пишет:
07.11.2013 22:12, Benjamin Thaut пишет:
Am 07.11.2013 15:58, schrieb Jacob Carlborg:
On 2013-11-07 11:45, Benjamin Thaut wrote:
I'm wondering what's the correct way to handle multiple gtk
installation
I'm getting "Unexpected OPTLINK Termination at EIP = 0
and assembly register values" when compiling the follow code. I'm
doing something wrong?
class MyClass
{
void opCall()
{
}
}
public void main(string[] arguments)
{
MyClass clazz = new MyClass();
TaskPool pool = new Ta
On Thursday, 7 November 2013 at 15:46:53 UTC, Marco Leise wrote:
Am Wed, 06 Nov 2013 14:22:13 +0100
schrieb "simendsjo" :
template isFoo(T) {
static if(is(T:Foo!U, int U))
enum isFoo = true;
else
enum isFoo = false;
}
enum isFoo(T) = is(T:
On Tuesday, 5 November 2013 at 16:00:43 UTC, bearophile wrote:
How to solve such little troubles? A possible idea is to add to
D another attribute, a kind of "private private" that is
enforced inside the same module. It could be named "super
private" because D has the "super" keyword :-) But th
07.11.2013 22:53, Alexandr Druzhinin пишет:
07.11.2013 22:12, Benjamin Thaut пишет:
Am 07.11.2013 15:58, schrieb Jacob Carlborg:
On 2013-11-07 11:45, Benjamin Thaut wrote:
I'm wondering what's the correct way to handle multiple gtk
installations on windows? When developing I most likely will h
Am Wed, 06 Nov 2013 18:14:54 +0100
schrieb "Gary Willoughby" :
> I'm not taking the chance and currently using:
>
> x = (int[string]).init;
x = null; is shorter. Just saying ;)
--
Marco
07.11.2013 22:12, Benjamin Thaut пишет:
Am 07.11.2013 15:58, schrieb Jacob Carlborg:
On 2013-11-07 11:45, Benjamin Thaut wrote:
I'm wondering what's the correct way to handle multiple gtk
installations on windows? When developing I most likely will have at
least two at all times, the 32-bit ver
Am Wed, 06 Nov 2013 14:22:13 +0100
schrieb "simendsjo" :
> template isFoo(T) {
> static if(is(T:Foo!U, int U))
> enum isFoo = true;
> else
> enum isFoo = false;
> }
enum isFoo(T) = is(T:Foo!U, int U);
correct ?
--
Marco
Am 07.11.2013 15:58, schrieb Jacob Carlborg:
On 2013-11-07 11:45, Benjamin Thaut wrote:
I'm wondering what's the correct way to handle multiple gtk
installations on windows? When developing I most likely will have at
least two at all times, the 32-bit version and the 64-bit version.
When they ar
On Thursday, 7 November 2013 at 15:03:40 UTC, Jacob Carlborg
wrote:
That doesn't work with libraries. You can have a library
consisting of two separate files that doesn't import each other.
I also prefer to put my tests in its own files, in a separate
directory. They are not imported by any ot
On 2013-11-07 13:22, Dicebot wrote:
I don't see this much an issue as expect good testing framework to be
coupled with a build system anyway. Also in really _lot_ of programs
simply adding mixin to your `app.d` / `main.d` is enough as everything
else is transitively imported from there.
That d
On 2013-11-07 11:45, Benjamin Thaut wrote:
I'm wondering what's the correct way to handle multiple gtk
installations on windows? When developing I most likely will have at
least two at all times, the 32-bit version and the 64-bit version.
When they are both added to the PATH they will obviously c
On Thursday, 7 November 2013 at 12:29:44 UTC, bearophile wrote:
Agustin:
no property 'popFront' for type 'BinaryHeap!(uint[])'
Try to use front and removeFront (I don't know why there is
removeFront instead of popFront).
Bye,
bearophile
I had to implement a custom IterableBinaryHeap impl
Is this simple enough to explain me what I need to do? I'm new to
the D language.
On Thursday, 7 November 2013 at 12:45:11 UTC, Agustin wrote:
On Thursday, 7 November 2013 at 12:29:44 UTC, bearophile wrote:
Agustin:
no property 'popFront' for type 'BinaryHeap!(uint[])'
Try to use front and removeFront (I don't know why there is
removeFront instead of popFront).
Bye,
be
On Thursday, 7 November 2013 at 12:29:44 UTC, bearophile wrote:
Agustin:
no property 'popFront' for type 'BinaryHeap!(uint[])'
Try to use front and removeFront (I don't know why there is
removeFront instead of popFront).
Bye,
bearophile
Saddly i had to do this
auto clone = _heap.dup
Agustin:
no property 'popFront' for type 'BinaryHeap!(uint[])'
Try to use front and removeFront (I don't know why there is
removeFront instead of popFront).
Bye,
bearophile
On Thursday, 7 November 2013 at 12:14:22 UTC, Agustin wrote:
On Thursday, 7 November 2013 at 09:00:11 UTC, bearophile wrote:
Agustin:
I'm trying to use BinaryHeap and i found out that i cannot
use foreach(). My question is, there is any other way to do
it?, can i iterate a BinaryHeap?
Pleas
On Thursday, 7 November 2013 at 08:37:02 UTC, Jacob Carlborg
wrote:
That is the problem. One needs to import all other modules.
That's not a good solution when creating a unit test framework.
One would basically have to scan a directory for all D files.
Then generate a new file that imports all
On Thursday, 7 November 2013 at 12:07:40 UTC, Dicebot wrote:
Only issue is .di file usage - you can't access implementation
declarations when importing those via compile-time reflection.
Other than that I don't see any possible failure sources.
As there is also an issue of having modules "a" a
On Thursday, 7 November 2013 at 09:00:11 UTC, bearophile wrote:
Agustin:
I'm trying to use BinaryHeap and i found out that i cannot use
foreach(). My question is, there is any other way to do it?,
can i iterate a BinaryHeap?
Please show the code :-)
Perhaps you need to look at the head, pop
On Thursday, 7 November 2013 at 10:04:57 UTC, Sönke Ludwig wrote:
Can't you do something like this? Or is the unit test framework
supposed to provide its own "root"/main module?
...
void runTests(string root_module = __MODULE__)()
{
// start recursion from root_module
}
---
Only issue is .
Am 07.11.2013 11:28, schrieb Atila Neves:
Looking like a bug I think. Changed the code to this and it crashes again:
import std.concurrency;
private void threadWriter() {
for(bool running = true; running;) {
receive(
(Tid i) {
},
(OwnerTermin
I'm wondering what's the correct way to handle multiple gtk
installations on windows? When developing I most likely will have at
least two at all times, the 32-bit version and the 64-bit version.
When they are both added to the PATH they will obviously conflict.
Googeling this issue doesn't hel
Looking like a bug I think. Changed the code to this and it
crashes again:
import std.concurrency;
private void threadWriter() {
for(bool running = true; running;) {
receive(
(Tid i) {
},
(OwnerTerminated trm) {
running = false;
qznc:
Operator precedence of "." is higher than unary minus.
You are right, I didn't know it, so Typedef and constructors are
not to blame:
double foo(in double x) {
assert (x >= 0);
return x;
}
void main() {
assert(-1.foo == -1);
}
Is this a good design of the operator prece
I had code that worked in 2.063 that crashes now (on Linux, on
Windows it still works). I suspect I was doing something stupid
and got lucky, but I'm posting here to make sure. Code:
import std.concurrency;
private void func() {
auto done = false;
while(!done) {
receive(
Am 07.11.2013 09:37, schrieb Jacob Carlborg:
On 2013-11-06 22:26, Dicebot wrote:
You need only symbol name of your root compiled module which imports all
others. All imported ones will be available in its member list, exactly
what this snippet shows.
That is the problem. One needs to import a
On Thursday, 7 November 2013 at 00:07:25 UTC, ChrisG wrote:
Hi, I've been following the D language off and on for several
years, have read Andrei's D book, but haven't ever posted here
before. Mostly, I come from a C++ and C# background. Recently,
I was playing with D using the derelict binding
Agustin:
I'm trying to use BinaryHeap and i found out that i cannot use
foreach(). My question is, there is any other way to do it?,
can i iterate a BinaryHeap?
Please show the code :-)
Perhaps you need to look at the head, pop the head item, look at
the head, etc.
Bye,
bearophile
On 2013-11-06 23:33, Gary Willoughby wrote:
foreach (module_; ModuleInfo)
{
auto func = module_.unitTest;
func(); // run tests;
}
The above code retrieves all of the current project's modules and then
grabs each module's unit test blocks. The only trouble is that the
module's unit test
On 2013-11-06 22:26, Dicebot wrote:
You need only symbol name of your root compiled module which imports all
others. All imported ones will be available in its member list, exactly
what this snippet shows.
That is the problem. One needs to import all other modules. That's not a
good solution
On 2013-11-06 09:03, John J wrote:
Sorry, I meant to say FreeTDS doesn't seem to support 64-bit Windows.
Aha, that might be the case. Somehow I missed that you needed to run the
application on Windows. FreeTDS is mainly to be able to connect to SQL
Server on non-Windows platforms. Can't you
76 matches
Mail list logo