fusion
fusion copied to clipboard
Fusion is for now an idea about how to grow Nim's ecosystem without the pain points of more traditional approaches.
```nim import fusion/matching {.experimental: "caseStmtMacros".} case [(1, 3), (3, 4)]: of [(1, @a), _]: echo a else: echo "Match failed" ``` Results in: ``` benjaminlee@Benjamins-Mac-mini ~ [1]> nim c tmatching.nim...
```nim import macros, fusion/matching {.experimental: "caseStmtMacros".} case newLit 0 else: discard ``` **current output** ``` Nim/compiler/nim.nim(138) nim Nim/compiler/nim.nim(94) handleCmdLine Nim/compiler/main.nim(275) mainCommand Nim/compiler/main.nim(245) compileToBackend Nim/compiler/main.nim(101) commandCompileToC Nim/compiler/modules.nim(178) compileProject Nim/compiler/modules.nim(98) compileModule Nim/compiler/passes.nim(180)...
Added iterutils module, with 2 functions (findAll with value, findAll with predicate function).
migrated from https://github.com/nim-lang/Nim/pull/15598 (refs https://github.com/nim-lang/Nim/pull/15598#issuecomment-714356421) * works at CT pending https://github.com/nim-lang/Nim/pull/15705, hence the NimPatch bump to facilitate this (and yes, people care about walking at CT, eg see recent https://forum.nim-lang.org/t/6984)...
The following fails: ``` import options import fusion/matching {.experimental: "caseStmtMacros".} type OKind* = enum O1 O* = object case kind*: OKind of O1: o1*: int case O(kind:O1,o1:1): of OKind.O1(o1: @i):...
Ref https://github.com/nim-lang/Nim/pull/17147#issue-577813481
Opening a File from a FileHandle using ``` proc open*(f: var File, filehandle: FileHandle, mode: FileMode = fmRead): bool {.tags: [], raises: [], benign.} ``` does not work on Windows...
/cc @haxscramper tests/tmatching.nim(1874, 11) Hint: 'doASsert' should be: 'doAssert' [Name] a fix for this issue should also include this change: ``` switch("styleCheck", "hint") => switch("styleCheck", "error") ``` in tests/config.nims
/cc @Araq ## rationale avoid code duplication and re-inventing the wheel ## how it'd work * `build_all.sh` builds csources * the it builds koch * then it calls `koch boot`...
* safer than using cast and inlining the code contained in the operators from this PR * future compiler work can enable the following: ```nim import fusion/pointers proc fn =...