I hereby claim:
- I am petarkirov on github.
- I am zombinedev (https://keybase.io/zombinedev) on keybase.
- I have a public key ASCA0YsistQoFVDfAnz7lwofsPa-p9KsgmJLPiejgiHt0wo
To claim this, I am signing this object:
#!/usr/bin/env bash | |
# The script clones and builds the main D repositories (comiler, runtime, | |
# standard library and auxiliary tools). | |
# In case one (or more) repository exists, the script will stash all uncommited | |
# changes (if any), checkout the desired branch, fetch from upstream and clean | |
# build the latest version. | |
# Fail on any error | |
set -euo pipefail |
I hereby claim:
To claim this, I am signing this object:
import std; | |
void main() | |
{ | |
alias NV = tuple; | |
auto arr = [NV("Steve", 1), NV("George", 500), NV("Adam", -5)]; | |
writefln("%(%(%s: %s%), %)", arr); | |
} |
import std.stdio; | |
int add0(int a, int b) { return a + b; } | |
int add1(int a, int b = 1) { return a + b; } | |
int add2(int a = 2, int b = 1) { return a + b; } | |
void main() | |
{ | |
wrapper!add0(10, 20).writeln; | |
wrapper!add1(10, 20).writeln; |
void main(string[] args) | |
{ | |
import std.process : userShell; | |
import std.stdio : writeln; | |
auto res = getProcessPath(args.length == 2? args[1] : userShell()); | |
res.writeln; | |
} | |
/++ | |
Gets the path to a command by running it and then using OS APIs to query |
void main() | |
{ | |
struct S | |
{ | |
int a = 11; | |
string b = "22"; | |
bool c = true; | |
double d = 4.4; | |
char e = '5'; | |
int f = 66; |
void main() | |
{ | |
import std.stdio, std.meta : AliasSeq; | |
static foreach (T; AliasSeq!(S1, S2, S3, S4, S5, S6, T1, T2, T3, T4, T5, T6, C1, C2, C3, C4, C5, C6)) | |
{{ | |
auto tid = newTypeid!T; | |
pragma (msg, T, " -> ", typeof(tid.xtoHash)); | |
scope T x = make!T; | |
"newTypeid!%s(x).xtoHash() -> ".writef(T.stringof); | |
tid.xtoHash(x).writeln; |
#include <cstdio> | |
struct M | |
{ | |
int x; | |
M() { /* printf("M ctor %p\n", this); */ } | |
M(const M&) { printf("M cctor %p\n", this); } | |
M& operator=(const M&) { printf("M assgn %p\n", this); return *this; } | |
~M() { printf("M dtor %p\n", this); } | |
}; |
enum isVar(T...) = | |
__traits(compiles, { void foo(typeof(T[0]) arg) { } }) && | |
__traits(compiles, &T[0]); | |
int m = 42; | |
int mt(T) = 42; | |
const int c = 42; | |
const int ct(T) = 42; | |
immutable int i = 42; | |
immutable int it(T) = 42; |
module | bare import time |
---|---|
std.regex | 1.04s |
std.net.curl | 0.29s |
std.zip | 0.19s |
std.path | 0.15s |
std.socket | 0.15s |
std.file | 0.14s |
std.mmfile | 0.14s |
std.datetime | 0.14s |