Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ let x = [ 0, :a, 2]
let y = [ :3 ]
```

Accessing data in lists can be accomplished in a few ways. You can itterate over a list:
Accessing data in lists can be accomplished in a few ways. You can iterate over a list:
```
let x = [ 1, 2, 3 ];

Expand Down Expand Up @@ -231,7 +231,7 @@ x += [[ 4, 5, 6 ]];

### Files and Binary

File io is a core feature of Sack, and as such it has it's own syntax.
File IO is a core feature of Sack, and as such it has it's own syntax.

Files are opened using the `open` keyword, and closed using the `close` keyword. There are multiple modes for opening files, and they are as follows:
```
Expand Down Expand Up @@ -473,7 +473,7 @@ The following are valid logical operators in sack:
# Not (inverts a boolean value)
!
```
By extension `<=` and `>=` are also valid since they are a combination of the geater than and less than operators with the equal operator.
By extension `<=` and `>=` are also valid since they are a combination of the greater than and less than operators with the equal operator.
Operators which check for a condition return a boolean value `true` or `false`.

### Comments
Expand Down Expand Up @@ -571,15 +571,15 @@ if ( b in a ) {

Invalid types will result in an error:
```
let a = "fourty-seven";
let a = "forty-seven";
let b = 47;

# This will result in an error
print ( b in a );
```

### Loops
A loop will itterate between a range of numbers starting at the first number and ending at the last for example `range( 1, 5 )` is equal to `[1, 2, 3, 4, 5]`
A loop will iterate between a range of numbers starting at the first number and ending at the last for example `range( 1, 5 )` is equal to `[1, 2, 3, 4, 5]`

The following is an example of valid loop in range syntax:
```
Expand All @@ -599,7 +599,7 @@ loop ( while a < 100 ) {
}
```

The keywords `break` and `continue` will exit the loop, or continue to the next itteration respectively.
The keywords `break` and `continue` will exit the loop, or continue to the next iteration respectively.

```
# Looping from 1 to 10, but breaking out at 5
Expand Down Expand Up @@ -712,7 +712,7 @@ helloworld();
```

You can import modules that are in the current directory without specifying the path to the file, else you will need to specify the path.
By default sack first tries to import modlues ending with ".sk", if that fails it will look for files ending with ".sack", if that also fails it will cause an error on runtime.
By default sack first tries to import modules ending with ".sk", if that fails it will look for files ending with ".sack", if that also fails it will cause an error on runtime.

### Scope
The following rules govern scope in sack.
Expand Down