The local-time-duration Reference Manual

This is the local-time-duration Reference Manual, version 1.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:54:04 2024 GMT+0.

Table of Contents


1 Systems

The main system appears first, followed by any subsystem dependency.


1.1 local-time-duration

local-time-duration: Simple duration functionality on top of local-time

Author

WebCheckout, Inc.

License

MIT

Version

1.1

Dependencies
  • local-time (system).
  • alexandria (system).
  • esrap (system).
Source

local-time-duration.asd.

Child Components

2 Files

Files are sorted by type and then listed depth-first from the systems components trees.


2.1 Lisp


2.1.1 local-time-duration/local-time-duration.asd

Source

local-time-duration.asd.

Parent Component

local-time-duration (system).

ASDF Systems

local-time-duration.

Packages

local-time-duration-system.


2.1.2 local-time-duration/package.lisp

Source

local-time-duration.asd.

Parent Component

local-time-duration (system).

Packages

local-time-duration.


2.1.3 local-time-duration/defcomparator.lisp

Dependency

package.lisp (file).

Source

local-time-duration.asd.

Parent Component

local-time-duration (system).

Internals

%defcomparator (macro).


2.1.4 local-time-duration/duration.lisp

Dependency

defcomparator.lisp (file).

Source

local-time-duration.asd.

Parent Component

local-time-duration (system).

Public Interface
Internals

2.1.5 local-time-duration/format.lisp

Dependency

duration.lisp (file).

Source

local-time-duration.asd.

Parent Component

local-time-duration (system).

Public Interface
Internals

2.1.6 local-time-duration/timestamp.lisp

Dependency

format.lisp (file).

Source

local-time-duration.asd.

Parent Component

local-time-duration (system).

Public Interface

2.1.7 local-time-duration/iso8601.lisp

Dependency

timestamp.lisp (file).

Source

local-time-duration.asd.

Parent Component

local-time-duration (system).

Public Interface

parse-iso8601-duration (function).

Internals

3 Packages

Packages are listed by definition order.


3.1 local-time-duration

Source

package.lisp.

Nickname

ltd

Use List
  • common-lisp.
  • esrap.
Public Interface
Internals

3.2 local-time-duration-system

Source

local-time-duration.asd.

Use List
  • asdf/interface.
  • common-lisp.

4 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


4.1 Public Interface


4.1.1 Compiler macros

Compiler Macro: duration/= (&rest items)
Package

local-time-duration.

Source

duration.lisp.

Compiler Macro: duration< (&rest items)
Package

local-time-duration.

Source

duration.lisp.

Compiler Macro: duration<= (&rest items)
Package

local-time-duration.

Source

duration.lisp.

Compiler Macro: duration= (&rest items)
Package

local-time-duration.

Source

duration.lisp.

Compiler Macro: duration> (&rest items)
Package

local-time-duration.

Source

duration.lisp.

Compiler Macro: duration>= (&rest items)
Package

local-time-duration.

Source

duration.lisp.


4.1.2 Ordinary functions

Function: duration (&key week day hour minute sec nsec)

Returns a new duration instance representing the sum of the ‘WEEK‘, ‘DAY‘, ‘HOUR‘, ‘MINUTE‘, ‘SEC‘, and ‘NSEC‘ arguments. Durations are normalized, that is, (duration :hour 1) and (duration :minute 60) will result in duration instances with the same internal representation.

Package

local-time-duration.

Source

duration.lisp.

Function: duration* (duration factor)

Returns a fresh duration as long as ‘DURATION‘ multiplied by ‘FACTOR‘.

Package

local-time-duration.

Source

duration.lisp.

Function: duration+ (&rest durations)

Returns a fresh duration representing the sum of the lengths of its arguments.

Package

local-time-duration.

Source

duration.lisp.

Function: duration- (&rest durations)

Returns a fresh duration representing the result of subtracting the length of each argument in turn.

Package

local-time-duration.

Source

duration.lisp.

Function: duration-as (duration unit)

Returns two values: the first is the number of whole ‘UNIT‘s within ‘DURATION‘, and the second is a fresh duration representing the reamainder of the original duration after dividing it by ‘UNIT‘. ‘UNIT‘ must be one of :week, :day, :hour, :minute, :sec, and :nsec.

Package

local-time-duration.

Source

duration.lisp.

Function: duration-maximum (duration &rest durations)
Package

local-time-duration.

Source

duration.lisp.

Function: duration-minimum (duration &rest durations)
Package

local-time-duration.

Source

