-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
connorwalsh
committed
Mar 11, 2018
1 parent
458d041
commit 46f5409
Showing
1 changed file
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,29 @@ | ||
slashslash functions.doc is a basic outline of how to define and call functions in dockerlang | ||
|
||
(❦ ) | ||
slashslash define a function called myGreatFunction which takes no parameters and prints something | ||
(❦ myGreatFunction () ( | ||
(#! "we are in a gr8 function") | ||
)) | ||
|
||
(myGreatFunction) slashslash executes myGreatFunction with no arguments | ||
slashslash output: "we are in a gr8 function" | ||
|
||
slashslash note that the floural heart, ❦, is the keyword for defining functions | ||
|
||
slashslash define a function called anotherGreatFunctionByMe which takes one parameter | ||
(❦ anotherGreatFunctionByMe (aCoolParameter) ( | ||
(#! (#"the cool argument is %d" aCoolParameter)) | ||
)) | ||
|
||
(anotherGreatFunctionByMe 999) | ||
slashslash output: "the cool parameter is 999" | ||
|
||
slashslash define a function which declares an internal variable and prints the sum | ||
(❦ possiblyTheBestFunctionIEverWrote (myInt1 myInt2) ( | ||
(variable anotherInt 9) | ||
(#! (#"the cool result is %d' (myInt1 + myInt2 + anotherInt))) | ||
)) | ||
|
||
(possiblyTheBestFunctionIEverWrote 2 3) | ||
slashslash output: "the cool result is 14" | ||
|