On Thu, Mar 26, 2015 at 4:57 PM, Vincent St-Amour <stamo...@ccs.neu.edu> wrote:
> At Thu, 26 Mar 2015 14:30:28 -0400,
> Jon Zeppieri wrote:
>>

[ snip]

> Since, IIUC, periods need to be "anchored" to a specific point in time,
> that would make them a bit more heavyweight to create. I could see
> durations being nice for that reason, and their use may not be too
> problematic if they're only used up to the week level, up to which there
> are reasonable, uniform conversion factors. (I.e. for dealing with
> unanchored durations, ignoring leap seconds is probably fine.)

The anchor really only needs to be supplied when you do something with
a period -- so it doesn't need to be part of the data structure. You
can carry around a bucket that says "5 years, 3 weeks, and 40 hours,"
but the precise number of seconds inside the bucket is indeterminate
until you pour it over a date-provider. (No, not a great metaphor.)

>
>> - Assuming that "periods" are useful, what operations on them do we
>> want? Arithmetic, probably; maybe the `period->nanoseconds` function I
>> just mentioned; maybe convenience functions based on the current time
>> (e.g., `ago`, `from-now`). Anything else?
>
> I think arithmetic is really the big one.

Yep.

>
>> - How do we represent a period? The obvious choice:
>
> I think a struct that implements `gen:dict` would be a nicer interface.
> I don't really like `duration-between`'s current interface.

I like that idea.

>
> Again, really cool work!
>
> Vincent

Thanks!

-Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to