R object-oriented programming with or without references