On 05/24/2016 03:59 AM, Jack Stouffer wrote:
parse!int(splitValue.front);
[...]
std.conv.parse(Target, Source)(ref Source s) if (
isSomeChar!(ElementType!Source) && isIntegral!Target && !is(Target
== enum))
You're missing that `parse`'s parameter is `ref`. `splitValue.front` is
On Monday, 23 May 2016 at 07:03:08 UTC, chmike wrote:
On Saturday, 21 May 2016 at 17:32:47 UTC, dan wrote:
(This effect could be simulated by making my_var into a
function, but i don't want to do that.)
May I ask why you don't want to do that ?
In D you can call a function without args
Consider the following code
-
import std.range;
import std.conv;
import std.utf;
import std.algorithm;
auto test(R)(R s)
{
auto value = s.byCodeUnit;
auto splitValue = value.splitter('.');
parse!int(splitValue.front);
}
void main()
{
test("1.8");
}
-
This fails
On 05/23/2016 08:10 PM, cy wrote:
I was squinting at the std.typecons.NullableRef code and it _looks_ like
isNull is only checked at runtime (and not checked at all in release
mode!) but D has surprised me before in its ability to pre-calculate
stuff during compilation.
NullableRef is little
Hi,
Today I stumbled upon this weird error:
struct ConfigContainer
{
Config[string] configs;
}
struct Config
{
string foo;
string bar;
}
enum ConfigContainer cc = {
configs: [// error: not an associative array
On Monday, 23 May 2016 at 18:10:14 UTC, cy wrote:
I was squinting at the std.typecons.NullableRef code and it
_looks_ like isNull is only checked at runtime (and not checked
at all in release mode!) but D has surprised me before in its
ability to pre-calculate stuff during compilation.
[...]
On Monday, 23 May 2016 at 15:53:23 UTC, moechofe wrote:
On Monday, 23 May 2016 at 14:16:13 UTC, Jack Stouffer wrote:
Sounds like a data race problem. Use a lock on the file write
operation and see if that helps.
That didn't solve anything.
What I observe is: when the process is slower, more
I was squinting at the std.typecons.NullableRef code and it
_looks_ like isNull is only checked at runtime (and not checked
at all in release mode!) but D has surprised me before in its
ability to pre-calculate stuff during compilation.
I was thinking of using something like this:
On Thursday, 19 May 2016 at 17:50:44 UTC, ciechowoj wrote:
dub build --nodeps
I tried it, doesn't seem to do anything, maybe something is
broken.
Perhaps you didn't complete "dub build" without --nodeps
beforehand? You have to do that once, and it's still as
annoyingly inefficient as
On Monday, 23 May 2016 at 14:16:13 UTC, Jack Stouffer wrote:
Sounds like a data race problem. Use a lock on the file write
operation and see if that helps.
Like this?:
synchronized(mutex) copy(source,dest);
That didn't solve anything.
What I observe is: when the process is slower, more
On Monday, May 23, 2016 14:08:43 Jack Applegame via Digitalmars-d-learn wrote:
> On Monday, 23 May 2016 at 11:05:34 UTC, Jonathan M Davis wrote:
> > I don't know why you think that D violates its own rules
> > frequently though. It's not perfect, but it usually does follow
> > its own rules - and
On Monday, 23 May 2016 at 08:59:31 UTC, moechofe wrote:
void delegate(string source,string dest) handler;
if(use_symlink) handler = delegate(string s,string d){
symlink(s,d);
}; else handler = delegate(string s,string d){
copy(s,d);
};
Boy that's a confusing
On Monday, 23 May 2016 at 11:05:34 UTC, Jonathan M Davis wrote:
I don't know why you think that D violates its own rules
frequently though. It's not perfect, but it usually does follow
its own rules - and when it doesn't, we fix it (though not
always as quickly as would be ideal).
The most
On Monday, 23 May 2016 at 04:11:31 UTC, Era Scarecrow wrote:
Is there a good article written for this? Preferably for D
specifically...
[...]
you might want to use __gshared data to avoid it being optimized
away.
Is it better to collect all the tests and output the results
all at once?
On Monday, 23 May 2016 at 03:03:12 UTC, Jon Degenhardt wrote:
On Sunday, 22 May 2016 at 23:01:07 UTC, Ali Çehreli wrote:
On 05/22/2016 11:59 AM, Jon Degenhardt wrote:
[...]
Currently not possible. Enhancement request perhaps?
Looking at the implementation, setting its 'offset' member
seems
On Sunday, 22 May 2016 at 12:03:16 UTC, Guillaume Piolat wrote:
On Sunday, 22 May 2016 at 09:47:54 UTC, Era Scarecrow wrote:
On Sunday, 22 May 2016 at 09:39:45 UTC, Saurabh Das wrote:
On Sunday, 22 May 2016 at 09:07:32 UTC, Guillaume Piolat
wrote:
On Monday, May 23, 2016 08:19:52 Jack Applegame via Digitalmars-d-learn wrote:
> On Sunday, 22 May 2016 at 13:08:19 UTC, Jonathan M Davis wrote:
> > Given how const and immutable work in D, having any portion of
> > them be treated as mutable, becomes highly problematic. It
> > could theoretically
On Monday, 23 May 2016 at 10:45:49 UTC, ParticlePeter wrote:
Is there a way to get the alias uint32_t instead ?
Nope. For the compiler uint32_t and uint are the same thing, this
is by design. Typedef can be used to create a separate type with
the same semantics as the type it's based upon:
alias uint32_t = uint;
struct Offset() {
uint32_t x;
uint32_t y;
}
// Introspect with:
void printStructInfo( T )( T info ) {
import std.stdio : writefln;
foreach (memb; __traits(allMembers, T)) {
writefln(typeof(__traits(getMember, info, memb)).stringof);
}
}
// Result is uint
Hi, I write a script that take a list of files from STDIN,
compute some stuff, and copy files with a new names.
I got 33k lines at input but got only 3k-5k in the destination
folder.
This is not append if I remove the .parallel() function.
What did I do wrong?
void delegate(string
On Sunday, 22 May 2016 at 13:08:19 UTC, Jonathan M Davis wrote:
Given how const and immutable work in D, having any portion of
them be treated as mutable, becomes highly problematic. It
could theoretically be done by having to mark such variables
with an attribute and mark such types with a
On Saturday, 21 May 2016 at 17:32:47 UTC, dan wrote:
(This effect could be simulated by making my_var into a
function, but i don't want to do that.)
May I ask why you don't want to do that ?
In D you can call a function without args without ().
So if you write
private int my_var_ = 4; //
On Sunday, 22 May 2016 at 04:33:44 UTC, Chris Katko wrote:
Basically, I want compile-time enforcement of semantic rules.
So the question is: Is there a way to get LDC2 to generate AST
or similar, and if not, any other way to go about this?
I think one popular approach to the task is to use
23 matches
Mail list logo