Commit Graph

216 Commits

Author SHA1 Message Date
6ef0583868 Fix array indexing 2024-08-18 15:51:19 -04:00
a49870f810 Add primality testing and next_prime()/prev_prime() 2024-08-18 15:22:51 -04:00
20b7793963 Make small integer constants actually constant 2024-08-17 15:17:41 -04:00
3229e74d91 Remove 'const' where it caused problems 2024-08-17 14:48:56 -04:00
cbe117a6d3 Allow for top-level or namespace-level variables that are initialized
with non-constant values by the use of an initializer function and
runtime checks for whether the variable is initialized.
2024-08-17 14:41:31 -04:00
bac188ce07 Change division and modulus to use euclidean division, plus fix up a few
integer bugs
2024-08-16 14:24:20 -04:00
04714e00d7 Add Bool:random(p=0.5) 2024-08-16 14:18:23 -04:00
0f1c475bb4 More fixes for ints 2024-08-16 13:14:45 -04:00
436c6d4457 Bugfix 2024-08-16 13:13:35 -04:00
688f883e16 Add array:find() 2024-08-15 03:01:04 -04:00
66ae30ac29 Add method for array:remove_item(item) and rename
array:remove(index)->array:remove_at(index) to avoid confusion. Also
hook up array:has()
2024-08-15 02:39:35 -04:00
ed1667cb37 Add array:shuffled() and checks for array insertion 2024-08-15 02:17:53 -04:00
7a472752e5 Bugfix for array:insert() 2024-08-15 02:09:49 -04:00
eccc4e4721 Add binary search method to arrays 2024-08-15 01:59:42 -04:00
9c2d7c437d Fix up type conversions with ints and nums 2024-08-14 14:57:01 -04:00
c8af1ac9c1 Tweak implementations of math ops 2024-08-13 23:21:59 -04:00
e56fd1aa94 Add Int:sqrt() 2024-08-13 16:36:41 -04:00
e0223a4c20 Support ^ exponentiation for integers 2024-08-13 16:32:00 -04:00
f0d97cd4cd Make biggest int semantically meaningful 2024-08-13 14:27:50 -04:00
5a0502bdf5 Fix some edge cases 2024-08-13 14:13:02 -04:00
148782e61b Create inlined fast versions of integer ops 2024-08-13 13:50:19 -04:00
eb9e5260a6 Fix channels 2024-08-13 03:27:32 -04:00
cf8c01845e Fix issue with integer comparisons 2024-08-13 03:25:13 -04:00
df520b7d61 Fix int hashes 2024-08-13 03:21:20 -04:00
9edace28e2 Fix ranges 2024-08-13 03:20:01 -04:00
5d3ab600f1 Fixes 2024-08-13 03:09:48 -04:00
2c4f6536a3 Fix Int->Num promotions 2024-08-13 02:51:10 -04:00
9b9087bfef Get rid of slow_* int functions 2024-08-13 02:42:02 -04:00
25519d2434 Fixing up more stuff 2024-08-13 02:28:14 -04:00
aa74180ed1 Fixing up integers 2024-08-13 02:20:48 -04:00
158a1c6ad2 More fixes 2024-08-13 02:09:18 -04:00
a32d90fcd7 Remove debug prints 2024-08-13 01:45:05 -04:00
21fd5c8195 Bugfixes 2024-08-13 01:43:46 -04:00
d08f795794 Partially working first draft of bigints 2024-08-13 01:30:25 -04:00
6aabed4fcc Fix some COW bugs for arrays/tables/sets 2024-08-12 17:44:05 -04:00
d2f4d07585 Support channels with maximum size 2024-08-11 15:04:22 -04:00
2ecb5fe885 Add channels and threads 2024-08-11 14:47:34 -04:00
926995f58d Bugfix for Text:split() 2024-08-10 16:41:23 -04:00
948d6b4c22 Add array:counts() 2024-08-10 16:36:50 -04:00
b37bd70b60 For tables, deprecate support for square bracket indexing and .default
values, replacing them with a `:bump()` function for tables with numeric
values. This means that counters can be implemented easily without the
need to mask complexity.
2024-08-10 16:03:41 -04:00
671f81137e Make Num32/Num64 literals explicitly typed to aid in macros using
__typeof
2024-08-10 16:03:00 -04:00
8d3d591312 Add Sets to the language 2024-08-10 15:15:38 -04:00
3b1d88ab93 Bugfix for table literals with duplicated keys 2024-08-10 14:20:54 -04:00
f78cd6357a Change table removal function to use values instead of references 2024-08-08 13:20:38 -04:00
c045c54309 Add a Range datatype with creation methods like 5:to(10) and
modification methods like `range:by(2)` or `range:reversed()`
2024-08-05 14:40:28 -04:00
8e2156ac48 Guard against tables exceeding maximum supported size 2024-08-04 18:28:18 -04:00
7300049867 Switch to TABLE_INCREF 2024-08-04 17:31:33 -04:00
d7e3d399d6 Fix up some edge cases with refcounting 2024-08-04 17:25:54 -04:00
fa0dee19e2 Add comment 2024-08-04 17:02:29 -04:00
aa218fe872 Tweak bits 2024-08-04 15:01:27 -04:00