97jaz / gregor

Date and time library for Racket
45 stars 10 forks source link

Feature request: list->period #22

Open jackfirth opened 7 years ago

jackfirth commented 7 years ago

I'm writing a *period function to let me scale periods, for example doubling (period [months 1] [hours 3])to (period [months 2] [hours 6]). I was hoping to do this by calling period->list, scaling the amount part of each unit-amount pair, and then converting the new list of units and amounts back to a period with list->period. To my dismay, that procedure doesn't exist. It would have been a nice to have in this instance.

97jaz commented 7 years ago

Yeah, this should be possible. Also, I have no problem providing a period-scale directly.