duration.lisp.

Function: duration/ (duration divisor)

Returns a fresh duration that is as long as ‘DURATION‘ divided by ‘DIVISOR‘.

Package

local-time-duration.

Source

duration.lisp.

Function: duration/= (&rest items)

Returns ‘T‘ if every duration is not equally long, else returns ‘NIL‘.

Package

local-time-duration.

Source

duration.lisp.

Function: duration< (&rest items)

Returns ‘T‘ if every duration is shorter than the preceding duration, else returns ‘NIL‘.

Package

local-time-duration.

Source

duration.lisp.

Function: duration<= (&rest items)

Returns ‘T‘ if every duration is shorter than or equal to the preceding duration, else returns ‘NIL‘.

Package

local-time-duration.

Source

duration.lisp.

Function: duration= (&rest items)

Returns ‘T‘ if every duration is equally long, else returns ‘NIL‘.

Package

local-time-duration.

Source

duration.lisp.

Function: duration> (&rest items)

Returns ‘T‘ if every duration is longer than the preceding duration, else returns ‘NIL‘.

Package

local-time-duration.

Source

duration.lisp.

Function: duration>= (&rest items)

Returns ‘T‘ if every duration is longer than or equal to the preceding duration, else returns ‘NIL‘.

Package

local-time-duration.

Source

duration.lisp.

Function: human-readable-duration (duration &optional stream)
Package

local-time-duration.

Source

format.lisp.

Function: parse-iso8601-duration (string)

Parser for ISO8601 durations (with limitations) returning DURATION instances.

http://en.wikipedia.org/wiki/ISO_8601#Durations

The only, known, divergence from the syntax specified is that
fractional values are allowed anywhere and not only in the smallest value.

Package

local-time-duration.

Source

iso8601.lisp.

Function: timestamp-difference (time-a time-b)

Returns a duration representing the time elapsed between the timestamps ‘TIME-A‘ and ‘TIME-B‘. This duration may be negative if ‘TIME-B‘ is later than ‘TIME-A‘.

Package

local-time-duration.

Source

timestamp.lisp.

Function: timestamp-duration+ (timestamp duration)

Returns a fresh timestamp representing the time when ‘DURATION‘ has elapsed after ‘TIMESTAMP‘.

Package

local-time-duration.

Source

timestamp.lisp.

Function: timestamp-duration- (timestamp duration)

Returns a fresh timestamp representing the time when ‘DURATION‘ will elapse before ‘TIMESTAMP‘.

Package

local-time-duration.

Source

timestamp.lisp.


4.1.3 Standalone methods

Method: print-object ((object duration) stream)
Source

format.lisp.


4.1.4 Classes

Class: duration

A duration instance represents a period of time with no additional context (e.g., starting or ending time or location).

Package

local-time-duration.

Source

duration.lisp.

Direct methods
Direct slots
Slot: day
Type

integer

Initform

0

Initargs

:day

Readers

day-of.

Writers

(setf day-of).

Slot: sec
Type

integer

Initform

0

Initargs

:sec

Readers

sec-of.

Writers

(setf sec-of).

Slot: nsec
Type

integer

Initform

0

Initargs

:nsec

Readers

nsec-of.

Writers

(setf nsec-of).


4.2 Internals


4.2.1 Constants

Constant: +nsecs-per-day+
Package

local-time-duration.

Source

duration.lisp.

Constant: +nsecs-per-hour+
Package

local-time-duration.

Source

duration.lisp.

Constant: +nsecs-per-minute+
Package

local-time-duration.

Source

duration.lisp.

Constant: +nsecs-per-second+
Package

local-time-duration.

Source

duration.lisp.

Constant: +nsecs-per-week+
Package

local-time-duration.

Source

duration.lisp.


4.2.2 Macros

Macro: %defcomparator (name (type) &body body)
Package

local-time-duration.

Source

defcomparator.lisp.

Macro: with-designated-stream ((var stream) &body body)

Binds VAR to the stream designated (as per cl:format’s stream argument) by the value STREAM and executes BODY.

If STREAM is nil VAR will be bound to a string-output-stream and the resulting string will be returned, otherwise the actual stream object used will be returned. In either case the return value of BODY is ignored.

Package

local-time-duration.

Source

format.lisp.


4.2.3 Ordinary functions

Function: %duration-compare (a b)
Package

local-time-duration.

Source

duration.lisp.

Function: %duration/= (a b)
Package

local-time-duration.

Source

duration.lisp.

Function: %duration< (a b)
Package

