This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install a fully encrypted ArchLinux on NVMe with detached LUKS | |
| # headers and LUKS encrypted UEFI boot partition on a USB dongle. | |
| # | |
| # Full tutorial can be found here: | |
| # https://headcrash.industries/reference/fully-encrypted-archlinux-with-secure-boot-on-yoga-920/ | |
| # | |
| # Written by Gerke Max Preussner <[email protected]> | |
| # Overview ############################################################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| Foo[T] = concept x | |
| x.foo(T) | |
| proc foobar[T](f: Foo[T]) = | |
| f.foo(42) | |
| type | |
| FooImpl[T, U] = object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| Foo[T] = concept x | |
| var t = T() | |
| x.foo(t) | |
| x.bar(t) is T | |
| FooImpl[T] = object | |
| proc foo[T](f: FooImpl[T], t: T) = discard | |
| proc bar[T](f: FooImpl[T], t: T): T = t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| Foo[T] = ref object | |
| x: T | |
| Bar[N: static[int], T] = ref object | |
| a: array[N, T] | |
| x: T | |
| Foobar[N: static[int], T] = object | |
| b: Bar[N, T] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type IntArray[T; N: static[int]] = array[N, T] | |
| proc ones[T](N: static[int]): IntArray[T, N] = | |
| for i in 0 .. < N: | |
| result[i] = 1 | |
| echo @[ones[int](5)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import macros | |
| const nmax = 500 | |
| type | |
| Complex*[T] = object | |
| re*: T | |
| im*: T | |
| converter toComplex*[T](x: tuple[re, im: T]): Complex[T] = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| Foo[T] = concept x, y | |
| foo(x, y) is bool | |
| Bar[T] = object | |
| b: T | |
| when true: # the following works | |
| proc foo(x, y: Bar): bool = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import macros | |
| macro midlInterface*(head: expr; body: stmt): stmt {.immediate.} = | |
| ## Generates the glue code required for MIDL interface types. | |
| ## | |
| ## For example, the following declaration... | |
| ## | |
| ## midlInterface IUnknown: | |
| ## proc queryInterface*(riid: Iid; outObj: ptr pointer): HResult |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| framework | |
| packageA | |
| bin | |
| docs | |
| src | |
| module1.nim | |
| module2.nim | |
| module3.nim | |
| tests | |
| tmodule1.nim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| RectArray*[R, C: static[int], T] = distinct array[R * C, T] | |
| StaticMatrix*[R, C: static[int], T] = object | |
| elements*: RectArray[R, C, T] | |
| StaticVector*[N: static[int], T] = StaticMatrix[N, 1, T] | |
| proc foo*[N, T](a: StaticVector[N, T]): T = 0.T |
NewerOlder