Changeset 35432 in project


Ignore:
Timestamp:
04/22/18 18:55:49 (4 months ago)
Author:
kon
Message:

rel 0.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/locale

    r35415 r35432  
    1010
    1111{{locale}} is a set of routines supporting locale query operations. The
    12 environment locale information is determined upon module load and the
    13 corresponding parameters are set.
     12environment locale information is determined lazily.
    1413
    1514{{locale}} does not interact with the C library routines {{setlocale}} or
    1615{{tzset}}, except for the {{with-tzset}} routine (see below).
    1716
    18 {{locale}} does not provide a localized message service, see [[srfi-29|SRFI 29]].
    19 
    20 {{locale}} does not provide a localized time service, see [[srfi-19|SRFI 19]].
    21 
    22 {{locale}} does not provide a localized collating service.
     17{{locale}} does not provide a:
     18
     19* localized message service, see [[srfi-29|SRFI 29]].
     20* localized time service, see [[srfi-19|SRFI 19]].
     21* a localized collating service.
    2322
    2423{{locale}} does not provide much of anything beyond locale identification.
     
    6564==== make-locale-components
    6665
    67 <procedure>(make-locale-components NAME [SOURCE #f [TAG 'locale]]) => locale-components</procedure>
     66<procedure>(make-locale-components NAME [SOURCE #f [TAG 'locale]]) -> locale-components</procedure>
    6867
    6968Returns a new {{locale-components}} object.
     
    7170==== locale-components?
    7271
    73 <procedure>(locale-components? OBJECT) => boolean</procedure>
     72<procedure>(locale-components? OBJECT) -> boolean</procedure>
    7473
    7574Is the {{OBJECT}} a {{locale-components}} object?
     
    8382==== check-locale-components
    8483
    85 <procedure>(check-locale-components LOCATION OBJECT [ARGUMENT-NAME]) => locale-components</procedure>
     84<procedure>(check-locale-components LOCATION OBJECT [ARGUMENT-NAME]) -> locale-components</procedure>
    8685
    8786Raise a type-error unless the {{OBJECT}} is a valid locale-components.
     
    8988==== locale-components-exists?
    9089
    91 <procedure>(locale-components-exists? LOCALE-COMPONENTS KEY) => boolean</procedure>
     90<procedure>(locale-components-exists? LOCALE-COMPONENTS KEY) -> boolean</procedure>
    9291
    9392Does the specified {{LOCALE-COMPONENTS}} have a value for {{KEY}}?
     
    9594==== locale-component-ref
    9695
    97 <procedure>(locale-component-ref LOCALE-COMPONENTS KEY [DEFAULT #f]) => object</procedure>
     96<procedure>(locale-component-ref LOCALE-COMPONENTS KEY [DEFAULT #f]) -> object</procedure>
    9897
    9998Returns the {{KEY}} property of {{LOCALE-COMPONENTS}} or the {{DEFAULT}} when
     
    109108==== update-locale-components!
    110109
    111 <procedure>(update-locale-components! LOCALE-COMPONENTS KEY VALUE ...) => locale-components</procedure>
     110<procedure>(update-locale-components! LOCALE-COMPONENTS KEY VALUE ...) -> locale-components</procedure>
    112111
    113112Updates in place the {{LOCALE-COMPONENTS}} with the specified {{KEY+VALUE}} pairs.
     
    139138==== current-locale
    140139
    141 <procedure>(current-locale) => string</procedure>
     140<procedure>(current-locale) -> string</procedure>
    142141<procedure>(current-locale VALUE)</procedure>
    143142
     
    151150==== current-locale-component
    152151
    153 <procedure>(current-locale-components) => locale-components</procedure>
     152<procedure>(current-locale-components) -> locale-components</procedure>
    154153
    155154Returns the {{locale-components}} object corresponding to the current-locale.
     
    157156==== posix-locale-string->locale-components
    158157
    159 <procedure>(posix-locale-string->locale-components STRING [SOURCE "POSIX" [TAG 'locale]]) => locale-components</procedure>
     158<procedure>(posix-locale-string->locale-components STRING [SOURCE "POSIX" [TAG 'locale]]) -> locale-components</procedure>
    160159
    161160Parses a POSIX locale string specification, {{STRING}}, and returns the
     
    195194==== current-timezone
    196195
    197 <procedure>(current-timezone) => string</procedure>
     196<procedure>(current-timezone) -> string</procedure>
    198197<procedure>(current-timezone VALUE)</procedure>
    199198
     
    207206==== current-timezone-component
    208207
    209 <procedure>(current-timezone-components) => timezone-components</procedure>
     208<procedure>(current-timezone-components) -> timezone-components</procedure>
    210209
    211210Returns the timezone-components object corresponding to the current-timezone.
     
    213212==== posix-timezone-string->timezone-components
    214213
    215 <procedure>(posix-timezone-string->timezone-components STRING [SOURCE "POSIX"]) => timezone-components</procedure>
     214<procedure>(posix-timezone-string->timezone-components STRING [SOURCE "POSIX"]) -> timezone-components</procedure>
    216215
    217216Parses a POSIX timezone string specification, {{STRING}}, and returns the
     
    233232==== make-timezone-components
    234233
    235 <procedure>(make-timezone-components NAME [SOURCE #f]) => timezone-components</procedure>
     234<procedure>(make-timezone-components NAME [SOURCE #f]) -> timezone-components</procedure>
    236235
    237236Returns a new {{timezone-components}} object.
     
    239238==== timezone-components?
    240239
    241 <procedure>(timezone-components? OBJECT) => boolean</procedure>
     240<procedure>(timezone-components? OBJECT) -> boolean</procedure>
    242241
    243242Is the specified {{OBJECT}} actually a timezone-components object?
     
    253252==== check-timezone-components
    254253
    255 <procedure>(check-timezone-components LOCATION OBJECT [ARGUMENT-NAME]) => timezone-components</procedure>
     254<procedure>(check-timezone-components LOCATION OBJECT [ARGUMENT-NAME]) -> timezone-components</procedure>
    256255
    257256Raise a type-error unless the {{OBJECT}} is a valid timezone-components.
     
    259258==== timezone-components-exists?
    260259
    261 <procedure>(timezone-components-exists? TIMEZONE-COMPONENTS KEY) => boolean</procedure>
     260<procedure>(timezone-components-exists? TIMEZONE-COMPONENTS KEY) -> boolean</procedure>
    262261
    263262Does the specified {{TIMEZONE-COMPONENTS}} have a value for {{KEY}}?
     
    279278==== update-timezone-components!
    280279
    281 <procedure>(update-timezone-components! TIMEZONE-COMPONENTS KEY VALUE ...) => timezone-components</procedure>
     280<procedure>(update-timezone-components! TIMEZONE-COMPONENTS KEY VALUE ...) -> timezone-components</procedure>
    282281
    283282Updates in place the {{TIMEZONE-COMPONENTS}} with the specified {{KEY+VALUE}} pairs.
     
    285284==== timezone-dst-rule-julian-noleap?
    286285
    287 <procedure>(timezone-dst-rule-julian-noleap? OBJECT) => boolean</procedure>
     286<procedure>(timezone-dst-rule-julian-noleap? OBJECT) -> boolean</procedure>
    288287
    289288Is the specified {{OBJECT}} actually a daylight saving time julian day without
     
    292291==== timezone-dst-rule-julian-leap?
    293292
    294 <procedure>(timezone-dst-rule-julian-leap? OBJECT) => boolean</procedure>
     293<procedure>(timezone-dst-rule-julian-leap? OBJECT) -> boolean</procedure>
    295294
    296295Is the specified {{OBJECT}} actually a daylight saving time julian day assuming
     
    299298==== timezone-dst-rule-mwd?
    300299
    301 <procedure>(timezone-dst-rule-mwd? OBJECT) => boolean</procedure>
     300<procedure>(timezone-dst-rule-mwd? OBJECT) -> boolean</procedure>
    302301
    303302Is the specified {{OBJECT}} actually a daylight saving time month+week+day
     
    306305==== timezone-dst-rule-offset
    307306
    308 <procedure>(timezone-dst-rule-offset TIMEZONE-DST-RULE) => INTEGER</procedure>
     307<procedure>(timezone-dst-rule-offset TIMEZONE-DST-RULE) -> INTEGER</procedure>
    309308
    310309Returns the seconds within day offset component of the specified
     
    313312==== timezone-dst-rule-julian
    314313
    315 <procedure>(timezone-dst-rule-julian TIMEZONE-DST-RULE) => INTEGER</procedure>
     314<procedure>(timezone-dst-rule-julian TIMEZONE-DST-RULE) -> INTEGER</procedure>
    316315
    317316Returns the julian day component of the specified {{TIMEZONE-DST-RULE}} object.
     
    319318==== timezone-dst-rule-month
    320319
    321 <procedure>(timezone-dst-rule-month TIMEZONE-DST-RULE) => INTEGER</procedure>
     320<procedure>(timezone-dst-rule-month TIMEZONE-DST-RULE) -> INTEGER</procedure>
    322321
    323322Returns the month of year component of the specified {{TIMEZONE-DST-RULE}}
     
    326325==== timezone-dst-rule-week
    327326
    328 <procedure>(timezone-dst-rule-week TIMEZONE-DST-RULE) => INTEGER</procedure>
     327<procedure>(timezone-dst-rule-week TIMEZONE-DST-RULE) -> INTEGER</procedure>
    329328
    330329Returns the week of month component of the specified {{TIMEZONE-DST-RULE}}
     
    333332==== timezone-dst-rule-day
    334333
    335 <procedure>(timezone-dst-rule-day TIMEZONE-DST-RULE) => INTEGER</procedure>
     334<procedure>(timezone-dst-rule-day TIMEZONE-DST-RULE) -> INTEGER</procedure>
    336335
    337336Returns the day of week component of the specified {{TIMEZONE-DST-RULE}}
     
    340339==== make-timezone-dst-rule-julian-leap
    341340
    342 <procedure>(make-timezone-dst-rule-julian-leap JULIAN-DAY OFFSET) => TIMEZONE-DST-RULE</procedure>
     341<procedure>(make-timezone-dst-rule-julian-leap JULIAN-DAY OFFSET) -> TIMEZONE-DST-RULE</procedure>
    343342
    344343Returns a daylight saving time julian day assuming leap seconds rule object.
     
    346345==== make-timezone-dst-rule-julian-noleap
    347346
    348 <procedure>(make-timezone-dst-rule-julian-noleap JULIAN-DAY OFFSET) => TIMEZONE-DST-RULE</procedure>
     347<procedure>(make-timezone-dst-rule-julian-noleap JULIAN-DAY OFFSET) -> TIMEZONE-DST-RULE</procedure>
    349348
    350349Returns a daylight saving time julian day without leap seconds rule object.
     
    352351==== make-timezone-dst-rule-mwd
    353352
    354 <procedure>(make-timezone-dst-rule-mwd MONTH WEEK DAY OFFSET) => TIMEZONE-DST-RULE</procedure>
     353<procedure>(make-timezone-dst-rule-mwd MONTH WEEK DAY OFFSET) -> TIMEZONE-DST-RULE</procedure>
    355354
    356355Returns a daylight saving time month.week.day rule object.
     
    358357==== local-timezone-name
    359358
    360 <procedure>(local-timezone-name TV | YEAR MONTH DAY [HOUR 12 [MINUTE 0 [SECOND 0]]]) => string</procedure>
     359<procedure>(local-timezone-name TV | YEAR MONTH DAY [HOUR 12 [MINUTE 0 [SECOND 0]]]) -> string</procedure>
    361360
    362361Returns the timezone for the given date as a string, (e.g. "EST").
     
    376375==== local-timezone-offset
    377376
    378 <procedure>(local-timezone-offset TV | YEAR MONTH DAY [HOUR 12 [MINUTE 0 [SECOND 0]]]) => integer</procedure>
     377<procedure>(local-timezone-offset TV | YEAR MONTH DAY [HOUR 12 [MINUTE 0 [SECOND 0]]]) -> integer</procedure>
    379378
    380379Returns the timezone offset as seconds where positive is east of UTC & negative
     
    383382==== local-timezone-name+offset
    384383
    385 <procedure>(local-timezone-name+offset TV | YEAR MONTH DAY [HOUR 12 [MINUTE 0 [SECOND 0]]]) => (integer string)</procedure>
     384<procedure>(local-timezone-name+offset TV | YEAR MONTH DAY [HOUR 12 [MINUTE 0 [SECOND 0]]]) -> (integer string)</procedure>
    386385
    387386Returns the timezone offset as seconds where positive is east of UTC & negative
     
    390389==== with-tzset
    391390
    392 <procedure>(with-tzset TZ THUNK) => object</procedure>
     391<procedure>(with-tzset TZ THUNK) -> object</procedure>
    393392
    394393Invoke {{THUNK}} with the TZ environment variable bound to the string {{TZ}}.
     
    398397==== timezone-offset?
    399398
    400 <procedure>(timezone-offset? OBJECT) => boolean</procedure>
     399<procedure>(timezone-offset? OBJECT) -> boolean</procedure>
    401400
    402401Is the {{OBJECT}} a valid timezone offset in +/- seconds.
     
    439438==== locale-category-ref
    440439
    441 <procedure>(locale-category-ref CATEGORY [DEFAULT #f])</procedure>
     440<procedure>(locale-category-ref CATEGORY [DEFAULT #f]) -> locale-components</procedure>
    442441
    443442Returns the specified {{CATEGORY}} locale-components object, or {{#f}}
     
    455454==== current-locale-dictionary
    456455
    457 <parameter>(current-locale-dictionary) => LOCALE-CATEGORIES</parameter>
     456<parameter>(current-locale-dictionary) -> locale-categories</parameter>
    458457<parameter>(current-locale-dictionary LOCALE-CATEGORIES)</parameter>
    459458
    460 Gets and sets the current {{locale-categories}} object.
     459Gets and sets the current {{LOCALE-CATEGORIES}} object.
    461460
    462461==== make-locale-dictionary
    463462
    464 <procedure>(make-locale-dictionary) => LOCALE-CATEGORIES</procedure>
     463<procedure>(make-locale-dictionary) -> locale-categories</procedure>
    465464
    466465Returns a new {{locale-categories}} object.
     
    468467==== locale-dictionary?
    469468
    470 <procedure>(locale-dictionary? OBJECT) => boolean</procedure>
     469<procedure>(locale-dictionary? OBJECT) -> boolean</procedure>
    471470
    472471Is the specified {{OBJECT}} a {{locale-categories}} object?
     
    474473==== locale-dictionary-category
    475474
    476 <procedure>(locale-dictionary-category LOCALE-CATEGORIES KEY [DEFAULT #f]) => object</procedure>
     475<procedure>(locale-dictionary-category LOCALE-CATEGORIES KEY [DEFAULT #f]) -> object</procedure>
    477476
    478477Returns the value for {{KEY}} in the {{LOCALE-CATEGORIES}}.
     
    492491</enscript>
    493492
     493
    494494== Notes
    495495
    496 * This is a work in progress. Currently only the Posix locale information is
    497 supported. Created to support the {{srfi-19}} and {{srfi-29}} extensions.
     496* Currently only, some, Posix locale information is supported.
    498497
    499498* {{locale-setup}} is performed at first use by the {{locale-current}} module.
     499
    500500
    501501== Requirements
     
    506506[[regex]]
    507507
     508[[setup-helper]]
     509
     510
    508511== Bugs and Limitations
    509512
    510 * As stated above no collation, normalization, formatting, or any other locale specific
    511 operation one might expect to find in a component named ''locale''.
     513* As stated above no collation, normalization, formatting, or any other locale
     514specific operation one might expect to find in a component named ''locale''.
     515
     516* Incomplete Posix support.
     517
     518* No Native support.
     519
    512520
    513521== Author
     
    515523[[/users/kon-lovett|Kon Lovett]]
    516524
     525
    517526== Version history
    518527
     528; 0.7.2 : Add Posix TZ offset name support for std time (not dst).
    519529; 0.7.1 : TLS {{locale-setup}}.
    520530; 0.7.0 : Delay {{locale-setup}}.
     
    533543; 0.6.0 : Initial Chicken 4 release
    534544
     545
    535546== License
    536547
Note: See TracChangeset for help on using the changeset viewer.