Skip to content

Definitions

Eric Evans edited this page Aug 22, 2017 · 5 revisions

This page is to hold definitions of terms used in string-time.

Time Sequence

Times are viewed as being members of a sequence. For example, a sequence of days. These times can be viewed as intervals, and each member of the sequence :meets the next member of the sequence.

Scale

Each Time Sequence is associated with a scale that corresponds to the steps of sequence. The scale of a member of a sequence of days is :day. The names of scales are Clojure keywords. There could be application-specific scales. The complete set of built-in scales is:

  • :year
  • :week-year
  • :month
  • :week
  • :day
  • :hour
  • :minute

Nesting

A Time Sequence can be nested within a member of another Time Sequence. This requires that the scales be compatible, so that the following would be true:

  • the first member of the nested sequence :starts the enclosing time.
  • the last member of the nested sequence :finishes the enclosing time.

The top-level sequence is typically unbounded. For example, :years is the top level of [:day :month :year] Whereas the days of a month is a bounded sequence (from 28-31 days long), there is no bound on years.

In time-count a nesting is expressed as a Clojure vector of scale names, with the name of the smallest scale appearing first. There may be application-specific nestings. The set of built-in nestings is:

  • [:second :minute :hour :day :month :year]
  • [... :day :year]
  • [... :day :week :week-year] These nestings are defined in the library. The user of the library can make others. For example, it might be useful for an application to have [:business-day :fiscal-month :fiscal-quarter :fiscal-year]
Clone this wiki locally