Complete conversion to nanoc
This commit is contained in:
parent
63eb103e85
commit
a77ddc8cdf
16 changed files with 48 additions and 4 deletions
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Case Statements
|
||||
---
|
||||
# Case Statements
|
||||
|
||||
Nimrod also supports case statements, which are like switches in other languages. There are several things to note here:
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
---
|
||||
title: Enums
|
||||
---
|
||||
# Enums
|
||||
|
|
@ -1 +1,4 @@
|
|||
---
|
||||
title: Exceptions
|
||||
---
|
||||
# Exceptions
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: If, Else, While, Block
|
||||
---
|
||||
# For Loops & Iterators
|
||||
|
||||
Nimrod has first class iterators and syntax to use them, for loops. The `continue` and `break` keywords also work inside of for loops. There are two kinds of iterator, and two special methods that for loops work with.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Getting Started
|
||||
---
|
||||
# Getting Started
|
||||
When installing Nimrod, you have two options: downloading a copy directly from git, or downloading a prepackaged distribution from the website
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Hello World
|
||||
---
|
||||
# Hello World
|
||||
|
||||
The code for a simple hello world program is as follows:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: If, Else, While, Block
|
||||
---
|
||||
|
||||
# If, Else, While, Block
|
||||
|
||||
Nimrod many different control flow constructs, including the standard `if`s, `else`s, and `while`s.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
---
|
||||
title: Main
|
||||
---
|
||||
|
||||
# Nimrod by Example
|
||||
|
||||
Nimrod is a powerful statically typed language that allows the programmer expressiveness without compromising run-time performance.
|
||||
|
||||
``` nimrod
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Numbers
|
||||
---
|
||||
# Numbers
|
||||
|
||||
Nimrod has several primitive types:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Objects
|
||||
---
|
||||
# Objects
|
||||
|
||||
In Nimrod, objects are like structs from C family languages and define a grouping of fields.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
title: OOP Macro
|
||||
---
|
||||
<!--- Thanks to fowl for creating this page -->
|
||||
|
||||
# OOP Macro
|
||||
This is the code that we currently must write to use OOP in nimrod:
|
||||
```nimrod
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
## Summary
|
||||
## Pages
|
||||
|
||||
* [Getting Started](/getting_started/)
|
||||
* [Hello World](/hello_world/)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Varargs
|
||||
---
|
||||
# Varargs
|
||||
|
||||
Standard varargs simply allows you to pass multiple parameters to your function.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Variables
|
||||
---
|
||||
# Variables
|
||||
|
||||
Nimrod supports three different types of variables, `let`, `var`, and `const`. As with most things, multiple variables can be declared in the same section.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Result
|
||||
---
|
||||
# Result
|
||||
|
||||
The `result` variable is a special variable that serves as an implicit return variable. This is useful because in most cases, the control flow semantics of the `return` statement are unneeded. `result` is initialized with the default value for a given return type, so the following code starts as `0`, before being initialized to `number`:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue