Switch to <* *> docs. Fix issue with dynamically loaded C3 libs with other C3 code.

This commit is contained in:
Christoffer Lerno
2024-10-12 17:55:05 +02:00
committed by Christoffer Lerno
parent 9f6a4eb300
commit 31cd839063
119 changed files with 3271 additions and 3277 deletions

View File

@@ -1,12 +1,12 @@
module std::sort;
/**
* Perform a binary search over the sorted array and return the index
* in [0, array.len) where x would be inserted or cmp(i) is true and cmp(j) is true for j in [i, array.len).
* @require @is_sortable(list) "The list must be sortable"
* @require @is_valid_cmp_fn(cmp, list, context) "Expected a comparison function which compares values"
* @require @is_valid_context(cmp, context) "Expected a valid context"
**/
<*
Perform a binary search over the sorted array and return the index
in [0, array.len) where x would be inserted or cmp(i) is true and cmp(j) is true for j in [i, array.len).
@require @is_sortable(list) "The list must be sortable"
@require @is_valid_cmp_fn(cmp, list, context) "Expected a comparison function which compares values"
@require @is_valid_context(cmp, context) "Expected a valid context"
*>
macro usz binarysearch(list, x, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
{
usz i;

View File

@@ -3,11 +3,11 @@ import std::sort::is;
import std::sort::cs;
import std::sort::qs;
/**
* Sort list using the counting sort algorithm.
* @require @is_sortable(list) "The list must be indexable and support .len or .len()"
* @require @is_cmp_key_fn(key_fn, list) "Expected a transformation function which returns an unsigned integer."
**/
<*
Sort list using the counting sort algorithm.
@require @is_sortable(list) "The list must be indexable and support .len or .len()"
@require @is_cmp_key_fn(key_fn, list) "Expected a transformation function which returns an unsigned integer."
*>
macro countingsort(list, key_fn = EMPTY_MACRO_SLOT) @builtin
{
usz len = sort::@len_from_list(list);

View File

@@ -1,11 +1,11 @@
module std::sort;
import std::sort::is;
/**
* Sort list using the quick sort algorithm.
* @require @is_sortable(list) "The list must be indexable and support .len or .len()"
* @require @is_valid_cmp_fn(cmp, list, context) "Expected a comparison function which compares values"
**/
<*
Sort list using the quick sort algorithm.
@require @is_sortable(list) "The list must be indexable and support .len or .len()"
@require @is_valid_cmp_fn(cmp, list, context) "Expected a comparison function which compares values"
*>
macro insertionsort(list, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
{
usz len = sort::@len_from_list(list);

View File

@@ -1,12 +1,12 @@
module std::sort;
import std::sort::qs;
/**
* Sort list using the quick sort algorithm.
* @require @is_sortable(list) "The list must be indexable and support .len or .len()"
* @require @is_valid_cmp_fn(cmp, list, context) "Expected a comparison function which compares values"
* @require @is_valid_context(cmp, context) "Expected a valid context"
**/
<*
Sort list using the quick sort algorithm.
@require @is_sortable(list) "The list must be indexable and support .len or .len()"
@require @is_valid_cmp_fn(cmp, list, context) "Expected a comparison function which compares values"
@require @is_valid_context(cmp, context) "Expected a valid context"
*>
macro quicksort(list, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
{
usz len = sort::@len_from_list(list);