Last active
August 29, 2015 14:02
-
-
Save mauro3/3fe9c7fd16177dafe90a to your computer and use it in GitHub Desktop.
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
module LoremIpsum | |
doc""" | |
LoremIpsum: dolor sit amet, consectetur adipisicing elit, sed do eiusmod | |
tempor incididunt ut labore et dolore magna aliqua. | |
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi | |
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit | |
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur | |
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt | |
mollit anim id est laborum. | |
""" | |
type Lorem | |
doc"Lorem: representation of a lorem." | |
sunt::In | |
cupla::Qui | |
end | |
const DEFAULT_Z = 100 | |
function ipsum(x, y, z=DEFAULT_Z) # the call signature should be inserted into help automatically | |
doc""" | |
function to ipsify things. | |
x: the value of x (required) | |
y: the y value (mandatory) | |
z: z value – defaults to $DEFAULT_Z | |
""" | |
# consectetur | |
end | |
# how to best associate doc with one-liners? | |
# Version 1: doc follows: | |
f(x) = x^2 | |
doc"function to square" | |
# Version 2: doc precedes, maybe with a colon? | |
doc"function to square": | |
f(x) = x^2 | |
doc"An important global": | |
const GLOBUS = 4.569 | |
end # module | |
doc""" | |
Not sure what documentation here should be associated with... | |
Probably should be an error to have a `doc"..." without association. | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment