GK
Size: a a a
GK
IE
GK
МК
МК
МК
D
GK
D
AD
Macros cannot change Nim's syntax because there is no need for it — the syntax is flexible enough.
Nim
import strformat
type
Person = object
name*: string # Field is exported using `*`.
age: Natural # Natural type ensures the age is positive.
var people = [
Person(name: "John", age: 45),
Person(name: "Kate", age: 30)
]
for person in people:
# Type-safe string interpolation.
echo(fmt"{person.name} is {person.age} years old")
AD
AD
🆅🆂
IE
IE
IE
IE