d2

    3熱度

    1回答

    我正在嘗試安裝DMD,以便遵循本頁面提供的建議:http://dlang.org/dmd-osx.html。然而,當我有一個錯誤,當我嘗試建立一個.D文件: 這裏是我的hello.d的 import std.stdio; void main() { writeln("hello world!"); } 然後: gcc hello.o -o hello -m64 -lphobos

    1熱度

    1回答

    我嘗試在D2中一起使用Tango和Phobo,並且我從link下載了包並按照其安裝process。 但它只有Linux安裝而不是windows。 這就是我所做的。 已經安裝了Visual-D和DMD。 link 我將文件保存到C:\探戈-D2-d2port 修改我的C:\ d \ DMD2 \ WINDOWS \ BIN \ sc.ini爲隨後 [版本] 版本= 7.51 Build 020 ;兩

    4熱度

    1回答

    所以我與d編程語言今天擺弄周圍,只是找不到任何關於如何對std.algorithm.map 返回類型使用 std.array.replace任何信息 void main() { import std.stdio : writeln; writeln(test([1, 2, 3])); // desired result: [1, 3, 4] } auto test(in

    7熱度

    2回答

    我需要執行N次操作。 D做最好的方法是什麼? for(uint i=0; i<N; i++) action(); foreach(uint i; 0.. N) action(); 也許更好?理想的情況是我想要的東西像Groovy的/ Ruby的times e.g N.times { action(); } 這可能嗎?

    1熱度

    1回答

    這是我的主文件(一觸發錯誤): /********************************************************** ** ** LOGRAMM ** Interpreter ** ** (c) 2009-2014, Dr.Kameleon ** ****************************************************

    2熱度

    2回答

    好的,所以我有一個string並且想要分割它並將其部分返回到一個字符串數組中。 這是我的代碼: // import std.algorithm; string include = "one,two,three"; string[] paths = splitter(include,","); 這將引發一個錯誤:Error: cannot cast from Result to strin

    4熱度

    1回答

    示例代碼產生的問題: import std.stdio, core.thread; void main() { ThreadGroup tg = new ThreadGroup(); foreach (int i; 1 .. 5) tg.create(() => writeln(i)); tg.joinAll(); } 輸出示例: 3 5 5

    3熱度

    1回答

    應該相當簡單,但事實並非如此。 這裏是我的代碼: string cases() { string ret = ""; string[] methods; methods = [__traits(derivedMembers,mixin("Math"))]; foreach (string s; methods) ret ~= "case \"" ~ s

    1熱度

    1回答

    我使用std.net.curl,所以我必須鏈接到libcurl。 添加-L-lcurl作品。 但是,當我在導入std.net.curl的文件頂部添加pragma(lib,"curl");時,會顯示各種鏈接錯誤(缺少引用)。 這是爲什麼?我做錯了什麼? 沒有這麼大的問題,真的,但因爲我喜歡聯的pragma方式,我其實很好奇,爲什麼它的工作如sqlite3,但不適用於Curl。

    1熱度

    1回答

    爲什麼我們不能計算兩個不變範圍的笛卡爾積? 以下代碼: import std.stdio; import std.algorithm; void main() { immutable int[] B = [ 1, 2, 3 ]; immutable int[] C = [ 4, 5, 6 ]; auto BC = cartesianProduct(B, C);