Field | Value |
---|---|
DIP: | (number/id -- assigned by DIP Manager) |
Review Count: | 0 (edited by DIP Manager) |
Author: | monkyyy, [email protected] |
Implementation: | (links to implementation PR if any) |
Status: | Draft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
[ | |
"Esc", | |
"~\n`", | |
"F1", | |
"F2", | |
"F3", | |
"F4", | |
"F5", | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import core.stdc.stdio; | |
extern(C) void main(){ | |
string s="hello"; | |
printf("%s",&s[0]); | |
} | |
/* | |
dmd -c -betterC min.d | |
gcc min.o -o min | |
./min |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std; | |
struct opindexopdispatch{ | |
int i=0; | |
auto opIndex(T...)(T args){ | |
struct op{ | |
opindexopdispatch* parent; | |
T args; | |
auto opDispatch(string op:"isnull",S...)(S args2){ | |
//pragma(msg,op,T,S); | |
return (*parent).opopdispatch!(T,op)(args,args2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NOTE_A2 110 | |
#define NOTE_B2 123 | |
#define NOTE_C3 131 | |
#define NOTE_D3 147 | |
#define NOTE_E3 165 | |
#define NOTE_F3 175 | |
#define NOTE_G3 196 | |
#define speaker 2 | |
#define keys 30 | |
#define play 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define dw digitalWrite | |
#define aw analogWrite | |
#define maxspeed 1000 | |
struct motor{ | |
int pins=0; | |
bool parity=0; | |
int lastspeed=1; | |
bool abovezero=1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto ref weak(T,alias A)(){ | |
static if(is(T:typeof(A))){ | |
return A; | |
} else { | |
return T.init; | |
}} | |
auto ref weak(T,S)(auto ref S a){ | |
static if(is(T:S)){ | |
return a; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.traits; | |
template polymorphic(alias F){ | |
auto polymorphic(T...)(T args){ | |
mixin((){ | |
import std.conv:to; | |
string o; | |
foreach(i,S;(Parameters!F)[0..T.length]){ | |
o~="args["~i.to!string~"].to!"~S.stringof~","; | |
} | |
return "return F("~o~");"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float isqrt(bool veryveryslow:true)(float f){ | |
import std.math:sqrt; | |
return 1/sqrt(f); | |
} | |
//float isqrt()(float f){ | |
// long i; | |
// float x2,y; | |
// const float threehalfs=1.5; | |
// x2=f*.5; |
New std means an opptunity to make breaking changes ranges, this should be siezed and drasticly done.
rough goals:
-
degrade doubly linked lists ("bidirectional") to be less important then arrays, hash maps, strings, databases, litterally any data stucture.
-
different "paths" an ideal array is very different from a skiplist