Show
Ignore:
Timestamp:
11/03/06 05:30:51 (2 years ago)
Author:
allbery_b
svk:copy_cache_prev:
41990
Message:

AUTHORS: hello, world\n :)
src/Pugs/Compat.hs: added file time tests
src/Pugs/Internals.hs, src/Pugs/Prim.hs: abstract out guts of "time" for

use in $*BASETIME and file tests

src/Pugs/Run.hs: add $*BASETIME
src/Pugs/AST.hs: document _reserved and filterUserDefinedPad; add $*BASETIME

to _reserved

src/Pugs/Prim.hs: add file time operators -M, -C, -A
src/Pugs/Prim/FileTest.hs: add implementation of file time operators
t/operators/filetest.t: correct existing file time operator tests, add a few

more, add all of them to the plan

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Internals.hs

    r14467 r14599  
    9292    __, (+++), nullID, addressOf, showAddressOf, 
    9393 
    94     hashNew, hashList 
     94    hashNew, hashList, 
     95    pugsTimeSpec, 
    9596) where 
    9697 
     
    575576    where 
    576577    addr = addressOf x 
     578 
     579{-| 
     580Convert an internal @ClockTime@ to a Pugs-style fractional time. 
     581Used by op0 "time", @Pugs.Run.prepareEnv@, and the file time tests. 
     582-} 
     583pugsTimeSpec :: ClockTime -> Rational 
     584pugsTimeSpec clkt = fdiff $ diffClockTimes clkt epochClkT 
     585    where 
     586       epochClkT = toClockTime epoch 
     587       epoch = CalendarTime 2000 January 1 0 0 0 0 Saturday 0 "UTC" 0 False 
     588       -- 10^12 is expanded because the alternatives tried gave type warnings. 
     589       fdiff = \d -> (fromInteger $ tdPicosec d) 
     590                   / (clocksPerSecond * clocksPerSecond) 
     591                   + (fromIntegral $ tdSec d)