Skip to content

A sub-field accessor macro for the Nim programming language.

License

Notifications You must be signed in to change notification settings

jyapayne/subfield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

nimble install subfield

#Usage

import subfield

type
  C = object
    y: int
  B = object
    x: int
    c: C
  A = ref object
    b: B

var 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

About

A sub-field accessor macro for the Nim programming language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages