https://github.com/jyapayne/subfield
A sub-field accessor macro for the Nim programming language.
https://github.com/jyapayne/subfield
Last synced: about 2 months ago
JSON representation
A sub-field accessor macro for the Nim programming language.
- Host: GitHub
- URL: https://github.com/jyapayne/subfield
- Owner: jyapayne
- License: mit
- Created: 2016-06-21T15:29:20.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-21T16:07:20.000Z (almost 9 years ago)
- Last Synced: 2025-01-22T01:46:30.686Z (3 months ago)
- Language: Nimrod
- Size: 3.91 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# subfield
A sub-field accessor macro for the Nim programming language. This lets you access nested fields within a Nim object or ref object.# Installation
```bash
nimble install subfield
```#Usage
```nim
import subfieldtype
C = object
y: int
B = object
x: int
c: C
A = ref object
b: Bvar c = C(y: 0)
var b = B(x: 5, c: c)
var a = A(b: b)echo a.x
echo a.y# Prints:
# 5
# 0
```