On Sun, 19 Aug 2012 10:15:42 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
it's generally considered good practice to put const and immutable on
the right-hand side.
I would also say that putting function attributes on a separate line
above the function is fairly common:
const
On Sat, 18 Aug 2012 07:11:38 +0200, 1100110 10equa...@gmail.com wrote:
I haven't been quite able to figure this one out.
string[string][] Dict;//sure ok.
alias string[string][] dict;//Error
void main()
{
Dict = [[Cow:moo ],[Duck:quack]];//cool
Dict
On Wed, 15 Aug 2012 20:07:59 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
1) The specification is clear that the if the template has only
one member and the member has the same name with the template's,
the member is implicitly referred to in the instantiation. The
template octal has
On Tue, 14 Aug 2012 21:27:25 +0200, Andrew andrew.sp...@gmail.com wrote:
I'm trying to interface with C code, where I have a function
definition that takes two const char[]'s:
PetscErrorCode PetscInitialize(int*, char***, const char[], const
char[]);
However, the typical way that you pass
On Sun, 12 Aug 2012 22:30:57 +0200, Andrew andrew.sp...@gmail.com wrote:
I'm attempting to create a wrapper for MPI, however, MPI_Init
wants to read the arguments for main():
MPI_Init(int *argv, char ***argc);
How do I get this last level of pointer reference?
So far, I have:
void main
On Sun, 12 Aug 2012 23:02:43 +0200, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
On 8/12/12, Simen Kjaeraas simen.kja...@gmail.com wrote:
// Array of pointers to command line parameters.
char*[] argv = args.map!((a)=(a.dup~'\0').ptr).array;
You know.. it'd be much simpler
On Thu, 09 Aug 2012 19:25:47 +0200, egslava egsl...@gmail.com wrote:
Hello! Sorry for my English.
I read manual about immutable and const keyword:
http://dlang.org/const3.html
And tried to build my program:
http://dpaste.dzfl.pl/f803ae94
If I will change immutable to const output will not
On Wed, 08 Aug 2012 15:46:23 +0200, ixid nuacco...@gmail.com wrote:
I'm using the recently released DMD2 version 2.060.
SIMD operations are not supported for Windows at the moment,
I think. Of course, if you're running Linux, ignore this answer.
--
Simen
On Wed, 08 Aug 2012 11:13:30 +0200, Timon Gehr timon.g...@gmx.ch wrote:
Yes, but note that this distinction does not make any sense.
alias int Int; // works
isType!Int // 'Int' is clearly a symbol, yet the instantiation fails.
I'm not sure it is 'clearly' a symbol. To the compiler, there is
On Mon, 06 Aug 2012 11:53:18 +0200, bioinfornatics
bioinfornat...@gmail.com wrote:
Dear,
1/
i would like have a code near as this haskell code:
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
main = do
print $ sum (filter even (takeWhile (400) fibs))
Ii know in D:
- auto fib =
On Mon, 06 Aug 2012 11:59:29 +0200, Simen Kjaeraas
simen.kja...@gmail.com wrote:
This is what you want, isn't it?
recurrence!((a,n)=a[n-1]+a[n-2])(1,1).until!(a=a=4)()
That is, the meat of it. The full line:
writeln(recurrence!((a,n)=a[n-1]+a[n-2])(1,1).until!(a=a=4)().filter
On Mon, 06 Aug 2012 17:49:19 +0200, Philippe Sigaud
philippe.sig...@gmail.com wrote:
On Mon, Aug 6, 2012 at 5:32 PM, Philippe Sigaud
philippe.sig...@gmail.com wrote:
What I'd like to know and may test myself is: is there any speed
difference in this functional-oriented D code and a more
On Sun, 29 Jul 2012 15:03:09 +0200, Minas Mina
minas_mina1...@hotmail.co.uk wrote:
Having a destructor and that you know when is going to be called is VERY
useful!
So by removing the delete keyword, what happens? We won't have a way
to destroy objects in a predictable way anymore? (I'm not
On Sun, 29 Jul 2012 16:13:03 +0200, Timon Gehr timon.g...@gmx.ch wrote:
On 07/28/2012 06:47 PM, Simen Kjaeraas wrote:
On Sat, 28 Jul 2012 18:17:14 +0200, Zhenya zh...@list.ru wrote:
Why do not D allow templates with more than one tuple
parameters,at the
same time that C++11 support
On Sun, 29 Jul 2012 19:11:17 +0200, Chad J
chadjoan@__spam.is.bad__gmail.com wrote:
So there. Now, you simply use auto a = constrain!isInputRange(
expression );. Is this what you wanted?
That's pretty good. It's still not as concise or easy to discover as
the language's natural syntax
On Sat, 28 Jul 2012 10:20:56 +0200, Namespace rswhi...@googlemail.com
wrote:
This is a NotNull I just implemented. It is designed to create a strict
division between things that can be null, and those that cannot. The
idea
being that the programmer should be aware of it when he needs to
On Fri, 27 Jul 2012 14:44:35 +0200, bearophile bearophileh...@lycos.com
wrote:
Namespace:
Then: What is the problem to introduce such shorthand?
I don't know.
I have a partial enhancement on the topic:
http://d.puremagic.com/issues/show_bug.cgi?id=4571
Bye,
bearophile
I believe at
On Fri, 27 Jul 2012 16:39:49 +0200, Namespace rswhi...@googlemail.com
wrote:
What's wrong with the solution that
void some_function(Foo? f) {
is converted to
void some_function(Foo f, string filename = __FILE__, uint line =
__LINE__) in {
assert(f !is null, std.string.format(Null
On Fri, 27 Jul 2012 17:35:19 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
Many of us think that
const Foo func() {}
should just become illegal inconsistency or not because of all of this
confusion, but Walter doesn't buy into that.
Like monarch_dodra said, this is also a style
On Fri, 27 Jul 2012 19:28:06 +0200, monarch_dodra monarchdo...@gmail.com
wrote:
I'm kind of confused, because every time I see pointer usage, the
deference operator is omitted?
For example:
struct S
{
void foo(){};
}
S* p = new S();
p.foo();
When and where
On Thu, 26 Jul 2012 13:34:34 +0200, bearophile bearophileh...@lycos.com
wrote:
static assert(0, ...);
But in release mode it doesn't print the message.
Now that'd be something. :p
--
Simen
On Thu, 26 Jul 2012 15:07:56 +0200, bearophile bearophileh...@lycos.com
wrote:
but isn't D supporting mixins inside enums?
Nope. The text contents of the string must be compilable as a valid
StatementList, and is compiled as such.
And enums don't allow statements in their body.
--
I've also written this implementation of enumerations. It's a bit
different from normal D enums, but supports inheritance, guarantees unique
values, as is much more conservative in what conversions and operations it
allows.
I'm considering adding addition and subtraction of integers as
On Thu, 26 Jul 2012 18:08:24 +0200, maarten van damme
maartenvd1...@gmail.com wrote:
The newly generated ExtendEnum will try to convert my old enum with
string fields to integer fields. the mixin should generated
ExtendEnum : string when passing in an enum with type string. Same
problem
On Thu, 26 Jul 2012 19:18:21 +0200, monarch_dodra monarchdo...@gmail.com
wrote:
So here are my two questions:
1) Is what I was originally trying to do actually illegal, or is it some
sort of compiler limitation? TDPL implies this should work perfectly
fine...
Compiler limitation. It's
On Thu, 26 Jul 2012 20:14:10 +0200, monarch_dodra monarchdo...@gmail.com
wrote:
On Thursday, 26 July 2012 at 17:57:31 UTC, Simen Kjaeraas wrote:
On Thu, 26 Jul 2012 19:18:21 +0200, monarch_dodra
monarchdo...@gmail.com wrote:
2) Is there a correct workaround?
Exactly what you did. Though
On Tue, 24 Jul 2012 22:53:05 +0200, David d...@dav1d.de wrote:
Am 24.07.2012 21:46, schrieb David:
Hmm. Could this be a GC-related issue?
Actually this could be. They are stored inside a Vertex* array which is
allocated which is allocated with `malloc`, maybe the GC scans all of
the created
On Mon, 23 Jul 2012 16:32:15 +0200, monarch_dodra monarchdo...@gmail.com
wrote:
Is there any (efficient and correct) way to do ternary comparison on two
objects?
You know the:
if(ab) return -1;
if(ba) return 1;
return 0;
I'm using the above method in a template, and the problem
On Wed, 18 Jul 2012 16:58:34 +0200, Namespace rswhi...@googlemail.com
wrote:
First:
Why is opDot not listed here: http://dlang.org/operatoroverloading.html ?
How much other operators exists which are not listed there?
I believe it's being deprecated. As far as I know, no other operators are
On Tue, 10 Jul 2012 21:27:54 +0200, Namespace rswhi...@googlemail.com
wrote:
Maybe D need's a readonly keyword.
Sometimes i have a class which can take an object from everywhere to
store it. So it can not be const, because i didn't just initialized it
with a ctor.
But i don't want to
On Tue, 12 Jun 2012 14:12:19 +0200, ixid nuacco...@gmail.com wrote:
Perhaps there is already a way to do this. With the UFCS one tends to
make elegant chains of statements, it would be useful to have writeln
and file functions that can easily be dropped in the middle of such
chains without
On Fri, 18 May 2012 23:06:00 +0200, Matthias Walter
xa...@xammy.homelinux.net wrote:
[snip]
prints out
false
Because Wrapper!(AliasStruct).Wrap does not exist. And _error_ is not
equal to any other type.
true
Indeed, they are the same.
false
And here I disagree. This prints true
On Thu, 17 May 2012 16:28:56 +0200, Christian Köstlin
christian.koest...@gmail.com wrote:
On 5/15/12 19:44 , H. S. Teoh wrote:
On Tue, May 15, 2012 at 07:29:38PM +0200, Christian Köstlin wrote:
for [1, 2, 3] and iota(2, 10)?
[...]
What are you trying to accomplish?
T
actually i just
On Tue, 15 May 2012 21:58:46 +0200, Jacob Carlborg d...@me.com wrote:
On 2012-05-15 21:50, Ali Çehreli wrote:
Not possible in D. D's const is transitive. If b is const, then what it
points to is also const.
Ali
Then it would be best to not declare that as const?
That depends. Will the
I would be glad for criticism and suggestions and maybe a
solution/workaround for the infinite loop bug, if it's the case, that
it's really a bug.
First thought (after just copying the code and compiling it, not reading
the
post :p), was 'where are the unittest blocks?' Then I saw you
On Thu, 03 May 2012 00:38:35 +0200, Namespace rswhi...@googlemail.com
wrote:
I'm not very skillful in such template stories. Maybe someone can help
me?
The main problem here is your opCast is non-const. (it's always an
indication of
const problems when DMD says X is not callable using
On Wed, 02 May 2012 23:01:21 +0200, Jacob Carlborg d...@me.com wrote:
Is there a general function for transforming a range back to the
original type? If not, would it be possible to create one?
In addition to std.array.array, as others have pointed out,
there is also
On Fri, 27 Apr 2012 13:23:00 +0200, Dmitry Olshansky
dmitry.o...@gmail.com wrote:
On 27.04.2012 15:15, Rene Zwanenburg wrote:
Since an OpenGL context is owned by one thread, any OpenGL calls made
from other threads will fail. I've wrapped OpenGL 'objects' in D classes
to automate destruction
On Fri, 27 Apr 2012 14:57:52 +0200, Rene Zwanenburg
renezwanenb...@gmail.com wrote:
On Friday, 27 April 2012 at 11:53:37 UTC, Simen Kjaeraas wrote:
On Fri, 27 Apr 2012 13:23:00 +0200, Dmitry Olshansky
dmitry.o...@gmail.com wrote:
On 27.04.2012 15:15, Rene Zwanenburg wrote:
Since
On Fri, 27 Apr 2012 14:52:08 +0200, Joseph Rushton Wakeling
joseph.wakel...@webdrake.net wrote:
Hello all,
Just recently I tried returning a Tuple from a function and received an
error message about this not being allowed.
Reading up a bit on the D site I'm not clear -- is it a
On Fri, 27 Apr 2012 17:55:02 +0200, Rene Zwanenburg
renezwanenb...@gmail.com wrote:
I _could_ modify the system to use ref counting everywhere, but I'm
reluctant to do that.
You wouldn't really need to. Only the texture struct would need that.
Look to std.typecons's RefCounted[1] for
On Friday, 27 April 2012 at 16:36:04 UTC, Namespace wrote:
By the following code i get a normal Access Violation.
My question is: why? Even if f0 is null, the object must be
converted to Ref and there i check if the given object is null.
When trying to convert f0 to Ref, the compiler has to
On Friday, 27 April 2012 at 16:57:52 UTC, Namespace wrote:
On Friday, 27 April 2012 at 16:49:49 UTC, Simen Kjaeraas wrote:
On Friday, 27 April 2012 at 16:36:04 UTC, Namespace wrote:
By the following code i get a normal Access Violation.
My question is: why? Even if f0 is null, the object must
On Fri, 13 Apr 2012 14:52:05 +0200, Andrea Fontana nos...@example.com
wrote:
If I have something like:
static int var = myFunction();
dmd will evaluate myFunction() at compile time. If it can't, it gives me
a compile error, doesn't it? If I'm not wrong, static force this.
Indeed.
If i
On Mon, 02 Apr 2012 09:58:18 +0200, simendsjo simend...@gmail.com wrote:
On Mon, 02 Apr 2012 00:04:58 +0200, Simen Kjærås
simen.kja...@gmail.com wrote:
On Sat, 31 Mar 2012 15:20:42 +0200, simendsjo simend...@gmail.com
wrote:
Seems __traits doesn't have a __traits(getMemberType, T,
On Wed, 26 Oct 2011 17:15:37 +0200, Simen Kjaeraas
simen.kja...@gmail.com wrote:
On Wed, 26 Oct 2011 10:58:12 +0200, Dominic Jones
dominic.jo...@qmul.ac.uk wrote:
Hello,
I was looking for a FIFO stack in std.containers but only found SList
and Array which both appear to essentially
On Thu, 22 Sep 2011 00:43:09 +0200, deadalnix deadal...@gmail.com wrote:
Great answer ! Thank you very much, it answered almost everything !
But what about, in the exemple you gave me (which is great by the way)
if foo as parameters ? Those parameters are passed on the stack by copy
to the
On Wed, 21 Sep 2011 18:32:49 +0200, deadalnix deadal...@gmail.com wrote:
D has a wonderfull feature named delegate. Delegate can acess local
data, thus would be dangerous if thoses data were on the stack. For what
I understand, when a delegate can access the local data of a function,
those
On Mon, 19 Sep 2011 23:20:47 +0200, bearophile bearophileh...@lycos.com
wrote:
A tiny puzzle I've shown on IRC. This is supposed to create an inverted
array of cards, but what does it print instead?
import std.stdio, std.algorithm, std.range;
void main() {
int[52] cards;
On Thu, 15 Sep 2011 16:46:24 +0200, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
struct Foo(T = int) {}
void main()
{
Foo foo; // fail
Foo!() bar; // ok
}
It would be very convenient to be able to default to one type like this.
For example, in CairoD there's a Point
On Thu, 15 Sep 2011 17:54:19 +0200, Christophe
trav...@phare.normalesup.org wrote:
Simen Kjaeraas , dans le message (digitalmars.D.learn:29539), a
écrit :
On Thu, 15 Sep 2011 16:46:24 +0200, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
struct Foo(T = int) {}
void main()
{
Foo
On Thu, 15 Sep 2011 22:24:50 +0200, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
I can do this:
struct Foo(T) { }
template bar(T : Foo!int) { }
I can check if T is a specific instantiation of Foo. But I want to
check whether T is *any* instantiation of Foo. Is this possible to do?
On Thu, 15 Sep 2011 22:45:21 +0200, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
Cool, that works, thanks. Is this in Phobos by any chance? Otherwise
I'll just use a more flexible version of that.
No more flexible version available, sadly. I wish this worked (I think
it's in Bugzilla
On Mon, 12 Sep 2011 00:11:11 +0200, Timon Gehr timon.g...@gmx.ch wrote:
I think the fact that in for AAs returns a pointer is a mistake and
ugly in the first place and any generic code that relies on any
container to return a raw internal pointer is flawed by itself imho.
If D had a
On Wed, 07 Sep 2011 20:50:04 +0200, Johannes Totz johan...@jo-t.de wrote:
On 06/09/2011 12:00, bearophile wrote:
malio:
Okay, thanks bearophile. But I currently doesn't exactly understand
what's the difference between ref and const ref/immutable
ref. If ref is syntactic sugar for pointers
On Mon, 22 Aug 2011 22:19:50 +0200, Don nos...@nospam.com wrote:
BTW: The whole weak pure/strong pure naming was just something I
came up with, to convince Walter to relax the purity rules. I'd rather
those names disappeared, they aren't very helpful.
The concepts are useful, but better
On Mon, 15 Aug 2011 21:53:11 +0200, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
This will print the count of whitespace chars in a line:
writeln(count!isWhite(line));
What I need is the count of whitspace chars until the first
non-whitespace char is found, essentially I need a
On Sun, 14 Aug 2011 01:15:29 +0200, mimocrocodil 4deni...@gmail.com
wrote:
Hi!
I am want to extend available enum to provide more items to them.
How I can do this job without manual copying of exsisting enum items?
If what you want is a new enum that contains the values of an existing
On Mon, 18 Jul 2011 18:06:46 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Monday 18 July 2011 15:55:52 teo wrote:
On Mon, 18 Jul 2011 10:26:27 -0400, Steven Schveighoffer wrote:
On Sun, 17 Jul 2011 15:29:02 -0400, teo teo.ubu...@yahoo.com wrote:
It looks like std.concurrency.spawn
On Thu, 14 Jul 2011 17:07:20 +0200, teo teo.ubu...@yahoo.com wrote:
Is there any way of wrapping a void* by a ubyte[] array? The void* comes
from mmap.
byte[] array = cast(ubyte[])mmap(addr, length, ...)[0..length;]
--
Simen
On Sun, 10 Jul 2011 22:30:34 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
Well, if you can do it with alias this, then it's possible. If not, then
it
probably isn't. But I don't know what opImplicitCast would give you if
alias
this doesn't (particularly if alias this is working
I'm trying to have this sort of code compile:
struct Foo {
int data;
this(int n) {
data = n;
}
}
void bar(Foo f) {}
bar(3);
Is this even possible? I believe the feature was called
opImplicitCastFrom, at some point.
Conversely, the
On Sun, 10 Jul 2011 16:41:17 +0200, bearophile bearophileh...@lycos.com
wrote:
There is a uncommon syntax that allows you to do it with a class, but I
don't know why structs don't work here:
class Foo {
int data;
this(int n) {
data = n;
}
}
void bar(Foo f ...) {
On Sun, 10 Jul 2011 21:39:54 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Sunday 10 July 2011 20:47:04 David Nadlinger wrote:
On 7/10/11 3:29 PM, Simen Kjaeraas wrote:
I'm trying to have this sort of code compile:
struct Foo {
int data;
this(int n) {
data = n
On Thu, 07 Jul 2011 20:19:05 +0200, Loopback elliott.darf...@gmail.com
wrote:
Hello!
I've been programming some miscellaneous code and got stuck in an odd
case. While comparing floats, two obviously identical values return
false in comparison.
I am not sure if this is related to float
On Fri, 01 Jul 2011 08:58:32 +0200, Zardoz luis.panad...@gmail.com wrote:
Well, the problem is that I must do the cast always, see :
// alias Matrix!(real,4) Mat4r;
// alias Vector!(float, 3) Vec3f;
// alias Vector!(real, 4) Vec4r;
// In Mat4r, VCol it's aliased to Vector!(real, 4)
auto tcol
On Thu, 30 Jun 2011 07:11:44 +0200, scarrow shawn.ba...@gmail.com wrote:
Hey all,
I'd like to embed hashed strings into my code. The C++ version of this
engine
ran an external tool to preprocess the files. In D my strongly pure
function
is only evaluated if I assign it to something like
On Fri, 01 Jul 2011 01:39:53 +0200, Zardoz luis.panad...@gmail.com wrote:
I have a parametrized struct (Vector!(T, dim)) that takes two parameters
(Type and a number). And made some Alias with defaults parameters.
In other struct (Matrix!(T, dim)), that uses these struct to represent a
matrix
On Wed, 29 Jun 2011 22:59:47 +0200, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
Is there any way a newly spawned thread can get the Tid of the thread
that spawned it, basically its parent? I'd prefer that over using
this:
__gshared mainThread; // so workThread can access it
{
On Sun, 26 Jun 2011 16:10:04 +0200, simendsjo simen.end...@pandavre.com
wrote:
This is probably not a minimal test case, but it's as far as I got.
Don't know what the actual bug is, so I'd be grateful if someone else
could help explain it so I can add it to Bugzilla with a better subject.
On Sat, 25 Jun 2011 15:57:03 +0200, simendsjo simen.end...@pandavre.com
wrote:
I have a templated struct, and I'd like to check if a given type is this
struct. I have no idea how I should write the is expression..
struct S(int C, int R, T) {
T[C][R] data;
}
template isS(T) {
enum
On Wed, 01 Jun 2011 01:57:52 +0200, Michael Shulman
viritril...@gmail.com wrote:
I've also realized that my proposed workaround actually doesn't work,
because 'alias this' doesn't actually behave like subclassing with
respect to references. That is, if Inner2 is 'alias this'ed to
Inner1, and
On Tue, 31 May 2011 19:49:24 +0200, Steven Schveighoffer
schvei...@yahoo.com wrote:
Currently, you can omit the template args only in the case of IFTI
(Implicit Function Template Instantiation) which actually deduces your
template arguments based on the function call.
I'd argue actually,
On Tue, 31 May 2011 20:17:23 +0200, Michael Shulman
viritril...@gmail.com wrote:
I have thought of a workaround with 'alias this':
class Outer2 : Outer1 {
class Inner2 {
Inner1 _self;
alias _self this;
this() {
_self = this.outer.new Inner1();
}
}
}
This seems to
On Sat, 21 May 2011 11:40:22 +0200, Matthew Ong on...@yahoo.com wrote:
Using your code I have this error:
src\Sample.d(16): Error: undefined identifier btype, did you mean
template AType(string name,U,alias V)?
src\Sample.d(16): Error: mixin AType!(ClassB,string,_error_) does not
match
On Sat, 21 May 2011 10:54:54 +0200, Matthew Ong on...@yahoo.com wrote:
mixin template AType(alias T, U, alias V){
class T : ClassC { // Class level Template
This gives you a class called T. You seem to want it to have the name
you pass as a string, in which case you have to use string mixins.
On Sat, 21 May 2011 05:12:20 +0200, Andrej Mitrovic n...@none.none wrote:
Taken from the docs:
alias int func(int);
void main()
{
if ( is(func[]) ) // not satisfied because arrays of
writeln(satisfied);// functions are not allowed
else
writeln(not
On Thu, 07 Apr 2011 02:13:16 +0200, bearophile bearophileh...@lycos.com
wrote:
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in a program I need an array of
On Thu, 31 Mar 2011 02:32:35 +0200, Aleksandar Ružičić
ruzicic.aleksan...@gmail.com wrote:
Is it possible to use opDispatch as generic getter and setter at the
same time? Something like __get() and __set() in PHP..
this is what I've tried: https://gist.github.com/895571
and I get Error:
On Mon, 28 Mar 2011 16:57:17 +0200, Kai Meyer k...@unixlords.com wrote:
On 03/25/2011 01:10 PM, Dr.Smith wrote:
To empty many arrays of various types, rather than:
clear(arr1);
clear(arr2);
...
clear(arrN);
is there something like:
clear(ALL);
No, but perhaps you can do a:
foreach(a; ALL)
On Fri, 25 Mar 2011 06:18:21 +0100, Ishan Thilina ishanthil...@gmail.com
wrote:
Hi,
I'm still new to D. I tried to implement a stack using templates. But I
get an
Access Violation error when I try to run a test on the stack that I
made.The
source code is attached with this mail. Can
On Mon, 21 Mar 2011 01:52:45 +0100, Ary Manzana a...@esperanto.org.ar
wrote:
On 3/19/11 9:11 PM, Don wrote:
Here's the task:
Given a .d source file, strip out all of the unittest {} blocks,
including everything inside them.
Strip out all comments as well.
Print out the resulting file.
On Mon, 21 Mar 2011 22:27:17 +0100, teo teo.ubu...@yahoo.com wrote:
I cannot initialize immutable class members inside a static this()
constructor. Is there any reason for that?
Example:
class Test
{
public immutable(int) x;
static this()
{
x = 1; // Error: variable Test.x
On Sun, 20 Mar 2011 19:37:45 +0100, spir denis.s...@gmail.com wrote:
* ideally, I would use the sign to tell signed types apart (1 is
unsigned, +1 is signed)
I hope you messed that one up. An unadorned int literal should be signed.
Period.
* get rid of 01 octal bug!
Oh gods, yes.
On Wed, 16 Mar 2011 21:07:08 +0100, simendsjo simen.end...@pandavre.com
wrote:
http://www.digitalmars.com/d/2.0/tuple.html
// this example fails
Tuple!(3, 7, 'c')
typecons.d(298): Error: static assert Attempted to instantiate Tuple
with an invalid argument: 3
Even this fails:
alias
On Wed, 16 Mar 2011 21:51:37 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Wed, 16 Mar 2011 16:28:48 -0400, Simen kjaeraas
simen.kja...@gmail.com wrote:
On Wed, 16 Mar 2011 21:07:08 +0100, simendsjo
simen.end...@pandavre.com wrote:
http://www.digitalmars.com/d/2.0
On Wed, 16 Mar 2011 22:39:00 +0100, Denis Koroskin 2kor...@gmail.com
wrote:
On Thu, 17 Mar 2011 00:30:17 +0300, Jacob Carlborg d...@me.com wrote:
Is it possible to declare string literal of a template type, something
like this:
void bar (const(T)[] a) {}
void foo (T) (const(T)[] a)
{
On Wed, 16 Mar 2011 22:43:20 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
Now I am concerned, this looks like an oxymoron:
TypeTuple!(1, 2, 3)
Should we think about changing the name of std.typetuple.TypeTuple since
it can clearly contain expressions as well as types? I would
On Tue, 15 Mar 2011 17:36:04 +0100, Michel Fortin
michel.for...@michelf.com wrote:
On 2011-03-15 10:42:46 -0400, Magnus Lie Hetland mag...@hetland.org
said:
I've got a function template along these lines:
Foo!T foo(T)(T[] bar, real function(T,T) baz) { ... }
The main reason I'm using
Spacen Jasset spacenjas...@yahoo.co.uk wrote:
On 13/03/2011 00:06, Bekenn wrote:
On 3/12/2011 2:20 PM, Simon wrote:
I've done lots of 3d over the years and used quite a lot of different
libraries and I've come to prefer code that makes a distinction between
points and vectors.
Agreed. This
On Sun, 13 Mar 2011 15:43:09 +0100, Simon s.d.hamm...@gmail.com wrote:
On 13/03/2011 14:11, Simen kjaeraas wrote:
Spacen Jasset spacenjas...@yahoo.co.uk wrote:
On 13/03/2011 00:06, Bekenn wrote:
On 3/12/2011 2:20 PM, Simon wrote:
I've done lots of 3d over the years and used quite a lot
nrgyzer nrgy...@gmail.com wrote:
I'm trying to read a png file and I'm having some trouble with the
chunk-size. Each chunk of a png file begins with a 4 byte (unsigned)
integer. When I read this 4 byte integer (uint) I get an absolutely
incorrect length. My code currently looks like:
void
useo u...@start.bg wrote:
Hey guys,
is it possible to declare a enum where all entries are instances of a
class (or struct), like the following:
class a {
...
public this(uint i) {
...
}
...
}
enum myEnum : a {
entry1 = new a(0);
entry2 = new a(1);
}
... or does
Martin Kinkelin no...@spam.com wrote:
Thanks,
movups XMM0, [EAX];
works. The SSE version takes more than 160% of the run-time compared to
the naive
version though. ;)
Yup. Functions using inline assembly are never inlined, so that's rarely
a good reason to use it.
--
Simen
Jesse Phillips jessekphillip...@gmail.com wrote:
simendsjo Wrote:
On 04.03.2011 23:10, Jesse Phillips wrote:
Remember that const/immutable, and other attributes/properties aren't
going to change the ABI so dropping them will be safer then leaving
them.
Thanks. Does this apply to all
Magnus Lie Hetland mag...@hetland.org wrote:
On 2011-03-04 17:06:29 +0100, Mafi said:
If you try to use it in the manner of `something in
classWhichDefinesThisOpBinary` then it doesn't work because operator
overloading normally overloads on the left operand (ie something). Use
Magnus Lie Hetland mag...@hetland.org wrote:
From what I understand, when you override iteration, you can either
implement the basic range primitives, permitting foreach to
destructively iterate over your object, or you can implement a custom
method that's called, and that must perform the
bearophile bearophileh...@lycos.com wrote:
Jacob Carlborg:
Maybe you can try something like typeof(t2) in the foreach.
If you mean code like this:
import std.typetuple;
int foo(T)(T x) {
return x;
}
void main() {
alias TypeTuple!(foo, foo) t2;
foreach (i, t; typeof(t2)) {
Simen kjaeraas simen.kja...@gmail.com wrote:
Magnus Lie Hetland mag...@hetland.org wrote:
From what I understand, when you override iteration, you can either
implement the basic range primitives, permitting foreach to
destructively iterate over your object, or you can implement a custom
bearophile bearophileh...@lycos.com wrote:
Simen kjaeraas:
It's probably correct that _adDupT is not nothrow. It is also wrong
that it shouldn't be.
I was about to write a bug report regarding allowing dupping in nothrow
functions, because this is now allowed, and I think this is the same
101 - 200 of 453 matches
Mail list logo