{"id":18896806,"url":"https://github.com/shakibamoshiri/d-by-example","last_synced_at":"2026-02-28T15:30:23.040Z","repository":{"id":128566825,"uuid":"90612034","full_name":"shakibamoshiri/D-By-Example","owner":"shakibamoshiri","description":"A simple collection of D code for beginners","archived":false,"fork":false,"pushed_at":"2017-05-08T10:44:50.000Z","size":189,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T08:16:18.465Z","etag":null,"topics":["d","d-feature","dlang","express"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shakibamoshiri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-08T09:45:32.000Z","updated_at":"2017-05-08T10:25:57.000Z","dependencies_parsed_at":"2023-08-22T07:45:48.389Z","dependency_job_id":null,"html_url":"https://github.com/shakibamoshiri/D-By-Example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2FD-By-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2FD-By-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2FD-By-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2FD-By-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakibamoshiri","download_url":"https://codeload.github.com/shakibamoshiri/D-By-Example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239877134,"owners_count":19712020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d","d-feature","dlang","express"],"created_at":"2024-11-08T08:35:26.424Z","updated_at":"2026-02-28T15:30:22.885Z","avatar_url":"https://github.com/shakibamoshiri.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# D by example\n### A collection of D Language examples and some features.\n\n---\n\nFor having here as offline:\n`git clone https://github.com/k-five/D-By-Example.git`\n\n---\n\n\nSince I have just learned D so these examples are not in advanced topic.\nbut if you are looking for some examples to start to learn D, it may\nhelp you and I hope so.\n\nThe [tp](https://github.com/k-five/D-By-Example/tree/master/tp) directory is the collection of examples that I read and put in code with the pdf of [tutorialspoint.com](http://www.tutorialspoint.com/d_programming/)\nnote that most of the examples were taken from that pdf but not all, and also some of them even did not compile,\nsuch as examples in thread part. ( under the license of main site ).\n\nThe [tour](https://github.com/k-five/D-By-Example/tree/master/tour) directory is the collection of examples that I read the tour page in the [main website](https://tour.dlang.org)\nSo I tried to introduce some feature of D on **tour** directory. ( under the license of main site ).\n\nNOTE that may you see some bugs on these, because I did it in two weeks for getting familiar with D and then port my program\n[renrem](https://github.com/k-five/renrem) from **C++** to **D**.\n\nThe D version of `renrem`, after getting ready will be put here so you can see a full program in D that is really useful.\n\nAnd like me, may you can not install mono-D IDE on your 32 OS, so for using an IDE you can use [geany](http://www.geany.org/) or [codeblock](http://www.codeblocks.org/).\n\nBut if you like using emacs like I am, you can install d-mode for your emacs.\nHere is the screenshot of mine:\n\n![d-mode_on_emacs](https://github.com/k-five/D-By-Example/blob/master/dlang.png)\n\n---\n\n## How to install d-mode on emacs:\n- create `.emacs` in your home directory ( Linux OS )\n- then put this code:\n\n```(require 'package)\n   (add-to-list 'package-archives\n         '(\"melpa-stable\" . \"https://stable.melpa.org/packages/\") t)\n   (package-initialize)\n   ```\n\n\n- then open emacs with `emacs -nw some.txt` ( any file )\n- then: M-x package-list-packages to get to the package listing\n- then: then package-install\n- then type: d-mode\n\nNOTE: You need the Internet to download d-mode  \nNOTE: If you see some other codes, put it before them  \n\nFor more details see  [Emacs-D-Mode](https://github.com/Emacs-D-Mode-Maintainers/Emacs-D-Mode)\n\n---\n\n## [May you like](https://tour.dlang.org/tour/en/gems/range-algorithms):\n\n```dlang\n// Hey come on, just get the whole army!\nimport std.algorithm : canFind, map,\n  filter, sort, uniq, joiner, chunkBy, splitter;\nimport std.array : array, empty;\nimport std.range : zip;\nimport std.stdio : writeln;\nimport std.string : format;\n\nvoid main()\n{\n    string text = q{This tour will give you an\noverview of this powerful and expressive systems\nprogramming language which compiles directly\nto efficient, *native* machine code.};\n\n    // splitting predicate\n    alias pred = c =\u003e canFind(\" ,.\\n\", c);\n    // as a good algorithm it just works\n    // lazily without allocating memory!\n    auto words = text.splitter!pred\n      .filter!(a =\u003e !a.empty);\n\n    auto wordCharCounts = words\n      .map!\"a.count\";\n\n    // Output the character count\n    // per word in a nice way\n    // beginning with least chars!\n    zip(wordCharCounts, words)\n      // convert to array for sorting\n      .array()\n      .sort()\n      // we don't need duplication, right?\n      .uniq()\n      // put all in one row that have the\n      // same char count. chunkBy helps\n      // us here by generating ranges\n      // of range that are chunked by the length\n      .chunkBy!(a =\u003e a[0])\n      // those elments will be joined\n      // on one line\n      .map!(chunk =\u003e format(\"%d -\u003e %s\",\n          chunk[0],\n          // just the words\n          chunk[1]\n            .map!(a =\u003e a[1])\n            .joiner(\", \")))\n      // joiner joins, but lazily!\n      // and now the lines with the line\n      // feed\n      .joiner(\"\\n\")\n      // pipe to stdout\n      .writeln();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2Fd-by-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakibamoshiri%2Fd-by-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2Fd-by-example/lists"}