Changeset 12806 in project


Ignore:
Timestamp:
12/09/08 21:47:49 (11 years ago)
Author:
Kon Lovett
Message:

Fix for parse posix. Doc update.

Location:
release/3/locale/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/3/locale/trunk/locale-components.scm

    r12794 r12806  
    4343(require-extension srfi-1)
    4444
    45 ;;;
     45;;; Association List Operations
    4646
    4747;;
     
    6565                al ) )
    6666
    67 ;;;
     67;;; Timezone Daylight Saving Time Rule
    6868
    6969;;
     
    125125        (cons (list m w d) o) )
    126126
     127;;; Timezone Components
     128
    127129;;
    128130;FIXME not a viable test
     
    161163                tz ) )
    162164
    163 ;;;
     165;;; Locale Components
    164166
    165167;;
  • release/3/locale/trunk/locale-eggdoc.scm

    r12791 r12806  
    4040                (documentation
    4141                        (p "locale is a set of routines supporting locale query operations. "
    42                         "The environment locale information is queried upon module load and the "
     42                        "The environment locale information is determined upon module load and the "
    4343                        "corresponding parameters are set.")
    44 
    45                         (p "NOTE: This is a work in progress. Currently only the Posix locale "
    46                         "information is supported. Plans are to support the native MacOS X and Windows locale "
    47                         "APIs. Changes to this API are almost certain.")
    4844
    4945      (subsection "Locale Components"
     
    5147        (p "The major data structure is the " (code "locale-components") " type, "
    5248        "portrayed as an extensible " (tt "key+value") " pairing. The " (tt "key") " "
    53         "is a (code "symbol") ". The " (tt "value") " is usually a " (code "string") ".")
     49        "is a " (code "symbol") ". The " (tt "value") " is usually a " (code "string") ".")
    5450
    5551        (p "A " (code "locale-components") " object will have more properties but the "
     
    6561          (describe BUILTIN "Information from system defaults.") )
    6662
    67         (p "The " (code "PLATFORM") " is queried for information first. Then the "
     63        (p "The " (code "PLATFORM") " source is used for information first. Then the "
    6864        (code "POSIX") " source is attempted. When all have failed the " (code "BUILTIN") " "
    6965        "source is used. The point being locale information will be available, but "
     
    9793
    9894                          (symbol-table "Timezone Component Properties"
    99           (describe std-name "The normal timezone name.")
    100           (describe std-offset "")
    101           (describe dst-name "The Daylight Saving Time timezone name")
    102           (describe dst-offset "")
    103           (describe dst-start "")
    104           (describe dst-end "") )
     95          (describe std-name "The Standard timezone name.")
     96          (describe std-offset "Seconds +/- UTC.")
     97          (describe dst-name "The Daylight Saving Time timezone name.")
     98          (describe dst-offset "Seconds +/- UTC.")
     99          (describe dst-start "The start of Daylight Saving Time; a timezone-dst-rule.")
     100          (describe dst-end "The end of Daylight Saving Time; a timezone-dst-rule.") )
    105101
    106102                                (group
    107103                                        (parameter "(current-timezone [VALUE])"
    108104                                                (p "The currently defined timezone. The specified " (tt "VALUE") " "
    109                                                 "is either a timezone string value, or #f, indicating no timezone. When "
     105                                                "is either a timezone string value, or " (code "#f") ", indicating no timezone. When "
    110106                                                "no timezone value is set the default timezone is UTC.") )
    111107
     
    126122                                                (tt "TIMEZONE-COMPONENTS") " object to " (tt "VALUE") ".") )
    127123
    128                                         (procedure "(timezone-dst-rule-julian-noleap? TIMEZONE-RULE)"
    129                                                 (p "Is the specified " (tt "TIMEZONE-RULE") " object actually a "
     124                                        (procedure "(timezone-dst-rule-julian-noleap? TIMEZONE-DST-RULE)"
     125                                                (p "Is the specified " (tt "TIMEZONE-DST-RULE") " object actually a "
    130126                                                "daylight saving time julian day without leap seconds object?") )
    131127
    132                                         (procedure "(timezone-dst-rule-julian-leap? TIMEZONE-RULE)"
    133                                                 (p "Is the specified " (tt "TIMEZONE-RULE") " object actually "
     128                                        (procedure "(timezone-dst-rule-julian-leap? TIMEZONE-DST-RULE)"
     129                                                (p "Is the specified " (tt "TIMEZONE-DST-RULE") " object actually "
    134130                                                "a daylight saving time julian day assuming leap seconds object?") )
    135131
    136                                         (procedure "(timezone-dst-rule-mwd? TIMEZONE-RULE)"
    137                                                 (p "Is the specified " (tt "TIMEZONE-RULE") " object actually "
    138                                                 "a daylight saving time month.week.day object?") )
    139 
    140                                         (procedure "(timezone-dst-rule-offset TIMEZONE-RULE)"
     132                                        (procedure "(timezone-dst-rule-mwd? TIMEZONE-DST-RULE)"
     133                                                (p "Is the specified " (tt "TIMEZONE-DST-RULE") " object actually "
     134                                                "a daylight saving time month+week+day object?") )
     135
     136                                        (procedure "(timezone-dst-rule-offset TIMEZONE-DST-RULE)"
    141137                                                (p "Returns the seconds within day offset component of the specified "
    142                                                 (tt "TIMEZONE-RULE") " object.") )
    143 
    144                                         (procedure "(timezone-dst-rule-julian TIMEZONE-RULE)"
     138                                                (tt "TIMEZONE-DST-RULE") " object.") )
     139
     140                                        (procedure "(timezone-dst-rule-julian TIMEZONE-DST-RULE)"
    145141                                                (p "Returns the julian day component of the specified "
    146                                                 (tt "TIMEZONE-RULE") " object.") )
    147 
    148                                         (procedure "(timezone-dst-rule-month TIMEZONE-RULE)"
     142                                                (tt "TIMEZONE-DST-RULE") " object.") )
     143
     144                                        (procedure "(timezone-dst-rule-month TIMEZONE-DST-RULE)"
    149145                                                (p "Returns the month of year component of the specified "
    150                                                 (tt "TIMEZONE-RULE") " object.") )
    151 
    152                                         (procedure "(timezone-dst-rule-week TIMEZONE-RULE)"
     146                                                (tt "TIMEZONE-DST-RULE") " object.") )
     147
     148                                        (procedure "(timezone-dst-rule-week TIMEZONE-DST-RULE)"
    153149                                                (p "Returns the week of month component of the specified "
    154                                                 (tt "TIMEZONE-RULE") " object.") )
    155 
    156                                         (procedure "(timezone-dst-rule-day TIMEZONE-RULE)"
     150                                                (tt "TIMEZONE-DST-RULE") " object.") )
     151
     152                                        (procedure "(timezone-dst-rule-day TIMEZONE-DST-RULE)"
    157153                                                (p "Returns the day of week component of the specified "
    158                                                 (tt "TIMEZONE-RULE") " object.") )
     154                                                (tt "TIMEZONE-DST-RULE") " object.") )
    159155
    160156                                        (procedure "(make-timezone-dst-rule-julian-leap JULIAN-DAY OFFSET)"
     
    169165                                        (procedure "(posix-timezone-value->timezone-components STRING [SOURCE \"POSIX\"])"
    170166                                                (p "Parses a POSIX timezone string specification, " (tt "STRING") ", and "
    171                                                 "returns the corresponding timezone-components object, or #f when a parse "
    172                                                 "error occurs. A #f or empty string value is mapped to the default timezone. The "
    173                                                 "optional " (tt "SOURCE") " indicates what locale system supplied the string.") )
     167                                                "returns the corresponding timezone-components object, or "
     168                                                (code "#f") " when a parse error occurs. A " (code "#f") " or empty string "
     169                                                "value is mapped to the default timezone. The optional " (tt "SOURCE") " "
     170                                                "indicates what locale system supplied the string.") )
    174171
    175172                                        (procedure "(posix-load-timezone)"
     
    190187                                  (describe script "RFC 3066bis name string.")
    191188                                  (describe region "ISO 3166-1 name string. Default \"US\".")
    192                                   (describe codeset "?")
    193                                   (describe modifier "?") )
     189                                  (describe codeset "The character code to character mapping system.")
     190                                  (describe modifier "The codeset subsection, if any.") )
    194191
    195192                                (group
    196193                                        (parameter "(current-locale [VALUE])"
    197194                                                (p "The currently defined locale. The specified " (tt "VALUE") " "
    198                                                 "is either a locale string value, or #f, indicating locale independence. "
    199                                                 "When no locale value is set the default locale is #f.") )
     195                                                "is either a locale string value, or " (code "#f") ", indicating locale independence. "
     196                                                "When no locale value is set the default locale is " (code "#f") ".") )
    200197
    201198                                        (procedure "(current-locale-components)"
     
    217214                                        (procedure "(posix-locale-value->locale-components STRING [SOURCE \"POSIX\"])"
    218215                                                (p "Parses a POSIX locale string specification, " (tt "STRING") ", and "
    219                                                 "returns the corresponding locale-components object, or #f when a parse "
    220                                                 "error occurs. A #f or empty string value is mapped to the default locale. The "
    221                                                 "optional " (tt "SOURCE") " indicates what locale system supplied the string.") )
     216                                                "returns the corresponding locale-components object, or " (code "#f") " "
     217                                                "when a parse error occurs. A " (code "#f") " or empty string value is "
     218                                                "mapped to the default locale. The optional " (tt "SOURCE") " indicates "
     219                                                "what locale system supplied the string.") )
    222220
    223221                                        (procedure "(posix-load-locale)"
    224                                                 (p "Initialize the current-locale from the LC_* or LANG environment variables. When "
    225                                                 "both the LC_ALL and LANG environment variables are not set the current-locale is #f, "
    226                                                 "even though some locale-categories may have values. LC_ALL or LANG should be "
    227                                                 "set if any locale categories are set.") )
     222                                                (p "Initialize the current-locale from the LC_* or LANG environment "
     223                                                "variables. When both the LC_ALL and LANG environment variables are not "
     224                                                "set the current-locale is " (code "#f") ", even though some locale-categories "
     225                                                "may have values. LC_ALL or LANG should be set if any locale categories are set.") )
    228226                                )
    229227                        )
     
    254252
    255253                                        (procedure "(locale-category-ref CATEGORY)"
    256                                                 (p "Returns the specified " (tt "CATEGORY") " locale-components object, or #f "
    257                                                 "if the category is not valued.") )
     254                                                (p "Returns the specified " (tt "CATEGORY") " locale-components object, or "
     255                                                (code "#f") " if the category is not valued.") )
    258256
    259257                                )
    260258                        )
    261259                )
     260
     261    (section "Issues"
     262
     263                        (p "NOTE: This is a work in progress. Currently only the Posix locale "
     264                        "information is supported. Plans are to support the native MacOS X and Windows locale "
     265                        "APIs. Changes to this API are almost certain.")
     266    )
    262267
    263268    #;(examples ,examples)
  • release/3/locale/trunk/locale-posix.scm

    r12794 r12806  
    2727  locale-categories locale-components locale-parameters)
    2828
     29;;;
     30
    2931;;
    3032
     
    6163                                [+defoff+ 3600])
    6264                (lambda (tz strtz)
    63                         (let ([str-idx 0]
    64             [str-len (string-length strtz)])
     65                        (let ([strtzpos 0]
     66            [strtzend (string-length strtz)])
    6567        (letrec (
    6668            [next-match
    6769              (lambda (re)
    68                 (and-let* ([m (string-match re strtz str-idx)])
    69                   (set! str-idx (+ str-idx (string-length (car m))))
     70                (and-let* ([m (string-match re strtz strtzpos)])
     71                  (set! strtzpos (+ strtzpos (string-length (car m))))
    7072                  m ) )]
    7173            [all-parsed
    72               (lambda () (= str-idx str-len))]
     74              (lambda () (= strtzpos strtzend))]
    7375            [fake-dst-rule
    7476              (lambda ()
     
    8486                        [else                     str])))]
    8587            [to-offset
    86               (lambda (g hms)
    87                 (let ([secs (+ (* (string->number (cadr hms)) 3600)
    88                                (* (to-num (caddr hms)) 60)
    89                                (to-num (cadddr hms)))])
    90                   (if (equal? g "-") (- secs) secs)))]
     88              (lambda (sgnstr hms-lst)
     89                (let ([secs (+ (* (string->number (car hms-lst)) 3600)
     90                               (* (to-num (cadr hms-lst)) 60)
     91                               (to-num (caddr hms-lst)))])
     92                  (if (equal? sgnstr "-") (- secs) secs)))]
    9193            [parse-nam+off
    9294              (lambda (namkey offkey)
     
    9496                           [o-m (next-match offset-re)])
    9597                  (set-timezone-component! tz namkey (cadr n-m))
    96                   (set-timezone-component! tz offkey (to-offset (cadr o-m) (cdr o-m)))
     98                  (set-timezone-component! tz offkey (to-offset (cadr o-m) (cddr o-m)))
    9799                  #t ) )]
    98100            [decode-dst-rule
    99               (lambda (g v o)
    100                 (let ([n1 (string->number (car v))])
    101                   (if (not g)
     101              (lambda (rulstr dat-lst off)
     102                (let ([n1 (string->number (car dat-lst))])
     103                  (if (not rulstr)
    102104                      ; Then assume Julian style rule
    103                       (make-timezone-dst-rule-julian-leap n1 o)
     105                      (make-timezone-dst-rule-julian-leap n1 off)
    104106                      ; Else select rule
    105                       (let ([rch (string-ref g 0)])
     107                      (let ([rch (string-ref rulstr 0)])
    106108                        (case rch
    107109                          [(#\J)  ; Julian
    108                             (make-timezone-dst-rule-julian-noleap n1 o)]
     110                            (make-timezone-dst-rule-julian-noleap n1 off)]
    109111                          [(#\M)  ; Date
    110                             (make-timezone-dst-rule-mwd n1 (to-num (cadr v)) (to-num (caddr v)) o)]
     112                            (make-timezone-dst-rule-mwd n1 (to-num (cadr dat-lst))
     113                                                           (to-num (caddr dat-lst)) off)]
    111114                          [else
    112                             (warning "unknown DST rule type" rch)
    113                             (make-timezone-dst-rule-julian-leap n1 o) ] ) ) ) ) ) ]
     115                            (warning "unknown DST rule type; assuming julian-leap" rch)
     116                            (make-timezone-dst-rule-julian-leap n1 off) ] ) ) ) ) ) ]
    114117            [parse-dst-rule
    115118              (lambda (key)
    116119                (and-let* ([d-m (next-match date-re)])
    117120                  (let* ([t-m (next-match time-re)]
    118                          [off (if t-m (to-offset #f t-m) +defoff+)])
    119                     (set-timezone-component! tz key (decode-dst-rule (cadr d-m) (cdr d-m) off))
     121                         [off (if t-m (to-offset #f (cdr t-m)) +defoff+)])
     122                    (set-timezone-component! tz key (decode-dst-rule (cadr d-m) (cddr d-m) off))
    120123                    #t)))] )
    121124          ; Walk the match set
  • release/3/locale/trunk/locale.html

    r12791 r12806  
    165165<div class="section">
    166166<h3>Documentation</h3>
    167 <p>locale is a set of routines supporting locale query operations. The environment locale information is queried upon module load and the corresponding parameters are set.</p>
    168 <p>NOTE: This is a work in progress. Currently only the Posix locale information is supported. Plans are to support the native MacOS X and Windows locale APIs. Changes to this API are almost certain.</p>
     167<p>locale is a set of routines supporting locale query operations. The environment locale information is determined upon module load and the corresponding parameters are set.</p>
     168<div class="subsection">
     169<h4>Locale Components</h4>
     170<p>The major data structure is the <code>locale-components</code> type, portrayed as an extensible <tt>key+value</tt> pairing. The <tt>key</tt> is a <code>symbol</code>. The <tt>value</tt> is usually a <code>string</code>.</p>
     171<p>A <code>locale-components</code> object will have more properties but the following are provided for every instance:</p><table class="symbol-table">Common Component Keys
     172<tr>
     173<td class="symbol">name</td>
     174<td>The composite information object, source specific.</td></tr>
     175<tr>
     176<td class="symbol">source</td>
     177<td>The origin for the information.</td></tr></table>
     178<p>The <code>source</code> property is one of the following (others are possible):</p><table class="symbol-table">Source Values
     179<tr>
     180<td class="symbol">PLATFORM</td>
     181<td>Information from the system.</td></tr>
     182<tr>
     183<td class="symbol">POSIX</td>
     184<td>Information from POSIX environment. The &quot;name&quot; is a string.</td></tr>
     185<tr>
     186<td class="symbol">BUILTIN</td>
     187<td>Information from system defaults.</td></tr></table>
     188<p>The <code>PLATFORM</code> source is used for information first. Then the <code>POSIX</code> source is attempted. When all have failed the <code>BUILTIN</code> source is used. The point being locale information will be available, but without an accuracy guarantee.</p>
     189<p>The <code>BUILTIN</code> source creates a POSIX-style string &quot;name&quot; constructed using constants and library procedures.</p></div>
     190<div class="subsection">
     191<h4>Generic Locale Components Property Access</h4>
     192<dt class="definition"><strong>procedure:</strong> (locale-components? OBJECT)</dt>
     193<dd>
     194<p>Is the <tt>OBJECT</tt> a <code>locale-compenents</code> object?</p></dd>
     195<dt class="definition"><strong>procedure:</strong> (locale-component-ref LOCALE-COMPONENTS KEY [DEFAULT #f])</dt>
     196<dd>
     197<p>Returns the <tt>KEY</tt> property of <tt>LOCALE-COMPONENTS</tt> or the <tt>DEFAULT</tt> when not found.</p></dd>
     198<dt class="definition"><strong>procedure:</strong> (set-locale-component! LOCALE-COMPONENTS KEY VALUE)</dt>
     199<dd>
     200<p>Updates or creates the <tt>KEY</tt> property of <tt>LOCALE-COMPONENTS</tt> with the <tt>VALUE</tt>.</p></dd></div>
    169201<div class="subsection">
    170202<h4>Timezone</h4>
    171 <p>Access to local timezone information. A timezone object is composed of a Standard Time Name and Offset, and an optional Summer or Daylight Saving Time Name and Offset. The offset is seconds west (positive) or east (negative) of UTC. The name is some locally accepted timezone name, such as PST. A Daylight Saving Time start rule and end rule are optional components.</p><table class="symbol-table">Timezone Component Selectors:
     203<p>Access to timezone information. A timezone object is a <code>locale-components</code> object with properties for Standard Time Name and Offset, and an optional Summer or Daylight Saving Time Name and Offset. The offset is seconds west (positive) or east (negative) of UTC. The name is some locally accepted timezone name, such as &quot;PST&quot;. A Daylight Saving Time start rule and end rule are optional properties.</p><table class="symbol-table">Timezone Component Properties
    172204<tr>
    173205<td class="symbol">std-name</td>
    174 <td></td></tr>
     206<td>The Standard timezone name.</td></tr>
    175207<tr>
    176208<td class="symbol">std-offset</td>
    177 <td></td></tr>
     209<td>Seconds +/- UTC.</td></tr>
    178210<tr>
    179211<td class="symbol">dst-name</td>
    180 <td></td></tr>
     212<td>The Daylight Saving Time timezone name.</td></tr>
    181213<tr>
    182214<td class="symbol">dst-offset</td>
    183 <td></td></tr>
     215<td>Seconds +/- UTC.</td></tr>
    184216<tr>
    185217<td class="symbol">dst-start</td>
    186 <td></td></tr>
     218<td>The start of Daylight Saving Time; a timezone-dst-rule.</td></tr>
    187219<tr>
    188220<td class="symbol">dst-end</td>
    189 <td></td></tr></table>
     221<td>The end of Daylight Saving Time; a timezone-dst-rule.</td></tr></table>
    190222<dl>
    191223<dt class="definition"><strong>parameter:</strong> (current-timezone [VALUE])</dt>
    192224<dd>
    193 <p>The currently defined timezone. The specified <tt>VALUE</tt> is either a timezone string value, or #f, indicating no timezone. When no timezone value is set the default timezone is UTC.</p></dd>
     225<p>The currently defined timezone. The specified <tt>VALUE</tt> is either a timezone string value, or <code>#f</code>, indicating no timezone. When no timezone value is set the default timezone is UTC.</p></dd>
    194226<dt class="definition"><strong>procedure:</strong> (current-timezone-components)</dt>
    195227<dd>
     
    198230<dd>
    199231<p>Is the specified <tt>TIMEZONE-COMPONENTS</tt> object actually a timezone-components object?</p></dd>
    200 <dt class="definition"><strong>procedure:</strong> (timezone-component-ref TIMEZONE-COMPONENTS SELECTOR [DEFAULT #f])</dt>
    201 <dd>
    202 <p>Returns the timezone-component <tt>SELECTOR</tt> of the <tt>TIMEZONE-COMPONENTS</tt> object, or the <tt>DEFAULT</tt> for a missing component.</p></dd>
    203 <dt class="definition"><strong>procedure:</strong> (set-timezone-component! TIMEZONE-COMPONENTS SELECTOR VALUE)</dt>
    204 <dd>
    205 <p>Sets the timezone-component <tt>SELECTOR</tt> of the <tt>TIMEZONE-COMPONENTS</tt> object to <tt>VALUE</tt>.</p></dd>
    206 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-julian-noleap? TIMEZONE-RULE)</dt>
    207 <dd>
    208 <p>Is the specified <tt>TIMEZONE-RULE</tt> object actually a daylight saving time julian day without leap seconds object?</p></dd>
    209 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-julian-leap? TIMEZONE-RULE)</dt>
    210 <dd>
    211 <p>Is the specified <tt>TIMEZONE-RULE</tt> object actually a daylight saving time julian day assuming leap seconds object?</p></dd>
    212 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-mwd? TIMEZONE-RULE)</dt>
    213 <dd>
    214 <p>Is the specified <tt>TIMEZONE-RULE</tt> object actually a daylight saving time month.week.day object?</p></dd>
    215 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-offset TIMEZONE-RULE)</dt>
    216 <dd>
    217 <p>Returns the seconds within day offset component of the specified <tt>TIMEZONE-RULE</tt> object.</p></dd>
    218 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-julian TIMEZONE-RULE)</dt>
    219 <dd>
    220 <p>Returns the julian day component of the specified <tt>TIMEZONE-RULE</tt> object.</p></dd>
    221 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-month TIMEZONE-RULE)</dt>
    222 <dd>
    223 <p>Returns the month of year component of the specified <tt>TIMEZONE-RULE</tt> object.</p></dd>
    224 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-week TIMEZONE-RULE)</dt>
    225 <dd>
    226 <p>Returns the week of month component of the specified <tt>TIMEZONE-RULE</tt> object.</p></dd>
    227 <dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-day TIMEZONE-RULE)</dt>
    228 <dd>
    229 <p>Returns the day of week component of the specified <tt>TIMEZONE-RULE</tt> object.</p></dd>
     232<dt class="definition"><strong>procedure:</strong> (timezone-component-ref TIMEZONE-COMPONENTS KEY [DEFAULT #f])</dt>
     233<dd>
     234<p>Returns the timezone-component <tt>KEY</tt> of the <tt>TIMEZONE-COMPONENTS</tt> object, or the <tt>DEFAULT</tt> for a missing component.</p></dd>
     235<dt class="definition"><strong>procedure:</strong> (set-timezone-component! TIMEZONE-COMPONENTS KEY VALUE)</dt>
     236<dd>
     237<p>Sets the timezone-component <tt>KEY</tt> of the <tt>TIMEZONE-COMPONENTS</tt> object to <tt>VALUE</tt>.</p></dd>
     238<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-julian-noleap? TIMEZONE-DST-RULE)</dt>
     239<dd>
     240<p>Is the specified <tt>TIMEZONE-DST-RULE</tt> object actually a daylight saving time julian day without leap seconds object?</p></dd>
     241<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-julian-leap? TIMEZONE-DST-RULE)</dt>
     242<dd>
     243<p>Is the specified <tt>TIMEZONE-DST-RULE</tt> object actually a daylight saving time julian day assuming leap seconds object?</p></dd>
     244<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-mwd? TIMEZONE-DST-RULE)</dt>
     245<dd>
     246<p>Is the specified <tt>TIMEZONE-DST-RULE</tt> object actually a daylight saving time month+week+day object?</p></dd>
     247<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-offset TIMEZONE-DST-RULE)</dt>
     248<dd>
     249<p>Returns the seconds within day offset component of the specified <tt>TIMEZONE-DST-RULE</tt> object.</p></dd>
     250<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-julian TIMEZONE-DST-RULE)</dt>
     251<dd>
     252<p>Returns the julian day component of the specified <tt>TIMEZONE-DST-RULE</tt> object.</p></dd>
     253<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-month TIMEZONE-DST-RULE)</dt>
     254<dd>
     255<p>Returns the month of year component of the specified <tt>TIMEZONE-DST-RULE</tt> object.</p></dd>
     256<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-week TIMEZONE-DST-RULE)</dt>
     257<dd>
     258<p>Returns the week of month component of the specified <tt>TIMEZONE-DST-RULE</tt> object.</p></dd>
     259<dt class="definition"><strong>procedure:</strong> (timezone-dst-rule-day TIMEZONE-DST-RULE)</dt>
     260<dd>
     261<p>Returns the day of week component of the specified <tt>TIMEZONE-DST-RULE</tt> object.</p></dd>
    230262<dt class="definition"><strong>procedure:</strong> (make-timezone-dst-rule-julian-leap JULIAN-DAY OFFSET)</dt>
    231263<dd>
     
    239271<dt class="definition"><strong>procedure:</strong> (posix-timezone-value-&gt;timezone-components STRING [SOURCE &quot;POSIX&quot;])</dt>
    240272<dd>
    241 <p>Parses a POSIX timezone string specification, <tt>STRING</tt>, and returns the corresponding timezone-components object, or #f when a parse error occurs. A #f or empty string value is mapped to the default timezone. The optional <tt>SOURCE</tt> indicates what locale system supplied the string.</p></dd>
     273<p>Parses a POSIX timezone string specification, <tt>STRING</tt>, and returns the corresponding timezone-components object, or <code>#f</code> when a parse error occurs. A <code>#f</code> or empty string value is mapped to the default timezone. The optional <tt>SOURCE</tt> indicates what locale system supplied the string.</p></dd>
    242274<dt class="definition"><strong>procedure:</strong> (posix-load-timezone)</dt>
    243275<dd>
     
    245277<div class="subsection">
    246278<h4>Locale</h4>
    247 <p>Access to locale information. A locale object is composed of a Language, an optional Script, an optional Region, an optional Codeset, and an optional Modifier. The language should be an ISO 639-1 or ISO 639-2 name. The Script should be a RFC 3066bis name. The region should be an ISO 3166-1 name. The codeset and modifier forms are locale dependent.</p>
    248 <p>Locale component selectors are 'language, 'script, 'region, 'codeset, and 'modifier.</p>
    249 <p>The default language is <code>EN</code>. The default region is <code>US</code>.</p>
     279<p>Access to locale information. A locale object is composed of a Language, an optional Script, an optional Region, an optional Codeset, and an optional Modifier. The language should be an ISO 639-1 or ISO 639-2 name. The Script should be a RFC 3066bis name. The region should be an ISO 3166-1 name. The codeset and modifier forms are locale dependent.</p><table class="symbol-table">Locale Properties
     280<tr>
     281<td class="symbol">language</td>
     282<td>ISO 639-1 or ISO 639-2 name string. Default &quot;en&quot;.</td></tr>
     283<tr>
     284<td class="symbol">script</td>
     285<td>RFC 3066bis name string.</td></tr>
     286<tr>
     287<td class="symbol">region</td>
     288<td>ISO 3166-1 name string. Default &quot;US&quot;.</td></tr>
     289<tr>
     290<td class="symbol">codeset</td>
     291<td>The character code to character mapping system.</td></tr>
     292<tr>
     293<td class="symbol">modifier</td>
     294<td>The codeset subsection, if any.</td></tr></table>
    250295<dl>
    251296<dt class="definition"><strong>parameter:</strong> (current-locale [VALUE])</dt>
    252297<dd>
    253 <p>The currently defined locale. The specified <tt>VALUE</tt> is either a locale string value, or #f, indicating locale independence. When no locale value is set the default locale is #f.</p></dd>
     298<p>The currently defined locale. The specified <tt>VALUE</tt> is either a locale string value, or <code>#f</code>, indicating locale independence. When no locale value is set the default locale is <code>#f</code>.</p></dd>
    254299<dt class="definition"><strong>procedure:</strong> (current-locale-components)</dt>
    255300<dd>
     
    258303<dd>
    259304<p>Is the specified <tt>LOCALE-COMPONENTS</tt> object actually a locale-components object?</p></dd>
    260 <dt class="definition"><strong>procedure:</strong> (locale-component-ref LOCALE-COMPONENTS SELECTOR [DEFAULT #f])</dt>
    261 <dd>
    262 <p>Returns the locale-component <tt>SELECTOR</tt> of the <tt>LOCALE-COMPONENTS</tt> object, or the <tt>DEFAULT</tt> for a missing component.</p></dd>
    263 <dt class="definition"><strong>procedure:</strong> (set-locale-component! LOCALE-COMPONENTS SELECTOR VALUE)</dt>
    264 <dd>
    265 <p>Sets the locale-component <tt>SELECTOR</tt> of the <tt>LOCALE-COMPONENTS</tt> object to <tt>VALUE</tt>.</p></dd>
     305<dt class="definition"><strong>procedure:</strong> (locale-component-ref LOCALE-COMPONENTS KEY [DEFAULT #f])</dt>
     306<dd>
     307<p>Returns the locale-component <tt>KEY</tt> of the <tt>LOCALE-COMPONENTS</tt> object, or the <tt>DEFAULT</tt> for a missing component.</p></dd>
     308<dt class="definition"><strong>procedure:</strong> (set-locale-component! LOCALE-COMPONENTS KEY VALUE)</dt>
     309<dd>
     310<p>Sets the locale-component <tt>KEY</tt> of the <tt>LOCALE-COMPONENTS</tt> object to <tt>VALUE</tt>.</p></dd>
    266311<dt class="definition"><strong>procedure:</strong> (posix-locale-value-&gt;locale-components STRING [SOURCE &quot;POSIX&quot;])</dt>
    267312<dd>
    268 <p>Parses a POSIX locale string specification, <tt>STRING</tt>, and returns the corresponding locale-components object, or #f when a parse error occurs. A #f or empty string value is mapped to the default locale. The optional <tt>SOURCE</tt> indicates what locale system supplied the string.</p></dd>
     313<p>Parses a POSIX locale string specification, <tt>STRING</tt>, and returns the corresponding locale-components object, or <code>#f</code> when a parse error occurs. A <code>#f</code> or empty string value is mapped to the default locale. The optional <tt>SOURCE</tt> indicates what locale system supplied the string.</p></dd>
    269314<dt class="definition"><strong>procedure:</strong> (posix-load-locale)</dt>
    270315<dd>
    271 <p>Initialize the current-locale from the LC_* or LANG environment variables. When both the LC_ALL and LANG environment variables are not set the current-locale is #f, even though some locale-categories may have values. LC_ALL or LANG should be set if any locale categories are set.</p></dd></dl></div>
     316<p>Initialize the current-locale from the LC_* or LANG environment variables. When both the LC_ALL and LANG environment variables are not set the current-locale is <code>#f</code>, even though some locale-categories may have values. LC_ALL or LANG should be set if any locale categories are set.</p></dd></dl></div>
    272317<div class="subsection">
    273318<h4>Locale Category</h4>
    274 <p>Access to the locale information by category.</p><table class="symbol-table">Locale Category Selectors
     319<p>Access to the locale information by category.</p><table class="symbol-table">Locale Category Keys
    275320<tr>
    276321<td class="symbol">ADDRESS</td>
     
    318363<dt class="definition"><strong>procedure:</strong> (locale-category-ref CATEGORY)</dt>
    319364<dd>
    320 <p>Returns the specified <tt>CATEGORY</tt> locale-components object, or #f if the category is not valued.</p></dd></dl></div></div>
     365<p>Returns the specified <tt>CATEGORY</tt> locale-components object, or <code>#f</code> if the category is not valued.</p></dd></dl></div></div>
     366<div class="section">
     367<h3>Issues</h3>
     368<p>NOTE: This is a work in progress. Currently only the Posix locale information is supported. Plans are to support the native MacOS X and Windows locale APIs. Changes to this API are almost certain.</p></div>
    321369<div class="section">
    322370<h3>Version</h3>
Note: See TracChangeset for help on using the changeset viewer.