Skip to content

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Oct 13, 2020

MCS cast

I use it a lot in my code, it leads to code that's easier to read/write/edit than cast[F](expr) especially in more complex expressions; yet it's as easy to audit than builtin cast (eg when grepping for cast).

for reference, previous attempt was in std/sugar (nim-lang/Nim#8528), I'm now moving this to fusion/pointers which is a module dedicated to making unsafe code easier to handle.

example

see runnableExamples

addrCast

it's a common pattern, and std/pointers is a good fit for it
see runnableExamples

@timotheecour timotheecour changed the title add pointers.cast: allow running cast in UFCS/method call syntax chains add pointers.cast: allow running cast in UFCS/method call syntax chains Oct 13, 2020
@timotheecour timotheecour changed the title add pointers.cast: allow running cast in UFCS/method call syntax chains add UFCS/MCS cast, and addrCast Jan 16, 2021
@timotheecour timotheecour marked this pull request as ready for review January 16, 2021 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant