On Sunday, March 08, 2015 14:04:52 Timothee Cour via Digitalmars-d-learn wrote:
> On Sun, Mar 8, 2015 at 4:36 AM, Jonathan M Davis via Digitalmars-d-learn <
> > I would point out though that until recently, the GC never ran the
> > destructors for structs on the heap, because it didn't have the typ
On 3/8/2015 3:55 PM, David Held wrote:
Since DDT (Eclipse plugin) uses Dub, I am trying to convert the DWT
build instructions into Dub. Here is my current attempt:
{
"name" : "foo",
"description" : "foo",
"importPaths" : [ "d:/workspace/dwt/imp" ],
"stringImportPaths" : [
"D
Since DDT (Eclipse plugin) uses Dub, I am trying to convert the DWT
build instructions into Dub. Here is my current attempt:
{
"name" : "foo",
"description" : "foo",
"importPaths" : [ "d:/workspace/dwt/imp" ],
"stringImportPaths" : [
"D:/workspace/dwt/org.eclipse.swt.win32.win3
On Sunday, 8 March 2015 at 21:58:20 UTC, safety0ff wrote:
On Sunday, 8 March 2015 at 21:34:25 UTC, Dennis Ritchie wrote:
This is normal behavior?
Yes it is normal, there are two potential points of confusion:
- remove mutates the input range and returns a shortened slice
to the range which e
On Sunday, 8 March 2015 at 21:34:25 UTC, Dennis Ritchie wrote:
This is normal behavior?
import std.stdio;
import std.algorithm;
void main() {
auto a = [3, 5, 8];
writeln(find(remove(a, 1), 5).length != 0); // prints false
writeln(a); // prints [3, 8, 8]
On Sunday, 8 March 2015 at 21:34:25 UTC, Dennis Ritchie wrote:
This is normal behavior?
Yes it is normal, there are two potential points of confusion:
- remove mutates the input range and returns a shortened slice to
the range which excludes the removed element.
- remove takes an index as it
On Sunday, 8 March 2015 at 21:41:44 UTC, FG wrote:
On 2015-03-08 at 20:26, Meta wrote:
On Sunday, 8 March 2015 at 18:57:38 UTC, Kagamin wrote:
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
What in the world is that code doing? I'm having a hard time
wrapping my head around this.
It's a tri
On 2015-03-08 at 20:26, Meta wrote:
On Sunday, 8 March 2015 at 18:57:38 UTC, Kagamin wrote:
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
What in the world is that code doing? I'm having a hard time wrapping my head
around this.
It's a trick to reuse string internals to store an int.
A stri
On Sunday, 8 March 2015 at 21:17:31 UTC, Meta wrote:
Urgh, I'm all messed up now. The results in the second case are
correct, but the results in the first case are wrong, as
!canBeAlias!true should be !false, not !true.
I also get the same results with __traits(compiles, { alias _ =
T[0]; }).
This is normal behavior?
import std.stdio;
import std.algorithm;
void main() {
auto a = [3, 5, 8];
writeln(find(remove(a, 1), 5).length != 0); // prints false
writeln(a); // prints [3, 8, 8] ???
}
On Sunday, 8 March 2015 at 21:18:31 UTC, Max Klyga wrote:
On 2015-03-08 21:11:42 +, Paul said:
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, "five
On Sunday, 8 March 2015 at 21:18:31 UTC, Max Klyga wrote:
OP is fighting a loosing battle in flame war on some obscure
forum. F# enthusiast trolls OP into solving stupid puzzles that
are trivial in F# (or any ML-family language) and clumsy in
C-family languages.
In language holy wars the only
On Sunday, 8 March 2015 at 21:11:12 UTC, Meta wrote:
Yeah, definitely wrong.
template canBeAlias(T...)
if (T.length == 1)
{
static if (is(typeof({alias _ = T[0];})))
{
enum canBeAlias = true;
}
else
{
enum canBeAlias = false
On 2015-03-08 21:11:42 +, Paul said:
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store strings
and numbers at the same time?
string-int[] array = [4, "five"];
As there's no mention of performance, what's wrong wi
On Sunday, 8 March 2015 at 20:36:34 UTC, anonymous wrote:
I get an error on your code: "test.d(16): Error: static assert
(canBeAlias!(true)) is false". But when commenting out the
first assert (line 15), there's no error.
Hmm, I might have made a mistake reducing my actual code.
Played arou
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, "five"];
As there's no mention of performance, what's wrong with a plain
old string array with a bit of
On Sun, Mar 8, 2015 at 4:36 AM, Jonathan M Davis via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
> On Sunday, March 08, 2015 04:13:28 Jonathan M Davis via
> Digitalmars-d-learn wrote:
> > On Saturday, March 07, 2015 17:20:49 Timothee Cour via
> Digitalmars-d-learn wrote:
> > >
On Sunday, 8 March 2015 at 15:41:23 UTC, Meta wrote:
template canBeAlias(T...)
if (T.length == 1)
{
static if (is(typeof({alias _ = T[0];})))
{
enum canBeAlias = true;
}
else
{
enum canBeAlias = false;
}
}
pragma(msg
On Sun, Mar 08, 2015 at 09:29:28PM +0100, Robert M. Münch via
Digitalmars-d-learn wrote:
> Hi, I just want to be sure that I'm not missing something, as I'm a
> bit confused:
>
> 1. The docs at http://dlang.org/phobos/ are not complete, right? Even
> not complete in that all runtime / phobos modu
Hi, I just want to be sure that I'm not missing something, as I'm a bit
confused:
1. The docs at http://dlang.org/phobos/ are not complete, right? Even
not complete in that all runtime / phobos modules are listed with a
comment "no docs yet". I'm missing stuff like:
import std.c.wind
On Sunday, 8 March 2015 at 18:57:38 UTC, Kagamin wrote:
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
What in the world is that code doing? I'm having a hard time
wrapping my head around this.
On Sunday, 8 March 2015 at 18:54:43 UTC, Meta wrote:
On Sunday, 8 March 2015 at 18:38:02 UTC, Dennis Ritchie wrote:
On Sunday, 8 March 2015 at 18:18:15 UTC, Baz wrote:
import std.stdio;
import std.typecons;
alias T = Tuple!(string, int);
void main(string[] args)
{
T[] tarr;
tarr ~= T("a",
On Sunday, 8 March 2015 at 18:54:43 UTC, Meta wrote:
On Sunday, 8 March 2015 at 18:38:02 UTC, Dennis Ritchie wrote:
On Sunday, 8 March 2015 at 18:18:15 UTC, Baz wrote:
import std.stdio;
import std.typecons;
alias T = Tuple!(string, int);
void main(string[] args)
{
T[] tarr;
tarr ~= T("a",
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
On Sunday, 8 March 2015 at 18:38:02 UTC, Dennis Ritchie wrote:
On Sunday, 8 March 2015 at 18:18:15 UTC, Baz wrote:
import std.stdio;
import std.typecons;
alias T = Tuple!(string, int);
void main(string[] args)
{
T[] tarr;
tarr ~= T("a",65);
tarr ~= T("b",66);
writeln(tarr);
}
On Sunday, 8 March 2015 at 18:38:02 UTC, Dennis Ritchie wrote:
Thanks, will do.
No, will not work.
On Sunday, 8 March 2015 at 18:25:33 UTC, Baz wrote:
mmmh maybe off-topic, you probably don't what pairs but either
a string representing an int or an int, do you ?
If so then an array of uni
On Sunday, 8 March 2015 at 18:18:15 UTC, Baz wrote:
import std.stdio;
import std.typecons;
alias T = Tuple!(string, int);
void main(string[] args)
{
T[] tarr;
tarr ~= T("a",65);
tarr ~= T("b",66);
writeln(tarr);
}
[Tuple!(string, int)("a", 65), Tuple!(string, int)("b", 66
On Sunday, 8 March 2015 at 18:18:15 UTC, Baz wrote:
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, "five"];
using an array of tuple it works:
imp
The following crashes on Windows 7 sp1 64-bit edition when build
at 64 bits with dmd and the Microsoft linker that comes with
Windows SDK 7.1 (i.e. MSVC 2010 linker). I've had no trouble with
other D code when using that arrangement, though I have not used
threads. When built at 32 bits with
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, "five"];
using an array of tuple it works:
import std.stdio;
import std.typecons;
alias T = Tuple!
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, "five"];
On Saturday, 7 March 2015 at 22:01:26 UTC, Bennet wrote:
Update: I've gotten the vertices, normals an uvs to load into
arrays properly, now I just can't get the indices loaded. I'm
loading them in the manner you suggested but they only load up
to index 22 when there are 33 vertices. I imagine t
template canBeAlias(T...)
if (T.length == 1)
{
static if (is(typeof({alias _ = T[0];})))
{
enum canBeAlias = true;
}
else
{
enum canBeAlias = false;
}
}
pragma(msg, canBeAlias!canBeAlias); //prints "true"
static asser
On Sunday, 8 March 2015 at 03:09:00 UTC, zhmt wrote:
Yes, this a good idea, if the author of vibe.d do this, will be
better, it is used frequently in many scenes.
You can do it too, unlike in C++, in D you can write extension
methods to any type, as long as they are visible, you can call
them
On Sunday, March 08, 2015 04:13:28 Jonathan M Davis via Digitalmars-d-learn
wrote:
> On Saturday, March 07, 2015 17:20:49 Timothee Cour via Digitalmars-d-learn
> wrote:
> > To clarify, I'm only asking about a struct allocated via new.
> > Unique!T is wrapped around a struct, but it allocates a st
On Saturday, March 07, 2015 17:20:49 Timothee Cour via Digitalmars-d-learn
wrote:
> To clarify, I'm only asking about a struct allocated via new.
> Unique!T is wrapped around a struct, but it allocates a struct T via 'new',
> so my question still holds: does 'delete t' (where t is a struct allocat
On Sunday, 8 March 2015 at 01:20:57 UTC, Timothee Cour wrote:
To clarify, I'm only asking about a struct allocated via new.
Unique!T is wrapped around a struct, but it allocates a struct
T via 'new',
so my question still holds: does 'delete t' (where t is a
struct allocated
via new) guarantee
37 matches
Mail list logo