Jacek Sieka
9f4e2bccdd
wip: general-purpose conversion
2020-04-28 16:36:37 +02:00
Jacek Sieka
8065e36c5a
results: fix non-void [] overload
2020-04-23 06:46:10 +02:00
Zahary Karadjov
df7f2e7ed5
Fix a typo [skip ci]
2020-04-22 16:39:37 +03:00
Zahary Karadjov
1eed7a72b7
Make any accidental "run-time" usage of declval an error
2020-04-22 16:34:11 +03:00
Zahary Karadjov
4acc3866ed
Adds results.Opt
...
It turned out that Nim's Option type is broken for `not nil` and
`requiresInit` types. It will report an udesired warning due to
the way `none` is defined. The `Result` type doesn't suffer from
this problem, so I've transitioned some APIs in NBC to use the
new `results.Opt[T]` type (alias of `Result[T, void]`).
Perhaps we should renamed `Result` to `Res` to make the naming
more consistent and to allow the code to more easily fit in the
80 character per-line budget.
2020-04-22 15:43:26 +03:00
Zahary Karadjov
9a0cded592
Add objects.declval
2020-04-22 15:41:42 +03:00
Jacek Sieka
ff755bbf75
change get/[] to always raise Defect and tryGet to do eh bridge mode ( #30 )
...
* also sprinkle mixin randomly across the codebase
2020-04-16 18:23:12 +02:00
Zahary Karadjov
8528ce28b4
Writing to FastStreams can have side-effects
2020-04-14 19:36:15 +03:00
Jacek Sieka
805ef4f1b2
result: cleanups
...
* fix defect raising without `$`
* doc updates
* better `?` that doesn't cause raises effect (it should, because of
FieldError but...)
2020-04-11 16:22:37 +02:00
Jacek Sieka
5512e89d4c
a few more cleanups
...
* add raises to endians2, bitops2 since they sometimes call C functions
2020-04-10 22:40:00 +03:00
Jacek Sieka
87ccf8e66b
hex byte: raise instead of assert on hex-to-byte odd lengths
2020-04-10 22:40:00 +03:00
Zahary Karadjov
3e1fa974a4
Use a simpler recursion in recordFields as it's no longer an iterator
2020-04-09 20:39:02 +03:00
Jacek Sieka
b06a5b6e32
result -> results ( #27 )
2020-04-07 11:43:07 +02:00
Jacek Sieka
55c2ec8977
result: more performance notes
2020-04-06 15:53:53 +03:00
Jacek Sieka
4d20b25c02
result: fix and/or template evaluation, add perf notes
2020-04-06 15:53:53 +03:00
Jacek Sieka
9414202d53
result: `and` can deal with heterogenous values
2020-04-04 00:28:46 +03:00
Jacek Sieka
86739f99c4
Use defect for normal errors, document exception bridge mode ( #20 )
...
Co-authored-by: Zahary Karadjov <zahary@gmail.com>
2020-04-02 11:39:11 +02:00
Jacek Sieka
4201f46750
Update README.md
2020-04-01 14:22:21 +02:00
Jacek Sieka
fe074766f1
Update README.md
2020-04-01 14:22:04 +02:00
Jacek Sieka
7287fffebe
result: add `expect` helper ( #23 )
...
* result: add `expect` helper
* result: use explicit conversion in mapConvert
2020-04-01 14:16:20 +02:00
Jacek Sieka
d622c07a08
result: cleanups ( #22 )
...
* fix ResultError type
* add/fix documentation
* clean up raises (in preparation for better Defect handling)
* fix toException mixin
* work around compiler bug with more explicit types
* fix capture exception type
* fix result type on `?`
2020-03-30 22:49:13 +02:00
Ștefan Talpalaru
4477f45c40
Merge branch 'basetype'
2020-03-30 19:56:37 +02:00
Ștefan Talpalaru
09e55cd375
stew/objects: add baseType()
2020-03-29 17:34:45 +02:00
Zahary Karadjov
989c33a82b
Take advantage of fixes in Nim 1.2
2020-03-25 17:52:09 +02:00
Jacek Sieka
76beeb769e
fix fromBytes for zero length arrays
2020-03-07 23:29:46 +01:00
Jacek Sieka
ca8fb7ebd0
add slice assignment for openarray
2020-03-05 12:11:25 +02:00
Jacek Sieka
598fe151f8
non-cast implementation of toBytes, add fromBytes
2020-03-05 12:11:25 +02:00
Zahary Karadjov
50562b515a
Add bitseqs.bitsLen(openarray)
2020-01-29 02:42:50 +02:00
Jacek Sieka
f5be0ab63a
add nim-result
2020-01-23 17:35:30 +01:00
Jacek Sieka
1edeabb453
Renames ( #17 )
...
* renames and warning fixes
* gitignore: nimcache
2019-12-20 13:23:30 +01:00
Jacek Sieka
898f4f47e3
Merge pull request #13 from status-im/bitsetting
...
set, clear, toggle and change bits
2019-12-20 12:55:41 +01:00
Jacek Sieka
a36df61d2b
set, clear, toggle and change bits
...
* use standard bit manipulation naming
* fix signed overflow on large shifts
* add toggle
* add smoke tests
* branch-free changeBit
2019-12-20 12:49:20 +01:00
Jacek Sieka
d8c2a64055
Merge pull request #16 from status-im/comparebyte
...
byteutils: lexicographical less than
2019-12-20 12:48:10 +01:00
Jacek Sieka
9c18a1cc55
byteutils: lexicographical less than
2019-12-19 13:29:38 +01:00
Yuriy Glukhov
1c1195dba3
Copied base32, 58, 64 from libp2p
2019-12-13 15:31:19 +02:00
Jacek Sieka
e9d75c05f6
fix 1.0 test compat
2019-12-10 15:50:02 +01:00
Jacek Sieka
cf4df3dc50
add toBytes ( #14 )
2019-12-10 15:39:57 +01:00
Zahary Karadjov
1c4293b3e7
A new fix for newLit
...
Upstream fix submitted here:
https://github.com/nim-lang/Nim/pull/12542
2019-10-28 14:30:49 +02:00
Zahary Karadjov
2c9ca5dabb
recordFields returns more accurate information in nested case objects
2019-10-23 09:36:16 +09:00
andri lim
53c1ebe9d4
fixes 'nimFirstOne' for Nim v1.0.2
2019-10-23 09:36:16 +09:00
Zahary Karadjov
11b6a831cb
Prepare for Nim v1.0.2
2019-10-23 09:36:16 +09:00
kdeme
0c3ab3eb78
Fix endianness typos
2019-10-03 16:38:42 +03:00
Zahary Karadjov
2bdd2fab6e
Add `len` for tuples
2019-10-02 16:25:58 +03:00
Jacek Sieka
62c1bebe2e
ptrops: remove mixin and work around compiler bugs
2019-09-26 18:25:19 +03:00
Jacek Sieka
df542980b6
ptrops: remove MemAddress
2019-09-26 18:25:19 +03:00
Jacek Sieka
ee484001d2
ptrops: fix mixins
2019-09-26 18:25:19 +03:00
Jacek Sieka
7fa9535f3c
ptrops: add mixins
2019-09-26 18:25:19 +03:00
Jacek Sieka
5ada369741
ptrops: add
2019-09-26 18:25:19 +03:00
Zahary Karadjov
5f1dc751ca
Convenience varints API going from int straight to openarray
2019-09-08 22:33:03 -04:00
Ștefan Talpalaru
a81d1fac85
CI: update script path
2019-08-24 20:42:13 +02:00