Abstract out the notion of clocks #7

Merged
merged 5 commits into from Apr 29, 2013

Projects

None yet

2 participants

@cddr
Contributor
cddr commented Mar 11, 2013

Please consider the attached pull request that redefines "now" and "today" in terms of a new "system-clock" class. The purpose of this re-factoring is to make it easier for other libraries (e.g. time mocking libraries) to play around with the current-time. For an example, see Delorean which provides "with-frozen-clock", "with-shifted-clock", and "with-scaled-clock" macros.

The other changes are:-

a) The addition of instructions for loading the library via quicklisp
b) Simple instructions on how to run the Stefil tests

If you like the idea, I'll update the pull request with a documentation patch as soon as I can.

@dlowe-net
Owner

Looks good. What's the reason for using an empty SYSTEM-CLOCK class instead of specializing the CLOCK-NOW and CLOCK-TODAY methods on T?

@cddr
Contributor
cddr commented Mar 11, 2013

What's the reason for using an empty SYSTEM-CLOCK class instead of specializing the CLOCK-NOW and CLOCK-TODAY methods on T?

Just that I didn't think of the latter. I'll do that whilst updating the docs. Thanks

@cddr
Contributor
cddr commented Mar 11, 2013

Uploaded the documentation to include info on the clock API

Screen Shot 2013-03-11 at 1 23 44 PM

@dlowe-net dlowe-net commented on an outdated diff Mar 12, 2013
src/package.lisp
@@ -54,6 +54,9 @@
#:timestamp-subtimezone
#:define-timezone
#:*default-timezone*
+ #:*clock*
@dlowe-net
dlowe-net Mar 12, 2013 Owner

Looks like you have mixed tabs and spaces here. Please convert to all spaces.

@dlowe-net dlowe-net merged commit 2605326 into dlowe-net:master Apr 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment