Commit graph

58 commits

Author SHA1 Message Date
Brendan Hansknecht
96b5d365b2
Add capacity growth to RocStr
Also, cleans up the alloc and realloc api for both list and str.
Updates Str.reserve to match List.reserve
2022-10-10 22:24:55 -07:00
Brian Hicks
0f4c848978
remove RocList.get
It wasn't used outside of `RocDict`'s `IntoIterator`, and in that use case it
was throwing segfaults and bus errors all over the place. I was unable to figure
out what was wrong with it, but since we have an alternative path forward let's
just drop it for now.
2022-09-22 06:03:50 -05:00
Brian Hicks
37fbc5ec24
use the slice's iterator for iterating over RocDictItems 2022-09-22 06:03:31 -05:00
Brian Hicks
74552f0bac
Merge pull request #4074 from roc-lang/dict-umentation
document why Dict is the way it is
2022-09-20 09:58:35 -05:00
Brian Hicks
9d6b27e23c
format references for automatic links
Co-authored-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
Signed-off-by: Brian Hicks <brian@brianthicks.com>
2022-09-20 07:48:38 -05:00
Brian Hicks
c6235f8c76
grammar
Co-authored-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
Signed-off-by: Brian Hicks <brian@brianthicks.com>
2022-09-20 07:48:11 -05:00
Richard Feldman
593bd02cb9
Make RocDict FFI-safe 2022-09-19 21:12:41 -04:00
Brian Hicks
3f1f90dce2
document why Dict is the way it is 2022-09-19 14:50:25 -05:00
Richard Feldman
523b18900f
Give RocDict a FromIterator instance 2022-09-19 12:44:13 -04:00
Brian Hicks
6236be9416
fix formatting 2022-09-15 12:53:17 -05:00
Brian Hicks
335a8372c5
implement Drop for RocDictItem 2022-09-14 15:39:46 -05:00
Brian Hicks
98a8cc02e6
follow Roc's layout rules for RocDictItem 2022-09-14 15:36:54 -05:00
Brian Hicks
5d23aec153
📎 2022-09-12 10:24:11 -05:00
Brian Hicks
39f73b4c7b
add size_hint for dict iterator 2022-09-12 10:24:03 -05:00
Brian Hicks
ca8490dc71
restore IntoIterator for borrowed RocDict values 2022-09-12 09:09:31 -05:00
Brian Hicks
5fec0ec0ce
restore IntoIterator for borrowed RocList values 2022-09-12 09:09:31 -05:00
Brian Hicks
1f31e16896
add RocSet.is_empty 2022-09-07 15:08:55 -05:00
Brian Hicks
3bcefd7f68
add RocDict.is_empty 2022-09-07 15:08:32 -05:00
Brian Hicks
c993d882cc
remove reference to into_iter 2022-09-07 15:06:50 -05:00
Brian Hicks
c1ae2fe8b7
make RocDict FFI-safe 2022-09-07 15:05:23 -05:00
Brian Hicks
2a141395d9
remove IntoIter for RocList
This implies we get ownership of the data inside the iterator, but that's
not true--it's not safe to change values in place because Roc might still
hold a reference to the memory.
2022-09-07 14:59:29 -05:00
Brian Hicks
0b78e14978
add RocList.get 2022-09-07 14:59:24 -05:00
isaacthefallenapple
4c5e89f46c
replace unsound MaybeUninit deref with ptr::copy
Signed-off-by: isaacthefallenapple <isaacthefallenapple@gmail.com>
2022-08-29 17:00:03 +02:00
Richard Feldman
ccd0d32332
Merge remote-tracking branch 'origin/main' into glue-dict 2022-08-21 09:51:22 -04:00
Ayaz Hafiz
f70993c2a3
Add RocList from array 2022-08-17 17:58:03 -05:00
Ayaz Hafiz
b1e41a5995
Remove Clone restriction from RocList FromIterator
You don't need clone-able elements to create a Roc list from an owned
iterator.
2022-08-17 17:44:06 -05:00
Richard Feldman
c2c9c87cd2
Simplify RocList Debug again 2022-08-15 13:05:32 -04:00
Richard Feldman
8742a81caf
Add len for RocDict and RocSet 2022-08-15 13:05:32 -04:00
Richard Feldman
f9013a881e
Don't print "RocList" in its Debug instance 2022-08-15 13:05:31 -04:00
Richard Feldman
ec0e80f5d2
Add basic roc_std Dict and Set implementations 2022-08-15 10:59:58 -04:00
Richard Feldman
97fef48864
Improve RocList's Debug implementation 2022-08-15 10:59:58 -04:00
Folkert de Vries
0fab77af99
Merge pull request #3751 from roc-lang/relax-clone
Don't require `Clone` on as many `RocList` methods
2022-08-13 00:11:23 +02:00
Richard Feldman
97e2900bf5
s/rtfeldman/roc-lang/g in links to GitHub repos 2022-08-12 15:24:09 -04:00
Richard Feldman
6224180462
Revert "Don't decrement refcount when extending RocList"
This reverts commit 477ed96e15.
2022-08-11 20:50:29 -04:00
Richard Feldman
477ed96e15
Don't decrement refcount when extending RocList 2022-08-11 10:25:34 -04:00
Brian Hicks
48de542f2c
remove copy-pasted comment 2022-08-11 05:55:50 -05:00
Richard Feldman
3180d16be2
Add some cfg(serde) annotations where needed 2022-08-10 21:16:47 -04:00
Richard Feldman
90badfe81f
Don't require Clone on as many RocList methods 2022-08-10 20:24:39 -04:00
Brian Hicks
31390c8ba3
implement Serialize/Deserialize for RocList 2022-08-10 17:32:31 -05:00
Brian Hicks
3afe0b1a30
implement Serialize/Deserialize for RocStr 2022-08-10 16:57:00 -05:00
Brian Hicks
3bf5949b32
we'll test ser/de with JSON 2022-08-10 16:56:48 -05:00
Brian Hicks
441b1f7b7d
keep version in sync with Cargo.toml 2022-08-10 16:47:28 -05:00
Brian Hicks
fc4e4fa832
add a serde feature and dependency 2022-08-10 16:47:27 -05:00
Folkert
792936066c
Merge remote-tracking branch 'origin/trunk' into roc-std-platform 2022-08-07 13:28:03 +02:00
Folkert
9574bd9928
move implementation of platform functions to use site... 2022-08-06 21:32:18 +02:00
Folkert
6394a4e337
update no_std config 2022-08-06 19:05:29 +02:00
Folkert
b4eda7c9d9
rework features for roc_std 2022-08-06 19:01:07 +02:00
Richard Feldman
7186c07151
Conditionally import ffi::c_void 2022-08-03 22:42:10 -04:00
Richard Feldman
b0071d274b
Drop unnecessary cfg(any(test)) condition 2022-08-03 22:41:54 -04:00
Folkert de Vries
64eba70f50 linker 2022-08-03 23:25:48 +02:00