Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard library documentation #1

Merged
merged 26 commits into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f5f9757
Standard library empty pages
BenjaminNavarro Apr 11, 2020
a278feb
std/io doc update
BenjaminNavarro Apr 11, 2020
13a3a0b
Minors fixes to std/io
BenjaminNavarro Apr 12, 2020
2731052
str module documentation
BenjaminNavarro Apr 12, 2020
2f71cce
Fixes in std/str
BenjaminNavarro Apr 12, 2020
cf60f71
Fixes in std/str
BenjaminNavarro Apr 13, 2020
5c7aa1c
std/vec doc
BenjaminNavarro Apr 13, 2020
885b202
Minor fixes
BenjaminNavarro Apr 13, 2020
46db3bf
std/lang doc
BenjaminNavarro Apr 14, 2020
adb4199
Fix std/vec member functions ordering
BenjaminNavarro Apr 14, 2020
e1d2a5a
std/map doc
BenjaminNavarro Apr 14, 2020
fd7766b
Move all imports in the header for clearer examples
BenjaminNavarro Apr 15, 2020
cf1e023
std/fs doc
BenjaminNavarro Apr 15, 2020
51954d1
Minor fixes to std/fs
BenjaminNavarro Apr 16, 2020
e298454
std.core doc outline
BenjaminNavarro Apr 21, 2020
caecfc7
Move part of std.str to std.core
BenjaminNavarro Apr 21, 2020
8a190ee
Minor fix in std/fs
BenjaminNavarro Apr 21, 2020
501f48b
std/os doc
BenjaminNavarro Apr 21, 2020
ebbae33
Add new sections
BenjaminNavarro Apr 21, 2020
7bf552b
Fixing typos
BenjaminNavarro Apr 22, 2020
0ae17fd
std/runtime doc
BenjaminNavarro Apr 22, 2020
c47681f
std/ptr doc
BenjaminNavarro Apr 22, 2020
c7cf6be
Merging std/runtime with std/sys
BenjaminNavarro Apr 22, 2020
76ee8a4
Addressing PR comments
BenjaminNavarro Apr 24, 2020
4b2bbef
std/builder doc
BenjaminNavarro Apr 25, 2020
06be0a0
Addressing PR comments
BenjaminNavarro Apr 25, 2020
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
1 change: 1 addition & 0 deletions src/07-conditionals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Conditionals
12 changes: 12 additions & 0 deletions src/12-standard-library.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Standard Library

- [IO](./std/1-std-io.md)
- [Lang](./std/2-std-lang.md)
- [Strings](./std/3-std-strings.md)
- [Vectors](./std/4-std-vectors.md)
- [Maps](./std/5-std-maps.md)
- [FS](./std/6-std-fs.md)
- [OS](./std/7-std-os.md)
- [Ptr](./std/8-std-ptr.md)
- [Sys](./std/9-std-sys.md)
- [Builder](./std/10-std-builder.md)
127 changes: 127 additions & 0 deletions src/13-core-functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Core Functions

- [Global](#global)
- [Structures](#structures)
- [All types](#all-types)
- [nil](#nil)
- [bool](#bool)
- [int](#int)
- [flt](#flt)
- [string](#string)

## Global
| Function | Description |
| :-------------: | ----------- |
| `mload` | |
| `import` | |
| `__ismainsrc__` | |

## Structures
| Function | Description |
| :------------: | ----------- |
| `set_typename` | |


## All types
| Function | Description |
| :------: | ----------- |
| `==` | |
| `!=` | |
| `copy` | |
| `str` | |

## nil
| Function | Description |
| :------: | ----------- |
| `==` | |
| `!=` | |

## bool
| Function | Description |
| :------: | ----------- |
| `<` | |
| `>` | |
| `<=` | |
| `>=` | |
| `==` | |
| `!=` | |
| `!` | |

## int
| Function | Description |
| :------: | ----------- |
| `+` | |
| `-` | |
| `*` | |
| `/` | |
| `%` | |
| `+=` | |
| `-=` | |
| `*=` | |
| `/=` | |
| `%=` | |
| `**` | |
| `++x` | |
| `x++` | |
| `--x` | |
| `x--` | |
| `u-` | |
| `<` | |
| `>` | |
| `<=` | |
| `>=` | |
| `==` | |
| `!=` | |

## flt
| Function | Description |
| :------: | ----------- |
| `+` | |
| `-` | |
| `*` | |
| `/` | |
| `+=` | |
| `-=` | |
| `*=` | |
| `/=` | |
| `++x` | |
| `x++` | |
| `--x` | |
| `x--` | |
| `u-` | |
| `round` | |
| `<` | |
| `>` | |
| `<=` | |
| `>=` | |
| `==` | |
| `!=` | |

## string
| Function | Description |
| :----------------------: | -------------------------------------------------------------- |
| `+` | |
| `*` | |
| `+=` | |
| `*=` | |
| `<` | |
| `<=` | |
| `>=` | |
| `==` | |
| `!=` | |
| `at(idx: int) -> string` | Returns the character at index `idx`, or `nil` if out of range |
| `[idx: int] -> string` | Returns the character at index `idx`, or `nil` if out of range |

Examples:
```
let io = import('std/io');
let hello = 'hello!';
io.println(hello.at(0));
io.println(hello[6]);
```

Output:
```
h
(nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umm... (nil) should have been ! and h should be as it is 😛

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

```
14 changes: 13 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,16 @@
- [Input](./05-input.md)
- [Functions](./06-functions.md)
- [Conditionals](./07-conditionals.md)
- [Loops](./08-loops.md)
- [Loops](./08-loops.md)
- [Standard Library](./12-standard-library.md)
- [IO](./std/1-std-io.md)
- [Lang](./std/2-std-lang.md)
- [Strings](./std/3-std-strings.md)
- [Vectors](./std/4-std-vectors.md)
- [Maps](./std/5-std-maps.md)
- [FS](./std/6-std-fs.md)
- [OS](./std/7-std-os.md)
- [Ptr](./std/8-std-ptr.md)
- [Sys](./std/9-std-sys.md)
- [Builder](./std/10-std-builder.md)
- [Core Functions](./13-core-functions.md)
Loading