local-time-duration.

Source

duration.lisp.

Function: %duration<= (a b)
Package

local-time-duration.

Source

duration.lisp.

Function: %duration= (a b)
Package

local-time-duration.

Source

duration.lisp.

Function: %duration> (a b)
Package

local-time-duration.

Source

duration.lisp.

Function: %duration>= (a b)
Package

local-time-duration.

Source

duration.lisp.

Function: call-with-designated-stream (stream thunk)
Package

local-time-duration.

Source

format.lisp.

Function: char-string-to-integer (chars)
Package

local-time-duration.

Source

iso8601.lisp.

Function: decode-duration (duration &key weeks)

Returns, as multiple values, DURATION’s logical components:

(nsecs secs minutes hours days weeks months years)

If WEEKS is T days the days component of DURATION will first be used to compute an integral number of weeks, and the remainder days will be returned. If WEEKS is NIL (the default) the weeks value will always be 0 and the whole number of days will be returned as DAYS.

In the current implementation MONTHS and YEARS are always 0.

Package

local-time-duration.

Source

duration.lisp.

Function: format-iso8601-duration (destination duration)
Package

local-time-duration.

Source

iso8601.lisp.

Function: make-duration-from-time-values (values)
Package

local-time-duration.

Source

iso8601.lisp.

Function: pretty-seconds (secs nsecs)
Package

local-time-duration.

Source

format.lisp.

Function: production-hms-to-list (hour minute second)
Package

local-time-duration.

Source

iso8601.lisp.

Function: production-ymd-to-list (year month day)
Package

local-time-duration.

Source

iso8601.lisp.


4.2.4 Generic functions

Generic Reader: day-of (object)
Package

local-time-duration.

Methods
Reader Method: day-of ((duration duration))

automatically generated reader method

Source

duration.lisp.

Target Slot

day.

Generic Writer: (setf day-of) (object)
Package

local-time-duration.

Methods
Writer Method: (setf day-of) ((duration duration))

automatically generated writer method

Source

duration.lisp.

Target Slot

day.

Generic Reader: nsec-of (object)
Package

local-time-duration.

Methods
Reader Method: nsec-of ((duration duration))

automatically generated reader method

Source

duration.lisp.

Target Slot

nsec.

Generic Writer: (setf nsec-of) (object)
Package

local-time-duration.

Methods
Writer Method: (setf nsec-of) ((duration duration))

automatically generated writer method

Source

duration.lisp.

Target Slot

nsec.

Generic Reader: sec-of (object)
Package

local-time-duration.

Methods
Reader Method: sec-of ((duration duration))

automatically generated reader method

Source

duration.lisp.

Target Slot

sec.

Generic Writer: (setf sec-of) (object)
Package

local-time-duration.

Methods
Writer Method: (setf sec-of) ((duration duration))

automatically generated writer method

Source

duration.lisp.

Target Slot

sec.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
C   D   F   G   H   M   N   P   S   T   W  
Index Entry  Section

%
%defcomparator: Private macros
%duration-compare: Private ordinary functions
%duration/=: Private ordinary functions
%duration<: Private ordinary functions
%duration<=: Private ordinary functions
%duration=: Private ordinary functions
%duration>: Private ordinary functions
%duration>=: Private ordinary functions

(
(setf day-of): Private generic functions
(setf day-of): Private generic functions
(setf nsec-of): Private generic functions
(setf nsec-of): Private generic functions
(setf sec-of): Private generic functions
(setf sec-of): Private generic functions

C
call-with-designated-stream: Private ordinary functions
char-string-to-integer: Private ordinary functions
Compiler Macro, duration/=: Public compiler macros
Compiler Macro, duration<: Public compiler macros
Compiler Macro, duration<=: Public compiler macros
Compiler Macro, duration=: Public compiler macros
Compiler Macro, duration>: Public compiler macros
Compiler Macro, duration>=: Public compiler macros

D
day-of: Private generic functions
day-of: Private generic functions
decode-duration: Private ordinary functions
duration: Public ordinary functions
duration*: Public ordinary functions
duration+: Public ordinary functions
duration-: Public ordinary functions
duration-as: Public ordinary functions
duration-maximum: Public ordinary functions
duration-minimum: Public ordinary functions
duration/: Public ordinary functions
duration/=: Public compiler macros
duration/=: Public ordinary functions
duration<: Public compiler macros
duration<: Public ordinary functions
duration<=: Public compiler macros
duration<=: Public ordinary functions
duration=: Public compiler macros
duration=: Public ordinary functions
duration>: Public compiler macros
duration>: Public ordinary functions
duration>=: Public compiler macros
duration>=: Public ordinary functions

F
format-iso8601-duration: Private ordinary functions
Function, %duration-compare: Private ordinary functions
Function, %duration/=: Private ordinary functions
Function, %duration<: Private ordinary functions
Function, %duration<=: Private ordinary functions
Function, %duration=: Private ordinary functions
Function, %duration>: Private ordinary functions
Function, %duration>=: Private ordinary functions
Function, call-with-designated-stream: Private ordinary functions
Function, char-string-to-integer: Private ordinary functions
Function, decode-duration: Private ordinary functions
Function, duration: Public ordinary functions
Function, duration*: Public ordinary functions
Function, duration+: Public ordinary functions
Function, duration-: Public ordinary functions
Function, duration-as: Public ordinary functions
Function, duration-maximum: Public ordinary functions
Function, duration-minimum: Public ordinary functions
Function, duration/: Public ordinary functions
Function, duration/=: Public ordinary functions
Function, duration<: Public ordinary functions
Function, duration<=: Public ordinary functions
Function, duration=: Public ordinary functions
Function, duration>: Public ordinary functions
Function, duration>=: Public ordinary functions
Function, format-iso8601-duration: Private ordinary functions
Function, human-readable-duration: Public ordinary functions
Function, make-duration-from-time-values: Private ordinary functions
Function, parse-iso8601-duration: Public ordinary functions
Function, pretty-seconds: Private ordinary functions
Function, production-hms-to-list: Private ordinary functions
Function, production-ymd-to-list: Private ordinary functions
Function, timestamp-difference: Public ordinary functions
Function, timestamp-duration+: Public ordinary functions
Function, timestamp-duration-: Public ordinary functions

G
Generic Function, (setf day-of): Private generic functions
Generic Function, (setf nsec-of): Private generic functions
Generic Function, (setf sec-of): Private generic functions
Generic Function, day-of: Private generic functions
Generic Function, nsec-of: Private generic functions
Generic Function, sec-of: Private generic functions

H
human-readable-duration: Public ordinary functions

M
Macro, %defcomparator: Private macros
Macro, with-designated-stream: Private macros
make-duration-from-time-values: Private ordinary functions
Method, (setf day-of): Private generic functions
Method, (setf nsec-of): Private generic functions
Method, (setf sec-of): Private generic functions
Method, day-of: Private generic functions
Method, nsec-of: Private generic functions
Method, print-object: Public standalone methods
Method, sec-of: Private generic functions

N
nsec-of: Private generic functions
nsec-of: Private generic functions

P
parse-iso8601-duration: Public ordinary functions
pretty-seconds: Private ordinary functions
print-object: Public standalone methods
production-hms-to-list: Private ordinary functions
production-ymd-to-list: Private ordinary functions

S
sec-of: Private generic functions
sec-of: Private generic functions

T
timestamp-difference: Public ordinary functions
timestamp-duration+: Public ordinary functions
timestamp-duration-: Public ordinary functions

W
with-designated-stream: Private macros


A.4 Data types

Jump to:   C   D   F   I   L   P   S   T  
Index Entry  Section

C
Class, duration: Public classes

D
defcomparator.lisp: The local-time-duration/defcomparator․lisp file
duration: Public classes
duration.lisp: The local-time-duration/duration․lisp file

F
File, defcomparator.lisp: The local-time-duration/defcomparator․lisp file
File, duration.lisp: The local-time-duration/duration․lisp file
File, format.lisp: The local-time-duration/format․lisp file
File, iso8601.lisp: The local-time-duration/iso8601․lisp file
File, local-time-duration.asd: The local-time-duration/local-time-duration․asd file
File, package.lisp: The local-time-duration/package․lisp file
File, timestamp.lisp: The local-time-duration/timestamp․lisp file
format.lisp: The local-time-duration/format․lisp file

I
iso8601.lisp: The local-time-duration/iso8601․lisp file

L
local-time-duration: The local-time-duration system
local-time-duration: The local-time-duration package
local-time-duration-system: The local-time-duration-system package
local-time-duration.asd: The local-time-duration/local-time-duration․asd file

P
Package, local-time-duration: The local-time-duration package
Package, local-time-duration-system: The local-time-duration-system package
package.lisp: The local-time-duration/package․lisp file

S
System, local-time-duration: The local-time-duration system

T
timestamp.lisp: The local-time-duration/timestamp․lisp file