Consider the following Python code from the link
# Python code
class Student:
# A student ID counter
idCounter = 0
def __init__(self):
self.gpa = 0
self.record = {}
# Each time I create a new student, the idCounter increment
Student.idCounter += 1
self.name = 'Student {0}'.format(Student.idCounter)
classRoster = [] # List of students
for number in range(25):
newStudent = Student()
classRoster.append(newStudent)
print(newStudent.name)
What would be the best way to implement this equivalently in Julia, preferably using mutable struct
? Any tips/best practices will be much appreciated.