On Sat, 26 Apr 2014 06:55:38 +
Domain via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
module test;
public interface I
{
void foo();
void foo(int);
}
public abstract class A : I
{
public void bar()
{
foo();
}
public
On Wed, 30 Apr 2014 07:27:23 +
brad clawsie via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
hi, I'm back again with another openssl related question.
given this program
--
import std.stdio;
import deimos.openssl.hmac;
import
On Thu, 01 May 2014 11:12:41 +
anonymous via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Thursday, 1 May 2014 at 10:42:36 UTC, Unwise wrote:
In the following example from the documentation, are strings
concatenated at compile time?
template foo(string s) {
On Sat, 03 May 2014 14:47:56 -0700
David Held via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
import std.algorithm;
int toInt(char c) { return 1; }
void main()
{
map!(a = toInt(a))(hello);
}
Can someone please explain why I get this:
Bug.d(10): Error:
On Fri, 02 May 2014 08:17:06 +
Mark Isaacson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I'm in the process of learning/practicing D and I noticed
something that seems peculiar coming from a C++ background:
If I compile and run:
void fun(const ref int x) {
On Sun, 04 May 2014 19:08:27 +
Mark Isaacson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Thanks for the insights! I suppose we'll get a chance to see
where things stand at this year's dconf.
It's quite interesting that D's concept of r-values seems less
developed
On Mon, 05 May 2014 22:16:58 -0400
Nick Sabalausky via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 5/5/2014 10:11 PM, Nick Sabalausky wrote:
Is this kinds stuff a sane thing to do, or does it just work by
accident?:
void modify(ubyte[] dynamicArr)
{
On Wed, 07 May 2014 13:39:55 +
Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Maybe D programmers need to adopt a new convention for
annotations in the long term. Instead of:
void doSomething(int n) pure @safe @nogc nothrow
{
}
We should write:
pure @safe @nogc
On Wed, 07 May 2014 18:51:58 +
Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wednesday, 7 May 2014 at 14:40:37 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
My eyes... Oh, how that hurts readibily.
While I agree that
pure @safe @nogc nothrow
void
On Thu, 08 May 2014 07:29:08 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Jonathan M Davis:
ultimately, this sort of
thing pretty much always ends up being highly subjective.
But please put the const/immutable of methods on the right:
struct Foo {
On Thu, 08 May 2014 09:15:13 +
amehat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Hello everyone,
in java, you can have exceptions on methods.
Thus we can write:
public static void control (String string) throws
MyException {}
Is that possible in D and if so how
On Thu, 08 May 2014 09:30:38 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Jonathan M Davis:
Unfortunately, making this consistent by doing something like
enforcing that
all function attributes go on the right would then be
inconsistent with other
On Thu, 08 May 2014 10:27:17 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Jonathan M Davis:
I still think that allowing const on the left is simply a
bad design decision.
I opened a request on this, and it was closed down :-)
I know. Walter doesn't
On Thu, 8 May 2014 07:32:52 -0700
H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Thu, May 08, 2014 at 01:59:58AM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
On Thu, 08 May 2014 07:29:08 +
bearophile via Digitalmars-d-learn
digitalmars-d-learn
On Sun, 11 May 2014 17:00:13 +
Remind me again why we can't just change this to a sensible
initial state? Or at least add a .initialize()?
All reference types have a null init value. Arrays and classes have the exact
same issue as AAs. Anything else would require not only allocating memory
On Mon, 12 May 2014 08:37:42 +
JR via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Given that...
1. importing a module makes it compile the entirety of it, as
well as whatever it may be importing in turn
2. templates are only compiled if instantiated
3. the new package.d
On Mon, 12 May 2014 14:49:52 +
hane via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
and is there any way to sort char array with algorithm.sort?
---
import std.algorithm;
import std.range;
void main()
{
int[] arr = [5, 3, 7];
sort(arr); // OK
char[] arr2 =
On Mon, 12 May 2014 11:08:47 -0700
Charles Hixson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 05/12/2014 09:29 AM, Jonathan M Davis via Digitalmars-d-learn
wrote:
On Mon, 12 May 2014 14:49:52 +
hane via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
On Mon, 12 May 2014 20:12:41 +
Kai via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Hi I am trying to iterate over a mmfile (ubyte[]) and convert it
to uint
void main(){
MmFile inn = new MmFile(mmData.dat);
ubyte[] arr = cast(ubyte[])inn[];
for(ulong index = 0;
On Wed, 14 May 2014 08:27:45 +
monarch_dodra via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Monday, 12 May 2014 at 18:44:22 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
Sure, you can cast char[] to ubyte[] and sort that if you know
that the array
only
On Wed, 14 May 2014 20:54:19 +
monarch_dodra via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I'm usually reluctant to add extra code when the generic case
works, but I feel we should make an exception for find.
We should avoid it where it doesn't gain us much, but the
On Wed, 14 May 2014 21:20:05 +
Kapps via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
That pull shows that the previous behaviour was to use enforce?
Isn't this very expensive, particularly considering that enforce
uses lazy non-scope arguments?
Yeah, much as Andrei would
On Thu, 15 May 2014 01:29:23 +
Kapps via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wednesday, 14 May 2014 at 23:50:34 UTC, Meta wrote:
On the topic of lazy, why *is* it so slow, exactly? I thought
it was just shorthand for taking a function that evaluates the
On Thu, 15 May 2014 05:53:45 +
monarch_dodra via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
As a workaround, I'm sure we could specialize enforce without
lazy for built-in types?
No. I don't think that that would work. The problem is that you'd have to be
able to overload
On Thu, 15 May 2014 08:04:59 -0300
Ary Borenszweig via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Isn't there a way in D to just expand:
enforce(cond, failure);
(or something with a similar syntax) to this, at compile-time:
if(!cond) throw new Exception(failure);
I
On Fri, 16 May 2014 11:51:31 -0400
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Fri, 16 May 2014 11:36:44 -0400, Jonathan M Davis via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Thu, 15 May 2014 08:04:59 -0300
Ary Borenszweig
On Thu, 29 May 2014 20:12:52 +
Remo via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Thursday, 29 May 2014 at 18:25:19 UTC, Jeremy DeHaan wrote:
I know that we can use MSVC to build a 64 bit program, but is
it also possible to use it to build a 32 bit program as well?
On Sat, 31 May 2014 06:38:46 +
Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
They may use different debugging formats, but just linking should
be possible, especially with import libraries.
_Dynamic_ linking is possible. Static linking is not.
- Jonathan M Davis
On Sat, 31 May 2014 07:53:40 +
Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
By dynamic linking do you mean LoadLibrary or linking with import
library?
Both will work, otherwise we couldn't use Microsoft's libraries - e.g.
std.windows.registry uses advapi32.dll
On Sat, 31 May 2014 18:26:53 +0200
Joseph Rushton Wakeling via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Hello all,
Is there a straightforward way to indicate that two modules should
not be used together in the same program? Preferably one that does
not require editing
On Sat, 31 May 2014 16:18:33 +
DLearner via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Hi,
import std.stdio;
void main() {
writefln(Entered);
sub1();
sub1();
sub1();
writefln(Returning);
void sub1() {
static int i2 = 6;
On Fri, 30 May 2014 20:13:19 +
Mark Isaacson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I'm having fun running some unittests. I set up a simple homemade
mock of std.net.curl's functions that essentially just consists
of a global queue that I can add strings to and
On Sun, 01 Jun 2014 14:42:34 +
Famous via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Sunday, 1 June 2014 at 12:45:26 UTC, bearophile wrote:
It's a bad question.
Actually, Martin's question is a good one.
Initializing a variable of type float via a literal or as
On Tue, 03 Jun 2014 10:14:21 +
Nordlöw via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
The title
More ref return fixes in std.datetime now that the compiler
allows them
of
https://github.com/D-Programming-Language/phobos/pull/2227/files
made me curious to what is
On Tue, 03 Jun 2014 17:07:02 +0200
Robert Schadek via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Is there a function in phobos that lets me do something like
DateTime.format(MM:DD: ) with a DateTime instance?
Not currently. It's on my todo list. I intend to get back
On Tue, 03 Jun 2014 19:39:14 +0200
Robert Schadek via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 06/03/2014 07:12 PM, Jonathan M Davis via Digitalmars-d-learn
wrote:
On Tue, 03 Jun 2014 17:07:02 +0200
Robert Schadek via Digitalmars-d-learn
digitalmars-d-learn
On Tue, 03 Jun 2014 22:54:11 +
Brad Anderson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Tuesday, 3 June 2014 at 18:22:59 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
Well, I would prefer to do it myself, but I obviously can't say
that I
wouldn't accept
On Wed, 04 Jun 2014 05:35:18 +
Steve D via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Is it possible to override std tuple's toString format?
so that
auto a = tuple(hello,1,2,3);
writeln(a);
prints
(hello, 1, 2, 3)
and not
On Wed, 04 Jun 2014 06:25:53 +
Steve D via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
You would think the promise of OO and Inheritance
would make it easy and free us from hacks like this ;)
That would require using OO and inheritance, which has nothing to do with
Tuple.
On Fri, 06 Jun 2014 10:10:24 +
Mikko Aarnos via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Hello all, I have a program which works perfectly when compiled
without -release:
parser a implies b equivalent not b implies not a
Input: ((a implies b) equivalent ((not b)
On Sat, 07 Jun 2014 08:56:37 +
Nordlöw via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
My recent
https://github.com/D-Programming-Language/dmd/pull/3606
fails in all the Auto-Testers but I don't understand why.
Running make unittest locally in phobos using my locally
On Sat, 07 Jun 2014 20:56:13 +
Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Dynamic array is really reference. Right? But why modification of
parameter in this case does not work:
void some_func(string[] s) {
s ~= xxx; s ~= yyy;
}
but this works:
void
On Sat, 07 Jun 2014 20:53:02 +
Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
I can not understand, why this code works:
char s[2] = ['0', 'A'];
string ss = to!string(s);
writeln(parse!uint(ss, 16));
but this can deduces template:
char s[2]
On Wed, 11 Jun 2014 02:30:00 +
WhatMeWorry via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
In Mr. Cehreli's book it says
Additionally, the length of dynamic arrays can be changed by
assigning a value to this property:
int[] array; // initially empty
array.length = 5;
Sent: Wednesday, June 11, 2014 at 8:07 PM
From: matovitch via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
To: digitalmars-d-learn@puremagic.com
Subject: Multiple alias this failed workaround...obscure error message
I was looking for a workaround to multiple alias this (or
On Wed, 11 Jun 2014 23:01:31 +
matovitch via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
About alias working with identifier but not with (runtime)
expression. Alias should work with compile time expression like
map!(x=2*x) right ? So a static cast should work isn't it ?
On Sat, 14 Jun 2014 01:24:03 +
Mike Franklin via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
In other words, is 'shared __gshared' redundant?
Redundant? Not exactly.
__gshared makes it so that the variable is treated like a C variable - it's
not in TLS - but its _type_ is
On Sat, 14 Jun 2014 11:59:52 +
Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
One stupid question: in Python subclassing of Exception looks
like:
class MyError(Exception): pass
but in D, if I'm right, we should write more code:
class MyError : Exception {
Sent: Wednesday, June 18, 2014 at 11:02 PM
From: Brad Anderson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
To: digitalmars-d-learn@puremagic.com
Subject: Re: '!' and naming conventions
There is a style guide on the website:
http://dlang.org/dstyle.html
Personally I just
On Fri, 20 Jun 2014 20:40:49 +
Juanjo Alvarez via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Hi,
Newbie question:
void foo(S)(S oneparam){}
void foo(S)(S oneparam, int anotherParam){}
alias fooStr = foo!string;
Gives:
Error: template test.foo matches more than one
Sent: Tuesday, June 24, 2014 at 11:12 AM
From: Mark Isaacson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
To: digitalmars-d-learn@puremagic.com
Subject: How to free memory of an associative array
How can I free the memory used by an associative array?
I need to be able to
On Wednesday, June 25, 2014 09:30:48 seany via Digitalmars-d-learn wrote:
Given an assosiative array : int[string] k, is there a way
(either phobos or tango) to pop the first element of this array
and append it to another array?
I can come up with a primitive soluiton:
int[string] k;
//
On Thu, 03 Jul 2014 10:24:26 +
pgtkda via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Thursday, 3 July 2014 at 10:22:14 UTC, ponce wrote:
On Thursday, 3 July 2014 at 10:15:25 UTC, pgtkda wrote:
why is this possible?
int count = 50_000_000;
int is always 4
On Friday, July 11, 2014 04:01:24 Joel via Digitalmars-d-learn wrote:
I've been trying to set a date for my program (a small struct):
import std.datetime;
auto date = cast(DateTime)Clock.currTime();
setDate(date.day, date.month, date.year);
Problem is that day month are not integers. And
On Fri, 11 Jul 2014 07:46:37 -0700
H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Fri, Jul 11, 2014 at 10:23:58AM -0300, Ary Borenszweig via
Digitalmars-d-learn wrote:
On 7/11/14, 4:46 AM, bearophile wrote:
pgtkda:
How can i get the number of items which
On Sunday, 20 July 2014 at 09:34:46 UTC, Sean Campbell wrote:
How do i get an os thread handle from a thread object.
or are d thread not wrapped os threads.
They do wrap OS threads, but they encapsulate them in a
cross-platform manner, and looking over Thread, it doesn't look
like anything
On Sunday, 20 July 2014 at 10:03:47 UTC, Sean Campbell wrote:
On Sunday, 20 July 2014 at 09:53:52 UTC, Jonathan M Davis wrote:
On Sunday, 20 July 2014 at 09:34:46 UTC, Sean Campbell wrote:
How do i get an os thread handle from a thread object.
or are d thread not wrapped os threads.
They do
On Friday, 25 July 2014 at 21:33:23 UTC, Timothee Cour via
Digitalmars-d-learn wrote:
Is there a function for doing this?
myrange.at(i)
(with meaning of myrange.dropExactly(i).front)
it's a common enough operation (analog to myrange[i]; the
naming is from
C++'s std::vectorT::at)
That would
On Saturday, 26 July 2014 at 00:28:32 UTC, Ary Borenszweig wrote:
On 7/25/14, 6:39 PM, Jonathan M Davis wrote:
On Friday, 25 July 2014 at 21:33:23 UTC, Timothee Cour via
Digitalmars-d-learn wrote:
Is there a function for doing this?
myrange.at(i)
(with meaning of myrange.dropExactly(i).front)
On Thursday, 31 July 2014 at 20:34:42 UTC, Vlad Levenfeld wrote:
What's the rationale behind stating the condition this way as
opposed to, say,
is (typeof(R.init.save)) == R) || is ((typeof(R.init.save()) ==
R)
so that member fields as well as @property and non-@property
methods will match
On Thursday, 31 July 2014 at 22:21:10 UTC, Vlad Levenfeld wrote:
Yes, I see the problem now. I can't think of any reason why I'd
want to make save anything but a function (especially since
`save` is a verb) but I guess someone out there might have a
good one.
It's Andrei's fault. I'm not
On Friday, 1 August 2014 at 11:51:55 UTC, Marc Schütz wrote:
On Friday, 1 August 2014 at 04:52:35 UTC, Jonathan M Davis
wrote:
On Thursday, 31 July 2014 at 22:21:10 UTC, Vlad Levenfeld
wrote:
Yes, I see the problem now. I can't think of any reason why
I'd want to make save anything but a
On Friday, 1 August 2014 at 19:59:16 UTC, Jonathan M Davis wrote:
But since dup and idup aren't being implemented by lots of
different people like the range API is, changing those doesn't
risk breaking code where folks made it a variable.
Well, I probably shouldn't put it quite that way,
On Fri, 01 Aug 2014 23:09:37 +
sigod via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Code: http://dpaste.dzfl.pl/51bd62138854
(It was reduced by DustMite.)
Have I missed something about structs? Or this simply a bug?
Don't do this with a member variable:
private Node *
On Tuesday, 5 August 2014 at 17:41:06 UTC, Marc Schütz wrote:
On Tuesday, 5 August 2014 at 15:39:55 UTC, sigod wrote:
On Saturday, 2 August 2014 at 06:46:04 UTC, Jonathan M Davis
via Digitalmars-d-learn wrote:
On Fri, 01 Aug 2014 23:09:37 +
sigod via Digitalmars-d-learn
digitalmars-d
On Wednesday, 6 August 2014 at 02:12:16 UTC, Era Scarecrow wrote:
On Tuesday, 5 August 2014 at 17:41:06 UTC, Marc Schütz wrote:
It's a consequence of the fact that every type in D has a
default initializer which is known at compile time.
Then doesn't this mean it should pop out a warning in
On Wednesday, 6 August 2014 at 18:33:23 UTC, Dicebot wrote:
Most voted DMD bug :
https://issues.dlang.org/show_bug.cgi?id=314
Yeah, it's why I'd suggest that folks not use selective imports
right now. But people seem to really love the feature, so they
use it and keep running into this
On Wednesday, 6 August 2014 at 19:35:02 UTC, Dicebot wrote:
On Wednesday, 6 August 2014 at 19:31:04 UTC, Jonathan M Davis
wrote:
On Wednesday, 6 August 2014 at 18:33:23 UTC, Dicebot wrote:
Most voted DMD bug :
https://issues.dlang.org/show_bug.cgi?id=314
Yeah, it's why I'd suggest that folks
On Wednesday, 6 August 2014 at 19:01:26 UTC, Patrick wrote:
I feel dumb. I've been searching for how to do this, and each
page or forum entry I read makes me more confused.
Let's say I have a list of values (Monday, Tuesday, Wednesday,
Thursday, Friday). I can store this list in an Slist,
On Sunday, 10 August 2014 at 18:45:00 UTC, Freddy wrote:
Is there any why i can put a opApply outside of a struct scope
No overloaded operators in D can be put outside of a struct or
class. They have to be member functions.
- Jonathan M Davis
On Sunday, 10 August 2014 at 19:01:18 UTC, Era Scarecrow wrote:
On Sunday, 10 August 2014 at 18:58:50 UTC, Jonathan M Davis
wrote:
No overloaded operators in D can be put outside of a struct or
class. They have to be member functions.
If I remember right, opApply was somewhat broken and only
On Sunday, 10 August 2014 at 22:03:28 UTC, Era Scarecrow wrote:
On Sunday, 10 August 2014 at 21:57:29 UTC, Jonathan M Davis
wrote:
I'm not aware of opApply being broken, but I never use it,
I remember very specifically it was brought up, that opApply
was not working correctly and you could
On Tue, 12 Aug 2014 06:21:17 +
uri via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Hi,
I'm trying to allow implicit conversions for my own type
happening. I have the following:
import std.math;
import std.traits;
struct S(T)
if(isFloatingPoint!T)
{
T
On Tue, 12 Aug 2014 13:17:37 +
Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Tuesday, 12 August 2014 at 06:37:45 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
The problem is that isNaN is now templatized, and its
constraint uses
isFloatingPoint, which
On Tuesday, 12 August 2014 at 15:39:09 UTC, Meta wrote:
What I mean is that this breaks the Liskov Substitution
Principle, which alias this should obey, as it denotes a
subtype.
Since S!float has an alias this to float, it should behave as a
float in all circumstances where a float is
On Tuesday, 12 August 2014 at 19:03:58 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
tl;dr: there are so many ways template code can go wrong, that
I don't
it justifies blaming alias this for problems.
Allowing implicit conversions makes the problem much worse IMHO.
It makes it far too easy
On Wed, 13 Aug 2014 14:28:29 +
Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote:
Are there variants of drop* and take* that only drop element if
its equal to a value kind of like strip does?
If not I
On Wed, 13 Aug 2014 07:45:17 -0700
Jonathan M Davis via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Wed, 13 Aug 2014 14:28:29 +
Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote
On Thursday, 14 August 2014 at 17:41:08 UTC, Nordlöw wrote:
On Thursday, 14 August 2014 at 17:33:41 UTC, Justin Whear wrote:
std.algorithm.startsWith? Should auto-decode, so it'll do a
What about
https://github.com/D-Programming-Language/phobos/pull/2043
Auto-decoding should be avoided
On Thursday, 14 August 2014 at 17:16:42 UTC, Philippe Sigaud
wrote:
From time to time, I try to speed up some array-heavy code by
using std.array.Appender, reserving some capacity and so on.
It never works. Never. It gives me executables that are maybe
30-50% slower than bog-standard array
On Thursday, 14 August 2014 at 19:29:28 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
It sounds like you're trying to use it as a way to manage
reusing
the array, and I have no idea how it works for that.
There is a misunderstanding there: I'm using clear only to
flush the
state at the
On Thursday, 14 August 2014 at 19:47:33 UTC, Brad Anderson wrote:
On Thursday, 14 August 2014 at 19:10:18 UTC, Jonathan M Davis
wrote:
I've never really tried to benchmark it, but it was my
understanding that the idea behind Appender was to use it to
create the array when you do that via a lot
On Thursday, 14 August 2014 at 21:00:55 UTC, Jonathan M Davis
wrote:
On Thursday, 14 August 2014 at 19:47:33 UTC, Brad Anderson
wrote:
On Thursday, 14 August 2014 at 19:10:18 UTC, Jonathan M Davis
wrote:
I've never really tried to benchmark it, but it was my
understanding that the idea behind
On Thursday, 14 August 2014 at 21:11:51 UTC, safety0ff wrote:
IIRC it manages the capacity information manually instead of
calling the runtime which reduces appending overhead.
That would make some sense, though it must be completely avoiding
~= then and probably is even GC-mallocing the
On Thursday, 14 August 2014 at 21:34:04 UTC, Jonathan M Davis
wrote:
On Thursday, 14 August 2014 at 21:11:51 UTC, safety0ff wrote:
IIRC it manages the capacity information manually instead of
calling the runtime which reduces appending overhead.
That would make some sense, though it must be
On Thursday, 14 August 2014 at 17:16:42 UTC, Philippe Sigaud
wrote:
From time to time, I try to speed up some array-heavy code by
using std.array.Appender, reserving some capacity and so on.
It never works. Never. It gives me executables that are maybe
30-50% slower than bog-standard array
On Friday, 15 August 2014 at 16:54:54 UTC, Philippe Sigaud wrote:
So I'm trying to use @safe, pure and nothrow.
If I understand correctly Adam Ruppe's Cookbook, by putting
@safe:
pure:
nothrow:
at the beginning of a module, I distribute it on all
definitions, right? Even methods, inner
On Friday, 15 August 2014 at 16:48:10 UTC, monarch_dodra wrote:
If you are using raw GC arrays, then the raw append
operation will, outweigh the relocation cost on extension. So
pre-allocation wouldn't really help in this situation (though
the use of Appender *should*)
Is that because it's
On Sat, 16 Aug 2014 14:39:00 +0200
Artur Skawina via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 08/16/14 13:58, Philippe Sigaud via Digitalmars-d-learn wrote:
On Sat, Aug 16, 2014 at 1:30 PM, Artur Skawina via
Digitalmars-d-learn
On Saturday, 16 August 2014 at 20:48:25 UTC, monarch_dodra wrote:
On Saturday, 16 August 2014 at 19:30:16 UTC, Jonathan M Davis
via Digitalmars-d-learn wrote:
On Sat, 16 Aug 2014 14:39:00 +0200
Artur Skawina via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
@safe, @trusted
On Mon, 18 Aug 2014 01:32:40 +
Phil Lavoie via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Ok, so after years of D usage I just noticed that this is valid D
(compiles anyways):
static void myFunc() {}
What is a static function at module level exactly? In C, that
means
On Monday, 18 August 2014 at 21:02:09 UTC, Gary Willoughby wrote:
In the new D release there have been some changes regarding
built-in types.
http://dlang.org/changelog.html?2.066#array_and_aa_changes
I would like to learn why this has been done like this and why
it is desired to be free
On Tuesday, 19 August 2014 at 16:28:54 UTC, monarch_dodra wrote:
Actually, the new free functions *are* properties. All that you
just declared is valid, but we never got around to doing it.
Walter (If I remember correctly) was opposed.
So right now, even if dup is a free function,
On Tuesday, 19 August 2014 at 19:00:49 UTC, Marc Schütz wrote:
On Tuesday, 19 August 2014 at 17:56:31 UTC, Low Functioning
wrote:
shared int[] foo;
auto bar() {
foo ~= 42;
return foo.idup;
}
Error: cannot implicitly convert element type shared(int) to
immutable in foo.idup
Is
On Wed, 20 Aug 2014 01:38:52 +
uri via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Hi all,
Bit new to D so this might be a very naive question...
Can the compiler auto infer function attributes?
I am often adding as many attributes as possible and use the
compiler to
On Wednesday, 20 August 2014 at 20:12:58 UTC, Justin Whear wrote:
On Wed, 20 Aug 2014 20:01:03 +, Colin wrote:
It looks veryhacky.
I see 3 distinct parts playing a role in my confusion:
A) The 'is' keyword. What does it do when you have
is(expression);
B) typeof( expression ); whats
On Wednesday, 20 August 2014 at 21:06:49 UTC, monarch_dodra wrote:
On Wednesday, 20 August 2014 at 20:39:42 UTC, Jonathan M Davis
wrote:
is(typeof(foo)) and __traits(compiles, foo) are not the same.
The first tests for the existence of the symbol, whereas the
second checks whether the code
On Friday, 22 August 2014 at 03:00:01 UTC, Timothee Cour via
Digitalmars-d-learn wrote:
On Thu, Aug 21, 2014 at 7:26 PM, Dicebot via
Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
http://dlang.org/phobos/std_typecons.html#.RefCounted
That doesn't work with classes though; is
On Sunday, 24 August 2014 at 23:42:51 UTC, Aerolite wrote:
Hey all,
I was surprised to learn yesterday that D does not actually
support Multiple-Dispatch, also known as Multimethods. Why is
this? Support for this feature is already present in Scala, C#
4.0, Groovy, Clojure, etc... Would it not
On Mon, 25 Aug 2014 15:48:10 +
Jeremy DeHaan via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I've done things like this before with traits and I figured that
this way should work as well, but it gives me errors instead.
Perhaps someone can point out my flaws.
1 - 100 of 1807 matches
Mail list logo