I have a few question on slots in a class. Given the following class that implements string utilities:
defclass( String()
()
(
(str @initarg nil) ; The string
(len @initarg nil); The length of the string
)
)
defmethod( Length ((s String))
s->len = strlen(str)
)
Is there a way to trigger Length() whenever the slot "str" is updated? I know I could make another method like "SetStr" but that is a little messy, I also have to remember to always use that method and not set str directly.
Thank you,
Aaron