Remaster

Remaster is a language-independent library design framework. It enables language designers to reuse a good design decision for the standard library, and provides a metadata for language bindings. It is not an initiative to replace the existing standard library, nor make the common standard library (what CLI and JVM has done).

This document is very early draft and subject to change.

set weekday

A set of weekdays.

item monday or mon = 0: int

Monday.

item tuesday or tue = 1: int

Tuesday.

item wednesday or wed = 2: int

Wednesday.

item thursday or thu = 3: int

Thursday.

item friday or fri = 4: int

Friday.

item saturday or sat = 5: int

Saturday.

item sunday or sun = 6: int

Sunday.

value date

Represents a single date in the Gregorian calendar. For the dates before the Gregorian calendar exists it uses the extended version of Gregorian calendar. For the conversion between Gregorian calendar with other calendar systems see julian date.

getter [get] min date(): date

Returns the minimum possible date value.

getter [get] max date(): date

Returns the maximum possible date value.

function [is] leap year(year: int): bool

Returns true when given year is a leap year, in the Gregorian calendar.

constructor [make] date [from date](year: int, month: int, day: int): date or error
is shared.

Creates a new date value from given year, month and day of the month.

constructor [make] date [from week date](week: ISO week, dow or day: weekday): date or error
is shared.

Creates a new date value from given ISO week and day of the week.

constructor [make] date [from ordinal date](year: int, doy or day: int): date or error
is shared.

Creates a new date value from given year and day of the year.

getter [get] year(self: date): int

Returns the year.

getter [get] month(self: date): int

Returns the month.

getter [get] day(self: date): int

Returns the day of the month.

getter [get] ISO week(self: date): ISO week

Returns the ISO week that contains given date.

getter [get] weekday(self: date): weekday

Returns the day of the week.

getter [get] day of year(self: date): int

Returns the day of the year.

operator [to string](self: date): string

Returns the string representation, or more explicitly, ISO 8601 date representation (YYYY-MM-DD) of given date.

operator [difference](self: date, other: date): duration
is shared.

Returns the difference between two dates.

operator [difference] [in days](self: date, other: date): int
is shared.

Returns the difference between two dates, in days.

method [increase](self: date): date or error

Increases given date by one day.

method [decrease](self: date): date or error

Decreases given date by one day.


ikiwiki를 씁니다.
마지막 수정