Skip to content

Commit

Permalink
[nim/en] Fixed instantiation of the reference object (#5234)
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-n0 authored Feb 3, 2025
1 parent 0dba59d commit ca117e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nim.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ type
var
defaultHouse = House() # initialize with default values
defaultRoom = new Room() # create new instance of ref object
sesameHouse = House(address: "123 Sesame St.", rooms: @[defaultRoom])
defaultRoom = Room() # create new instance of ref object with default values
# Create and initialize instances with given values
sesameRoom = Room(windows: 4, doors: 2)
sesameHouse = House(address: "123 Sesame St.", rooms: @[sesameRoom])
# Enumerations allow a type to have one of a limited number of values
Expand Down

0 comments on commit ca117e4

Please sign in to comment.