随笔分类 - Dlang
摘要:1 import std.stdio, std.string; 2 3 void main() 4 { 5 bool find(T)(T[] all, T sub) 6 { 7 foreach(each; all) 8 { 9 if(each == sub) return true; 10 } 11
阅读全文
摘要:没找到打开gz压缩文件的标准库,暂时调用系统命令打开gz压缩文件(参考:https://dlang.org/phobos/std_process.html#.Redirect.stdoutToStderr)。 缺点是文件全部会读入内存处理,对于大文件不太友好。 1 import std.stdio;
阅读全文
摘要:ref 作用 1 import std.stdio, std.string; 2 3 void main() 4 { 5 string[] color=["red","blue","cyan","grey"]; 6 7 writeln("raw:",color); 8 write("m1:"); 9
阅读全文
摘要:各个情况下数据类型异同 1 import std.stdio; 2 import std.string; 3 4 void main(){ 5 6 auto a="auto_a"; //immutable(char)[] 7 auto b="auto_b.dup".dup; // char[] 8
阅读全文
摘要:刷论坛看到TIOBE排行榜,排名靠前的基本是C、C++、java、python之类的语言,常用的R语言近几年排名一路走高,前20基本变化不大。 后面发现第二十九位居然有个叫做D的语言,看了下和C语法很类似,也是系统级语言,写起来比C舒服,C用起来实在是太糟心了😔;有垃圾回 收机制,不用自己管理内存
阅读全文