-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from dictu-lang/develop
Release 0.20.0
- Loading branch information
Showing
14 changed files
with
137 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
layout: default | ||
title: Thank you! | ||
nav_order: 16 | ||
--- | ||
|
||
# Thank You! | ||
{: .no_toc } | ||
|
||
## DigitalOcean | ||
|
||
Dictu has been proudly sponsored by [DigitalOcean](https://m.do.co/c/02bd923f5cda). They are providing the project with a generous amount | ||
of credits so that testing of the Dictu VM can be carried out across a number of different platform versions along with providing the use of | ||
tooling that comes with these specific platforms. | ||
|
||
I've personally been using their services for many years prior to this sponsorship so can attest to their excellent service, so if you too wish | ||
to sign up, you can do so via [this](https://m.do.co/c/02bd923f5cda) referral link! |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#define DICTU_DICT_SOURCE "/**\n" \ | ||
" * This file contains all the methods for Dicts written in Dictu that\n" \ | ||
" * are unable to be written in C due to re-enterability issues.\n" \ | ||
" *\n" \ | ||
" * We should always strive to write methods in C where possible.\n" \ | ||
" */\n" \ | ||
"def forEach(dict, func) {\n" \ | ||
" const dictKeys = dict.keys();\n" \ | ||
"\n" \ | ||
" for (var i = 0; i < dictKeys.len(); i += 1) {\n" \ | ||
" func(dictKeys[i], dict[dictKeys[i]]);\n" \ | ||
" }\n" \ | ||
"}\n" \ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* This file contains all the methods for Dicts written in Dictu that | ||
* are unable to be written in C due to re-enterability issues. | ||
* | ||
* We should always strive to write methods in C where possible. | ||
*/ | ||
def forEach(dict, func) { | ||
const dictKeys = dict.keys(); | ||
|
||
for (var i = 0; i < dictKeys.len(); i += 1) { | ||
func(dictKeys[i], dict[dictKeys[i]]); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ def generate(filename) { | |
|
||
var files = [ | ||
'lists/list', | ||
'dicts/dict', | ||
'result/result' | ||
]; | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* forEach.du | ||
* | ||
* Testing the dict.forEach() method | ||
* | ||
* .forEach() loops over a dictionary | ||
*/ | ||
|
||
const myDict = {"key": 1, "key1": 2, "key2": 3}; | ||
var count = 0; | ||
|
||
myDict.forEach(def (key, value) => { | ||
count += 1; | ||
assert(type(key) == "string"); | ||
assert(type(value) == "number"); | ||
}); | ||
|
||
assert(count == 3); | ||
|
||
const myNewDict = {1: 1, 2: 2, 3: 3}; | ||
var sum = 0; | ||
|
||
myNewDict.forEach(def (key, value) => { | ||
sum += key + value; | ||
}); | ||
|
||
assert(sum == 12); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ import "copy.du"; | |
import "len.du"; | ||
import "toString.du"; | ||
import "toBool.du"; | ||
import "forEach.du"; |