-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed fun rvalue references; Updated README and stdlib documentation.
- Loading branch information
Showing
13 changed files
with
192 additions
and
43 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Allocation library | ||
|
||
Source: [include/stdlib/builtin/alloc.ml](../../include/stdlib/builtin/alloc.ml) | ||
|
||
Provides customizable memory allocation utilities. | ||
|
||
## Macros | ||
|
||
Macro | Description | ||
----------------------------|------------ | ||
`alloc_warn` | Default warning for non-gc allocation. | ||
`alloc_stop` | Stops the garbage collector. | ||
`alloc_start(_lit)` | Starts the garbage collector, `_lit` points to the stack bottom. | ||
`alloc(_lit)` | Assigns `_lit` to an allocated memory block based on its size. | ||
`alloc(_lit,_size)` | Assigns `_lit` to an allocated memory block of size `_size`. | ||
`alloc_zeroed(_lit)` | Assigns `_lit` to an zero-filled allocated memory block based on its size. | ||
`alloc_zeroed(_lit, _size)` | Assigns `_lit` to an zero-filled allocated memory block of size `_size`. | ||
`dealloc(_lit)` | Deallocates the memory block pointed by `_lit` and assigns `_lit` to null. | ||
`with(_lit,_body)` | Creates a block in which `_lit` is allocated, used by `_body`, then deallocated. | ||
|
||
## Functions | ||
|
||
Function | Description | ||
-------------|------------ | ||
`alloc_size` | Allocates a memory block of the given size, filled based the `fill` flag. | ||
|
||
## Warnings | ||
|
||
> [!WARNING] | ||
> Memory allocated by the `alloc` utilites use different allocators than the one provided by the c standard library. Thus, calling `free` on a memory address allocated by `alloc` causes undefined behaviour. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# For loop utilities | ||
|
||
Source: [include/stdlib/builtin/for.ml](../../include/stdlib/builtin/for.ml) | ||
|
||
Provides convenient for-based constructs and looping utilities. | ||
|
||
## Types | ||
|
||
Types | Description | ||
--------------|------------ | ||
`range` | Type to hold range-based looping information. | ||
`file_range` | Type to hold file-based looping information. | ||
`c_str_range` | Type to hold string-based looping information. | ||
|
||
## Functions | ||
|
||
> [!NOTE] | ||
> `iter`/`start`/`stop`/`next` methods are not discussed in this document. Check the [standard library examples](examples.md) for-based loop examples. | ||
Functions | Description | ||
------|------------ | ||
range | Creates an iterator to a sequence of numbers based on the `start` and `stop` (optional) values. | ||
lines | Creates an iterator to a sequence of lines from the given file. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Macro library | ||
|
||
Source: [include/stdlib/macro.ml](../../include/stdlib/macro.ml) | ||
|
||
Provides convenient stand-alone macros. | ||
|
||
## Macro | ||
|
||
Macro | Description | ||
----------|------------ | ||
`repeat` | Repeats the expression list a specified number of times | ||
`delimit` | Inserts a delimiter between each argument of the list | ||
`reverse` | Reverses the order of the arguments of the list | ||
`not` | Negates the given boolean argument | ||
`neg` | Negates the identifier passed as a argument | ||
`incr` | Increments the identifier passed as a argument | ||
`decr` | Decrements the identifier passed as a argument |
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
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
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
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
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
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
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