Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d13a377f14489811b3d4d10076588f3697ec7de7
Ticket: 2010909fffffffffffffffffffffffffffffffff
clock scan fails with %V
User & Date: ferrieux on 2008-07-07 17:30:38
Changes

  1. icomment:
    Logged In: YES 
    user_id=496139
    Originator: NO
    
    The idea is to think about format groups as constraints, hence each providing a (possibly large) *set* of solutions, instead of just a default value. Then the job of [clock scan] can be defined as returning *any* value within the intersection of all sets:
    
         "1993 4" / "%Y %V" --> any value on week 4 of 1993
    
    And again, picking a value in the intersection may be completely driven by the will of the implementor of [clock]. No value is worse than another in that respect !
    
    In the case of empty intersection (inconsistent fields like your example), it may use a predefined ordering of the constraints and return a value in the first nonempty intersection during relaxation:
    
          "7 juillet 2008 jeudi" / "%d %B %Y %A" -->
    
          predefined order of relaxation: %A..%d..%B..%Y
          first nonempty after relaxing: %A
          final intersection: %d,%B,%Y
    
    Tha above remark about "freedom of choice" means that
    
          [clock scan "2008-1" -format "%G-%u"]
    
    is free to return any monday of 2008. It currently returns the next Monday starting from today, which is a valid choice, just as would have been the first Monday of 2008. So I think your worries about The Right Thing are virtual...
    
    Do you have in mind a case breaking that compatibility principle ?
    
          
    
    
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"