On Sunday, August 11, 2013 07:24:52 captaindet wrote:
I'm pretty sure that this is just a bad error message.
void main(){
writeln(ok: , ok, ok[0]: , ok[0]);
// ok: Tuple!(string, string, string)(one, two, three)
ok[0]:
one
writeln(er: , er, er[0]: , er[0]);
// er:
On Friday, 9 August 2013 at 21:24:30 UTC, Ali Çehreli wrote:
On 08/09/2013 12:41 PM, captaindet wrote:
On 2013-08-09 11:36, Ali Çehreli wrote:
as I am in the process of revising and translating a Tuples
chapter.
as a matter of fact, i am checking your website regularly,
eagerly
awaiting
I'm pretty sure that this is just a bad error message.
void main(){
writeln(ok: , ok, ok[0]: , ok[0]);
// ok: Tuple!(string, string, string)(one, two, three)
ok[0]:
one
writeln(er: , er, er[0]: , er[0]);
// er: onetwothree er[0]: one
}
What I expect is happening is that TypeTuples don't
On 08/09/2013 10:41 AM, H. S. Teoh wrote:
1) There's the built-in tuple, which is a compiler concept, and
basically means any sequential collections of things (for lack of a
better word). For example, you can have a sequence of types, like (int,
string, float), or a sequence of values, like
/aggregates. anyhow, i started playing a bit putting them in enums anyway.
surprisingly, storing tuples and typetuples in enums is accepted by the
compiler. however, while enum tuples seem to behave normal/useful at compile time and run
time, enum'ed typetuples don't like compile time, but seem to behave
On 08/08/2013 11:16 PM, captaindet wrote: hi,
i am still struggling getting to grips with tuples, especially
typetuples.
Yes, especially TypeTuples. :)
typetuples seem to live in a shadow world
My feelings! :)
Coincidentally, I am struggling with the same question at the moment as
I am
On Fri, Aug 09, 2013 at 09:36:16AM -0700, Ali Çehreli wrote:
On 08/08/2013 11:16 PM, captaindet wrote: hi,
i am still struggling getting to grips with tuples, especially
typetuples.
Yes, especially TypeTuples. :)
typetuples seem to live in a shadow world
My feelings! :)
On Friday, August 09, 2013 10:41:05 H. S. Teoh wrote:
On Fri, Aug 09, 2013 at 09:36:16AM -0700, Ali Çehreli wrote:
On 08/08/2013 11:16 PM, captaindet wrote: hi,
i am still struggling getting to grips with tuples, especially
typetuples.
Yes, especially TypeTuples. :)
On Friday, August 09, 2013 01:16:12 captaindet wrote:
module demo;
import std.stdio, std.typetuple, std.typecons;
enum ok = tuple(one, two, three);
pragma(msg, ok, , , ok[0]);
// Tuple(one, two, three), one
enum er = TypeTuple!(one, two, three);
// pragma(msg, er);
// Error: variable
On 2013-08-09 11:36, Ali Çehreli wrote:
as I am in the process of revising and translating a Tuples chapter.
thanks for the reply, Ali.
as a matter of fact, i am checking your website regularly, eagerly awaiting the
translations of the tuples chapter. and the __traits and the template
On Friday, 9 August 2013 at 06:16:20 UTC, captaindet wrote:
a) if we are not allowed to put typetuples in enums, why is it
not an error?
[...]
enum er = TypeTuple!(one, two, three);
FWIW, it's an error in the current git head dmd: Error: cannot
cast one to (string, string, string) at
On 08/09/2013 12:41 PM, captaindet wrote:
On 2013-08-09 11:36, Ali Çehreli wrote:
as I am in the process of revising and translating a Tuples chapter.
as a matter of fact, i am checking your website regularly, eagerly
awaiting the translations of the tuples chapter. and the __traits and
On 2012-09-27, 00:02, Jonathan M Davis wrote:
Classes will not work for the same reason that you can never use a class
object as an enum with manifest constants.
Has a decision been made as to whether or not this will be possible in the
future?
--
Simen
On Friday, September 28, 2012 03:56:39 Simen Kjaeraas wrote:
On 2012-09-27, 00:02, Jonathan M Davis wrote:
Classes will not work for the same reason that you can never use a class
object as an enum with manifest constants.
Has a decision been made as to whether or not this will be possible
Hi,
I faced a little trouble and can not decide if it is a my
mistake, a bug in std library or in compiler…
Look:
$ cat enum_of_structs.d
struct T {
int v;
int opCmp( T rhs ) { return v == rhs.v ? 0 : ( v rhs.v ? -1 :
+1 ); };
};
enum E : T {
A = T( 1 ),
BTW, I use DMD64 D Compiler v2.060 on Fedora 17. ldc2 compiler
(LLVM D Compiler LDC trunk, based on DMD v2.059 and LLVM 3.0)
produces similar results:
$ ldc2 -c -w enum_of_tuples.d
enum_of_tuples.d(5): Error: template
std.typecons.Tuple!(int,v).Tuple.opCmp does not match any
function
Van de Bugger:
Oops. What the problem?
I seems one or more bugs. D named enums are adapted from the C
language, they were first of all meant to contain simple values
like ints or chars. The more complex things you keep trying to
put in them, the more bugs you will find :-) People in
On Wednesday, September 26, 2012 23:24:08 bearophile wrote:
Van de Bugger:
Oops. What the problem?
I seems one or more bugs. D named enums are adapted from the C
language, they were first of all meant to contain simple values
like ints or chars. The more complex things you keep trying to
18 matches
Mail list logo