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
|
# Case Statements
|
||||||
|
|
||||||
Nimrod also supports case statements, which are like switches in other languages. There are several things to note here:
|
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
|
# Enums
|
||||||
|
|
@ -1 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Exceptions
|
||||||
|
---
|
||||||
# Exceptions
|
# Exceptions
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
---
|
||||||
|
title: If, Else, While, Block
|
||||||
|
---
|
||||||
# For Loops & Iterators
|
# 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.
|
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
|
# Getting Started
|
||||||
When installing Nimrod, you have two options: downloading a copy directly from git, or downloading a prepackaged distribution from the website
|
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
|
# Hello World
|
||||||
|
|
||||||
The code for a simple hello world program is as follows:
|
The code for a simple hello world program is as follows:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: If, Else, While, Block
|
||||||
|
---
|
||||||
|
|
||||||
# If, Else, While, Block
|
# If, Else, While, Block
|
||||||
|
|
||||||
Nimrod many different control flow constructs, including the standard `if`s, `else`s, and `while`s.
|
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 is a powerful statically typed language that allows the programmer expressiveness without compromising run-time performance.
|
||||||
|
|
||||||
``` nimrod
|
``` nimrod
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Numbers
|
||||||
|
---
|
||||||
# Numbers
|
# Numbers
|
||||||
|
|
||||||
Nimrod has several primitive types:
|
Nimrod has several primitive types:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Objects
|
||||||
|
---
|
||||||
# Objects
|
# Objects
|
||||||
|
|
||||||
In Nimrod, objects are like structs from C family languages and define a grouping of fields.
|
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 -->
|
<!--- Thanks to fowl for creating this page -->
|
||||||
|
|
||||||
# OOP Macro
|
# OOP Macro
|
||||||
This is the code that we currently must write to use OOP in nimrod:
|
This is the code that we currently must write to use OOP in nimrod:
|
||||||
```nimrod
|
```nimrod
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
## Summary
|
## Pages
|
||||||
|
|
||||||
* [Getting Started](/getting_started/)
|
* [Getting Started](/getting_started/)
|
||||||
* [Hello World](/hello_world/)
|
* [Hello World](/hello_world/)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Varargs
|
||||||
|
---
|
||||||
# Varargs
|
# Varargs
|
||||||
|
|
||||||
Standard varargs simply allows you to pass multiple parameters to your function.
|
Standard varargs simply allows you to pass multiple parameters to your function.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Variables
|
||||||
|
---
|
||||||
# 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.
|
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
|
# 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`:
|
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`:
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,10 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>A Brand New nanoc Site - <%= @item[:title] %></title>
|
<title>Nimrod by Example - <%= @item[:title] %></title>
|
||||||
<link rel="stylesheet" href="<%= @items['/stylesheets/main/'].path %>">
|
<link rel="stylesheet" href="<%= @items['/stylesheets/main/'].path %>">
|
||||||
<link rel="stylesheet" href="<%= @items['/stylesheets/syntax/'].path %>">
|
<link rel="stylesheet" href="<%= @items['/stylesheets/syntax/'].path %>">
|
||||||
|
|
||||||
<!-- you don't need to keep this, but it's cool for stats! -->
|
|
||||||
<meta name="generator" content="nanoc <%= Nanoc::VERSION %>">
|
<meta name="generator" content="nanoc <%= Nanoc::VERSION %>">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue