jameslairdsmith / gs

A grammar of recurring calendar events.
https://jameslairdsmith.github.io/gs/
Other
14 stars 0 forks source link

Schedules should not behave like functions #22

Closed jameslairdsmith closed 5 years ago

jameslairdsmith commented 5 years ago

Schedules are functions. This property is essential to the gs grammar. But I've changed my mind on whether I think schedules should behave like functions. I think this even though functions in R can do almost everything that ordinary objects can do.

For example I no longer think users should be able to invoke schedules as functions with a date object as their first argument. This is because it creates a confusion when this cannot be done with the basic schedules. Even if the basic schedules could be changed to accommodate this, it would probably result in more confusion rather than less.

The other irritation with schedules behaving as functions is that they will autocomplete as functions, rather than objects. Even beginner users are then forced to grapple with whether to use a schedule object is a function or an object.

jameslairdsmith commented 5 years ago

Closed with #23