]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix conflict
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 22 Nov 2009 08:12:44 +0000 (02:12 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 22 Nov 2009 08:12:44 +0000 (02:12 -0600)
920 files changed:
Makefile
basis/alarms/alarms-docs.factor
basis/alarms/alarms.factor
basis/alien/arrays/arrays.factor [changed mode: 0755->0644]
basis/alien/c-types/c-types-docs.factor [changed mode: 0755->0644]
basis/alien/c-types/c-types-tests.factor [changed mode: 0755->0644]
basis/alien/c-types/c-types.factor [changed mode: 0755->0644]
basis/alien/destructors/destructors.factor [changed mode: 0755->0644]
basis/alien/libraries/libraries-docs.factor [changed mode: 0755->0644]
basis/alien/libraries/libraries.factor [changed mode: 0755->0644]
basis/bootstrap/bootstrap-error.factor
basis/bootstrap/compiler/compiler.factor [changed mode: 0755->0644]
basis/bootstrap/finish-bootstrap.factor
basis/bootstrap/finish-staging.factor
basis/bootstrap/image/image.factor
basis/bootstrap/stage2.factor
basis/bootstrap/ui/ui.factor [changed mode: 0755->0644]
basis/cairo/cairo.factor [changed mode: 0755->0644]
basis/calendar/calendar-docs.factor
basis/calendar/calendar-tests.factor
basis/calendar/calendar.factor
basis/calendar/model/model.factor
basis/calendar/unix/unix.factor
basis/channels/remote/remote.factor
basis/checksums/hmac/hmac-tests.factor [changed mode: 0755->0644]
basis/checksums/hmac/hmac.factor [changed mode: 0755->0644]
basis/circular/circular.factor
basis/classes/struct/struct-tests.factor [changed mode: 0755->0644]
basis/classes/struct/struct.factor [changed mode: 0755->0644]
basis/cocoa/application/application.factor
basis/cocoa/cocoa.factor
basis/cocoa/enumeration/enumeration.factor [changed mode: 0755->0644]
basis/cocoa/messages/messages.factor [changed mode: 0755->0644]
basis/columns/columns.factor
basis/combinators/smart/smart-tests.factor
basis/combinators/smart/smart.factor
basis/command-line/command-line.factor
basis/compiler/cfg/builder/builder.factor [changed mode: 0755->0644]
basis/compiler/cfg/cfg.factor
basis/compiler/cfg/intrinsics/intrinsics.factor
basis/compiler/cfg/intrinsics/misc/misc.factor
basis/compiler/cfg/intrinsics/slots/slots.factor
basis/compiler/cfg/linearization/linearization.factor [changed mode: 0755->0644]
basis/compiler/cfg/stacks/stacks.factor [changed mode: 0755->0644]
basis/compiler/cfg/value-numbering/expressions/expressions.factor
basis/compiler/cfg/value-numbering/rewrite/rewrite.factor [changed mode: 0755->0644]
basis/compiler/codegen/codegen.factor [changed mode: 0755->0644]
basis/compiler/codegen/fixup/fixup.factor [changed mode: 0755->0644]
basis/compiler/compiler.factor [changed mode: 0755->0644]
basis/compiler/crossref/authors.txt [new file with mode: 0644]
basis/compiler/crossref/crossref.factor [new file with mode: 0644]
basis/compiler/tests/alien.factor [changed mode: 0755->0644]
basis/compiler/tests/intrinsics.factor [changed mode: 0755->0644]
basis/compiler/tests/redefine3.factor
basis/compiler/tests/stack-trace.factor [changed mode: 0755->0644]
basis/compiler/tree/builder/builder-tests.factor [changed mode: 0755->0644]
basis/compiler/tree/builder/builder.factor
basis/compiler/tree/checker/checker.factor [changed mode: 0755->0644]
basis/compiler/tree/cleanup/cleanup-tests.factor [changed mode: 0755->0644]
basis/compiler/tree/cleanup/cleanup.factor
basis/compiler/tree/combinators/combinators.factor [changed mode: 0755->0644]
basis/compiler/tree/dead-code/simple/simple.factor [changed mode: 0755->0644]
basis/compiler/tree/finalization/finalization.factor [changed mode: 0755->0644]
basis/compiler/tree/propagation/branches/branches.factor [changed mode: 0755->0644]
basis/compiler/tree/propagation/call-effect/call-effect-tests.factor
basis/compiler/tree/propagation/call-effect/call-effect.factor
basis/compiler/tree/propagation/constraints/constraints.factor
basis/compiler/tree/propagation/info/info.factor
basis/compiler/tree/propagation/inlining/inlining.factor [changed mode: 0755->0644]
basis/compiler/tree/propagation/known-words/known-words.factor
basis/compiler/tree/propagation/propagation-tests.factor
basis/compiler/tree/propagation/simple/simple.factor
basis/compiler/tree/propagation/transforms/transforms.factor
basis/compiler/tree/tree.factor
basis/compiler/tree/tuple-unboxing/tuple-unboxing.factor [changed mode: 0755->0644]
basis/compression/huffman/huffman.factor [changed mode: 0755->0644]
basis/compression/zlib/ffi/ffi.factor [changed mode: 0755->0644]
basis/compression/zlib/zlib-tests.factor [changed mode: 0755->0644]
basis/compression/zlib/zlib.factor [changed mode: 0755->0644]
basis/concurrency/combinators/combinators.factor [changed mode: 0755->0644]
basis/concurrency/distributed/distributed.factor
basis/concurrency/mailboxes/mailboxes.factor [changed mode: 0755->0644]
basis/cords/cords.factor
basis/core-foundation/fsevents/fsevents.factor [changed mode: 0755->0644]
basis/core-foundation/run-loop/run-loop.factor
basis/core-text/core-text.factor
basis/core-text/fonts/fonts.factor
basis/cpu/arm/assembler/assembler.factor [changed mode: 0755->0644]
basis/cpu/ppc/bootstrap.factor
basis/cpu/ppc/macosx/macosx.factor
basis/cpu/ppc/ppc.factor
basis/cpu/x86/32/32.factor [changed mode: 0755->0644]
basis/cpu/x86/64/winnt/bootstrap.factor
basis/cpu/x86/features/features.factor
basis/cpu/x86/x86.factor
basis/csv/csv.factor [changed mode: 0755->0644]
basis/db/queries/queries.factor [changed mode: 0755->0644]
basis/db/sqlite/lib/lib.factor
basis/db/sqlite/sqlite.factor [changed mode: 0755->0644]
basis/db/types/types.factor [changed mode: 0755->0644]
basis/debugger/debugger.factor
basis/debugger/windows/tags.txt [new file with mode: 0644]
basis/debugger/windows/windows.factor [changed mode: 0755->0644]
basis/dlists/dlists-docs.factor [changed mode: 0755->0644]
basis/dlists/dlists-tests.factor [changed mode: 0755->0644]
basis/dlists/dlists.factor [changed mode: 0755->0644]
basis/editors/editors.factor
basis/editors/emacs/windows/windows.factor [changed mode: 0755->0644]
basis/editors/etexteditor/etexteditor.factor [changed mode: 0755->0644]
basis/editors/notepad/notepad.factor [changed mode: 0755->0644]
basis/endian/endian-tests.factor [changed mode: 0755->0644]
basis/endian/endian.factor [changed mode: 0755->0644]
basis/environment/environment.factor
basis/environment/winnt/winnt.factor [changed mode: 0755->0644]
basis/fry/fry-docs.factor
basis/fry/fry-tests.factor
basis/fry/fry.factor
basis/ftp/server/server.factor
basis/furnace/auth/features/edit-profile/edit-profile.factor [changed mode: 0755->0644]
basis/furnace/cache/cache.factor
basis/furnace/utilities/utilities.factor [changed mode: 0755->0644]
basis/game/input/dinput/dinput.factor [changed mode: 0755->0644]
basis/game/input/dinput/keys-array/keys-array.factor [changed mode: 0755->0644]
basis/game/input/input-docs.factor [changed mode: 0755->0644]
basis/game/input/input.factor [changed mode: 0755->0644]
basis/game/input/iokit/iokit.factor [changed mode: 0755->0644]
basis/glib/glib.factor [changed mode: 0755->0644]
basis/half-floats/half-floats.factor [changed mode: 0755->0644]
basis/help/apropos/apropos.factor
basis/help/help.factor
basis/help/lint/lint.factor [changed mode: 0755->0644]
basis/http/client/client-docs.factor
basis/http/client/client.factor
basis/http/http-tests.factor
basis/http/http.factor [changed mode: 0755->0644]
basis/http/server/server.factor [changed mode: 0755->0644]
basis/images/bitmap/bitmap.factor [changed mode: 0755->0644]
basis/images/bitmap/loading/loading.factor
basis/images/images.factor [changed mode: 0755->0644]
basis/images/memory/memory.factor
basis/images/normalization/normalization.factor [changed mode: 0755->0644]
basis/images/png/png-tests.factor [changed mode: 0755->0644]
basis/images/png/png.factor [changed mode: 0755->0644]
basis/images/processing/processing.factor [changed mode: 0755->0644]
basis/images/tiff/tiff-tests.factor [changed mode: 0755->0644]
basis/images/tiff/tiff.factor [changed mode: 0755->0644]
basis/inverse/inverse.factor [changed mode: 0755->0644]
basis/io/backend/unix/multiplexers/epoll/epoll.factor
basis/io/backend/unix/multiplexers/kqueue/kqueue.factor
basis/io/backend/unix/multiplexers/multiplexers.factor
basis/io/backend/unix/multiplexers/run-loop/run-loop.factor
basis/io/backend/unix/multiplexers/select/select.factor
basis/io/backend/unix/unix.factor
basis/io/backend/windows/nt/nt.factor [changed mode: 0755->0644]
basis/io/backend/windows/nt/privileges/privileges.factor [changed mode: 0755->0644]
basis/io/backend/windows/privileges/privileges-tests.factor [changed mode: 0755->0644]
basis/io/backend/windows/privileges/privileges.factor [changed mode: 0755->0644]
basis/io/backend/windows/windows.factor [changed mode: 0755->0644]
basis/io/directories/directories.factor [changed mode: 0755->0644]
basis/io/directories/search/search.factor [changed mode: 0755->0644]
basis/io/directories/windows/windows.factor [changed mode: 0755->0644]
basis/io/encodings/8-bit/8-bit-docs.factor
basis/io/encodings/8-bit/8-bit-tests.factor
basis/io/encodings/8-bit/8-bit.factor
basis/io/encodings/8-bit/CP1251.TXT [new file with mode: 0644]
basis/io/encodings/8-bit/CP1253.TXT [new file with mode: 0644]
basis/io/encodings/8-bit/CP1254.TXT [new file with mode: 0644]
basis/io/encodings/8-bit/CP1255.TXT [new file with mode: 0644]
basis/io/encodings/8-bit/CP1256.TXT [new file with mode: 0644]
basis/io/encodings/8-bit/CP1257.TXT [new file with mode: 0644]
basis/io/encodings/8-bit/CP1258.TXT [new file with mode: 0644]
basis/io/encodings/8-bit/arabic/arabic-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/arabic/arabic.factor [new file with mode: 0644]
basis/io/encodings/8-bit/arabic/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/cyrillic/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/cyrillic/cyrillic-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/cyrillic/cyrillic.factor [new file with mode: 0644]
basis/io/encodings/8-bit/ebcdic/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/ebcdic/ebcdic-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/ebcdic/ebcdic.factor [new file with mode: 0644]
basis/io/encodings/8-bit/greek/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/greek/greek-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/greek/greek.factor [new file with mode: 0644]
basis/io/encodings/8-bit/hebrew/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/hebrew/hebrew-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/hebrew/hebrew.factor [new file with mode: 0644]
basis/io/encodings/8-bit/koi8-r/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/koi8-r/koi8-r-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/koi8-r/koi8-r.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin1/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin1/latin1-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin1/latin1.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin10/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin10/latin10-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin10/latin10.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin2/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin2/latin2-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin2/latin2.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin3/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin3/latin3-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin3/latin3.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin4/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin4/latin4-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin4/latin4.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin5/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin5/latin5-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin5/latin5.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin6/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin6/latin6-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin6/latin6.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin7/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin7/latin7-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin7/latin7.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin8/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin8/latin8-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin8/latin8.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin9/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/latin9/latin9-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/latin9/latin9.factor [new file with mode: 0644]
basis/io/encodings/8-bit/mac-roman/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/mac-roman/mac-roman-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/mac-roman/mac-roman.factor [new file with mode: 0644]
basis/io/encodings/8-bit/thai/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/thai/thai-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/thai/thai.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1250/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1250/windows-1250.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1251/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1251/windows-1251.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1252/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1252/windows-1252-docs.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1252/windows-1252.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1253/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1253/windows-1253.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1254/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1254/windows-1254.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1255/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1255/windows-1255.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1256/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1256/windows-1256.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1257/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1257/windows-1257.factor [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1258/authors.txt [new file with mode: 0644]
basis/io/encodings/8-bit/windows-1258/windows-1258.factor [new file with mode: 0644]
basis/io/encodings/iana/iana.factor
basis/io/files/info/unix/macosx/macosx.factor [changed mode: 0755->0644]
basis/io/files/info/unix/netbsd/netbsd.factor [changed mode: 0755->0644]
basis/io/files/info/unix/openbsd/openbsd.factor [changed mode: 0755->0644]
basis/io/files/info/windows/windows-tests.factor [changed mode: 0755->0644]
basis/io/files/info/windows/windows.factor [changed mode: 0755->0644]
basis/io/files/windows/nt/nt.factor [changed mode: 0755->0644]
basis/io/files/windows/windows.factor [changed mode: 0755->0644]
basis/io/launcher/launcher.factor [changed mode: 0755->0644]
basis/io/launcher/windows/nt/nt-tests.factor [changed mode: 0755->0644]
basis/io/launcher/windows/nt/nt.factor [changed mode: 0755->0644]
basis/io/launcher/windows/windows.factor [changed mode: 0755->0644]
basis/io/monitors/windows/nt/nt.factor [changed mode: 0755->0644]
basis/io/pipes/windows/nt/nt.factor
basis/io/servers/packet/authors.txt [deleted file]
basis/io/servers/packet/packet.factor [deleted file]
basis/io/servers/packet/summary.txt [deleted file]
basis/io/servers/packet/tags.txt [deleted file]
basis/io/sockets/secure/openssl/openssl.factor
basis/io/sockets/sockets-tests.factor [changed mode: 0755->0644]
basis/io/sockets/sockets.factor [changed mode: 0755->0644]
basis/io/sockets/unix/unix.factor [changed mode: 0755->0644]
basis/io/sockets/windows/nt/nt.factor [changed mode: 0755->0644]
basis/io/sockets/windows/windows.factor [changed mode: 0755->0644]
basis/io/streams/limited/limited-docs.factor [changed mode: 0755->0644]
basis/io/streams/limited/limited-tests.factor
basis/io/streams/limited/limited.factor [changed mode: 0755->0644]
basis/io/styles/styles-docs.factor [changed mode: 0755->0644]
basis/io/thread/thread.factor
basis/io/timeouts/timeouts.factor [changed mode: 0755->0644]
basis/iokit/hid/hid.factor
basis/iokit/iokit.factor [changed mode: 0755->0644]
basis/lists/lists-docs.factor
basis/lists/lists.factor
basis/literals/literals-tests.factor [changed mode: 0755->0644]
basis/literals/literals.factor [changed mode: 0755->0644]
basis/locals/fry/fry.factor
basis/locals/locals-tests.factor
basis/locals/macros/macros.factor
basis/locals/rewrite/point-free/point-free.factor [changed mode: 0755->0644]
basis/locals/rewrite/sugar/sugar.factor [changed mode: 0755->0644]
basis/logging/server/server.factor
basis/macros/macros-docs.factor [changed mode: 0755->0644]
basis/macros/macros.factor
basis/math/bitwise/bitwise-docs.factor [changed mode: 0755->0644]
basis/math/bitwise/bitwise.factor [changed mode: 0755->0644]
basis/math/blas/matrices/matrices.factor [changed mode: 0755->0644]
basis/math/blas/vectors/vectors.factor [changed mode: 0755->0644]
basis/math/intervals/intervals.factor [changed mode: 0755->0644]
basis/math/matrices/elimination/elimination.factor [changed mode: 0755->0644]
basis/math/primes/miller-rabin/miller-rabin.factor [changed mode: 0755->0644]
basis/math/quaternions/quaternions.factor [changed mode: 0755->0644]
basis/math/vectors/simd/functor/functor.factor
basis/math/vectors/simd/simd-tests.factor
basis/mime/multipart/multipart.factor [changed mode: 0755->0644]
basis/models/illusion/authors.txt [deleted file]
basis/models/illusion/illusion.factor [deleted file]
basis/models/illusion/summary.txt [deleted file]
basis/models/models.factor
basis/opengl/capabilities/capabilities.factor [changed mode: 0755->0644]
basis/opengl/gl/extensions/extensions.factor
basis/opengl/gl/windows/windows.factor [changed mode: 0755->0644]
basis/opengl/opengl-tests.factor [new file with mode: 0644]
basis/opengl/opengl.factor [changed mode: 0755->0644]
basis/opengl/shaders/shaders.factor [changed mode: 0755->0644]
basis/opengl/textures/textures.factor [changed mode: 0755->0644]
basis/openssl/openssl.factor
basis/pack/pack-tests.factor [changed mode: 0755->0644]
basis/pack/pack.factor [changed mode: 0755->0644]
basis/pango/cairo/cairo.factor
basis/pango/fonts/fonts.factor
basis/peg/ebnf/ebnf-docs.factor
basis/prettyprint/backend/backend.factor
basis/promises/promises-docs.factor [changed mode: 0755->0644]
basis/promises/promises.factor [changed mode: 0755->0644]
basis/quoted-printable/quoted-printable-tests.factor
basis/random/mersenne-twister/mersenne-twister.factor
basis/random/random-docs.factor [changed mode: 0755->0644]
basis/random/random.factor [changed mode: 0755->0644]
basis/random/unix/unix.factor
basis/random/windows/windows.factor
basis/refs/refs-docs.factor [changed mode: 0755->0644]
basis/roman/roman-tests.factor
basis/sequences/deep/deep-docs.factor [changed mode: 0755->0644]
basis/sequences/deep/deep-tests.factor [changed mode: 0755->0644]
basis/sequences/deep/deep.factor [changed mode: 0755->0644]
basis/sequences/merged/merged-docs.factor
basis/sequences/merged/merged-tests.factor
basis/sequences/merged/merged.factor
basis/sequences/parser/parser-tests.factor
basis/serialize/serialize.factor
basis/smtp/smtp.factor
basis/specialized-arrays/prettyprint/prettyprint.factor [changed mode: 0755->0644]
basis/specialized-arrays/specialized-arrays-docs.factor [changed mode: 0755->0644]
basis/specialized-arrays/specialized-arrays-tests.factor [changed mode: 0755->0644]
basis/specialized-arrays/specialized-arrays.factor [changed mode: 0755->0644]
basis/stack-checker/alien/alien.factor
basis/stack-checker/backend/backend-tests.factor
basis/stack-checker/backend/backend.factor [changed mode: 0755->0644]
basis/stack-checker/branches/branches.factor [changed mode: 0755->0644]
basis/stack-checker/dependencies/authors.txt [new file with mode: 0644]
basis/stack-checker/dependencies/dependencies-tests.factor [new file with mode: 0644]
basis/stack-checker/dependencies/dependencies.factor [new file with mode: 0644]
basis/stack-checker/errors/errors-docs.factor [changed mode: 0755->0644]
basis/stack-checker/errors/errors.factor
basis/stack-checker/errors/prettyprint/prettyprint.factor
basis/stack-checker/inlining/inlining.factor
basis/stack-checker/known-words/known-words.factor
basis/stack-checker/stack-checker-docs.factor
basis/stack-checker/stack-checker-tests.factor
basis/stack-checker/state/state-tests.factor [deleted file]
basis/stack-checker/state/state.factor
basis/stack-checker/transforms/transforms-tests.factor
basis/stack-checker/transforms/transforms.factor [changed mode: 0755->0644]
basis/stack-checker/values/values.factor
basis/suffix-arrays/suffix-arrays-docs.factor [changed mode: 0755->0644]
basis/suffix-arrays/suffix-arrays-tests.factor [changed mode: 0755->0644]
basis/suffix-arrays/suffix-arrays.factor [changed mode: 0755->0644]
basis/suffix-arrays/words/words.factor [changed mode: 0755->0644]
basis/syndication/syndication.factor [changed mode: 0755->0644]
basis/system-info/system-info.factor [changed mode: 0755->0644]
basis/system-info/windows/ce/ce.factor [changed mode: 0755->0644]
basis/system-info/windows/nt/nt.factor [changed mode: 0755->0644]
basis/system-info/windows/windows.factor [changed mode: 0755->0644]
basis/threads/threads-docs.factor
basis/threads/threads.factor
basis/tools/crossref/crossref-tests.factor [changed mode: 0755->0644]
basis/tools/crossref/crossref.factor
basis/tools/deploy/backend/backend.factor [changed mode: 0755->0644]
basis/tools/deploy/deploy-tests.factor
basis/tools/deploy/macosx/macosx.factor [changed mode: 0755->0644]
basis/tools/deploy/shaker/shaker.factor [changed mode: 0755->0644]
basis/tools/deploy/shaker/strip-cocoa.factor
basis/tools/deploy/test/17/17.factor [new file with mode: 0644]
basis/tools/deploy/test/17/deploy.factor [new file with mode: 0644]
basis/tools/deploy/test/4/4.factor
basis/tools/deploy/test/5/5.factor
basis/tools/deploy/test/5/deploy.factor
basis/tools/deploy/test/test.factor [changed mode: 0755->0644]
basis/tools/deploy/unix/unix.factor [changed mode: 0755->0644]
basis/tools/deploy/windows/windows.factor [changed mode: 0755->0644]
basis/tools/deprecation/deprecation.factor
basis/tools/disassembler/disassembler.factor [changed mode: 0755->0644]
basis/tools/disassembler/gdb/gdb.factor [changed mode: 0755->0644]
basis/tools/disassembler/udis/udis-tests.factor
basis/tools/disassembler/udis/udis.factor [changed mode: 0755->0644]
basis/tools/errors/model/model.factor
basis/tools/files/files.factor [changed mode: 0755->0644]
basis/tools/files/unix/unix.factor [changed mode: 0755->0644]
basis/tools/files/windows/windows.factor [changed mode: 0755->0644]
basis/tools/memory/memory.factor
basis/tools/profiler/profiler-tests.factor
basis/tools/profiler/profiler.factor
basis/tools/scaffold/scaffold.factor [changed mode: 0755->0644]
basis/tools/scaffold/windows/windows.factor [changed mode: 0755->0644]
basis/tools/test/test.factor
basis/tools/threads/threads.factor
basis/tools/time/time-docs.factor
basis/tools/time/time.factor
basis/typed/typed.factor
basis/ui/backend/backend.factor [changed mode: 0755->0644]
basis/ui/backend/cocoa/cocoa.factor [changed mode: 0755->0644]
basis/ui/backend/cocoa/tools/tools.factor
basis/ui/backend/windows/windows.factor [changed mode: 0755->0644]
basis/ui/backend/x11/x11.factor [changed mode: 0755->0644]
basis/ui/debugger/debugger.factor [changed mode: 0755->0644]
basis/ui/event-loop/event-loop.factor [changed mode: 0755->0644]
basis/ui/gadgets/editors/editors.factor [changed mode: 0755->0644]
basis/ui/gadgets/gadgets.factor
basis/ui/gadgets/grid-lines/grid-lines.factor [changed mode: 0755->0644]
basis/ui/gadgets/presentations/presentations.factor [changed mode: 0755->0644]
basis/ui/gadgets/worlds/worlds-docs.factor [changed mode: 0755->0644]
basis/ui/gadgets/worlds/worlds.factor [changed mode: 0755->0644]
basis/ui/gestures/gestures-docs.factor
basis/ui/gestures/gestures.factor
basis/ui/images/images.factor [changed mode: 0755->0644]
basis/ui/operations/operations.factor [changed mode: 0755->0644]
basis/ui/render/render.factor [changed mode: 0755->0644]
basis/ui/text/core-text/core-text.factor [changed mode: 0755->0644]
basis/ui/text/pango/pango.factor [changed mode: 0755->0644]
basis/ui/text/text-tests.factor [changed mode: 0755->0644]
basis/ui/text/text.factor [changed mode: 0755->0644]
basis/ui/text/uniscribe/uniscribe.factor [changed mode: 0755->0644]
basis/ui/tools/debugger/debugger.factor [changed mode: 0755->0644]
basis/ui/ui.factor
basis/unicode/collation/collation.factor [changed mode: 0755->0644]
basis/unix/bsd/netbsd/netbsd.factor
basis/unix/time/time.factor
basis/unix/types/macosx/macosx.factor
basis/unix/types/types.factor
basis/unix/unix.factor
basis/uuid/uuid.factor
basis/vm/vm.factor
basis/vocabs/cache/cache.factor
basis/vocabs/refresh/monitor/monitor.factor
basis/windows/advapi32/advapi32.factor [changed mode: 0755->0644]
basis/windows/com/com-tests.factor
basis/windows/com/com.factor [changed mode: 0755->0644]
basis/windows/com/prettyprint/prettyprint.factor [changed mode: 0755->0644]
basis/windows/com/syntax/syntax.factor [changed mode: 0755->0644]
basis/windows/com/wrapper/wrapper.factor [changed mode: 0755->0644]
basis/windows/dinput/constants/constants.factor [changed mode: 0755->0644]
basis/windows/dinput/dinput.factor [changed mode: 0755->0644]
basis/windows/dragdrop-listener/dragdrop-listener.factor [changed mode: 0755->0644]
basis/windows/dwmapi/dwmapi.factor [changed mode: 0755->0644]
basis/windows/errors/errors-tests.factor [changed mode: 0755->0644]
basis/windows/errors/errors.factor [changed mode: 0755->0644]
basis/windows/fonts/fonts.factor [changed mode: 0755->0644]
basis/windows/gdi32/gdi32.factor [changed mode: 0755->0644]
basis/windows/kernel32/kernel32.factor [changed mode: 0755->0644]
basis/windows/messages/messages.factor [changed mode: 0755->0644]
basis/windows/offscreen/offscreen-tests.factor [changed mode: 0755->0644]
basis/windows/offscreen/offscreen.factor [changed mode: 0755->0644]
basis/windows/ole32/ole32.factor [changed mode: 0755->0644]
basis/windows/opengl32/opengl32.factor [changed mode: 0755->0644]
basis/windows/psapi/psapi.factor [changed mode: 0755->0644]
basis/windows/shell32/shell32.factor [changed mode: 0755->0644]
basis/windows/time/time.factor
basis/windows/types/types-tests.factor [changed mode: 0755->0644]
basis/windows/types/types.factor [changed mode: 0755->0644]
basis/windows/uniscribe/uniscribe.factor [changed mode: 0755->0644]
basis/windows/user32/user32.factor [changed mode: 0755->0644]
basis/windows/usp10/usp10.factor [changed mode: 0755->0644]
basis/windows/windows.factor [changed mode: 0755->0644]
basis/windows/winsock/winsock.factor [changed mode: 0755->0644]
basis/xml/entities/html/html.factor
basis/xml/tests/encodings.factor
basis/xml/traversal/traversal.factor [changed mode: 0755->0644]
basis/xml/writer/writer.factor [changed mode: 0755->0644]
basis/xml/xml.factor [changed mode: 0755->0644]
basis/xmode/marker/marker.factor [changed mode: 0755->0644]
core/alien/alien.factor
core/alien/strings/strings-tests.factor
core/alien/strings/strings.factor
core/assocs/assocs-docs.factor [changed mode: 0755->0644]
core/assocs/assocs.factor [changed mode: 0755->0644]
core/bootstrap/layouts/layouts.factor
core/bootstrap/primitives.factor
core/bootstrap/stage1.factor
core/bootstrap/syntax.factor
core/classes/algebra/algebra-docs.factor
core/classes/algebra/algebra-tests.factor
core/classes/algebra/algebra.factor [changed mode: 0755->0644]
core/classes/builtin/builtin-tests.factor [changed mode: 0755->0644]
core/classes/builtin/builtin.factor
core/classes/intersection/intersection.factor
core/classes/predicate/predicate.factor
core/classes/singleton/singleton.factor
core/classes/tuple/tuple-tests.factor
core/classes/tuple/tuple.factor [changed mode: 0755->0644]
core/classes/union/union.factor [changed mode: 0755->0644]
core/combinators/combinators-docs.factor [changed mode: 0755->0644]
core/combinators/combinators-tests.factor [changed mode: 0755->0644]
core/combinators/combinators.factor [changed mode: 0755->0644]
core/compiler/units/units-tests.factor
core/compiler/units/units.factor
core/definitions/definitions-docs.factor
core/definitions/definitions.factor
core/destructors/destructors.factor
core/effects/parser/parser.factor
core/generic/generic-tests.factor [changed mode: 0755->0644]
core/hashtables/hashtables-docs.factor [changed mode: 0755->0644]
core/hashtables/hashtables.factor
core/init/init-docs.factor
core/init/init.factor
core/io/backend/backend.factor
core/io/encodings/utf8/utf8-tests.factor [changed mode: 0755->0644]
core/io/encodings/utf8/utf8.factor [changed mode: 0755->0644]
core/io/files/files-tests.factor
core/io/files/files.factor
core/io/pathnames/pathnames-docs.factor
core/io/pathnames/pathnames.factor
core/io/streams/c/c.factor [changed mode: 0755->0644]
core/kernel/kernel-docs.factor
core/kernel/kernel-tests.factor
core/kernel/kernel.factor
core/layouts/layouts.factor
core/math/math.factor [changed mode: 0755->0644]
core/memory/memory-tests.factor [changed mode: 0755->0644]
core/namespaces/namespaces-docs.factor [changed mode: 0755->0644]
core/parser/parser-docs.factor
core/quotations/quotations.factor
core/sequences/sequences-docs.factor [changed mode: 0755->0644]
core/sequences/sequences.factor [changed mode: 0755->0644]
core/sets/sets-docs.factor [changed mode: 0755->0644]
core/sets/sets-tests.factor [changed mode: 0755->0644]
core/sets/sets.factor [changed mode: 0755->0644]
core/slots/slots.factor [changed mode: 0755->0644]
core/source-files/errors/errors.factor
core/source-files/source-files.factor
core/splitting/splitting-docs.factor
core/splitting/splitting-tests.factor
core/splitting/splitting.factor
core/system/system-docs.factor
core/system/system.factor
core/vocabs/loader/loader-docs.factor
core/vocabs/parser/parser.factor [changed mode: 0755->0644]
core/words/words-docs.factor
core/words/words-tests.factor [changed mode: 0755->0644]
core/words/words.factor [changed mode: 0755->0644]
extra/animations/animations-docs.factor [deleted file]
extra/animations/animations.factor [deleted file]
extra/animations/authors.txt [deleted file]
extra/asn1/asn1-tests.factor [changed mode: 0755->0644]
extra/backtrack/backtrack.factor [changed mode: 0755->0644]
extra/benchmark/backtrack/backtrack.factor [changed mode: 0755->0644]
extra/benchmark/benchmark.factor [changed mode: 0755->0644]
extra/benchmark/beust2/beust2.factor [changed mode: 0755->0644]
extra/benchmark/crc32/crc32.factor [changed mode: 0755->0644]
extra/benchmark/dispatch4/dispatch4.factor [changed mode: 0755->0644]
extra/benchmark/dispatch5/dispatch5.factor [changed mode: 0755->0644]
extra/benchmark/fannkuch/fannkuch.factor
extra/benchmark/fasta/fasta.factor [changed mode: 0755->0644]
extra/benchmark/fib6/fib6.factor [changed mode: 0755->0644]
extra/benchmark/mandel/mandel.factor [changed mode: 0755->0644]
extra/benchmark/random/random.factor [changed mode: 0755->0644]
extra/benchmark/raytracer/raytracer.factor [changed mode: 0755->0644]
extra/benchmark/recursive/recursive.factor [changed mode: 0755->0644]
extra/benchmark/reverse-complement/reverse-complement-tests.factor [changed mode: 0755->0644]
extra/benchmark/reverse-complement/reverse-complement.factor [changed mode: 0755->0644]
extra/benchmark/ring/ring.factor [changed mode: 0755->0644]
extra/benchmark/sockets/sockets.factor [changed mode: 0755->0644]
extra/benchmark/sort/sort.factor [changed mode: 0755->0644]
extra/bunny/bunny.factor [changed mode: 0755->0644]
extra/bunny/deploy.factor [changed mode: 0755->0644]
extra/bunny/fixed-pipeline/fixed-pipeline.factor [changed mode: 0755->0644]
extra/bunny/model/model.factor [changed mode: 0755->0644]
extra/bunny/outlined/outlined.factor [changed mode: 0755->0644]
extra/calendar/holidays/authors.txt [new file with mode: 0644]
extra/calendar/holidays/canada/authors.txt [new file with mode: 0644]
extra/calendar/holidays/canada/canada-tests.factor [new file with mode: 0644]
extra/calendar/holidays/canada/canada.factor [new file with mode: 0644]
extra/calendar/holidays/holidays.factor [new file with mode: 0644]
extra/calendar/holidays/us/authors.txt [new file with mode: 0644]
extra/calendar/holidays/us/us-tests.factor [new file with mode: 0644]
extra/calendar/holidays/us/us.factor [new file with mode: 0644]
extra/chicago-talk/deploy.factor [changed mode: 0755->0644]
extra/color-picker/color-picker.factor [changed mode: 0755->0644]
extra/color-picker/deploy.factor [changed mode: 0755->0644]
extra/contributors/contributors.factor [changed mode: 0755->0644]
extra/cpu/8080/8080.factor [changed mode: 0755->0644]
extra/cpu/8080/emulator/emulator.factor [changed mode: 0755->0644]
extra/cpu/8080/test/test.factor [changed mode: 0755->0644]
extra/curses/curses.factor
extra/descriptive/descriptive-docs.factor [changed mode: 0755->0644]
extra/descriptive/descriptive-tests.factor [changed mode: 0755->0644]
extra/descriptive/descriptive.factor [changed mode: 0755->0644]
extra/digraphs/digraphs.factor [changed mode: 0755->0644]
extra/drills/deployed/deploy.factor [deleted file]
extra/drills/deployed/deployed.factor [deleted file]
extra/drills/deployed/tags.txt [deleted file]
extra/drills/drills.factor [deleted file]
extra/drills/tags.txt [deleted file]
extra/fjsc/fjsc-tests.factor [changed mode: 0755->0644]
extra/fjsc/fjsc.factor [changed mode: 0755->0644]
extra/game/loop/loop.factor
extra/game/worlds/worlds.factor
extra/geobytes/geobytes.factor
extra/gesture-logger/deploy.factor [changed mode: 0755->0644]
extra/gpu/demos/bunny/bunny.factor [changed mode: 0755->0644]
extra/gpu/demos/raytrace/raytrace.factor
extra/gpu/framebuffers/framebuffers-docs.factor [changed mode: 0755->0644]
extra/gpu/framebuffers/framebuffers.factor [changed mode: 0755->0644]
extra/gpu/gpu-docs.factor [changed mode: 0755->0644]
extra/gpu/render/render-docs.factor [changed mode: 0755->0644]
extra/gpu/shaders/shaders-docs.factor [changed mode: 0755->0644]
extra/gpu/shaders/shaders.factor [changed mode: 0755->0644]
extra/gpu/state/state-docs.factor [changed mode: 0755->0644]
extra/gpu/state/state.factor [changed mode: 0755->0644]
extra/hashcash/hashcash.factor [changed mode: 0755->0644]
extra/hello-ui/deploy.factor
extra/hello-world/deploy.factor [changed mode: 0755->0644]
extra/html/parser/analyzer/analyzer.factor [changed mode: 0755->0644]
extra/icfp/2006/2006.factor [changed mode: 0755->0644]
extra/io/serial/unix/termios/bsd/bsd.factor
extra/io/serial/unix/termios/linux/linux.factor
extra/io/serial/windows/windows.factor [changed mode: 0755->0644]
extra/irc/client/chats/chats.factor
extra/irc/client/client.factor [changed mode: 0755->0644]
extra/irc/client/internals/internals.factor
extra/irc/gitbot/gitbot.factor
extra/irc/logbot/logbot.factor
extra/irc/messages/messages.factor [changed mode: 0755->0644]
extra/jamshred/player/player.factor
extra/jamshred/tunnel/tunnel-tests.factor
extra/jamshred/tunnel/tunnel.factor
extra/joystick-demo/joystick-demo.factor [changed mode: 0755->0644]
extra/key-caps/key-caps.factor [changed mode: 0755->0644]
extra/koszul/koszul-tests.factor [changed mode: 0755->0644]
extra/koszul/koszul.factor [changed mode: 0755->0644]
extra/lcd/lcd.factor [changed mode: 0755->0644]
extra/log-viewer/log-viewer.factor [changed mode: 0755->0644]
extra/mason/child/child.factor [changed mode: 0755->0644]
extra/mason/cleanup/cleanup.factor [changed mode: 0755->0644]
extra/mason/common/common-tests.factor
extra/mason/common/common.factor [changed mode: 0755->0644]
extra/mason/platform/platform.factor
extra/mason/release/archive/archive.factor [changed mode: 0755->0644]
extra/mason/release/tidy/tidy.factor [changed mode: 0755->0644]
extra/mason/report/report.factor
extra/mason/test/test.factor
extra/math/analysis/analysis.factor [changed mode: 0755->0644]
extra/math/text/english/english.factor [changed mode: 0755->0644]
extra/math/text/utils/utils-docs.factor [changed mode: 0755->0644]
extra/math/text/utils/utils-tests.factor [changed mode: 0755->0644]
extra/math/text/utils/utils.factor [changed mode: 0755->0644]
extra/maze/deploy.factor [changed mode: 0755->0644]
extra/minneapolis-talk/deploy.factor [changed mode: 0755->0644]
extra/minneapolis-talk/minneapolis-talk.factor [changed mode: 0755->0644]
extra/models/combinators/authors.txt [deleted file]
extra/models/combinators/combinators-docs.factor [deleted file]
extra/models/combinators/combinators.factor [deleted file]
extra/models/combinators/summary.txt [deleted file]
extra/models/combinators/templates/templates.factor [deleted file]
extra/models/illusion/authors.txt [new file with mode: 0644]
extra/models/illusion/illusion.factor [new file with mode: 0644]
extra/models/illusion/summary.txt [new file with mode: 0644]
extra/mongodb/tuple/persistent/persistent.factor
extra/multi-methods/multi-methods.factor [changed mode: 0755->0644]
extra/multi-methods/tests/definitions.factor
extra/nehe/5/5.factor [changed mode: 0755->0644]
extra/nehe/deploy.factor [changed mode: 0755->0644]
extra/opengl/demo-support/demo-support.factor [changed mode: 0755->0644]
extra/parser-combinators/parser-combinators-docs.factor [changed mode: 0755->0644]
extra/parser-combinators/parser-combinators-tests.factor [changed mode: 0755->0644]
extra/parser-combinators/parser-combinators.factor [changed mode: 0755->0644]
extra/parser-combinators/simple/simple-docs.factor [changed mode: 0755->0644]
extra/parser-combinators/simple/simple.factor [changed mode: 0755->0644]
extra/partial-continuations/partial-continuations-tests.factor
extra/partial-continuations/partial-continuations.factor [changed mode: 0755->0644]
extra/project-euler/024/024.factor [changed mode: 0755->0644]
extra/project-euler/032/032.factor [changed mode: 0755->0644]
extra/project-euler/035/035.factor [changed mode: 0755->0644]
extra/project-euler/037/037.factor [changed mode: 0755->0644]
extra/project-euler/038/038.factor [changed mode: 0755->0644]
extra/project-euler/039/039.factor [changed mode: 0755->0644]
extra/project-euler/040/040.factor [changed mode: 0755->0644]
extra/project-euler/046/046.factor [changed mode: 0755->0644]
extra/project-euler/062/062-tests.factor [new file with mode: 0644]
extra/project-euler/062/062.factor [new file with mode: 0644]
extra/project-euler/062/authors.txt [new file with mode: 0644]
extra/project-euler/075/075.factor [changed mode: 0755->0644]
extra/project-euler/188/188-tests.factor [changed mode: 0755->0644]
extra/project-euler/188/188.factor [changed mode: 0755->0644]
extra/project-euler/ave-time/ave-time-docs.factor
extra/project-euler/ave-time/ave-time-tests.factor [new file with mode: 0644]
extra/project-euler/ave-time/ave-time.factor
extra/project-euler/project-euler.factor
extra/random/blum-blum-shub/blum-blum-shub.factor [changed mode: 0755->0644]
extra/recipes/authors.txt [deleted file]
extra/recipes/icons/back.tiff [deleted file]
extra/recipes/icons/hate.tiff [deleted file]
extra/recipes/icons/love.tiff [deleted file]
extra/recipes/icons/more.tiff [deleted file]
extra/recipes/icons/submit.tiff [deleted file]
extra/recipes/recipes.factor [deleted file]
extra/recipes/summary.txt [deleted file]
extra/redis/redis.factor
extra/reports/noise/noise.factor [changed mode: 0755->0644]
extra/s3/s3-docs.factor
extra/sequences/modified/modified.factor
extra/sequences/repeating/repeating.factor
extra/site-watcher/site-watcher.factor
extra/slides/slides.factor [changed mode: 0755->0644]
extra/space-invaders/space-invaders.factor [changed mode: 0755->0644]
extra/spheres/spheres.factor [changed mode: 0755->0644]
extra/spider/unique-deque/unique-deque.factor
extra/sudoku/deploy.factor [changed mode: 0755->0644]
extra/sudoku/sudoku.factor [changed mode: 0755->0644]
extra/sudokus/authors.txt [deleted file]
extra/sudokus/sudokus.factor [deleted file]
extra/sudokus/summary.txt [deleted file]
extra/tar/tar.factor [changed mode: 0755->0644]
extra/terrain/terrain.factor
extra/tetris/deploy.factor [changed mode: 0755->0644]
extra/tetris/game/game.factor
extra/tetris/tetris.factor
extra/tokyo/alien/tcbdb/tcbdb.factor [changed mode: 0755->0644]
extra/tokyo/alien/tcfdb/tcfdb.factor [changed mode: 0755->0644]
extra/tokyo/alien/tchdb/tchdb.factor [changed mode: 0755->0644]
extra/tokyo/alien/tcrdb/tcrdb.factor [changed mode: 0755->0644]
extra/tokyo/alien/tctdb/tctdb.factor [changed mode: 0755->0644]
extra/tokyo/alien/tcutil/tcutil.factor [changed mode: 0755->0644]
extra/trees/avl/avl-tests.factor [changed mode: 0755->0644]
extra/trees/avl/avl.factor [changed mode: 0755->0644]
extra/trees/splay/splay.factor [changed mode: 0755->0644]
extra/trees/trees.factor [changed mode: 0755->0644]
extra/ui/gadgets/alerts/alerts.factor [deleted file]
extra/ui/gadgets/alerts/authors.txt [deleted file]
extra/ui/gadgets/alerts/summary.txt [deleted file]
extra/ui/gadgets/comboboxes/authors.txt [deleted file]
extra/ui/gadgets/comboboxes/comboboxes.factor [deleted file]
extra/ui/gadgets/comboboxes/summary.txt [deleted file]
extra/ui/gadgets/controls/authors.txt [deleted file]
extra/ui/gadgets/controls/controls-docs.factor [deleted file]
extra/ui/gadgets/controls/controls.factor [deleted file]
extra/ui/gadgets/controls/summary.txt [deleted file]
extra/ui/gadgets/layout/authors.txt [deleted file]
extra/ui/gadgets/layout/layout-docs.factor [deleted file]
extra/ui/gadgets/layout/layout.factor [deleted file]
extra/ui/gadgets/layout/summary.txt [deleted file]
extra/ui/gadgets/poppers/authors.txt [deleted file]
extra/ui/gadgets/poppers/poppers.factor [deleted file]
extra/ui/render/test/test.factor [changed mode: 0755->0644]
extra/units/units-tests.factor [changed mode: 0755->0644]
extra/units/units.factor [changed mode: 0755->0644]
extra/vocabs/git/authors.txt [new file with mode: 0644]
extra/vocabs/git/git.factor [new file with mode: 0644]
extra/webapps/imagebin/imagebin.factor [changed mode: 0755->0644]
extra/webapps/mason/mason.factor
extra/webapps/planet/planet.factor [changed mode: 0755->0644]
extra/webapps/todo/todo.factor [changed mode: 0755->0644]
extra/window-controls-demo/window-controls-demo.factor [changed mode: 0755->0644]
extra/yahoo/yahoo.factor [changed mode: 0755->0644]
extra/zoneinfo/africa [new file with mode: 0644]
extra/zoneinfo/antarctica [new file with mode: 0644]
extra/zoneinfo/asia [new file with mode: 0644]
extra/zoneinfo/australasia [new file with mode: 0644]
extra/zoneinfo/authors.txt [new file with mode: 0644]
extra/zoneinfo/europe [new file with mode: 0644]
extra/zoneinfo/leapseconds [new file with mode: 0644]
extra/zoneinfo/northamerica [new file with mode: 0644]
extra/zoneinfo/pacificnew [new file with mode: 0644]
extra/zoneinfo/solar87 [new file with mode: 0644]
extra/zoneinfo/solar88 [new file with mode: 0644]
extra/zoneinfo/solar89 [new file with mode: 0644]
extra/zoneinfo/southamerica [new file with mode: 0644]
extra/zoneinfo/systemv [new file with mode: 0644]
extra/zoneinfo/zoneinfo.factor [new file with mode: 0644]
unmaintained/4DNav/4DNav-docs.factor [changed mode: 0755->0644]
unmaintained/4DNav/4DNav.factor [changed mode: 0755->0644]
unmaintained/4DNav/camera/camera-docs.factor [changed mode: 0755->0644]
unmaintained/4DNav/camera/camera.factor [changed mode: 0755->0644]
unmaintained/4DNav/deep/deep-docs.factor [changed mode: 0755->0644]
unmaintained/4DNav/deep/deep.factor [changed mode: 0755->0644]
unmaintained/4DNav/deploy.factor [changed mode: 0755->0644]
unmaintained/4DNav/file-chooser/file-chooser.factor [changed mode: 0755->0644]
unmaintained/4DNav/space-file-decoder/space-file-decoder-docs.factor [changed mode: 0755->0644]
unmaintained/4DNav/space-file-decoder/space-file-decoder.factor [changed mode: 0755->0644]
unmaintained/4DNav/turtle/turtle-docs.factor [changed mode: 0755->0644]
unmaintained/4DNav/turtle/turtle.factor [changed mode: 0755->0644]
unmaintained/4DNav/window3D/window3D-docs.factor [changed mode: 0755->0644]
unmaintained/4DNav/window3D/window3D.factor [changed mode: 0755->0644]
unmaintained/adsoda/adsoda-docs.factor [changed mode: 0755->0644]
unmaintained/adsoda/adsoda-tests.factor [changed mode: 0755->0644]
unmaintained/adsoda/adsoda.factor [changed mode: 0755->0644]
unmaintained/adsoda/combinators/combinators-docs.factor [changed mode: 0755->0644]
unmaintained/adsoda/combinators/combinators-tests.factor [changed mode: 0755->0644]
unmaintained/adsoda/combinators/combinators.factor [changed mode: 0755->0644]
unmaintained/adsoda/solution2/solution2.factor [changed mode: 0755->0644]
unmaintained/adsoda/tools/tools-docs.factor [changed mode: 0755->0644]
unmaintained/adsoda/tools/tools-tests.factor [changed mode: 0755->0644]
unmaintained/adsoda/tools/tools.factor [changed mode: 0755->0644]
unmaintained/animations/animations-docs.factor [new file with mode: 0644]
unmaintained/animations/animations.factor [new file with mode: 0644]
unmaintained/animations/authors.txt [new file with mode: 0644]
unmaintained/arm/4/4.factor [changed mode: 0755->0644]
unmaintained/arm/allot/allot.factor [changed mode: 0755->0644]
unmaintained/arm/architecture/architecture.factor [changed mode: 0755->0644]
unmaintained/arm/arm.factor [changed mode: 0755->0644]
unmaintained/arm/bootstrap.factor [changed mode: 0755->0644]
unmaintained/arm/intrinsics/intrinsics.factor [changed mode: 0755->0644]
unmaintained/automata/ui/deploy.factor [changed mode: 0755->0644]
unmaintained/ce/backend/backend.factor [changed mode: 0755->0644]
unmaintained/ce/ce.factor [changed mode: 0755->0644]
unmaintained/ce/files/files.factor [changed mode: 0755->0644]
unmaintained/ce/privileges/privileges.factor [changed mode: 0755->0644]
unmaintained/ce/sockets/sockets.factor [changed mode: 0755->0644]
unmaintained/cont-responder/callbacks-tests.factor [changed mode: 0755->0644]
unmaintained/cont-responder/callbacks.factor [changed mode: 0755->0644]
unmaintained/cryptlib/streams/streams.factor [changed mode: 0755->0644]
unmaintained/db/mysql/mysql.factor [changed mode: 0755->0644]
unmaintained/drills/deployed/deploy.factor [new file with mode: 0644]
unmaintained/drills/deployed/deployed.factor [new file with mode: 0644]
unmaintained/drills/deployed/tags.txt [new file with mode: 0644]
unmaintained/drills/drills.factor [new file with mode: 0644]
unmaintained/drills/tags.txt [new file with mode: 0644]
unmaintained/golden-section/deploy.factor [changed mode: 0755->0644]
unmaintained/headers/bsd/bsd.factor [changed mode: 0755->0644]
unmaintained/headers/headers.factor [changed mode: 0755->0644]
unmaintained/images/processing/rotation/rotation-tests.factor [changed mode: 0755->0644]
unmaintained/irc-ui/commandparser/commandparser.factor [changed mode: 0755->0644]
unmaintained/irc-ui/commands/commands.factor [changed mode: 0755->0644]
unmaintained/irc-ui/load/load.factor [changed mode: 0755->0644]
unmaintained/irc-ui/ui.factor [changed mode: 0755->0644]
unmaintained/ldap/ldap-tests.factor [changed mode: 0755->0644]
unmaintained/ldap/libldap/libldap.factor [changed mode: 0755->0644]
unmaintained/lint/lint.factor [changed mode: 0755->0644]
unmaintained/models/combinators/authors.txt [new file with mode: 0644]
unmaintained/models/combinators/combinators-docs.factor [new file with mode: 0644]
unmaintained/models/combinators/combinators.factor [new file with mode: 0644]
unmaintained/models/combinators/summary.txt [new file with mode: 0644]
unmaintained/models/combinators/templates/templates.factor [new file with mode: 0644]
unmaintained/ogg/player/player.factor [changed mode: 0755->0644]
unmaintained/oracle/oracle-tests.factor [changed mode: 0755->0644]
unmaintained/pdf/pdf-tests.factor [changed mode: 0755->0644]
unmaintained/recipes/authors.txt [new file with mode: 0644]
unmaintained/recipes/icons/back.tiff [new file with mode: 0644]
unmaintained/recipes/icons/hate.tiff [new file with mode: 0644]
unmaintained/recipes/icons/love.tiff [new file with mode: 0644]
unmaintained/recipes/icons/more.tiff [new file with mode: 0644]
unmaintained/recipes/icons/submit.tiff [new file with mode: 0644]
unmaintained/recipes/recipes.factor [new file with mode: 0644]
unmaintained/recipes/summary.txt [new file with mode: 0644]
unmaintained/semantic-db/semantic-db.factor [changed mode: 0755->0644]
unmaintained/sniffer/channels/bsd/bsd.factor [changed mode: 0755->0644]
unmaintained/sniffer/channels/sniffer.factor [changed mode: 0755->0644]
unmaintained/sniffer/io/filter/filter.factor [changed mode: 0755->0644]
unmaintained/sniffer/io/sniffer.factor [changed mode: 0755->0644]
unmaintained/springies/springies.factor [changed mode: 0755->0644]
unmaintained/sudokus/authors.txt [new file with mode: 0644]
unmaintained/sudokus/sudokus.factor [new file with mode: 0644]
unmaintained/sudokus/summary.txt [new file with mode: 0644]
unmaintained/tabs/tabs.factor [changed mode: 0755->0644]
unmaintained/ui/gadgets/alerts/alerts.factor [new file with mode: 0644]
unmaintained/ui/gadgets/alerts/authors.txt [new file with mode: 0644]
unmaintained/ui/gadgets/alerts/summary.txt [new file with mode: 0644]
unmaintained/ui/gadgets/comboboxes/authors.txt [new file with mode: 0644]
unmaintained/ui/gadgets/comboboxes/comboboxes.factor [new file with mode: 0644]
unmaintained/ui/gadgets/comboboxes/summary.txt [new file with mode: 0644]
unmaintained/ui/gadgets/controls/authors.txt [new file with mode: 0644]
unmaintained/ui/gadgets/controls/controls-docs.factor [new file with mode: 0644]
unmaintained/ui/gadgets/controls/controls.factor [new file with mode: 0644]
unmaintained/ui/gadgets/controls/summary.txt [new file with mode: 0644]
unmaintained/ui/gadgets/layout/authors.txt [new file with mode: 0644]
unmaintained/ui/gadgets/layout/layout-docs.factor [new file with mode: 0644]
unmaintained/ui/gadgets/layout/layout.factor [new file with mode: 0644]
unmaintained/ui/gadgets/layout/summary.txt [new file with mode: 0644]
unmaintained/ui/gadgets/poppers/authors.txt [new file with mode: 0644]
unmaintained/ui/gadgets/poppers/poppers.factor [new file with mode: 0644]
unmaintained/ui/offscreen/offscreen.factor [changed mode: 0755->0644]
vm/Config.freebsd
vm/Config.linux
vm/Config.netbsd
vm/Config.solaris
vm/allot.hpp
vm/arrays.cpp
vm/arrays.hpp
vm/bitwise_hacks.hpp
vm/byte_arrays.cpp
vm/byte_arrays.hpp
vm/code_block_visitor.hpp
vm/collector.hpp
vm/compaction.cpp
vm/contexts.cpp
vm/contexts.hpp
vm/data_heap.cpp
vm/data_heap_checker.cpp [new file with mode: 0644]
vm/debug.cpp
vm/factor.cpp
vm/free_list.cpp
vm/free_list.hpp
vm/full_collector.cpp
vm/gc.cpp
vm/gc.hpp
vm/generic_arrays.hpp
vm/image.cpp
vm/layouts.hpp
vm/objects.cpp
vm/objects.hpp
vm/os-genunix.cpp
vm/os-macosx.mm
vm/os-unix.cpp
vm/os-unix.hpp
vm/os-windows-ce.cpp
vm/os-windows-ce.hpp
vm/os-windows-nt.cpp
vm/os-windows.cpp
vm/os-windows.hpp
vm/primitives.cpp
vm/profiler.cpp
vm/run.cpp
vm/strings.cpp
vm/tagged.hpp
vm/vm.hpp
vm/words.cpp

index f85dbb9bee8524f8e6a240a24d2dc927350cc17e..e5229ef7dfb562cfeb4a676b7718f40a1926ef0c 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -44,6 +44,7 @@ DLL_OBJS = $(PLAF_DLL_OBJS) \
        vm/compaction.o \
        vm/contexts.o \
        vm/data_heap.o \
+       vm/data_heap_checker.o \
        vm/debug.o \
        vm/dispatch.o \
        vm/embedded_pointers.o \
index 82134e825ea1320da202a2069d254212904bbdd5..2c5a567d62a94cf14fb9694d2a732d3547267a8e 100644 (file)
@@ -1,16 +1,23 @@
+USING: help.markup help.syntax calendar quotations system ;\r
 IN: alarms\r
-USING: help.markup help.syntax calendar quotations ;\r
 \r
 HELP: alarm\r
 { $class-description "An alarm. Can be passed to " { $link cancel-alarm } "." } ;\r
 \r
 HELP: add-alarm\r
-{ $values { "quot" quotation } { "time" timestamp } { "frequency" { $maybe duration } } { "alarm" alarm } }\r
-{ $description "Creates and registers an alarm. If " { $snippet "frequency" } " is " { $link f } ", this will be a one-time alarm, otherwise it will fire with the given frequency. The quotation will be called from the alarm thread." } ;\r
+{ $values { "quot" quotation } { "start" duration } { "interval" { $maybe "duration/f" } } { "alarm" alarm } }\r
+{ $description "Creates and registers an alarm to start at " { $snippet "start" } " offset from the current time. If " { $snippet "interval" } " is " { $link f } ", this will be a one-time alarm, otherwise it will fire with the given frequency, with scheduling happening before the quotation is called in order to ensure that the next event will happen on time. The quotation will be called from the alarm thread." } ;\r
 \r
 HELP: later\r
 { $values { "quot" quotation } { "duration" duration } { "alarm" alarm } }\r
-{ $description "Creates and registers an alarm which calls the quotation once at " { $snippet "time" } " from now." } ;\r
+{ $description "Creates and registers an alarm which calls the quotation once at " { $snippet "duration" } " offset from now." }\r
+{ $examples\r
+    { $unchecked-example\r
+        "USING: alarms io calendar ;"\r
+        """[ "Break's over!" print flush ] 15 minutes drop"""\r
+        ""\r
+    }\r
+} ;\r
 \r
 HELP: cancel-alarm\r
 { $values { "alarm" alarm } }\r
@@ -20,16 +27,27 @@ HELP: every
 { $values\r
      { "quot" quotation } { "duration" duration }\r
      { "alarm" alarm } }\r
-{ $description "Creates and registers an alarm which calls the quotation repeatedly, using " { $snippet "dt" } " as the frequency." } ;\r
+{ $description "Creates and registers an alarm which calls the quotation repeatedly, using " { $snippet "dt" } " as the frequency." }\r
+{ $examples\r
+    { $unchecked-example\r
+        "USING: alarms io calendar ;"\r
+        """[ "Hi Buddy." print flush ] 10 seconds every drop"""\r
+        ""\r
+    }\r
+} ;\r
 \r
 ARTICLE: "alarms" "Alarms"\r
-"The " { $vocab-link "alarms" } " vocabulary provides a lightweight way to schedule one-time and recurring tasks without spawning a new thread."\r
-{ $subsections\r
-    alarm\r
-    add-alarm\r
-    later\r
-    cancel-alarm\r
-}\r
+"The " { $vocab-link "alarms" } " vocabulary provides a lightweight way to schedule one-time and recurring tasks without spawning a new thread. Alarms use " { $link nano-count } ", so they continue to work across system clock changes." $nl\r
+"The alarm class:"\r
+{ $subsections alarm }\r
+"Register a recurring alarm:"\r
+{ $subsections every }\r
+"Register a one-time alarm:"\r
+{ $subsections later }\r
+"Low-level interface to add alarms:"\r
+{ $subsections add-alarm }\r
+"Cancelling an alarm:"\r
+{ $subsections cancel-alarm }\r
 "Alarms do not persist across image saves. Saving and restoring an image has the effect of calling " { $link cancel-alarm } " on all " { $link alarm } " instances." ;\r
 \r
 ABOUT: "alarms"\r
index 9943d39ad194a6d0efe5d356d3873afa6099ed94..251d82eec8f096704be879493699c5f599cfda64 100644 (file)
@@ -2,12 +2,12 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs boxes calendar
 combinators.short-circuit fry heaps init kernel math.order
-namespaces quotations threads ;
+namespaces quotations threads math system ;
 IN: alarms
 
 TUPLE: alarm
     { quot callable initial: [ ] }
-    { time timestamp }
+    { start integer }
     interval
     { entry box } ;
 
@@ -19,30 +19,33 @@ SYMBOL: alarm-thread
 : notify-alarm-thread ( -- )
     alarm-thread get-global interrupt ;
 
-ERROR: bad-alarm-frequency frequency ;
-: check-alarm ( frequency/f -- frequency/f )
-    dup { [ duration? ] [ not ] } 1|| [ bad-alarm-frequency ] unless ;
+: normalize-argument ( obj -- nanoseconds )
+    >duration duration>nanoseconds >integer ;
 
-: <alarm> ( quot time frequency -- alarm )
-    check-alarm <box> alarm boa ;
+: <alarm> ( quot start interval -- alarm )
+    alarm new
+        swap dup [ normalize-argument ] when >>interval
+        swap dup [ normalize-argument nano-count + ] when >>start
+        swap >>quot
+        <box> >>entry ;
 
 : register-alarm ( alarm -- )
-    [ dup time>> alarms get-global heap-push* ]
+    [ dup start>> alarms get-global heap-push* ]
     [ entry>> >box ] bi
     notify-alarm-thread ;
 
-: alarm-expired? ( alarm now -- ? )
-    [ time>> ] dip before=? ;
+: alarm-expired? ( alarm n -- ? )
+    [ start>> ] dip <= ;
 
 : reschedule-alarm ( alarm -- )
-    dup '[ _ interval>> time+ now max ] change-time register-alarm ;
+    dup interval>> nano-count + >>start register-alarm ;
 
 : call-alarm ( alarm -- )
     [ entry>> box> drop ]
-    [ quot>> "Alarm execution" spawn drop ]
-    [ dup interval>> [ reschedule-alarm ] [ drop ] if ] tri ;
+    [ dup interval>> [ reschedule-alarm ] [ drop ] if ]
+    [ quot>> "Alarm execution" spawn drop ] tri ;
 
-: (trigger-alarms) ( alarms now -- )
+: (trigger-alarms) ( alarms n -- )
     over heap-empty? [
         2drop
     ] [
@@ -54,11 +57,10 @@ ERROR: bad-alarm-frequency frequency ;
     ] if ;
 
 : trigger-alarms ( alarms -- )
-    now (trigger-alarms) ;
+    nano-count (trigger-alarms) ;
 
-: next-alarm ( alarms -- timestamp/f )
-    dup heap-empty?
-    [ drop f ] [ heap-peek drop time>> ] if ;
+: next-alarm ( alarms -- nanos/f )
+    dup heap-empty? [ drop f ] [ heap-peek drop start>> ] if ;
 
 : alarm-thread-loop ( -- )
     alarms get-global
@@ -75,18 +77,16 @@ ERROR: bad-alarm-frequency frequency ;
     [ alarm-thread-loop t ] "Alarms" spawn-server
     alarm-thread set-global ;
 
-[ init-alarms ] "alarms" add-init-hook
+[ init-alarms ] "alarms" add-startup-hook
 
 PRIVATE>
 
-: add-alarm ( quot time frequency -- alarm )
+: add-alarm ( quot start interval -- alarm )
     <alarm> [ register-alarm ] keep ;
 
-: later ( quot duration -- alarm )
-    hence f add-alarm ;
+: later ( quot duration -- alarm ) f add-alarm ;
 
-: every ( quot duration -- alarm )
-    [ hence ] keep add-alarm ;
+: every ( quot duration -- alarm ) dup add-alarm ;
 
 : cancel-alarm ( alarm -- )
     entry>> [ alarms get-global heap-delete ] if-box? ;
old mode 100755 (executable)
new mode 100644 (file)
index ee75d22..7eed1a0
@@ -20,6 +20,8 @@ M: array heap-size unclip [ array-length ] [ heap-size ] bi* * ;
 
 M: array c-type-align first c-type-align ;
 
+M: array c-type-align-first first c-type-align-first ;
+
 M: array c-type-stack-align? drop f ;
 
 M: array unbox-parameter drop void* unbox-parameter ;
@@ -55,6 +57,9 @@ M: string-type heap-size
 M: string-type c-type-align
     drop void* c-type-align ;
 
+M: string-type c-type-align-first
+    drop void* c-type-align-first ;
+
 M: string-type c-type-stack-align?
     drop void* c-type-stack-align? ;
 
@@ -97,5 +102,5 @@ M: string-type c-type-setter
 { char* utf8 } char* typedef
 char* uchar* typedef
 
-char  char*  "pointer-c-type" set-word-prop
+char char* "pointer-c-type" set-word-prop
 uchar uchar* "pointer-c-type" set-word-prop
old mode 100755 (executable)
new mode 100644 (file)
index a0dea4e..b221051
@@ -66,12 +66,12 @@ HELP: unbox-return
 { $notes "This is an internal word used by the compiler when compiling callbacks." } ;
 
 HELP: define-deref
-{ $values { "name" "a word name" } }
+{ $values { "c-type" "a C type" } }
 { $description "Defines a word " { $snippet "*name" } " with stack effect " { $snippet "( c-ptr -- value )" } " for reading a value with C type " { $snippet "name" } " stored at an alien pointer." }
 { $notes "This is an internal word called when defining C types, there is no need to call it on your own." } ;
 
 HELP: define-out
-{ $values { "name" "a word name" } }
+{ $values { "c-type" "a C type" } }
 { $description "Defines a word " { $snippet "<" { $emphasis "name" } ">" } " with stack effect " { $snippet "( value -- array )" } ". This word allocates a byte array large enough to hold a value with C type " { $snippet "name" } ", and writes the value at the top of the stack to the array." }
 { $notes "This is an internal word called when defining C types, there is no need to call it on your own." } ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index cfbed53..1245aed
@@ -30,8 +30,9 @@ TUPLE: abstract-c-type
 { unboxer-quot callable }
 { getter callable }
 { setter callable }
-size
-align ;
+{ size integer }
+{ align integer }
+{ align-first integer } ;
 
 TUPLE: c-type < abstract-c-type
 boxer
@@ -104,10 +105,9 @@ M: word c-type
 
 GENERIC: c-struct? ( c-type -- ? )
 
-M: object c-struct?
-    drop f ;
-M: c-type-name c-struct?
-    dup void? [ drop f ] [ c-type c-struct? ] if ;
+M: object c-struct? drop f ;
+
+M: c-type-name c-struct? dup void? [ drop f ] [ c-type c-struct? ] if ;
 
 ! These words being foldable means that words need to be
 ! recompiled if a C type is redefined. Even so, folding the
@@ -172,6 +172,12 @@ M: abstract-c-type c-type-align align>> ;
 
 M: c-type-name c-type-align c-type c-type-align ;
 
+GENERIC: c-type-align-first ( name -- n )
+
+M: c-type-name c-type-align-first c-type c-type-align-first ;
+
+M: abstract-c-type c-type-align-first align-first>> ;
+
 GENERIC: c-type-stack-align? ( name -- ? )
 
 M: c-type c-type-stack-align? stack-align?>> ;
@@ -212,13 +218,13 @@ M: c-type-name unbox-return c-type unbox-return ;
 
 : little-endian? ( -- ? ) 1 <int> *char 1 = ; foldable
 
-GENERIC: heap-size ( name -- size ) foldable
+GENERIC: heap-size ( name -- size )
 
 M: c-type-name heap-size c-type heap-size ;
 
 M: abstract-c-type heap-size size>> ;
 
-GENERIC: stack-size ( name -- size ) foldable
+GENERIC: stack-size ( name -- size )
 
 M: c-type-name stack-size c-type stack-size ;
 
@@ -291,20 +297,17 @@ M: long-long-type box-parameter ( n c-type -- )
 M: long-long-type box-return ( c-type -- )
     f swap box-parameter ;
 
-: define-deref ( name -- )
-    [ CHAR: * prefix "alien.c-types" create ] [ c-getter 0 prefix ] bi
+: define-deref ( c-type -- )
+    [ name>> CHAR: * prefix "alien.c-types" create ] [ c-getter 0 prefix ] bi
     (( c-ptr -- value )) define-inline ;
 
-: define-out ( name -- )
-    [ "alien.c-types" constructor-word ]
+: define-out ( c-type -- )
+    [ name>> "alien.c-types" constructor-word ]
     [ dup c-setter '[ _ heap-size (byte-array) [ 0 @ ] keep ] ] bi
     (( value -- c-ptr )) define-inline ;
 
 : define-primitive-type ( c-type name -- )
-    [ typedef ]
-    [ name>> define-deref ]
-    [ name>> define-out ]
-    tri ;
+    [ typedef ] [ define-deref ] [ define-out ] tri ;
 
 : if-void ( c-type true false -- )
     pick void? [ drop nip call ] [ nip call ] if ; inline
@@ -324,6 +327,13 @@ SYMBOLS:
     ptrdiff_t intptr_t uintptr_t size_t
     char* uchar* ;
 
+: 8-byte-alignment ( c-type -- c-type )
+    {
+        { [ cpu ppc? os macosx? and ] [ 4 >>align 8 >>align-first ] }
+        { [ cpu x86.32? os windows? not and ] [ 4 >>align 4 >>align-first ] }
+        [ 8 >>align 8 >>align-first ]
+    } cond ;
+
 [
     <c-type>
         c-ptr >>class
@@ -332,6 +342,7 @@ SYMBOLS:
         [ [ >c-ptr ] 2dip set-alien-cell ] >>setter
         bootstrap-cell >>size
         bootstrap-cell >>align
+        bootstrap-cell >>align-first
         [ >c-ptr ] >>unboxer-quot
         "box_alien" >>boxer
         "alien_offset" >>unboxer
@@ -343,7 +354,7 @@ SYMBOLS:
         [ alien-signed-8 ] >>getter
         [ set-alien-signed-8 ] >>setter
         8 >>size
-        cpu x86.32? os windows? not and 4 8 ? >>align
+        8-byte-alignment
         "box_signed_8" >>boxer
         "to_signed_8" >>unboxer
     \ longlong define-primitive-type
@@ -354,7 +365,7 @@ SYMBOLS:
         [ alien-unsigned-8 ] >>getter
         [ set-alien-unsigned-8 ] >>setter
         8 >>size
-        cpu x86.32? os windows? not and 4 8 ? >>align
+        8-byte-alignment
         "box_unsigned_8" >>boxer
         "to_unsigned_8" >>unboxer
     \ ulonglong define-primitive-type
@@ -366,6 +377,7 @@ SYMBOLS:
         [ set-alien-signed-cell ] >>setter
         bootstrap-cell >>size
         bootstrap-cell >>align
+        bootstrap-cell >>align-first
         "box_signed_cell" >>boxer
         "to_fixnum" >>unboxer
     \ long define-primitive-type
@@ -377,6 +389,7 @@ SYMBOLS:
         [ set-alien-unsigned-cell ] >>setter
         bootstrap-cell >>size
         bootstrap-cell >>align
+        bootstrap-cell >>align-first
         "box_unsigned_cell" >>boxer
         "to_cell" >>unboxer
     \ ulong define-primitive-type
@@ -388,6 +401,7 @@ SYMBOLS:
         [ set-alien-signed-4 ] >>setter
         4 >>size
         4 >>align
+        4 >>align-first
         "box_signed_4" >>boxer
         "to_fixnum" >>unboxer
     \ int define-primitive-type
@@ -399,6 +413,7 @@ SYMBOLS:
         [ set-alien-unsigned-4 ] >>setter
         4 >>size
         4 >>align
+        4 >>align-first
         "box_unsigned_4" >>boxer
         "to_cell" >>unboxer
     \ uint define-primitive-type
@@ -410,6 +425,7 @@ SYMBOLS:
         [ set-alien-signed-2 ] >>setter
         2 >>size
         2 >>align
+        2 >>align-first
         "box_signed_2" >>boxer
         "to_fixnum" >>unboxer
     \ short define-primitive-type
@@ -421,6 +437,7 @@ SYMBOLS:
         [ set-alien-unsigned-2 ] >>setter
         2 >>size
         2 >>align
+        2 >>align-first
         "box_unsigned_2" >>boxer
         "to_cell" >>unboxer
     \ ushort define-primitive-type
@@ -432,6 +449,7 @@ SYMBOLS:
         [ set-alien-signed-1 ] >>setter
         1 >>size
         1 >>align
+        1 >>align-first
         "box_signed_1" >>boxer
         "to_fixnum" >>unboxer
     \ char define-primitive-type
@@ -443,6 +461,7 @@ SYMBOLS:
         [ set-alien-unsigned-1 ] >>setter
         1 >>size
         1 >>align
+        1 >>align-first
         "box_unsigned_1" >>boxer
         "to_cell" >>unboxer
     \ uchar define-primitive-type
@@ -453,6 +472,7 @@ SYMBOLS:
             [ [ >c-bool ] 2dip set-alien-unsigned-4 ] >>setter
             4 >>size
             4 >>align
+            4 >>align-first
             "box_boolean" >>boxer
             "to_boolean" >>unboxer
     ] [
@@ -461,10 +481,11 @@ SYMBOLS:
             [ [ >c-bool ] 2dip set-alien-unsigned-1 ] >>setter
             1 >>size
             1 >>align
+            1 >>align-first
             "box_boolean" >>boxer
             "to_boolean" >>unboxer
-        \ bool define-primitive-type
     ] if
+    \ bool define-primitive-type
 
     <c-type>
         math:float >>class
@@ -473,6 +494,7 @@ SYMBOLS:
         [ [ >float ] 2dip set-alien-float ] >>setter
         4 >>size
         4 >>align
+        4 >>align-first
         "box_float" >>boxer
         "to_float" >>unboxer
         float-rep >>rep
@@ -485,7 +507,7 @@ SYMBOLS:
         [ alien-double ] >>getter
         [ [ >float ] 2dip set-alien-double ] >>setter
         8 >>size
-        cpu x86.32? os windows? not and 4 8 ? >>align
+        8-byte-alignment
         "box_double" >>boxer
         "to_double" >>unboxer
         double-rep >>rep
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 01eb002e447df51288fad9e384028dcd3548aaf6..7cae86b18672d4018ac209f203c45dca331900e7 100644 (file)
@@ -2,7 +2,8 @@ USING: continuations kernel io debugger vocabs words system namespaces ;
 
 :c
 :error
+
 "listener" vocab
 [ restarts. vocab-main execute ]
-[ die ] if*
+[ error get die ] if*
 1 exit
old mode 100755 (executable)
new mode 100644 (file)
index ab08aa87a9b02fa170d8cebe5f386a7cbaff74bd..70ccaedad422a1110da717d6f8fa91196527c66a 100644 (file)
@@ -3,7 +3,7 @@ namespaces eval kernel vocabs.loader io ;
 
 [
     boot
-    do-init-hooks
+    do-startup-hooks
     [
         (command-line) parse-command-line
         load-vocab-roots
@@ -14,4 +14,4 @@ namespaces eval kernel vocabs.loader io ;
         output-stream get [ stream-flush ] when*
         0 exit
     ] [ print-error 1 exit ] recover
-] set-boot-quot
+] set-startup-quot
index 49f504fd41441d34f148171aefb5c9f3a43f70b4..4512d84053246094415e10c77de2463ded519df6 100644 (file)
@@ -1,11 +1,10 @@
-USING: init command-line system namespaces kernel vocabs.loader
-io ;
+USING: init command-line system namespaces kernel vocabs.loader io ;
 
 [
     boot
-    do-init-hooks
+    do-startup-hooks
     (command-line) parse-command-line
     "run" get run
     output-stream get [ stream-flush ] when*
     0 exit
-] set-boot-quot
+] set-startup-quot
index 2178b5d4cb45653fc92ba9d29b0cfc252ed88278..eb08809ec1412280a8fef3059f684cc7da687b03 100644 (file)
@@ -71,6 +71,9 @@ C: <eq-wrapper> eq-wrapper
 M: eq-wrapper equal?
     over eq-wrapper? [ [ obj>> ] bi@ eq? ] [ 2drop f ] if ;
 
+M: eq-wrapper hashcode*
+    nip obj>> identity-hashcode ;
+
 SYMBOL: objects
 
 : cache-eql-object ( obj quot -- value )
@@ -142,7 +145,7 @@ SYMBOL: architecture
 RESET
 
 ! Boot quotation, set in stage1.factor
-USERENV: bootstrap-boot-quot 20
+USERENV: bootstrap-startup-quot 20
 
 ! Bootstrap global namesapce
 USERENV: bootstrap-global 21
@@ -224,9 +227,11 @@ USERENV: undefined-quot 60
 
 : emit-fixnum ( n -- ) tag-fixnum emit ;
 
+: emit-header ( n -- ) tag-header emit ;
+
 : emit-object ( class quot -- addr )
     [ type-number ] dip over here-as
-    [ swap tag-fixnum emit call align-here ] dip ;
+    [ swap emit-header call align-here ] dip ;
     inline
 
 ! Write an object to the image.
@@ -234,7 +239,7 @@ GENERIC: ' ( obj -- ptr )
 
 ! Image header
 
-: emit-header ( -- )
+: emit-image-header ( -- )
     image-magic emit
     image-version emit
     data-base emit ! relocation base at end of header
@@ -518,7 +523,7 @@ M: quotation '
 : build-image ( -- image )
     800000 <vector> image set
     20000 <hashtable> objects set
-    emit-header t, 0, 1, -1,
+    emit-image-header t, 0, 1, -1,
     "Building generic words..." print flush
     remake-generics
     "Serializing words..." print flush
index 0b517c0e66f649fd0c4d1228d2d422fa52390b26..98b6a472edc0e0ad49b44076e790379c67d11a7c 100644 (file)
@@ -35,8 +35,8 @@ SYMBOL: bootstrap-time
 : count-words ( pred -- )
     all-words swap count number>string write ; inline
 
-: print-time ( ms -- )
-    1000 /i
+: print-time ( us -- )
+    1,000,000,000 /i
     60 /mod swap
     number>string write
     " minutes and " write number>string write " seconds." print ;
@@ -56,9 +56,10 @@ SYMBOL: bootstrap-time
     error-continuation set-global
     error set-global ; inline
 
+
 [
     ! We time bootstrap
-    millis
+    nano-count
 
     default-image-name "output-image" set-global
 
@@ -83,14 +84,14 @@ SYMBOL: bootstrap-time
 
     load-components
 
-    millis over - core-bootstrap-time set-global
+    nano-count over - core-bootstrap-time set-global
 
     run-bootstrap-init
 
     f error set-global
     f error-continuation set-global
 
-    millis swap - bootstrap-time set-global
+    nano-count swap - bootstrap-time set-global
     print-report
 
     "deploy-vocab" get [
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 074798a..38398ae
@@ -16,7 +16,7 @@ ERROR: cairo-error message ;
 
 : check-surface ( surface -- ) cairo_surface_status (check-cairo) ;
 
-: width>stride ( width -- stride ) "uint" heap-size * ; inline
+: width>stride ( width -- stride ) uint heap-size * ; inline
 
 : <image-surface> ( data dim -- surface )
     [ CAIRO_FORMAT_ARGB32 ] dip first2 over width>stride
index 8cb1e751b26fde2202ad6c3967f847cfd6a77e8d..616c4d2c2c77873f2ea8b0968972ebd91ffd5c4a 100644 (file)
@@ -32,7 +32,7 @@ HELP: month-names
 { $warning "Do not use this array for looking up a month name directly. Use month-name instead." } ;
 
 HELP: month-name
-{ $values { "n" integer } { "string" string } }
+{ $values { "obj" { $or integer timestamp } } { "string" string } }
 { $description "Looks up the month name and returns it as a string.  January has an index of 1 instead of zero." } ;
 
 HELP: month-abbreviations
@@ -46,11 +46,11 @@ HELP: month-abbreviation
 
 
 HELP: day-names
-{ $values { "array" array } }
+{ $values { "value" array } }
 { $description "Returns an array with the English names of the days of the week." } ;
 
 HELP: day-name
-{ $values { "n" integer } { "string" string } }
+{ $values { "obj" { $or integer timestamp } } { "string" string } }
 { $description "Looks up the day name and returns it as a string." } ;
 
 HELP: day-abbreviations2
@@ -355,7 +355,7 @@ HELP: before
 
 HELP: <zero>
 { $values { "timestamp" timestamp } }
-{ $description "Outputs a zero timestamp that consists of zeros for every slot.  Used to see if timestamps are valid." } ;
+{ $description "Returns a zero timestamp that consists of zeros for every slot.  Used to see if timestamps are valid." } ;
 
 HELP: valid-timestamp?
 { $values { "timestamp" timestamp } { "?" "a boolean" } }
@@ -363,7 +363,7 @@ HELP: valid-timestamp?
 
 HELP: unix-1970
 { $values { "timestamp" timestamp } }
-{ $description "Outputs the beginning of UNIX time, or midnight, January 1, 1970." } ;
+{ $description "Returns the beginning of UNIX time, or midnight, January 1, 1970." } ;
 
 HELP: micros>timestamp
 { $values { "x" number } { "timestamp" timestamp } }
@@ -377,13 +377,13 @@ HELP: micros>timestamp
 
 HELP: gmt
 { $values { "timestamp" timestamp } }
-{ $description "Outputs the time right now, but in the GMT timezone." } ;
+{ $description "Returns the time right now, but in the GMT timezone." } ;
 
 { gmt now } related-words
 
 HELP: now
 { $values { "timestamp" timestamp } }
-{ $description "Outputs the time right now in your computer's timezone." }
+{ $description "Returns the time right now in your computer's timezone." }
 { $examples
     { $unchecked-example "USING: calendar prettyprint ;"
         "now ."
@@ -490,23 +490,23 @@ HELP: saturday
 
 HELP: midnight
 { $values { "timestamp" timestamp } { "new-timestamp" timestamp } }
-{ $description "Returns a timestamp that represents today at midnight, or the beginning of the day." } ;
+{ $description "Returns a new timestamp that represents today at midnight, or the beginning of the day." } ;
 
 HELP: noon
 { $values { "timestamp" timestamp } { "new-timestamp" timestamp } }
-{ $description "Returns a timestamp that represents today at noon, or the middle of the day." } ;
+{ $description "Returns a new timestamp that represents today at noon, or the middle of the day." } ;
 
 HELP: beginning-of-month
 { $values { "timestamp" timestamp } { "new-timestamp" timestamp } }
-{ $description "Outputs a timestamp with the day set to one." } ;
+{ $description "Returns a new timestamp with the day set to one." } ;
 
 HELP: beginning-of-week
 { $values { "timestamp" timestamp } { "new-timestamp" timestamp } }
-{ $description "Outputs a timestamp where the day of the week is Sunday." } ;
+{ $description "Returns a new timestamp where the day of the week is Sunday." } ;
 
 HELP: beginning-of-year
-{ $values { "timestamp" timestamp } { "new-timestamp" timestamp } }
-{ $description "Outputs a timestamp with the month and day set to one, or January 1 of the input timestamp." } ;
+{ $values { "object" object } { "new-timestamp" timestamp } }
+{ $description "Returns a new timestamp with the month and day set to one, or January 1 of the input timestamp, given a year or a timestamp." } ;
 
 HELP: time-since-midnight
 { $values { "timestamp" timestamp } { "duration" duration } }
index 8d1071122d98f5c58bb214097f785a460311a6cf..2490b87c374b0876dc6bf991d2b7ec232f305a31 100644 (file)
@@ -1,5 +1,6 @@
 USING: arrays calendar kernel math sequences tools.test
-continuations system math.order threads accessors ;
+continuations system math.order threads accessors
+random ;
 IN: calendar.tests
 
 [ f ] [ 2004 12 32 0   0  0 instant <timestamp> valid-timestamp? ] unit-test
@@ -139,7 +140,7 @@ IN: calendar.tests
 [ +gt+ ] [ 2005 1 1 12 30 0 instant <timestamp>
         2004 1 1 13 30 0 instant <timestamp> <=> ] unit-test
 
-[ t ] [ now timestamp>micros micros - 1000000 < ] unit-test
+[ t ] [ now timestamp>micros system-micros - 1000000 < ] unit-test
 [ t ] [ 0 micros>timestamp unix-1970 = ] unit-test
 [ t ] [ 123456789000000 [ micros>timestamp timestamp>micros ] keep = ] unit-test
 [ t ] [ 123456789123456000 [ micros>timestamp timestamp>micros ] keep = ] unit-test
@@ -170,3 +171,8 @@ IN: calendar.tests
 [ f ] [ now dup midnight eq? ] unit-test
 [ f ] [ now dup easter eq? ] unit-test
 [ f ] [ now dup beginning-of-year eq? ] unit-test
+
+[ t ] [ 1325376000 unix-time>timestamp 2012 <year-gmt> = ] unit-test
+[ t ] [ 1356998399 unix-time>timestamp 2013 <year-gmt> 1 seconds time- = ] unit-test
+
+[ t ] [ 1500000000 random [ unix-time>timestamp timestamp>unix-time ] keep = ] unit-test
index 0378e2701ee16e2a61c58576e13bf4ec3f4222ef..fd51feeed97e8e4fc64fe87196c54210c42ee25b 100644 (file)
@@ -17,6 +17,8 @@ TUPLE: duration
 
 C: <duration> duration
 
+: instant ( -- duration ) 0 0 0 0 0 0 <duration> ;
+
 TUPLE: timestamp
     { year integer }
     { month integer }
@@ -34,6 +36,15 @@ C: <timestamp> timestamp
 : <date> ( year month day -- timestamp )
     0 0 0 gmt-offset-duration <timestamp> ;
 
+: <date-gmt> ( year month day -- timestamp )
+    0 0 0 instant <timestamp> ;
+
+: <year> ( year -- timestamp )
+    1 1 <date> ;
+
+: <year-gmt> ( year -- timestamp )
+    1 1 <date-gmt> ;
+
 ERROR: not-a-month ;
 M: not-a-month summary
     drop "Months are indexed starting at 1" ;
@@ -51,8 +62,16 @@ CONSTANT: month-names
         "July" "August" "September" "October" "November" "December"
     }
 
-: month-name ( n -- string )
-    check-month 1 - month-names nth ;
+<PRIVATE
+
+: (month-name) ( n -- string ) 1 - month-names nth ;
+
+PRIVATE>
+
+GENERIC: month-name ( obj -- string )
+
+M: integer month-name check-month 1 - month-names nth ;
+M: timestamp month-name month>> 1 - month-names nth ;
 
 CONSTANT: month-abbreviations
     {
@@ -65,12 +84,8 @@ CONSTANT: month-abbreviations
 
 CONSTANT: day-counts { 0 31 28 31 30 31 30 31 31 30 31 30 31 }
 
-: day-names ( -- array )
-    {
-        "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"
-    } ;
-
-: day-name ( n -- string ) day-names nth ;
+CONSTANT: day-names
+    { "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" }
 
 CONSTANT: day-abbreviations2
     { "Su" "Mo" "Tu" "We" "Th" "Fr" "Sa" }
@@ -145,7 +160,6 @@ M: timestamp easter ( timestamp -- timestamp )
 : >time< ( timestamp -- hour minute second )
     [ hour>> ] [ minute>> ] [ second>> ] tri ;
 
-: instant ( -- duration ) 0 0 0 0 0 0 <duration> ;
 : years ( x -- duration ) instant clone swap >>year ;
 : months ( x -- duration ) instant clone swap >>month ;
 : days ( x -- duration ) instant clone swap >>day ;
@@ -157,6 +171,23 @@ M: timestamp easter ( timestamp -- timestamp )
 : microseconds ( x -- duration ) 1000000 / seconds ;
 : nanoseconds ( x -- duration ) 1000000000 / seconds ;
 
+GENERIC: >duration ( obj -- duration/f )
+M: duration >duration ;
+M: real >duration seconds ;
+M: f >duration ;
+
+GENERIC: year ( obj -- n )
+M: integer year ;
+M: timestamp year year>> ;
+
+GENERIC: month ( obj -- n )
+M: integer month ;
+M: timestamp month month>> ;
+
+GENERIC: day ( obj -- n )
+M: integer day ;
+M: timestamp day day>> ;
+
 GENERIC: leap-year? ( obj -- ? )
 
 M: integer leap-year? ( year -- ? )
@@ -305,6 +336,9 @@ GENERIC: time- ( time1 time2 -- time3 )
 M: timestamp <=> ( ts1 ts2 -- n )
     [ >gmt tuple-slots ] compare ;
 
+: same-day? ( ts1 ts2 -- ? )
+    [ >gmt >date< <date> ] bi@ = ;
+
 : (time-) ( timestamp timestamp -- n )
     [ >gmt ] bi@
     [ [ >date< julian-day-number ] bi@ - 86400 * ] 2keep
@@ -357,7 +391,7 @@ M: duration time-
 
 : gmt ( -- timestamp )
     #! GMT time, right now
-    unix-1970 micros microseconds time+ ;
+    unix-1970 system-micros microseconds time+ ;
 
 : now ( -- timestamp ) gmt >local-time ;
 : hence ( duration -- timestamp ) now swap time+ ;
@@ -387,6 +421,10 @@ M: timestamp days-in-year ( timestamp -- n ) year>> days-in-year ;
 : day-of-week ( timestamp -- n )
     >date< zeller-congruence ;
 
+GENERIC: day-name ( obj -- string )
+M: integer day-name day-names nth ;
+M: timestamp day-name day-of-week day-names nth ;
+
 :: (day-of-year) ( year month day -- n )
     day-counts month head-slice sum day +
     year leap-year? [
@@ -398,14 +436,75 @@ M: timestamp days-in-year ( timestamp -- n ) year>> days-in-year ;
 : day-of-year ( timestamp -- n )
     >date< (day-of-year) ;
 
+: midnight ( timestamp -- new-timestamp )
+    clone 0 >>hour 0 >>minute 0 >>second ; inline
+
+: noon ( timestamp -- new-timestamp )
+    midnight 12 >>hour ; inline
+
+: beginning-of-month ( timestamp -- new-timestamp )
+    midnight 1 >>day ;
+
+: end-of-month ( timestamp -- new-timestamp )
+    [ midnight ] [ days-in-month ] bi >>day ;
+
 <PRIVATE
-: day-offset ( timestamp m -- timestamp n )
+
+: day-offset ( timestamp m -- new-timestamp n )
     over day-of-week - ; inline
 
-: day-this-week ( timestamp n -- timestamp )
+: day-this-week ( timestamp n -- new-timestamp )
     day-offset days time+ ;
+
+:: nth-day-this-month ( timestamp n day -- new-timestamp )
+    timestamp beginning-of-month day day-this-week
+    dup timestamp [ month>> ] bi@ = [ 1 weeks time+ ] unless
+    n 1 - [ weeks time+ ] unless-zero ;
+
+: last-day-this-month ( timestamp day -- new-timestamp )
+    [ 1 months time+ 1 ] dip nth-day-this-month 1 weeks time- ;
+
 PRIVATE>
 
+GENERIC: january ( obj -- timestamp )
+GENERIC: february ( obj -- timestamp )
+GENERIC: march ( obj -- timestamp )
+GENERIC: april ( obj -- timestamp )
+GENERIC: may ( obj -- timestamp )
+GENERIC: june ( obj -- timestamp )
+GENERIC: july ( obj -- timestamp )
+GENERIC: august ( obj -- timestamp )
+GENERIC: september ( obj -- timestamp )
+GENERIC: october ( obj -- timestamp )
+GENERIC: november ( obj -- timestamp )
+GENERIC: december ( obj -- timestamp )
+
+M: integer january 1 1 <date> ;
+M: integer february 2 1 <date> ;
+M: integer march 3 1 <date> ;
+M: integer april 4 1 <date> ;
+M: integer may 5 1 <date> ;
+M: integer june 6 1 <date> ;
+M: integer july 7 1 <date> ;
+M: integer august 8 1 <date> ;
+M: integer september 9 1 <date> ;
+M: integer october 10 1 <date> ;
+M: integer november 11 1 <date> ;
+M: integer december 12 1 <date> ;
+
+M: timestamp january clone 1 >>month ;
+M: timestamp february clone 2 >>month ;
+M: timestamp march clone 3 >>month ;
+M: timestamp april clone 4 >>month ;
+M: timestamp may clone 5 >>month ;
+M: timestamp june clone 6 >>month ;
+M: timestamp july clone 7 >>month ;
+M: timestamp august clone 8 >>month ;
+M: timestamp september clone 9 >>month ;
+M: timestamp october clone 10 >>month ;
+M: timestamp november clone 11 >>month ;
+M: timestamp december clone 12 >>month ;
+
 : sunday ( timestamp -- new-timestamp ) 0 day-this-week ;
 : monday ( timestamp -- new-timestamp ) 1 day-this-week ;
 : tuesday ( timestamp -- new-timestamp ) 2 day-this-week ;
@@ -414,20 +513,40 @@ PRIVATE>
 : friday ( timestamp -- new-timestamp ) 5 day-this-week ;
 : saturday ( timestamp -- new-timestamp ) 6 day-this-week ;
 
-: midnight ( timestamp -- new-timestamp )
-    clone 0 >>hour 0 >>minute 0 >>second ; inline
-
-: noon ( timestamp -- new-timestamp )
-    midnight 12 >>hour ; inline
-
-: beginning-of-month ( timestamp -- new-timestamp )
-    midnight 1 >>day ;
+: sunday? ( timestamp -- ? ) day-of-week 0 = ;
+: monday? ( timestamp -- ? ) day-of-week 1 = ;
+: tuesday? ( timestamp -- ? ) day-of-week 2 = ;
+: wednesday? ( timestamp -- ? ) day-of-week 3 = ;
+: thursday? ( timestamp -- ? ) day-of-week 4 = ;
+: friday? ( timestamp -- ? ) day-of-week 5 = ;
+: saturday? ( timestamp -- ? ) day-of-week 6 = ;
+
+: sunday-of-month ( timestamp n -- new-timestamp ) 0 nth-day-this-month ;
+: monday-of-month ( timestamp n -- new-timestamp ) 1 nth-day-this-month ;
+: tuesday-of-month ( timestamp n -- new-timestamp ) 2 nth-day-this-month ;
+: wednesday-of-month ( timestamp n -- new-timestamp ) 3 nth-day-this-month ;
+: thursday-of-month ( timestamp n -- new-timestamp ) 4 nth-day-this-month ;
+: friday-of-month ( timestamp n -- new-timestamp ) 5 nth-day-this-month ;
+: saturday-of-month ( timestamp n -- new-timestamp ) 6 nth-day-this-month ;
+
+: last-sunday-of-month ( timestamp -- new-timestamp ) 0 last-day-this-month ;
+: last-monday-of-month ( timestamp -- new-timestamp ) 1 last-day-this-month ;
+: last-tuesday-of-month ( timestamp -- new-timestamp ) 2 last-day-this-month ;
+: last-wednesday-of-month ( timestamp -- new-timestamp ) 3 last-day-this-month ;
+: last-thursday-of-month ( timestamp -- new-timestamp ) 4 last-day-this-month ;
+: last-friday-of-month ( timestamp -- new-timestamp ) 5 last-day-this-month ;
+: last-saturday-of-month ( timestamp -- new-timestamp ) 6 last-day-this-month ;
 
 : beginning-of-week ( timestamp -- new-timestamp )
     midnight sunday ;
 
-: beginning-of-year ( timestamp -- new-timestamp )
-    beginning-of-month 1 >>month ;
+GENERIC: beginning-of-year ( object -- new-timestamp )
+M: timestamp beginning-of-year beginning-of-month 1 >>month ;
+M: integer beginning-of-year <year> ;
+
+GENERIC: end-of-year ( object -- new-timestamp )
+M: timestamp end-of-year 12 >>month 31 >>day ;
+M: integer end-of-year 12 31 <date> ;
 
 : time-since-midnight ( timestamp -- duration )
     dup midnight time- ;
@@ -435,9 +554,13 @@ PRIVATE>
 : since-1970 ( duration -- timestamp )
     unix-1970 time+ >local-time ;
 
-M: timestamp sleep-until timestamp>micros sleep-until ;
+: timestamp>unix-time ( timestamp -- seconds )
+    unix-1970 time- second>> ;
+
+: unix-time>timestamp ( seconds -- timestamp )
+    seconds unix-1970 time+ ;
 
-M: duration sleep hence sleep-until ;
+M: duration sleep duration>nanoseconds nano-count + sleep-until ;
 
 {
     { [ os unix? ] [ "calendar.unix" ] }
index 8665cc22cefe67749a59f0dca7fbe8bd490a42a8..38ad986952c224800a29ca4e4b58ca1c4a94fb9e 100644 (file)
@@ -16,4 +16,4 @@ SYMBOL: time
     ] "Time model update" spawn drop ;\r
 \r
 f <model> time set-global\r
-[ time-thread ] "calendar.model" add-init-hook\r
+[ time-thread ] "calendar.model" add-startup-hook\r
index 28e54b89fb5d95fa01d1119d3a9fbdb2ab9cf28d..ac72385d8c75a33d8ce55270a7cfcaf4b17eaa40 100644 (file)
@@ -14,6 +14,9 @@ IN: calendar.unix
 : timespec>seconds ( timespec -- seconds )
     [ sec>> seconds ] [ nsec>> nanoseconds ] bi time+ ;
 
+: timespec>nanoseconds ( timespec -- seconds )
+    [ sec>> 1000000000 * ] [ nsec>> ] bi + ;
+
 : timespec>unix-time ( timespec -- timestamp )
     timespec>seconds since-1970 ;
 
index 0a8887554491c777078ad001552996d3f62bd66b..4eab29fd81f15322cf6f5283c9663dfb5d4cb6ef 100644 (file)
@@ -69,4 +69,4 @@ M: remote-channel from ( remote-channel -- value )
 [
     H{ } clone \ remote-channels set-global
     start-channel-node
-] "channel-registry" add-init-hook
+] "channel-registry" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index b3be4651cd627799269edbefa72ac168f97718ba..1c0efb1c36c15c104ba8a200e39f8028a3cd3a8d 100644 (file)
@@ -21,7 +21,7 @@ M: circular length seq>> length ;
 
 M: circular virtual@ circular-wrap seq>> ;
 
-M: circular virtual-seq seq>> ;
+M: circular virtual-exemplar seq>> ;
 
 : change-circular-start ( n circular -- )
     #! change start to (start + n) mod length
old mode 100755 (executable)
new mode 100644 (file)
index 58ab2df..2c0db93
@@ -365,3 +365,18 @@ STRUCT: bit-field-test
 [ -2 ] [ bit-field-test <struct> 2 >>b b>> ] unit-test
 [ 1 ] [ bit-field-test <struct> 257 >>c c>> ] unit-test
 [ 3 ] [ bit-field-test heap-size ] unit-test
+
+cpu ppc? [
+    STRUCT: ppc-align-test-1
+        { x longlong }
+        { y int } ;
+
+    [ 16 ] [ ppc-align-test-1 heap-size ] unit-test
+
+    STRUCT: ppc-align-test-2
+        { y int }
+        { x longlong } ;
+
+    [ 12 ] [ ppc-align-test-2 heap-size ] unit-test
+    [ 4 ] [ "x" ppc-align-test-2 offset-of ] unit-test
+] when
old mode 100755 (executable)
new mode 100644 (file)
index d5e5fdc..91ad707
@@ -211,27 +211,32 @@ M: struct-c-type c-struct? drop t ;
         slots >>fields
         size >>size
         align >>align
+        align >>align-first
         class (unboxer-quot) >>unboxer-quot
-        class (boxer-quot)   >>boxer-quot ;
-    
-GENERIC: align-offset ( offset class -- offset' )
+        class (boxer-quot) >>boxer-quot ;
+
+GENERIC: compute-slot-offset ( offset class -- offset' )
 
-M: struct-slot-spec align-offset
-    [ type>> c-type-align 8 * align ] keep
+: c-type-align-at ( class offset -- n )
+    0 = [ c-type-align-first ] [ c-type-align ] if ;
+
+M: struct-slot-spec compute-slot-offset
+    [ type>> over c-type-align-at 8 * align ] keep
     [ [ 8 /i ] dip (>>offset) ] [ type>> heap-size 8 * + ] 2bi ;
 
-M: struct-bit-slot-spec align-offset
+M: struct-bit-slot-spec compute-slot-offset
     [ (>>offset) ] [ bits>> + ] 2bi ;
 
-: struct-offsets ( slots -- size )
-    0 [ align-offset ] reduce 8 align 8 /i ;
+: compute-struct-offsets ( slots -- size )
+    0 [ compute-slot-offset ] reduce 8 align 8 /i ;
 
-: union-struct-offsets ( slots -- size )
+: compute-union-offsets ( slots -- size )
     1 [ 0 >>offset type>> heap-size max ] reduce ;
 
-: struct-align ( slots -- align )
+: struct-alignment ( slots -- align )
     [ struct-bit-slot-spec? not ] filter
-    1 [ type>> c-type-align max ] reduce ;
+    1 [ [ type>> ] [ offset>> ] bi c-type-align-at max ] reduce ;
+
 PRIVATE>
 
 M: struct byte-length class "struct-size" word-prop ; foldable
@@ -243,10 +248,8 @@ GENERIC: binary-zero? ( value -- ? )
 
 M: object binary-zero? drop f ;
 M: f binary-zero? drop t ;
-M: number binary-zero? zero? ;
-M: struct binary-zero?
-    [ byte-length iota ] [ >c-ptr ] bi
-    [ <displaced-alien> *uchar zero? ] curry all? ;
+M: number binary-zero? 0 = ;
+M: struct binary-zero? >c-ptr [ 0 = ] all? ;
 
 : struct-needs-prototype? ( class -- ? )
     struct-slots [ initial>> binary-zero? ] all? not ;
@@ -278,8 +281,9 @@ M: struct binary-zero?
     slots empty? [ struct-must-have-slots ] when
     class redefine-struct-tuple-class
     slots make-slots dup check-struct-slots :> slot-specs
-    slot-specs struct-align :> alignment
-    slot-specs offsets-quot call alignment align :> size
+    slot-specs offsets-quot call :> unaligned-size
+    slot-specs struct-alignment :> alignment
+    unaligned-size alignment align :> size
 
     class  slot-specs  size  alignment  c-type-for-class :> c-type
 
@@ -291,10 +295,10 @@ M: struct binary-zero?
 PRIVATE>
 
 : define-struct-class ( class slots -- )
-    [ struct-offsets ] (define-struct-class) ;
+    [ compute-struct-offsets ] (define-struct-class) ;
 
 : define-union-struct-class ( class slots -- )
-    [ union-struct-offsets ] (define-struct-class) ;
+    [ compute-union-offsets ] (define-struct-class) ;
 
 M: struct-class reset-class
     [ call-next-method ] [ name>> c-types get delete-at ] bi ;
index cbf8636a7537f4a3862b3d30c70a98010ee1690c..83213b47ba005ec11c6442898a74a9b96a9d214c 100644 (file)
@@ -49,7 +49,7 @@ TUPLE: objc-error alien reason ;
 M: objc-error summary ( error -- )
     drop "Objective C exception" ;
 
-[ [ objc-error ] 19 setenv ] "cocoa.application" add-init-hook
+[ [ objc-error ] 19 setenv ] "cocoa.application" add-startup-hook
 
 : running.app? ( -- ? )
     #! Test if we're running a .app.
index ec09f8f2ba3108a017b52b017eae01f1c146544d..34bac0a5055229e13b7a738190f577359fd3ab7e 100644 (file)
@@ -27,7 +27,7 @@ SYMBOL: frameworks
 
 frameworks [ V{ } clone ] initialize
 
-[ frameworks get [ load-framework ] each ] "cocoa" add-init-hook
+[ frameworks get [ load-framework ] each ] "cocoa" add-startup-hook
 
 SYNTAX: FRAMEWORK: scan [ load-framework ] [ frameworks get push ] bi ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index fce7adc..4cc9554
@@ -76,13 +76,13 @@ MACRO: (send) ( selector super? -- quot )
 : super-send ( receiver args... selector -- return... ) t (send) ; inline
 
 ! Runtime introspection
-SYMBOL: class-init-hooks
+SYMBOL: class-startup-hooks
 
-class-init-hooks [ H{ } clone ] initialize
+class-startup-hooks [ H{ } clone ] initialize
 
 : (objc-class) ( name word -- class )
     2dup execute dup [ 2nip ] [
-        drop over class-init-hooks get at [ call( -- ) ] when*
+        drop over class-startup-hooks get at [ call( -- ) ] when*
         2dup execute dup [ 2nip ] [
             2drop "No such class: " prepend throw
         ] if
@@ -229,7 +229,7 @@ ERROR: no-objc-type name ;
 : class-exists? ( string -- class ) objc_getClass >boolean ;
 
 : define-objc-class-word ( quot name -- )
-    [ class-init-hooks get set-at ]
+    [ class-startup-hooks get set-at ]
     [
         [ "cocoa.classes" create ] [ '[ _ objc-class ] ] bi
         (( -- class )) define-declared
index 8f45dab8728c4e7ef153f94692dea47d0b2c36a1..8674217655c572e0bf977279d2fd3c9dc251882d 100644 (file)
@@ -8,7 +8,7 @@ TUPLE: column seq col ;
 
 C: <column> column
 
-M: column virtual-seq seq>> ;
+M: column virtual-exemplar seq>> ;
 M: column virtual@ [ col>> swap ] [ seq>> ] bi nth bounds-check ;
 M: column length seq>> length ;
 
index 399b4dc36fe35feaf226288c2944ea555094265c..bd224919f9e00c524e2a59f355f6797df286fde9 100644 (file)
@@ -47,3 +47,9 @@ IN: combinators.smart.tests
 [ { { 1 2 } { 3 4 } } ] [ nested-smart-combo-test ] unit-test
 
 [ 14 ] [ [ 1 2 3 ] [ sq ] [ + ] map-reduce-outputs ] unit-test
+
+{ 2 3 } [ [ + ] preserving ] must-infer-as
+
+{ 2 0 } [ [ + ] nullary ] must-infer-as
+
+{ 2 2 } [ [ [ + ] nullary ] preserving ] must-infer-as
index a00967742f716a28c58afbb54b2fd49edc95c614..91987e0dfa6577f05a1d3b492ab56a6279ce33dd 100644 (file)
@@ -46,5 +46,8 @@ MACRO: append-outputs ( quot -- seq )
 MACRO: preserving ( quot -- )
     [ infer in>> length ] keep '[ _ ndup @ ] ;
 
+MACRO: nullary ( quot -- quot' )
+    dup infer out>> length '[ @ _ ndrop ] ;
+
 MACRO: smart-if ( pred true false -- )
     '[ _ preserving _ _ if ] ; inline
index 19421359a395f96168981a6bcb37073c34a20561..f1748d37083f7ebbaba5663eb8a238f39db590c3 100644 (file)
@@ -69,4 +69,4 @@ SYMBOL: main-vocab-hook
 : ignore-cli-args? ( -- ? )
     os macosx? "run" get "ui" = and ;
 
-[ default-cli-args ] "command-line" add-init-hook
+[ default-cli-args ] "command-line" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
index 369e6ebc32631f8177b338225cc12f8e79da93cb..5d815e3b0f06b79edb1fce4524d077ebc5c3f3a2 100644 (file)
@@ -10,14 +10,14 @@ number
 { successors vector }
 { predecessors vector } ;
 
-M: basic-block hashcode* nip id>> ;
-
 : <basic-block> ( -- bb )
     basic-block new
+        \ basic-block counter >>id
         V{ } clone >>instructions
         V{ } clone >>successors
-        V{ } clone >>predecessors
-        \ basic-block counter >>id ;
+        V{ } clone >>predecessors ;
+
+M: basic-block hashcode* nip id>> ;
 
 TUPLE: cfg { entry basic-block } word label
 spill-area-size reps
index a03f04f182aed195b4dc95ec5c454614e7f4799f..f40b838b97214f6cac38672e0a646eaed3d243d3 100644 (file)
@@ -33,6 +33,7 @@ IN: compiler.cfg.intrinsics
 {
     { kernel.private:tag [ drop emit-tag ] }
     { kernel.private:getenv [ emit-getenv ] }
+    { kernel.private:(identity-hashcode) [ drop emit-identity-hashcode ] }
     { math.private:both-fixnums? [ drop emit-both-fixnums? ] }
     { math.private:fixnum+ [ drop emit-fixnum+ ] }
     { math.private:fixnum- [ drop emit-fixnum- ] }
index ce005e8353650e5f6461b4d4188b8fef7be11f8c..a477ef4b950b1d0b9b6a6dcbf58d99edc1a6a6c6 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: namespaces layouts sequences kernel
-accessors compiler.tree.propagation.info
-compiler.cfg.stacks compiler.cfg.hats
-compiler.cfg.instructions compiler.cfg.utilities ;
+USING: namespaces layouts sequences kernel math accessors
+compiler.tree.propagation.info compiler.cfg.stacks
+compiler.cfg.hats compiler.cfg.instructions
+compiler.cfg.utilities ;
 IN: compiler.cfg.intrinsics.misc
 
 : emit-tag ( -- )
@@ -14,3 +14,9 @@ IN: compiler.cfg.intrinsics.misc
     swap node-input-infos first literal>>
     [ ds-drop 0 ^^slot-imm ] [ ds-pop ^^offset>slot ^^slot ] if*
     ds-push ;
+
+: emit-identity-hashcode ( -- )
+    ds-pop tag-mask get bitnot ^^load-immediate ^^and 0 0 ^^slot-imm
+    hashcode-shift ^^shr-imm
+    ^^tag-fixnum
+    ds-push ;
index 1424aba354d968557e51db6ec316f3d5bee12b8c..1ceac4990ace32a93fdea8342e6af3bf07474b3c 100644 (file)
@@ -1,14 +1,17 @@
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: layouts namespaces kernel accessors sequences math
-classes.algebra locals combinators cpu.architecture
-compiler.tree.propagation.info compiler.cfg.stacks
-compiler.cfg.hats compiler.cfg.registers
+classes.algebra classes.builtin locals combinators
+cpu.architecture compiler.tree.propagation.info
+compiler.cfg.stacks compiler.cfg.hats compiler.cfg.registers
 compiler.cfg.instructions compiler.cfg.utilities
 compiler.cfg.builder.blocks compiler.constants ;
 IN: compiler.cfg.intrinsics.slots
 
-: value-tag ( info -- n ) class>> class-type ; inline
+: class-tag ( class -- tag/f )
+    builtins get [ class<= ] with find drop ;
+
+: value-tag ( info -- n ) class>> class-tag ;
 
 : ^^tag-offset>slot ( slot tag -- vreg' )
     [ ^^offset>slot ] dip ^^sub-imm ;
old mode 100755 (executable)
new mode 100644 (file)
index 6534aa74ab07b90f81cafde06e19c216f93d35e2..d2e7c2ac864fd48a0ff07e0ffb3265ead010cdd1 100644 (file)
@@ -27,6 +27,9 @@ C: <reference> reference-expr
 M: reference-expr equal?
     over reference-expr? [ [ value>> ] bi@ eq? ] [ 2drop f ] if ;
 
+M: reference-expr hashcode*
+    nip value>> identity-hashcode ;
+
 : constant>vn ( constant -- vn ) <constant> expr>vn ; inline
 
 GENERIC: >expr ( insn -- expr )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e58cf0c..a772855
@@ -5,13 +5,16 @@ continuations vocabs assocs dlists definitions math graphs generic
 generic.single combinators deques search-deques macros
 source-files.errors combinators.short-circuit
 
-stack-checker stack-checker.state stack-checker.inlining stack-checker.errors
+stack-checker stack-checker.dependencies stack-checker.inlining
+stack-checker.errors
 
 compiler.errors compiler.units compiler.utilities
 
 compiler.tree.builder
 compiler.tree.optimizer
 
+compiler.crossref
+
 compiler.cfg
 compiler.cfg.builder
 compiler.cfg.optimizer
@@ -60,17 +63,23 @@ M: method-body no-compile? "method-generic" word-prop no-compile? ;
 M: predicate-engine-word no-compile? "owner-generic" word-prop no-compile? ;
 
 M: word no-compile?
-    {
-        [ macro? ]
-        [ inline? ]
-        [ "special" word-prop ]
-        [ "no-compile" word-prop ]
-    } 1|| ;
+    { [ macro? ] [ "special" word-prop ] [ "no-compile" word-prop ] } 1|| ;
+
+GENERIC: combinator? ( word -- ? )
+
+M: method-body combinator? "method-generic" word-prop combinator? ;
+
+M: predicate-engine-word combinator? "owner-generic" word-prop combinator? ;
+
+M: word combinator? inline? ;
 
 : ignore-error? ( word error -- ? )
     #! Ignore some errors on inline combinators, macros, and special
     #! words such as 'call'.
-    [ no-compile? ] [ { [ do-not-compile? ] [ literal-expected? ] } 1|| ] bi* and ;
+    {
+        [ drop no-compile? ]
+        [ [ combinator? ] [ unknown-macro-input? ] bi* and ]
+    } 2|| ;
 
 : finish ( word -- )
     #! Recompile callers if the word's stack effect changed, then
@@ -193,6 +202,14 @@ M: optimizing-compiler recompile ( words -- alist )
     ] with-scope
     "--- compile done" compiler-message ;
 
+M: optimizing-compiler to-recompile ( -- words )
+    changed-definitions get compiled-usages
+    changed-generics get compiled-generic-usages
+    append assoc-combine keys ;
+
+M: optimizing-compiler process-forgotten-words
+    [ delete-compiled-xref ] each ;
+
 : with-optimizer ( quot -- )
     [ optimizing-compiler compiler-impl ] dip with-variable ; inline
 
diff --git a/basis/compiler/crossref/authors.txt b/basis/compiler/crossref/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/compiler/crossref/crossref.factor b/basis/compiler/crossref/crossref.factor
new file mode 100644 (file)
index 0000000..e6ef5cf
--- /dev/null
@@ -0,0 +1,68 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: assocs classes.algebra compiler.units definitions graphs
+grouping kernel namespaces sequences words
+stack-checker.dependencies ;
+IN: compiler.crossref
+
+SYMBOL: compiled-crossref
+
+compiled-crossref [ H{ } clone ] initialize
+
+SYMBOL: compiled-generic-crossref
+
+compiled-generic-crossref [ H{ } clone ] initialize
+
+: compiled-usage ( word -- assoc )
+    compiled-crossref get at ;
+
+: (compiled-usages) ( word -- assoc )
+    #! If the word is not flushable anymore, we have to recompile
+    #! all words which flushable away a call (presumably when the
+    #! word was still flushable). If the word is flushable, we
+    #! don't have to recompile words that folded this away.
+    [ compiled-usage ]
+    [ "flushable" word-prop inlined-dependency flushed-dependency ? ] bi
+    [ dependency>= nip ] curry assoc-filter ;
+
+: compiled-usages ( seq -- assocs )
+    [ drop word? ] assoc-filter
+    [ [ drop (compiled-usages) ] { } assoc>map ] keep suffix ;
+
+: compiled-generic-usage ( word -- assoc )
+    compiled-generic-crossref get at ;
+
+: (compiled-generic-usages) ( generic class -- assoc )
+    [ compiled-generic-usage ] dip
+    [
+        2dup [ valid-class? ] both?
+        [ classes-intersect? ] [ 2drop f ] if nip
+    ] curry assoc-filter ;
+
+: compiled-generic-usages ( assoc -- assocs )
+    [ (compiled-generic-usages) ] { } assoc>map ;
+
+: (compiled-xref) ( word dependencies word-prop variable -- )
+    [ [ concat ] dip set-word-prop ] [ get add-vertex* ] bi-curry* 2bi ;
+
+: compiled-xref ( word dependencies generic-dependencies -- )
+    [ [ drop crossref? ] { } assoc-filter-as ] bi@
+    [ "compiled-uses" compiled-crossref (compiled-xref) ]
+    [ "compiled-generic-uses" compiled-generic-crossref (compiled-xref) ]
+    bi-curry* bi ;
+
+: (compiled-unxref) ( word word-prop variable -- )
+    [ [ [ dupd word-prop 2 <groups> ] dip get remove-vertex* ] 2curry ]
+    [ drop [ remove-word-prop ] curry ]
+    2bi bi ;
+
+: compiled-unxref ( word -- )
+    [ "compiled-uses" compiled-crossref (compiled-unxref) ]
+    [ "compiled-generic-uses" compiled-generic-crossref (compiled-unxref) ]
+    bi ;
+
+: delete-compiled-xref ( word -- )
+    [ compiled-unxref ]
+    [ compiled-crossref get delete-at ]
+    [ compiled-generic-crossref get delete-at ]
+    tri ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index b2159e9..7fe5e2b
@@ -585,16 +585,16 @@ TUPLE: alien-accessor-regression { b byte-array } { i fixnum } ;
     swap [
         { tuple } declare 1 slot
     ] [
-        0 slot
+        1 slot
     ] if ;
 
-[ t ] [ f B{ } mutable-value-bug-1 byte-array type-number = ] unit-test
+[ 0 ] [ f { } mutable-value-bug-1 ] unit-test
 
 : mutable-value-bug-2 ( a b -- c )
     swap [
-        0 slot
+        1 slot
     ] [
         { tuple } declare 1 slot
     ] if ;
 
-[ t ] [ t B{ } mutable-value-bug-2 byte-array type-number = ] unit-test
+[ 0 ] [ t { } mutable-value-bug-2 ] unit-test
index 67added49d9b53647545b01332539ebf65a8bf3f..913111b8ea34586a677bbe908770eb23e0826608 100644 (file)
@@ -1,6 +1,6 @@
 USING: accessors compiler compiler.units tools.test math parser
 kernel sequences sequences.private classes.mixin generic
-definitions arrays words assocs eval ;
+definitions arrays words assocs eval grouping ;
 IN: compiler.tests.redefine3
 
 GENERIC: sheeple ( obj -- x )
@@ -13,20 +13,23 @@ M: empty-mixin sheeple drop "wake up" ; inline
 
 : sheeple-test ( -- string ) { } sheeple ;
 
+: compiled-use? ( key word -- ? )
+    "compiled-uses" word-prop 2 <groups> key? ;
+
 [ "sheeple" ] [ sheeple-test ] unit-test
 [ t ] [ \ sheeple-test optimized? ] unit-test
-[ t ] [ object \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
-[ f ] [ empty-mixin \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
+[ t ] [ object \ sheeple method \ sheeple-test compiled-use? ] unit-test
+[ f ] [ empty-mixin \ sheeple method \ sheeple-test compiled-use? ] unit-test
 
 [ ] [ "IN: compiler.tests.redefine3 USE: arrays INSTANCE: array empty-mixin" eval( -- ) ] unit-test
 
 [ "wake up" ] [ sheeple-test ] unit-test
-[ f ] [ object \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
-[ t ] [ empty-mixin \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
+[ f ] [ object \ sheeple method \ sheeple-test compiled-use? ] unit-test
+[ t ] [ empty-mixin \ sheeple method \ sheeple-test compiled-use? ] unit-test
 
 [ ] [ [ array empty-mixin remove-mixin-instance ] with-compilation-unit ] unit-test
 
 [ "sheeple" ] [ sheeple-test ] unit-test
 [ t ] [ \ sheeple-test optimized? ] unit-test
-[ t ] [ object \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
-[ f ] [ empty-mixin \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
+[ t ] [ object \ sheeple method \ sheeple-test compiled-use? ] unit-test
+[ f ] [ empty-mixin \ sheeple method \ sheeple-test compiled-use? ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
index e4523deb9ff7515575f0223e8e4afdac85f87582..8eb66fde1f82c9ed5b2bbf67e795e169df0d2be1 100644 (file)
@@ -39,7 +39,7 @@ M: word (build-tree)
     [
         <recursive-state> recursive-state set
         V{ } clone stack-visitor set
-        [ [ >vector \ meta-d set ] [ length d-in set ] bi ]
+        [ [ >vector \ meta-d set ] [ length input-count set ] bi ]
         [ (build-tree) ]
         bi*
     ] with-infer nip ;
old mode 100755 (executable)
new mode 100644 (file)
index 8ed83188e5ddd6841f019340e4081501e78513be..ec819d0eacaee737d47cb5243b5947d3f95508d0 100644 (file)
@@ -3,7 +3,7 @@
 USING: kernel accessors sequences combinators fry
 classes.algebra namespaces assocs words math math.private
 math.partial-dispatch math.intervals classes classes.tuple
-classes.tuple.private layouts definitions stack-checker.state
+classes.tuple.private layouts definitions stack-checker.dependencies
 stack-checker.branches
 compiler.utilities
 compiler.tree
old mode 100755 (executable)
new mode 100644 (file)
index f6165a4..67c5cfd
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel accessors words assocs sequences arrays namespaces
 fry locals definitions classes classes.algebra generic
-stack-checker.state
+stack-checker.dependencies
 stack-checker.backend
 compiler.tree
 compiler.tree.propagation.info
old mode 100755 (executable)
new mode 100644 (file)
index 0d837d8..28f34cb
@@ -97,7 +97,7 @@ M: #phi propagate-before ( #phi -- )
     constraints get last update-constraints ;
 
 : branch-phi-constraints ( output values booleans -- )
-     {
+    {
         {
             { { t } { f } }
             [
@@ -130,6 +130,22 @@ M: #phi propagate-before ( #phi -- )
                 swap t-->
             ]
         }
+        {
+            { { t f } { t } }
+            [
+                first =f
+                condition-value get =t /\
+                swap f-->
+            ]
+        }
+        {
+            { { t } { t f } }
+            [
+                second =f
+                condition-value get =f /\
+                swap f-->
+            ]
+        }
         {
             { { t f } { } }
             [
index 79a9f69de5c2a1566f87f4811c8699db77975263..4a543fb87a1e427bffbdff157faffea8e8831a28 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2009 Slava Pestov, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: compiler.tree.propagation.call-effect tools.test fry math effects kernel
-compiler.tree.builder compiler.tree.optimizer compiler.tree.debugger sequences ;
+compiler.tree.builder compiler.tree.optimizer compiler.tree.debugger sequences
+eval combinators ;
 IN: compiler.tree.propagation.call-effect.tests
 
 [ t ] [ \ + (( a b -- c )) execute-effect-unsafe? ] unit-test
@@ -58,4 +59,23 @@ IN: compiler.tree.propagation.call-effect.tests
 ! [ boa ] by itself doesn't infer
 TUPLE: a-tuple x ;
 
-[ V{ a-tuple } ] [ [ a-tuple '[ _ boa ] call( x -- tuple ) ] final-classes ] unit-test
\ No newline at end of file
+[ V{ a-tuple } ] [ [ a-tuple '[ _ boa ] call( x -- tuple ) ] final-classes ] unit-test
+
+! See if redefinitions are handled correctly
+: call(-redefine-test ( a -- b ) 1 + ;
+
+: test-quotatation ( -- quot ) [ call(-redefine-test ] ;
+
+[ t ] [ test-quotatation cached-effect (( a -- b )) effect<= ] unit-test
+
+[ ] [ "IN: compiler.tree.propagation.call-effect.tests USE: math : call(-redefine-test ( a b -- c ) + ;" eval( -- ) ] unit-test
+
+[ t ] [ test-quotatation cached-effect (( a b -- c )) effect<= ] unit-test
+
+: inline-cache-invalidation-test ( a b c -- c ) call( a b -- c ) ;
+
+[ 4 ] [ 1 3 test-quotatation inline-cache-invalidation-test ] unit-test
+
+[ ] [ "IN: compiler.tree.propagation.call-effect.tests USE: math : call(-redefine-test ( a -- c ) 1 + ;" eval( -- ) ] unit-test
+
+[ 1 3 test-quotatation inline-cache-invalidation-test ] [ T{ wrong-values f (( a b -- c )) } = ] must-fail-with
index 614ceeb59770bf5eb74c0f8b75f41a74b68312da..ff4886d1c795ad0ecc2fb7d7dbe0d246f9474871 100644 (file)
@@ -2,9 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors combinators combinators.private effects fry
 kernel kernel.private make sequences continuations quotations
-words math stack-checker stack-checker.transforms
-compiler.tree.propagation.info
-compiler.tree.propagation.inlining ;
+words math stack-checker combinators.short-circuit
+stack-checker.transforms compiler.tree.propagation.info
+compiler.tree.propagation.inlining compiler.units ;
 IN: compiler.tree.propagation.call-effect
 
 ! call( and execute( have complex expansions.
@@ -15,13 +15,20 @@ IN: compiler.tree.propagation.call-effect
 !   and compare it with declaration. If matches, call it unsafely.
 ! - Fallback. If the above doesn't work, call it and compare the datastack before
 !   and after to make sure it didn't mess anything up.
+! - Inline caches and cached effects are invalidated whenever a macro is redefined, or
+!   a word's effect changes, by comparing a global counter against the counter value
+!   last observed. The counter is incremented by compiler.units.
 
 ! execute( uses a similar strategy.
 
-TUPLE: inline-cache value ;
+TUPLE: inline-cache value counter ;
 
-: cache-hit? ( word/quot ic -- ? )
-    [ value>> eq? ] [ value>> ] bi and ; inline
+: inline-cache-hit? ( word/quot ic -- ? )
+    { [ value>> eq? ] [ nip counter>> effect-counter eq? ] } 2&& ; inline
+
+: update-inline-cache ( word/quot ic -- )
+    [ effect-counter ] dip
+    [ (>>value) ] [ (>>counter) ] bi-curry bi* ; inline
 
 SINGLETON: +unknown+
 
@@ -53,9 +60,16 @@ M: compose cached-effect
 : safe-infer ( quot -- effect )
     [ infer ] [ 2drop +unknown+ ] recover ;
 
+: cached-effect-valid? ( quot -- ? )
+    cache-counter>> effect-counter eq? ; inline
+
+: save-effect ( effect quot -- )
+    [ effect-counter ] dip
+    [ (>>cached-effect) ] [ (>>cache-counter) ] bi-curry bi* ;
+
 M: quotation cached-effect
-    dup cached-effect>>
-    [ ] [ [ safe-infer dup ] keep (>>cached-effect) ] ?if ;
+    dup cached-effect-valid?
+    [ cached-effect>> ] [ [ safe-infer dup ] keep save-effect ] if ;
 
 : call-effect-unsafe? ( quot effect -- ? )
     [ cached-effect ] dip
@@ -82,12 +96,12 @@ M: quotation cached-effect
 
 : call-effect-fast ( quot effect inline-cache -- )
     2over call-effect-unsafe?
-    [ [ nip (>>value) ] [ drop call-effect-unsafe ] 3bi ]
+    [ [ nip update-inline-cache ] [ drop call-effect-unsafe ] 3bi ]
     [ drop call-effect-slow ]
     if ; inline
 
 : call-effect-ic ( quot effect inline-cache -- )
-    3dup nip cache-hit?
+    3dup nip inline-cache-hit?
     [ drop call-effect-unsafe ]
     [ call-effect-fast ]
     if ; inline
@@ -103,12 +117,12 @@ M: quotation cached-effect
 
 : execute-effect-fast ( word effect inline-cache -- )
     2over execute-effect-unsafe?
-    [ [ nip (>>value) ] [ drop execute-effect-unsafe ] 3bi ]
+    [ [ nip update-inline-cache ] [ drop execute-effect-unsafe ] 3bi ]
     [ drop execute-effect-slow ]
     if ; inline
 
 : execute-effect-ic ( word effect inline-cache -- )
-    3dup nip cache-hit?
+    3dup nip inline-cache-hit?
     [ drop execute-effect-unsafe ]
     [ execute-effect-fast ]
     if ; inline
index 59c9912e47539f3a519a200f207b97d7c3b19f7a..617352d6998fcc8fbd7e627725e7451ec166f052 100644 (file)
@@ -39,8 +39,8 @@ M: true-constraint assume*
     bi ;
 
 M: true-constraint satisfied?
-    value>> value-info class>>
-    { [ true-class? ] [ null-class? not ] } 1&& ;
+    value>> value-info*
+    [ class>> true-class? ] [ drop f ] if ;
 
 TUPLE: false-constraint value ;
 
@@ -52,8 +52,8 @@ M: false-constraint assume*
     bi ;
 
 M: false-constraint satisfied?
-    value>> value-info class>>
-    { [ false-class? ] [ null-class? not ] } 1&& ;
+    value>> value-info*
+    [ class>> false-class? ] [ drop f ] if ;
 
 ! Class constraints
 TUPLE: class-constraint value class ;
index 9030914e340a657faf0c46393ac0b8c32560b1c3..6dcf6f7317e2353d10a57bcb2e5f80240f9e8198 100644 (file)
@@ -294,8 +294,11 @@ DEFER: (value-info-union)
 ! Assoc stack of current value --> info mapping
 SYMBOL: value-infos
 
+: value-info* ( value -- info ? )
+    resolve-copy value-infos get assoc-stack [ null-info or ] [ >boolean ] bi ; inline
+
 : value-info ( value -- info )
-    resolve-copy value-infos get assoc-stack null-info or ;
+    value-info* drop ;
 
 : set-value-info ( info value -- )
     resolve-copy value-infos get last set-at ;
index 8afbaf0099082710c1ee8e2805dec359b8e6a575..1453bebf9aa30f78ae48667619da8fa8d369aa07 100644 (file)
@@ -8,7 +8,7 @@ classes.algebra combinators generic.math splitting fry locals
 classes.tuple alien.accessors classes.tuple.private
 slots.private definitions strings.private vectors hashtables
 generic quotations alien
-stack-checker.state
+stack-checker.dependencies
 compiler.tree.comparisons
 compiler.tree.propagation.info
 compiler.tree.propagation.nodes
index 3627757acd485f736d8703e4ba40f6d1ce5b2718..c7e02aef4c59fa99a6151ce368bf490e23086f9a 100644 (file)
@@ -224,6 +224,14 @@ IN: compiler.tree.propagation.tests
 
 [ t ] [ [ over [ drop f ] when [ "A" throw ] unless ] final-classes first false-class? ] unit-test
 
+[ V{ fixnum } ] [
+    [
+        [ { fixnum } declare ] [ drop f ] if
+        dup [ dup 13 eq? [ t ] [ f ] if ] [ t ] if
+        [ "Oops" throw ] when
+    ] final-classes
+] unit-test
+
 [ V{ fixnum } ] [
     [
         >fixnum
@@ -231,6 +239,14 @@ IN: compiler.tree.propagation.tests
     ] final-classes
 ] unit-test
 
+[ ] [
+    [
+        dup dup dup [ 100 < ] [ drop f ] if dup
+        [ 2drop f ] [ 2drop f ] if
+        [ ] [ dup [ ] [ ] if ] if
+    ] final-info drop
+] unit-test
+
 [ V{ fixnum } ] [
     [ { fixnum } declare (clone) ] final-classes
 ] unit-test
@@ -925,3 +941,4 @@ M: tuple-with-read-only-slot clone
 
 ! Could be bignum not integer but who cares
 [ V{ integer } ] [ [ 10 >bignum bitand ] final-classes ] unit-test
+
index 5de5e26a304e4f8d8025157cf06364f5b21259ca..b4d8b95247b4e7c1966f2323e685b09b0e3ce5ea 100644 (file)
@@ -4,7 +4,7 @@ USING: fry accessors kernel sequences sequences.private assocs
 words namespaces classes.algebra combinators
 combinators.short-circuit classes classes.tuple
 classes.tuple.private continuations arrays alien.c-types math
-math.private slots generic definitions stack-checker.state
+math.private slots generic definitions stack-checker.dependencies
 compiler.tree
 compiler.tree.propagation.info
 compiler.tree.propagation.nodes
index ff68fb2400a97a345afb744373d61bc06b39da4c..809b51c6ef64128acb1e0d8360acc1f568bafc16 100644 (file)
@@ -1,13 +1,14 @@
 ! Copyright (C) 2008, 2009 Slava Pestov, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences words fry generic accessors
+USING: alien.c-types kernel sequences words fry generic accessors
 classes.tuple classes classes.algebra definitions
-stack-checker.state quotations classes.tuple.private math
+stack-checker.dependencies quotations classes.tuple.private math
 math.partial-dispatch math.private math.intervals sets.private
 math.floats.private math.integers.private layouts math.order
 vectors hashtables combinators effects generalizations assocs
-sets combinators.short-circuit sequences.private locals
+sets combinators.short-circuit sequences.private locals growable
 stack-checker namespaces compiler.tree.propagation.info ;
+FROM: math => float ;
 IN: compiler.tree.propagation.transforms
 
 \ equal? [
@@ -300,3 +301,18 @@ CONSTANT: lookup-table-at-max 256
     tester '[ _ filter ] ;
 
 \ intersect [ intersect-quot ] 1 define-partial-eval
+
+! Speeds up sum-file, sort and reverse-complement benchmarks by
+! compiling decoder-readln better
+\ push [
+    in-d>> second value-info class>> growable class<=
+    [ \ push def>> ] [ f ] if
+] "custom-inlining" set-word-prop
+
+! We want to constant-fold calls to heap-size, and recompile those
+! calls when a C type is redefined
+\ heap-size [
+    dup word? [
+        [ inlined-dependency depends-on ] [ heap-size '[ _ ] ] bi
+    ] [ drop f ] if
+] 1 define-partial-eval
index 7fa096b62392f828aef97bee34568b97cf5c93dd..82b8fbb8434f7ceae30119b96a3675a42bf83eab 100644 (file)
@@ -10,8 +10,6 @@ IN: compiler.tree
 
 TUPLE: node < identity-tuple ;
 
-M: node hashcode* drop node hashcode* ;
-
 TUPLE: #introduce < node out-d ;
 
 : #introduce ( out-d -- node )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 244f1d95a34c082ddda82ad597e24d066aedb952..0015b10cef444c70b0903a24545f177a7acc6981 100644 (file)
@@ -60,6 +60,4 @@ M: thread (serialize) ( obj -- )
 
 [
     H{ } clone \ registered-remote-threads set-global
-] "remote-thread-registry" add-init-hook
-
-
+] "remote-thread-registry" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
index a50de60c45c4505fe4be2e81ff15fa486e053a23..ad17da96524718d87a599b9d535ad7c464b60e8f 100644 (file)
@@ -12,7 +12,7 @@ TUPLE: simple-cord
 M: simple-cord length
     [ first>> length ] [ second>> length ] bi + ; inline
 
-M: simple-cord virtual-seq first>> ; inline
+M: simple-cord virtual-exemplar first>> ; inline
 
 M: simple-cord virtual@
     2dup first>> length <
@@ -28,7 +28,7 @@ M: multi-cord virtual@
     seqs>> [ first <=> ] with search nip
     [ first - ] [ second ] bi ; inline
 
-M: multi-cord virtual-seq
+M: multi-cord virtual-exemplar
     seqs>> [ f ] [ first second ] if-empty ; inline
 
 : <cord> ( seqs -- cord )
old mode 100755 (executable)
new mode 100644 (file)
index 24ac24b..37dbcd1
@@ -156,7 +156,7 @@ SYMBOL: event-stream-callbacks
 [
     event-stream-callbacks
     [ [ drop expired? not ] assoc-filter H{ } assoc-like ] change-global
-] "core-foundation" add-init-hook
+] "core-foundation" add-startup-hook
 
 : add-event-source-callback ( quot -- id )
     event-stream-counter <alien>
index 0b61274b22fc6debce7bf44ea8b416de8f565a89..2370dd45628dd47005409f8a897c8c6416033685 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.syntax kernel math
 namespaces sequences destructors combinators threads heaps
-deques calendar core-foundation core-foundation.strings
+deques calendar system core-foundation core-foundation.strings
 core-foundation.file-descriptors core-foundation.timers
 core-foundation.time ;
 IN: core-foundation.run-loop
@@ -96,12 +96,15 @@ TUPLE: run-loop fds sources timers ;
 : ((reset-timer)) ( timer counter timestamp -- )
     nip >CFAbsoluteTime CFRunLoopTimerSetNextFireDate ;
 
+: nano-count>timestamp ( x -- timestamp )
+    nano-count - nanoseconds now time+ ;
+
 : (reset-timer) ( timer counter -- )
     yield {
         { [ dup 0 = ] [ now ((reset-timer)) ] }
         { [ run-queue deque-empty? not ] [ 1 - (reset-timer) ] }
         { [ sleep-queue heap-empty? ] [ 5 minutes hence ((reset-timer)) ] }
-        [ sleep-queue heap-peek nip micros>timestamp ((reset-timer)) ]
+        [ sleep-queue heap-peek nip nano-count>timestamp ((reset-timer)) ]
     } cond ;
 
 : reset-timer ( timer -- )
@@ -121,8 +124,8 @@ PRIVATE>
 : init-thread-timer ( -- )
     timer-callback <CFTimer> add-timer-to-run-loop ;
 
-: run-one-iteration ( us -- handled? )
+: run-one-iteration ( nanos -- handled? )
     reset-run-loop
     CFRunLoopDefaultMode
-    swap [ microseconds ] [ 5 minutes ] if* >CFTimeInterval
+    swap [ nanoseconds ] [ 5 minutes ] if* >CFTimeInterval
     t CFRunLoopRunInMode kCFRunLoopRunHandledSource = ;
index e431df941424ef135bd90861886a50cc4aade04e..7af6792e79845d8d14517139ba4d86f0b66513b7 100644 (file)
@@ -149,4 +149,4 @@ SYMBOL: cached-lines
 : cached-line ( font string -- line )
     cached-lines get [ <line> ] 2cache ;
 
-[ <cache-assoc> cached-lines set-global ] "core-text" add-init-hook
+[ <cache-assoc> cached-lines set-global ] "core-text" add-startup-hook
index 5c57034632ea973d43a023f0e3a3d4e1ca2ce985..63b9a0f6e155e5670194e5a78181dde923660bb1 100644 (file)
@@ -127,4 +127,4 @@ MEMO: (cache-font-metrics) ( font -- metrics )
 [
     \ (cache-font) reset-memoized
     \ (cache-font-metrics) reset-memoized
-] "core-text.fonts" add-init-hook
+] "core-text.fonts" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
index 5d3caca20625c8040b70203af7d29aa03e5a24c3..7e7de6d4bcb0dd5a6301cac6c954bfb9f1e64c80 100644 (file)
@@ -200,12 +200,7 @@ CONSTANT: rs-reg 14
     ! cache = ...\r
     0 3 LOAD32 rc-absolute-ppc-2/2 rt-immediate jit-rel\r
     ! key = hashcode(class)\r
-    5 4 3 SRAWI\r
-    6 4 8 SRAWI\r
-    5 5 6 ADD\r
-    6 4 13 SRAWI\r
-    5 5 6 ADD\r
-    5 5 3 SLWI\r
+    5 4 1 SRAWI\r
     ! key &= cache.length - 1\r
     5 5 mega-cache-size get 1 - bootstrap-cell * ANDI\r
     ! cache += array-start-offset\r
@@ -475,7 +470,7 @@ CONSTANT: rs-reg 14
 \r
 [\r
     3 ds-reg 0 LWZ\r
-    3 3 1 SRAWI\r
+    3 3 2 SRAWI\r
     rs-reg 3 3 LWZX\r
     3 ds-reg 0 STW\r
 ] \ get-local define-sub-primitive\r
@@ -483,7 +478,7 @@ CONSTANT: rs-reg 14
 [\r
     3 ds-reg 0 LWZ\r
     ds-reg ds-reg 4 SUBI\r
-    3 3 1 SRAWI\r
+    3 3 2 SRAWI\r
     rs-reg 3 rs-reg SUBF\r
 ] \ drop-locals define-sub-primitive\r
 \r
index c742cf2ddc2aba25ecef3d8e828626dd4ba0ac87..152a3aa7209e81f1c2f982802c27b5a4fb66ca48 100644 (file)
@@ -4,12 +4,6 @@ USING: accessors system kernel layouts
 alien.c-types cpu.architecture cpu.ppc ;
 IN: cpu.ppc.macosx
 
-<<
-4 "longlong" c-type (>>align)
-4 "ulonglong" c-type (>>align)
-4 "double" c-type (>>align)
->>
-
 M: macosx reserved-area-size 6 cells ;
 
 M: macosx lr-save 2 cells ;
index 0f33df8df7cc8a6fef0a8d2effa0ed0cbf08b82b..a7eb3bb4a59f410afcf88b5688cbc00deaa9152b 100644 (file)
@@ -256,35 +256,22 @@ M: ppc %double>single-float FRSP ;
 M: ppc %unbox-alien ( dst src -- )
     alien-offset LWZ ;
 
-M:: ppc %unbox-any-c-ptr ( dst src temp -- )
+M:: ppc %unbox-any-c-ptr ( dst src -- )
     [
-        { "is-byte-array" "end" "start" } [ define-label ] each
-        ! Address is computed in dst
+        "end" define-label
         0 dst LI
-        ! Load object into scratch-reg
-        scratch-reg src MR
-        ! We come back here with displaced aliens
-        "start" resolve-label
         ! Is the object f?
-        0 scratch-reg \ f type-number CMPI
-        ! If so, done
+        0 src \ f type-number CMPI
         "end" get BEQ
+        ! Compute tag in dst register
+        dst src tag-mask get ANDI
         ! Is the object an alien?
-        0 scratch-reg header-offset LWZ
-        0 0 alien type-number tag-fixnum CMPI
-        "is-byte-array" get BNE
-        ! If so, load the offset
-        0 scratch-reg alien-offset LWZ
-        ! Add it to address being computed
-        dst dst 0 ADD
-        ! Now recurse on the underlying alien
-        scratch-reg scratch-reg underlying-alien-offset LWZ
-        "start" get B
-        "is-byte-array" resolve-label
-        ! Add byte array address to address being computed
-        dst dst scratch-reg ADD
-        ! Add an offset to start of byte array's data area
-        dst dst byte-array-offset ADDI
+        0 dst alien type-number CMPI
+        ! Add an offset to start of byte array's data
+        dst src byte-array-offset ADDI
+        "end" get BNE
+        ! If so, load the offset and add it to the address
+        dst src alien-offset LWZ
         "end" resolve-label
     ] with-scope ;
 
@@ -293,53 +280,84 @@ M:: ppc %unbox-any-c-ptr ( dst src temp -- )
 M:: ppc %box-alien ( dst src temp -- )
     [
         "f" define-label
-        dst  %load-immediate
+        dst \ f type-number %load-immediate
         0 src 0 CMPI
         "f" get BEQ
         dst 5 cells alien temp %allot
         temp \ f type-number %load-immediate
         temp dst 1 alien@ STW
         temp dst 2 alien@ STW
-        displacement dst 3 alien@ STW
-        displacement dst 4 alien@ STW
+        src dst 3 alien@ STW
+        src dst 4 alien@ STW
         "f" resolve-label
     ] with-scope ;
 
-M:: ppc %box-displaced-alien ( dst displacement base displacement' base' base-class -- )
+M:: ppc %box-displaced-alien ( dst displacement base temp base-class -- )
+    ! This is ridiculous
     [
         "end" define-label
-        "alloc" define-label
-        "simple-case" define-label
+        "not-f" define-label
+        "not-alien" define-label
+
         ! If displacement is zero, return the base
         dst base MR
         0 displacement 0 CMPI
         "end" get BEQ
-        ! Quickly use displacement' before its needed for real, as allot temporary
-        displacement' :> temp
-        dst 4 cells alien temp %allot
-        ! If base is already a displaced alien, unpack it
-        0 base \ f type-number CMPI
-        "simple-case" get BEQ
-        temp base header-offset LWZ
-        0 temp alien type-number tag-fixnum CMPI
-        "simple-case" get BNE
-        ! displacement += base.displacement
-        temp base 3 alien@ LWZ
-        displacement' displacement temp ADD
-        ! base = base.base
-        base' base 1 alien@ LWZ
-        "alloc" get B
-        "simple-case" resolve-label
-        displacement' displacement MR
-        base' base MR
-        "alloc" resolve-label
-        ! Store underlying-alien slot
-        base' dst 1 alien@ STW
-        ! Store offset
-        displacement' dst 3 alien@ STW
-        ! Store expired slot (its ok to clobber displacement')
+
+        ! Displacement is non-zero, we're going to be allocating a new
+        ! object
+        dst 5 cells alien temp %allot
+
+        ! Set expired to f
         temp \ f type-number %load-immediate
         temp dst 2 alien@ STW
+
+        ! Is base f?
+        0 base \ f type-number CMPI
+        "not-f" get BNE
+
+        ! Yes, it is f. Fill in new object
+        base dst 1 alien@ STW
+        displacement dst 3 alien@ STW
+        displacement dst 4 alien@ STW
+
+        "end" get B
+
+        "not-f" resolve-label
+
+        ! Check base type
+        temp base tag-mask get ANDI
+
+        ! Is base an alien?
+        0 temp alien type-number CMPI
+        "not-alien" get BNE
+
+        ! Yes, it is an alien. Set new alien's base to base.base
+        temp base 1 alien@ LWZ
+        temp dst 1 alien@ STW
+
+        ! Compute displacement
+        temp base 3 alien@ LWZ
+        temp temp displacement ADD
+        temp dst 3 alien@ STW
+
+        ! Compute address
+        temp base 4 alien@ LWZ
+        temp temp displacement ADD
+        temp dst 4 alien@ STW
+
+        ! We are done
+        "end" get B
+
+        ! Is base a byte array? It has to be, by now...
+        "not-alien" resolve-label
+
+        base dst 1 alien@ STW
+        displacement dst 3 alien@ STW
+        temp base byte-array-offset ADDI
+        temp temp displacement ADD
+        temp dst 4 alien@ STW
+
         "end" resolve-label
     ] with-scope ;
 
@@ -373,7 +391,7 @@ M: ppc %set-alien-double -rot STFD ;
     scratch-reg nursery-ptr 0 STW ;
 
 :: store-header ( dst class -- )
-    class type-number tag-fixnum scratch-reg LI
+    class type-number tag-header scratch-reg LI
     scratch-reg dst 0 STW ;
 
 : store-tagged ( dst tag -- )
old mode 100755 (executable)
new mode 100644 (file)
index 2e3944fcaf10177c88e8158b02fff2388b8356cb..6cf2f2a10f6ef405d71ac885b64840c4bdafae6e 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: bootstrap.image.private kernel namespaces system
-layouts vocabs parser sequences cpu.x86.assembler parser
+USING: bootstrap.image.private kernel namespaces system layouts
+vocabs sequences cpu.x86.assembler parser
 cpu.x86.assembler.operands ;
 IN: bootstrap.x86
 
index b21aa762d861c078f29588d2ea02ffa3bbd259bd..38364805eb90215a362676f461ff34edd8384313 100644 (file)
@@ -17,7 +17,7 @@ MEMO: sse-version ( -- n )
     sse_version
     "sse-version" get string>number [ min ] when* ;
 
-[ \ sse-version reset-memoized ] "cpu.x86.features" add-init-hook
+[ \ sse-version reset-memoized ] "cpu.x86.features" add-startup-hook
 
 : sse? ( -- ? ) sse-version 10 >= ;
 : sse2? ( -- ? ) sse-version 20 >= ;
index a63b92e05081c8abb815b48adaaf13c9e284fc8d..86006f843ec11f57397d4f9d73222d5a1fa6b06f 100644 (file)
@@ -430,7 +430,7 @@ M: x86 %vm-field-ptr ( dst field -- )
     [ [] ] dip data-alignment get align ADD ;
 
 : store-header ( temp class -- )
-    [ [] ] [ type-number tag-fixnum ] bi* MOV ;
+    [ [] ] [ type-number tag-header ] bi* MOV ;
 
 : store-tagged ( dst tag -- )
     type-number OR ;
@@ -1413,7 +1413,7 @@ enable-fixnum-log2
             flush
             1 exit
         ] when
-    ] "cpu.x86" add-init-hook ;
+    ] "cpu.x86" add-startup-hook ;
 
 : enable-sse2 ( version -- )
     20 >= [
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 163026f5ff2031bd3158b0db4135845a71a904e7..53034d148ab5aa194429655b8b5ad8182bd48b4e 100644 (file)
@@ -32,14 +32,14 @@ ERROR: sqlite-sql-error < sql-error n string ;
 
 : sqlite-open ( path -- db )
     normalize-path
-    "void*" <c-object>
+    void* <c-object>
     [ sqlite3_open sqlite-check-result ] keep *void* ;
 
 : sqlite-close ( db -- )
     sqlite3_close sqlite-check-result ;
 
 : sqlite-prepare ( db sql -- handle )
-    utf8 encode dup length "void*" <c-object> "void*" <c-object>
+    utf8 encode dup length void* <c-object> void* <c-object>
     [ sqlite3_prepare_v2 sqlite-check-result ] 2keep
     drop *void* ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index f1e23b18f5313c6706c3132876278a82a2d115e7..5c76216c4fdf402b8402595d189250ba4218ccef 100644 (file)
@@ -26,6 +26,9 @@ M: object error. short. ;
 
 M: string error. print ;
 
+: traceback-link. ( continuation -- )
+    "[" write [ "Traceback" ] dip write-object "]" print ;
+
 : :s ( -- )
     error-continuation get data>> stack. ;
 
@@ -330,6 +333,8 @@ M: not-found-in-roots summary drop "Cannot resolve vocab: path" ;
 
 M: wrong-values summary drop "Quotation called with wrong stack effect" ;
 
+M: stack-effect-omits-dashes summary drop "Stack effect must contain “--”" ;
+
 {
     { [ os windows? ] [ "debugger.windows" require ] }
     { [ os unix? ] [ "debugger.unix" require ] }
diff --git a/basis/debugger/windows/tags.txt b/basis/debugger/windows/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index feb19af04057f6c0def58ed57d9b7f988067d416..7e16c1c218478d08fdef4734d1165d5b7a2768a4 100644 (file)
@@ -49,7 +49,7 @@ M: cannot-find-source error.
 
 : edit-error ( error -- )
     [ error-file ] [ error-line ] bi
-    2dup and [ edit-location ] [ 2drop ] if ;
+    over [ 1 or edit-location ] [ 2drop ] if ;
 
 : :edit ( -- )
     error get edit-error ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e60a52c995b94fb2613c4b272242ff1a88663a9c..ccdbd66d96c53f8fb35d797cd0a3b3256a08755c 100644 (file)
@@ -32,4 +32,4 @@ HOOK: (set-os-envs) os ( seq -- )
         os windows? ";" ":" ? split
         [ add-vocab-root ] each
     ] when*    
-] "environment" add-init-hook
+] "environment" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
index 3401208858ad242d542936b79ee7127e21e5d398..b3d2ff296e196b367706b6031cb87b9feb417c92 100644 (file)
@@ -2,17 +2,20 @@ USING: help.markup help.syntax quotations kernel ;
 IN: fry\r
 \r
 HELP: _\r
-{ $description "Fry specifier. Inserts a literal value into the fried quotation." } ;\r
+{ $description "Fry specifier. Inserts a literal value into the fried quotation." }\r
+{ $examples "See " { $link "fry.examples" } "." } ;\r
 \r
 HELP: @\r
-{ $description "Fry specifier. Splices a quotation into the fried quotation." } ;\r
+{ $description "Fry specifier. Splices a quotation into the fried quotation." }\r
+{ $examples "See " { $link "fry.examples" } "." } ;\r
 \r
 HELP: fry\r
 { $values { "quot" quotation } { "quot'" quotation } }\r
 { $description "Outputs a quotation that when called, fries " { $snippet "quot" } " by taking values from the stack and substituting them in." }\r
 { $notes "This word is used to implement " { $link POSTPONE: '[ } "; the following two lines are equivalent:"\r
     { $code "[ X ] fry call" "'[ X ]" }\r
-} ;\r
+}\r
+{ $examples "See " { $link "fry.examples" } "." } ;\r
 \r
 HELP: '[\r
 { $syntax "'[ code... ]" }\r
index 549db25e09e96e76639dbfe6fa44e411c98968b7..10d9b282adef77dd86f16b034dfd107385160da1 100644 (file)
@@ -1,18 +1,41 @@
+! (c)2009 Slava Pestov, Eduardo Cavazos, Joe Groff bsd license
 USING: fry tools.test math prettyprint kernel io arrays
 sequences eval accessors ;
 IN: fry.tests
 
+SYMBOLS: a b c d e f g h ;
+
+[ [ 1 ] ] [ 1 '[ _ ] ] unit-test
+[ [ 1 ] ] [ [ 1 ] '[ @ ] ] unit-test
+[ [ 1 2 ] ] [ [ 1 ] [ 2 ] '[ @ @ ] ] unit-test
+
+[ [ 1 2 a ] ] [ 1 2 '[ _ _ a ] ] unit-test
+[ [ 1 2 ] ] [ 1 2 '[ _ _ ] ] unit-test
+[ [ a 1 2 ] ] [ 1 2 '[ a _ _ ] ] unit-test
+[ [ 1 2 a ] ] [ [ 1 ] [ 2 ] '[ @ @ a ] ] unit-test
+[ [ 1 a 2 b ] ] [ 1 2 '[ _ a _ b ] ] unit-test
+[ [ 1 a 2 b ] ] [ 1 [ 2 ] '[ _ a @ b ] ] unit-test
+[ [ a 1 b ] ] [ 1 '[ a _ b ] ] unit-test
+
+[ [ a 1 b ] ] [ [ 1 ] '[ a @ b ] ] unit-test
+[ [ a 1 2 ] ] [ [ 1 ] [ 2 ] '[ a @ @ ] ] unit-test
+
+[ [ a [ 1 ] b ] ] [ 1 '[ a [ _ ] b ] ] unit-test
+[ [ a 1 b [ c 2 d ] e 3 f ] ] [ 1 2 3 '[ a _ b [ c _ d ] e _ f ] ] unit-test
+[ [ a 1 b [ c 2 d [ e 3 f ] ] g 4 h ] ] [ 1 2 3 4 '[ a _ b [ c _ d [ e _ f ] ] g _ h ] ] unit-test
+[ [ a 1 b [ [ c 2 d ] e 3 f ] g 4 h ] ] [ 1 2 3 4 '[ a _ b [ [ c _ d ] e _ f ] g _ h ] ] unit-test
+
 [ [ 3 + ] ] [ 3 '[ _ + ] ] unit-test
 
 [ [ 1 3 + ] ] [ 1 3 '[ _ _ + ] ] unit-test
 
-[ [ 1 [ + ] call ] ] [ 1 [ + ] '[ _ @ ] ] unit-test
+[ [ 1 + ] ] [ 1 [ + ] '[ _ @ ] ] unit-test
 
-[ [ 1 [ + ] call . ] ] [ 1 [ + ] '[ _ @ . ] ] unit-test
+[ [ 1 + . ] ] [ 1 [ + ] '[ _ @ . ] ] unit-test
 
-[ [ [ + ] [ - ] [ call ] dip call ] ] [ [ + ] [ - ] '[ @ @ ] ] unit-test
+[ [ + - ] ] [ [ + ] [ - ] '[ @ @ ] ] unit-test
 
-[ [ "a" "b" [ write ] dip print ] ]
+[ [ "a" write "b" print ] ]
 [ "a" "b" '[ _ write _ print ] ] unit-test
 
 [ 1/2 ] [
index 184c6247a6004e32ba3b7b898aa5bdbb5990be84..931397e933f9cdb206bfcb5ecdf6b98180b58dca 100644 (file)
@@ -1,7 +1,6 @@
-! Copyright (C) 2008 Slava Pestov, Eduardo Cavazos.
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences combinators parser splitting math
-quotations arrays make words locals.backend summary sets ;
+! (c)2009 Slava Pestov, Eduardo Cavazos, Joe Groff bsd license
+USING: accessors combinators kernel locals.backend math parser
+quotations sequences sets splitting words ;
 IN: fry
 
 : _ ( -- * ) "Only valid inside a fry" throw ;
@@ -9,20 +8,9 @@ IN: fry
 
 ERROR: >r/r>-in-fry-error ;
 
-<PRIVATE
-
-: [ncurry] ( n -- quot )
-    {
-        { 0 [ [ ] ] }
-        { 1 [ [ curry ] ] }
-        { 2 [ [ 2curry ] ] }
-        { 3 [ [ 3curry ] ] }
-        [ \ curry <repetition> ]
-    } case ;
+GENERIC: fry ( quot -- quot' )
 
-M: >r/r>-in-fry-error summary
-    drop
-    "Explicit retain stack manipulation is not permitted in fried quotations" ;
+<PRIVATE
 
 : check-fry ( quot -- quot )
     dup { load-local load-locals get-local drop-locals } intersect
@@ -36,21 +24,122 @@ M: callable count-inputs [ count-inputs ] map-sum ;
 M: fry-specifier count-inputs drop 1 ;
 M: object count-inputs drop 0 ;
 
-GENERIC: deep-fry ( obj -- )
+MIXIN: fried
+PREDICATE: fried-callable < callable
+    count-inputs 0 > ;
+INSTANCE: fried-callable fried
 
-: shallow-fry ( quot -- quot' curry# )
-    check-fry
-    [ [ deep-fry ] each ] [ ] make
-    [ dup \ @ = [ drop [ _ call ] ] [ 1array ] if ] map concat
-    { _ } split [ spread>quot ] [ length 1 - ] bi ;
+: (ncurry) ( quot n -- quot )
+    {
+        { 0 [ ] }
+        { 1 [ \ curry  suffix! ] }
+        { 2 [ \ 2curry suffix! ] }
+        { 3 [ \ 3curry suffix! ] }
+        [ [ \ 3curry suffix! ] dip 3 - (ncurry) ]
+    } case ;
 
-PRIVATE>
+: wrap-non-callable ( obj -- quot )
+    dup callable? [ ] [ [ call ] curry ] if ; inline
 
-: fry ( quot -- quot' ) shallow-fry [ncurry] swap prefix ;
+: [ncurry] ( n -- quot )
+    [ V{ } clone ] dip (ncurry) >quotation ;
 
-M: callable deep-fry
-    [ count-inputs \ _ <repetition> % ] [ fry % ] bi ;
+: [ndip] ( quot n -- quot' )
+    {
+        { 0 [ wrap-non-callable ] }
+        { 1 [ \ dip  [ ] 2sequence ] }
+        { 2 [ \ 2dip [ ] 2sequence ] }
+        { 3 [ \ 3dip [ ] 2sequence ] }
+        [ [ \ 3dip [ ] 2sequence ] dip 3 - [ndip] ]
+    } case ;
+
+: (make-curry) ( tail quot -- quot' )
+    swap [ncurry] curry [ compose ] compose ;
+
+: make-compose ( consecutive quot -- consecutive quot' )
+    [
+        [ [ ] ]
+        [ [ncurry] ] if-zero
+    ] [
+        [ [ compose ] ]
+        [ [ compose compose ] curry ] if-empty
+    ] bi* compose
+    0 swap ;
+
+: make-curry ( consecutive quot -- consecutive' quot' )
+    [ 1 + ] dip
+    [ [ ] ] [ (make-curry) 0 swap ] if-empty ;
+
+: convert-curry ( consecutive quot -- consecutive' quot' )
+    [ [ ] make-curry ] [
+        dup first \ @ =
+        [ rest >quotation make-compose ]
+        [ >quotation make-curry ] if
+    ] if-empty ;
+
+: prune-curries ( seq -- seq' )
+    dup [ empty? not ] find 
+    [ [ 1 + tail ] dip but-last prefix ]
+    [ 2drop { } ] if* ;
+
+: convert-curries ( seq -- tail seq' )
+    unclip-slice [ 0 swap [ convert-curry ] map ] dip
+    [ prune-curries ]
+    [ >quotation 1quotation prefix ] if-empty ;
+
+: mark-composes ( quot -- quot' )
+    [ dup \ @ = [ drop [ _ @ ] ] [ 1quotation ] if ] map concat ; inline
+
+: shallow-fry ( quot -- quot' )
+    check-fry mark-composes
+    { _ } split convert-curries
+    [ [ [ ] ] [ [ ] (make-curry) but-last ] if-zero ]
+    [ spread>quot swap [ [ ] (make-curry) compose ] unless-zero ] if-empty ;
+
+DEFER: dredge-fry
+
+TUPLE: dredge-fry-state
+    { in-quot read-only }
+    { prequot read-only }
+    { quot read-only } ;
+
+: <dredge-fry> ( quot -- dredge-fry )
+    V{ } clone V{ } clone dredge-fry-state boa ; inline
+
+: in-quot-slices ( n i state -- head tail )
+    in-quot>>
+    [ <slice> ]
+    [ [ drop ] 2dip swap 1 + tail-slice ] 3bi ; inline
+
+: push-head-slice ( head state -- )
+    quot>> [ push-all ] [ \ _ swap push ] bi ; inline
+
+: push-subquot ( tail elt state -- )
+    [ fry swap >quotation count-inputs [ndip] ] dip prequot>> push-all ; inline
+
+: (dredge-fry-subquot) ( n state i elt -- )
+    rot {
+        [ nip in-quot-slices ] ! head tail i elt state
+        [ [ 2drop swap ] dip push-head-slice ]
+        [ [ drop ] 2dip push-subquot ]
+        [ [ 1 + ] [ drop ] [ ] tri* dredge-fry ]
+    } 3cleave ; inline recursive
+
+: (dredge-fry-simple) ( n state -- )
+    [ in-quot>> swap tail-slice ] [ quot>> ] bi push-all ; inline recursive
+
+: dredge-fry ( n dredge-fry -- )
+    2dup in-quot>> [ fried? ] find-from
+    [ (dredge-fry-subquot) ]
+    [ drop (dredge-fry-simple) ] if* ; inline recursive
+
+PRIVATE>
 
-M: object deep-fry , ;
+M: callable fry ( quot -- quot' )
+    0 swap <dredge-fry>
+    [ dredge-fry ] [
+        [ prequot>> >quotation ]
+        [ quot>> >quotation shallow-fry ] bi append
+    ] bi ;
 
 SYNTAX: '[ parse-quotation fry append! ;
index 7653a922eae57aebcfaeeeee60a804f0a8e12c3f..251a99115efaa31dcecf204172002f7ac35e13e4 100644 (file)
@@ -3,13 +3,13 @@
 USING: accessors assocs byte-arrays calendar classes
 combinators combinators.short-circuit concurrency.promises
 continuations destructors ftp io io.backend io.directories
-io.encodings io.encodings.8-bit io.encodings.binary
+io.encodings io.encodings.binary
 tools.files io.encodings.utf8 io.files io.files.info
 io.pathnames io.launcher.unix.parser io.servers.connection
 io.sockets io.streams.duplex io.streams.string io.timeouts
 kernel make math math.bitwise math.parser namespaces sequences
 splitting threads unicode.case logging calendar.format
-strings io.files.links io.files.types ;
+strings io.files.links io.files.types io.encodings.8-bit.latin1 ;
 IN: ftp.server
 
 SYMBOL: server
index fe2840c9eba3d2e1f14e71daeb82cac4ae386176..51de8c0be6852053c8af3ad55a7508ac90899508 100644 (file)
@@ -22,7 +22,7 @@ server-state f
 
 : expire-state ( class -- )
     new
-        -1/0. millis [a,b] >>expires
+        -1/0. system-micros [a,b] >>expires
     delete-tuples ;
 
 TUPLE: server-state-manager < filter-responder timeout ;
@@ -33,4 +33,4 @@ TUPLE: server-state-manager < filter-responder timeout ;
         20 minutes >>timeout ; inline
 
 : touch-state ( state manager -- )
-    timeout>> hence timestamp>millis >>expires drop ;
+    timeout>> hence timestamp>micros >>expires drop ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 954602c..261f19c
@@ -35,7 +35,7 @@ M: f (reset-game-input) ;
 : reset-game-input ( -- )
     (reset-game-input) ;
 
-[ reset-game-input ] "game-input" add-init-hook
+[ reset-game-input ] "game-input" add-startup-hook
 
 PRIVATE>
 
old mode 100755 (executable)
new mode 100644 (file)
index 258f19e..efc586e
@@ -4,7 +4,7 @@ sequences locals combinators.short-circuit threads
 namespaces assocs arrays combinators hints alien
 core-foundation.run-loop accessors sequences.private
 alien.c-types alien.data math parser game.input vectors
-bit-arrays ;
+bit-arrays unix.types ;
 IN: game.input.iokit
 
 SINGLETON: iokit-game-input-backend
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d0f6a09..4c84bb8
@@ -39,6 +39,7 @@ SYMBOL: half
     [ [ >float half>bits ] 2dip set-alien-unsigned-2 ] >>setter
     2 >>size
     2 >>align
+    2 >>align-first
     [ >float ] >>unboxer-quot
 \ half define-primitive-type
 
index 3bcc8151911fb042ccab52becf2966e8c78f743c..e77e7bccad0b13a3be79eb785a7b420c309ad559 100644 (file)
@@ -73,4 +73,4 @@ M: apropos >link ;
 INSTANCE: apropos topic
 
 : apropos ( str -- )
-    <apropos> print-topic ;
+    <apropos> print-topic nl ;
index ddd6ce23fca8566b1c3689c1708d3c79d5dee7c4..6fb87d7a33a74c35cf61c989c00e2db8dcbeb3d8 100644 (file)
@@ -129,7 +129,7 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
 
 SYMBOL: help-hook
 
-help-hook [ [ print-topic ] ] initialize
+help-hook [ [ print-topic nl ] ] initialize
 
 : help ( topic -- )
     help-hook get call( topic -- ) ;
old mode 100755 (executable)
new mode 100644 (file)
index 330db4467b12b5d07d67da1d47d1e01ed8b6a24d..04077fc2f7b0369b4cab6750041a1e57de778f6a 100644 (file)
@@ -1,7 +1,7 @@
 USING: http help.markup help.syntax io.pathnames io.streams.string
-io.encodings.8-bit io.encodings.binary kernel urls
+io.encodings.binary kernel urls
 urls.encoding byte-arrays strings assocs sequences destructors
-http.client.post-data.private ;
+http.client.post-data.private io.encodings.8-bit.latin1 ;
 IN: http.client
 
 HELP: download-failed
index 016e347e89bc2b66d62d5c2a8a983f3215cef796..482a23aeaa644328712528762155b16e210b9202 100644 (file)
@@ -5,7 +5,7 @@ sequences strings splitting calendar continuations accessors vectors
 math.order hashtables byte-arrays destructors
 io io.sockets io.streams.string io.files io.timeouts
 io.pathnames io.encodings io.encodings.string io.encodings.ascii
-io.encodings.utf8 io.encodings.8-bit io.encodings.binary io.crlf
+io.encodings.utf8 io.encodings.binary io.crlf
 io.streams.duplex fry ascii urls urls.encoding present locals
 http http.parsers http.client.post-data ;
 IN: http.client
index 3fe5e84abd6762a3cdd781ebbff437392d10041f..35d01c10141d7ebbd6157cb02206af74dcc1039e 100644 (file)
@@ -2,7 +2,8 @@ USING: http http.server http.client http.client.private tools.test
 multiline io.streams.string io.encodings.utf8 io.encodings.8-bit
 io.encodings.binary io.encodings.string io.encodings.ascii kernel
 arrays splitting sequences assocs io.sockets db db.sqlite
-continuations urls hashtables accessors namespaces xml.data ;
+continuations urls hashtables accessors namespaces xml.data
+io.encodings.8-bit.latin1 ;
 IN: http.tests
 
 [ "text/plain" latin1 ] [ "text/plain" parse-content-type ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
index 4bcfbeb..6f898e9
@@ -5,9 +5,7 @@ sequences splitting sorting sets strings vectors hashtables
 quotations arrays byte-arrays math.parser calendar
 calendar.format present urls fry
 io io.encodings io.encodings.iana io.encodings.binary
-io.encodings.8-bit io.crlf ascii
-http.parsers
-base64 ;
+io.crlf ascii io.encodings.8-bit.latin1 http.parsers base64 ;
 IN: http
 
 CONSTANT: max-redirects 10
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 50926666f6239205473b2018e05e4e3a7520aa71..702fd14472fa2f2dc45a6035b93cff0c2c0fa8cb 100644 (file)
@@ -2,9 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types arrays byte-arrays combinators
 compression.run-length fry grouping images images.loader io
-io.binary io.encodings.8-bit io.encodings.binary
+io.binary io.encodings.binary
 io.encodings.string io.streams.limited kernel math math.bitwise
-sequences specialized-arrays summary images.bitmap ;
+io.encodings.8-bit.latin1 sequences specialized-arrays summary images.bitmap ;
 QUALIFIED-WITH: bitstreams b
 SPECIALIZED-ARRAY: ushort
 IN: images.bitmap.loading
old mode 100755 (executable)
new mode 100644 (file)
index ccf891d770f4458687d432dbdfdc6b543160ab35..883a0975118ddbdefb2c5db9f985e307686df227 100644 (file)
@@ -10,7 +10,7 @@ IN: images.memory
 
 <PRIVATE
 
-: bitmap-size ( dim -- n ) product "uint" heap-size * ;
+: bitmap-size ( dim -- n ) product uint heap-size * ;
 
 : malloc-bitmap-data ( dim -- alien ) bitmap-size 1 calloc &free ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index b9c224c6294bb3d2c2f739dd9b2badb97e97c80f..3985729935dd95099828e546e33b94874a282fb3 100644 (file)
@@ -51,8 +51,8 @@ M: epoll-mx remove-output-callbacks ( fd mx -- seq )
         [ EPOLLOUT do-epoll-del ] [ call-next-method ] 2bi
     ] [ 2drop f ] if ;
 
-: wait-event ( mx us -- n )
-    [ [ fd>> ] [ events>> ] bi dup length ] [ 1000 /i ] bi*
+: wait-event ( mx nanos -- n )
+    [ [ fd>> ] [ events>> ] bi dup length ] [ 1000000 /i ] bi*
     epoll_wait multiplexer-error ;
 
 : handle-event ( event mx -- )
@@ -63,5 +63,5 @@ M: epoll-mx remove-output-callbacks ( fd mx -- seq )
 : handle-events ( mx n -- )
     [ dup events>> ] dip head-slice swap '[ _ handle-event ] each ;
 
-M: epoll-mx wait-for-events ( us mx -- )
+M: epoll-mx wait-for-events ( nanos mx -- )
     swap 60000000 or dupd wait-event handle-events ;
index c777e57f1db528649fa30fb949576323d35ff6c2..16d0338da532eb39f8e59129797353b2db545155 100644 (file)
@@ -73,6 +73,6 @@ M: kqueue-mx remove-output-callbacks ( fd mx -- seq )
     [ dup events>> ] dip head-slice
     [ handle-kevent ] with each ;
 
-M: kqueue-mx wait-for-events ( us mx -- )
+M: kqueue-mx wait-for-events ( nanos mx -- )
     swap dup [ make-timespec ] when
     dupd wait-kevent handle-kevents ;
index 73d8a603104061b7b7f81c36ae100ef59fc81ca1..ded028dda49e62a15bb61a66526f72ff7fde6319 100644 (file)
@@ -26,7 +26,7 @@ GENERIC: remove-output-callbacks ( fd mx -- callbacks )
 
 M: mx remove-output-callbacks writes>> delete-at* drop ;
 
-GENERIC: wait-for-events ( ms mx -- )
+GENERIC: wait-for-events ( nanos mx -- )
 
 : input-available ( fd mx -- )
     reads>> delete-at* drop [ resume ] each ;
index 276949a99fadcb501776a8981994e082ab117299..05328b48dc9e34f438ee3af44460638e73c7f486 100644 (file)
@@ -30,5 +30,5 @@ M: run-loop-mx add-output-callback kqueue-mx>> add-output-callback ;
 M: run-loop-mx remove-input-callbacks kqueue-mx>> remove-input-callbacks ;
 M: run-loop-mx remove-output-callbacks kqueue-mx>> remove-output-callbacks ;
 
-M: run-loop-mx wait-for-events ( us mx -- )
+M: run-loop-mx wait-for-events ( nanos mx -- )
     swap run-one-iteration [ 0 swap wait-for-events ] [ drop ] if ;
index 8022ed34e223f899cb302486d63efa795b3e2368..f2d1a3a3b78c3cf7a22f5048c3a1e26591cb0741 100644 (file)
@@ -48,9 +48,9 @@ TUPLE: select-mx < mx read-fdset write-fdset ;
     [ write-fdset/tasks [ init-fdset ] keep ] tri
     f ;
 
-M:: select-mx wait-for-events ( us mx -- )
+M:: select-mx wait-for-events ( nanos mx -- )
     mx
-    [ init-fdsets us dup [ make-timeval ] when select multiplexer-error drop ]
+    [ init-fdsets nanos 1000 /i dup [ make-timeval ] when select multiplexer-error drop ]
     [ [ read-fdset/tasks ] keep [ input-available ] check-fdset ]
     [ [ write-fdset/tasks ] keep [ output-available ] check-fdset ]
     tri ;
index ebb8f1ec05c9367050661c2ecd736221bbf08779..a8070525c7d3ca676b5d3d2389811de801d5043a 100644 (file)
@@ -5,7 +5,7 @@ kernel.private math io.ports sequences strings sbufs threads
 unix vectors io.buffers io.backend io.encodings math.parser
 continuations system libc namespaces make io.timeouts
 io.encodings.utf8 destructors destructors.private accessors
-summary combinators locals unix.time fry
+summary combinators locals unix.time unix.types fry
 io.backend.unix.multiplexers ;
 QUALIFIED: io
 IN: io.backend.unix
@@ -151,7 +151,7 @@ M: stdin dispose*
 
 : wait-for-stdin ( stdin -- n )
     [ control>> CHAR: X over io:stream-write1 io:stream-flush ]
-    [ size>> "ssize_t" heap-size swap io:stream-read *int ]
+    [ size>> ssize_t heap-size swap io:stream-read *int ]
     bi ;
 
 :: refill-stdin ( buffer stdin size -- )
old mode 100755 (executable)
new mode 100644 (file)
index 1301d69..de29f33
@@ -50,12 +50,12 @@ M: winnt add-completion ( win32-handle -- )
         } cond
     ] with-timeout ;
 
-:: wait-for-overlapped ( usec -- bytes-transferred overlapped error? )
+:: wait-for-overlapped ( nanos -- bytes-transferred overlapped error? )
     master-completion-port get-global
     0 <int> :> bytes
     f <void*> :> key
     f <void*> :> overlapped
-    usec [ 1000 /i ] [ INFINITE ] if* :> timeout
+    nanos [ 1,000,000 /i ] [ INFINITE ] if* :> timeout
     bytes key overlapped timeout GetQueuedCompletionStatus zero? :> error?
 
     bytes *int
@@ -65,7 +65,7 @@ M: winnt add-completion ( win32-handle -- )
 : resume-callback ( result overlapped -- )
     >c-ptr pending-overlapped get-global delete-at* drop resume-with ;
 
-: handle-overlapped ( us -- ? )
+: handle-overlapped ( nanos -- ? )
     wait-for-overlapped [
         [
             [ drop GetLastError 1array ] dip resume-callback t
@@ -75,7 +75,7 @@ M: winnt add-completion ( win32-handle -- )
 M: win32-handle cancel-operation
     [ check-disposed ] [ handle>> CancelIo drop ] bi ;
 
-M: winnt io-multiplex ( us -- )
+M: winnt io-multiplex ( nanos -- )
     handle-overlapped [ 0 io-multiplex ] when ;
 
 M: winnt init-io ( -- )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 203d7c187ff6cc5254d7c2ad49cb8c658aa78fa1..b0677e80bd201e5937071417006d826bb2db7ec5 100644 (file)
@@ -5,106 +5,34 @@ strings ;
 IN: io.encodings.8-bit
 
 ARTICLE: "io.encodings.8-bit" "Legacy 8-bit encodings"
-"Many encodings are a simple mapping of bytes onto characters. The " { $vocab-link "io.encodings.8-bit" } " vocabulary implements these generically using existing resource files. These encodings should be used with extreme caution, as fully general Unicode encodings like UTF-8 are nearly always more appropriate. The following 8-bit encodings are already defined:"
-{ $subsections
-    latin1
-    latin2
-    latin3
-    latin4
-    latin/cyrillic
-    latin/arabic
-    latin/greek
-    latin/hebrew
-    latin5
-    latin6
-    latin/thai
-    latin7
-    latin8
-    latin9
-    latin10
-    koi8-r
-    windows-1252
-    ebcdic
-    mac-roman
+"Many encodings are a simple mapping of bytes onto characters. The " { $vocab-link "io.encodings.8-bit" } " vocabulary implements these generically using existing resource files. These encodings should be used with extreme caution, as fully general Unicode encodings like UTF-8 are nearly always more appropriate. The following 8-bit encodings are available:"
+{ $list
+    { $vocab-link "io.encodings.8-bit.ebcdic" }
+    { $vocab-link "io.encodings.8-bit.latin1" }
+    { $vocab-link "io.encodings.8-bit.latin2" }
+    { $vocab-link "io.encodings.8-bit.latin3" }
+    { $vocab-link "io.encodings.8-bit.latin4" }
+    { $vocab-link "io.encodings.8-bit.cyrillic" }
+    { $vocab-link "io.encodings.8-bit.arabic" }
+    { $vocab-link "io.encodings.8-bit.greek" }
+    { $vocab-link "io.encodings.8-bit.hebrew" }
+    { $vocab-link "io.encodings.8-bit.latin5" }
+    { $vocab-link "io.encodings.8-bit.latin6" }
+    { $vocab-link "io.encodings.8-bit.thai" }
+    { $vocab-link "io.encodings.8-bit.latin7" }
+    { $vocab-link "io.encodings.8-bit.latin8" }
+    { $vocab-link "io.encodings.8-bit.latin9" }
+    { $vocab-link "io.encodings.8-bit.koi8-r" }
+    { $vocab-link "io.encodings.8-bit.mac-roman" }
+    { $vocab-link "io.encodings.8-bit.windows-1250" }
+    { $vocab-link "io.encodings.8-bit.windows-1251" }
+    { $vocab-link "io.encodings.8-bit.windows-1252" }
+    { $vocab-link "io.encodings.8-bit.windows-1253" }
+    { $vocab-link "io.encodings.8-bit.windows-1254" }
+    { $vocab-link "io.encodings.8-bit.windows-1255" }
+    { $vocab-link "io.encodings.8-bit.windows-1256" }
+    { $vocab-link "io.encodings.8-bit.windows-1257" }
+    { $vocab-link "io.encodings.8-bit.windows-1258" }
 } ;
 
 ABOUT: "io.encodings.8-bit"
-
-HELP: 8-bit
-{ $class-description "Describes an 8-bit encoding, including its name (a symbol) and a table used for encoding and decoding." } ;
-
-HELP: latin1
-{ $description "This is the ISO-8859-1 encoding, also called Latin-1: Western European. It is an 8-bit superset of ASCII which is the default for a mimetype starting with 'text' and provides the characters necessary for most western European languages." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin2
-{ $description "This is the ISO-8859-2 encoding, also called Latin-2: Eastern European. It is an 8-bit superset of ASCII and provides the characters necessary for most eastern European languages." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin3
-{ $description "This is the ISO-8859-3 encoding, also called Latin-3: South European. It is an 8-bit superset of ASCII and provides the characters necessary for Turkish, Maltese and Esperanto." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin4
-{ $description "This is the ISO-8859-4 encoding, also called Latin-4: North European. It is an 8-bit superset of ASCII and provides the characters necessary for Latvian, Lithuanian, Estonian, Greenlandic and Sami." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin/cyrillic
-{ $description "This is the ISO-8859-5 encoding, also called Latin/Cyrillic. It is an 8-bit superset of ASCII and provides the characters necessary for most languages which use Cyrilic, including Russian, Macedonian, Belarusian, Bulgarian, Serbian, and Ukrainian. KOI8-R is used much more commonly." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin/arabic
-{ $description "This is the ISO-8859-6 encoding, also called Latin/Arabic. It is an 8-bit superset of ASCII and provides the characters necessary for Arabic, though not other languages which use Arabic script." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin/greek
-{ $description "This is the ISO-8859-7 encoding, also called Latin/Greek. It is an 8-bit superset of ASCII and provides the characters necessary for Greek written in modern monotonic orthography, or ancient Greek without accent marks." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin/hebrew
-{ $description "This is the ISO-8859-8 encoding, also called Latin/Hebrew. It is an 8-bit superset of ASCII and provides the characters necessary for modern Hebrew without explicit vowels. Generally, this is interpreted in logical order, making it ISO-8859-8-I, technically." }
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin5
-{ $description "This is the ISO-8859-9 encoding, also called Latin-5: Turkish. It is an 8-bit superset of ASCII and provides the characters necessary for Turkish, similar to Latin-1 but replacing the spots used for Icelandic with characters used in Turkish." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin6
-{ $description "This is the ISO-8859-10 encoding, also called Latin-6: Nordic. It is an 8-bit superset of ASCII containing the same characters as Latin-4, but rearranged to be of better use to nordic languages." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin/thai
-{ $description "This is the ISO-8859-11 encoding, also called Latin/Thai. It is an 8-bit superset of ASCII containing the characters necessary to represent Thai. It is basically identical to TIS-620." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin7
-{ $description "This is the ISO-8859-13 encoding, also called Latin-7: Baltic Rim. It is an 8-bit superset of ASCII containing all characters necesary to represent Baltic Rim languages, as previous character sets were incomplete." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin8
-{ $description "This is the ISO-8859-14 encoding, also called Latin-8: Celtic. It is an 8-bit superset of ASCII designed for Celtic languages like Gaelic and Breton." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin9
-{ $description "This is the ISO-8859-15 encoding, also called Latin-9 and unoffically as Latin-0. It is an 8-bit superset of ASCII designed as a modification of Latin-1, removing little-used characters in favor of the Euro symbol and other characters." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: latin10
-{ $description "This is the ISO-8859-16 encoding, also called Latin-10: South-Eastern European. It is an 8-bit superset of ASCII." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: windows-1252
-{ $description "Windows 1252 is an 8-bit superset of ASCII which is closely related to Latin-1. Control characters in the 0x80 to 0x9F range are replaced with printable characters such as the Euro symbol." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: ebcdic
-{ $description "EBCDIC is an 8-bit legacy encoding designed for IBM mainframes like System/360 in the 1960s. It has since fallen into disuse. It contains large unallocated regions, and the version included here (code page 37) contains auxiliary characters in this region for English- and Portugese-speaking countries." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: mac-roman
-{ $description "Mac Roman is an 8-bit superset of ASCII which was the standard encoding on Mac OS prior to version 10. It is incompatible with Latin-1 in all but a few places and ASCII, and it is suitable for encoding many Western European languages." } 
-{ $see-also "encodings-introduction" } ;
-
-HELP: koi8-r
-{ $description "KOI8-R is an 8-bit superset of ASCII which encodes the Cyrillic alphabet, as used in Russian and Bulgarian. Characters are in such an order that, if the eight bit is stripped, text is still interpretable as ASCII. Block-building characters also exist." } 
-{ $see-also "encodings-introduction" } ;
index 55b9c44934e2c0448fe22de49f6b7e5b1446c841..5178630f0fa0cecda1cdf58306415731435a61ef 100644 (file)
@@ -1,5 +1,6 @@
 USING: io.encodings.string io.encodings.8-bit
-io.encodings.8-bit.private tools.test strings arrays ;
+io.encodings.8-bit.private tools.test strings arrays
+io.encodings.8-bit.latin1 io.encodings.8-bit.windows-1252 ;
 IN: io.encodings.8-bit.tests
 
 [ B{ CHAR: f CHAR: o CHAR: o } ] [ "foo" latin1 encode ] unit-test
index c13bbccd432e988644245c824265cef8c13920c6..7f92028c312ff3417e28047ba79e520f43603b9f 100644 (file)
@@ -1,42 +1,19 @@
-! Copyright (C) 2008 Daniel Ehrenberg
+! Copyright (C) 2008 Daniel Ehrenberg, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: math.parser arrays io.encodings sequences kernel assocs
 hashtables io.encodings.ascii generic parser classes.tuple words
 words.symbol io io.files splitting namespaces math
 compiler.units accessors classes.singleton classes.mixin
-io.encodings.iana fry simple-flat-file ;
+io.encodings.iana fry simple-flat-file lexer ;
 IN: io.encodings.8-bit
 
 <PRIVATE
 
-CONSTANT: mappings {
-    ! encoding-name iana-name file-name
-    { "latin1" "ISO_8859-1:1987" "8859-1" }
-    { "latin2" "ISO_8859-2:1987" "8859-2" }
-    { "latin3" "ISO_8859-3:1988" "8859-3" }
-    { "latin4" "ISO_8859-4:1988" "8859-4" }
-    { "latin/cyrillic" "ISO_8859-5:1988" "8859-5" }
-    { "latin/arabic" "ISO_8859-6:1987" "8859-6" }
-    { "latin/greek" "ISO_8859-7:1987" "8859-7" }
-    { "latin/hebrew" "ISO_8859-8:1988" "8859-8" }
-    { "latin5" "ISO_8859-9:1989" "8859-9" }
-    { "latin6" "ISO-8859-10" "8859-10" }
-    { "latin/thai" "TIS-620" "8859-11" }
-    { "latin7" "ISO-8859-13" "8859-13" }
-    { "latin8" "ISO-8859-14" "8859-14" }
-    { "latin9" "ISO-8859-15" "8859-15" }
-    { "latin10" "ISO-8859-16" "8859-16" }
-    { "koi8-r" "KOI8-R" "KOI8-R" }
-    { "windows-1250" "windows-1250" "CP1250" }
-    { "windows-1252" "windows-1252" "CP1252" }
-    { "ebcdic" "IBM037" "CP037" }
-    { "mac-roman" "macintosh" "ROMAN" }
-}
-
 : encoding-file ( file-name -- stream )
     "vocab:io/encodings/8-bit/" ".TXT" surround ;
 
 SYMBOL: 8-bit-encodings
+8-bit-encodings [ H{ } clone ] initialize
 
 TUPLE: 8-bit biassoc ;
 
@@ -62,20 +39,17 @@ M: 8-bit-encoding <decoder>
     8-bit-encodings get-global at <decoder> ;
 
 : create-encoding ( name -- word )
-    "io.encodings.8-bit" create
+    create-in
     [ define-singleton-class ]
     [ 8-bit-encoding add-mixin-instance ]
     [ ] tri ;
 
+: load-encoding ( name iana-name file-name -- )
+    [ create-encoding dup ]
+    [ register-encoding ]
+    [ encoding-file flat-file>biassoc 8-bit boa ] tri*
+    swap 8-bit-encodings get-global set-at ;
+
 PRIVATE>
 
-[
-    mappings [
-        first3
-        [ create-encoding ]
-        [ dupd register-encoding ]
-        [ encoding-file flat-file>biassoc 8-bit boa ]
-        tri*
-    ] H{ } map>assoc
-    8-bit-encodings set-global
-] with-compilation-unit
+SYNTAX: 8-BIT: scan scan scan load-encoding ;
diff --git a/basis/io/encodings/8-bit/CP1251.TXT b/basis/io/encodings/8-bit/CP1251.TXT
new file mode 100644 (file)
index 0000000..4d9b355
--- /dev/null
@@ -0,0 +1,274 @@
+#
+#    Name:     cp1251 to Unicode table
+#    Unicode version: 2.0
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          04/15/98
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp1251 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp1251 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80   0x0402  #CYRILLIC CAPITAL LETTER DJE
+0x81   0x0403  #CYRILLIC CAPITAL LETTER GJE
+0x82   0x201A  #SINGLE LOW-9 QUOTATION MARK
+0x83   0x0453  #CYRILLIC SMALL LETTER GJE
+0x84   0x201E  #DOUBLE LOW-9 QUOTATION MARK
+0x85   0x2026  #HORIZONTAL ELLIPSIS
+0x86   0x2020  #DAGGER
+0x87   0x2021  #DOUBLE DAGGER
+0x88   0x20AC  #EURO SIGN
+0x89   0x2030  #PER MILLE SIGN
+0x8A   0x0409  #CYRILLIC CAPITAL LETTER LJE
+0x8B   0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+0x8C   0x040A  #CYRILLIC CAPITAL LETTER NJE
+0x8D   0x040C  #CYRILLIC CAPITAL LETTER KJE
+0x8E   0x040B  #CYRILLIC CAPITAL LETTER TSHE
+0x8F   0x040F  #CYRILLIC CAPITAL LETTER DZHE
+0x90   0x0452  #CYRILLIC SMALL LETTER DJE
+0x91   0x2018  #LEFT SINGLE QUOTATION MARK
+0x92   0x2019  #RIGHT SINGLE QUOTATION MARK
+0x93   0x201C  #LEFT DOUBLE QUOTATION MARK
+0x94   0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x95   0x2022  #BULLET
+0x96   0x2013  #EN DASH
+0x97   0x2014  #EM DASH
+0x98           #UNDEFINED
+0x99   0x2122  #TRADE MARK SIGN
+0x9A   0x0459  #CYRILLIC SMALL LETTER LJE
+0x9B   0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+0x9C   0x045A  #CYRILLIC SMALL LETTER NJE
+0x9D   0x045C  #CYRILLIC SMALL LETTER KJE
+0x9E   0x045B  #CYRILLIC SMALL LETTER TSHE
+0x9F   0x045F  #CYRILLIC SMALL LETTER DZHE
+0xA0   0x00A0  #NO-BREAK SPACE
+0xA1   0x040E  #CYRILLIC CAPITAL LETTER SHORT U
+0xA2   0x045E  #CYRILLIC SMALL LETTER SHORT U
+0xA3   0x0408  #CYRILLIC CAPITAL LETTER JE
+0xA4   0x00A4  #CURRENCY SIGN
+0xA5   0x0490  #CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+0xA6   0x00A6  #BROKEN BAR
+0xA7   0x00A7  #SECTION SIGN
+0xA8   0x0401  #CYRILLIC CAPITAL LETTER IO
+0xA9   0x00A9  #COPYRIGHT SIGN
+0xAA   0x0404  #CYRILLIC CAPITAL LETTER UKRAINIAN IE
+0xAB   0x00AB  #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #NOT SIGN
+0xAD   0x00AD  #SOFT HYPHEN
+0xAE   0x00AE  #REGISTERED SIGN
+0xAF   0x0407  #CYRILLIC CAPITAL LETTER YI
+0xB0   0x00B0  #DEGREE SIGN
+0xB1   0x00B1  #PLUS-MINUS SIGN
+0xB2   0x0406  #CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+0xB3   0x0456  #CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+0xB4   0x0491  #CYRILLIC SMALL LETTER GHE WITH UPTURN
+0xB5   0x00B5  #MICRO SIGN
+0xB6   0x00B6  #PILCROW SIGN
+0xB7   0x00B7  #MIDDLE DOT
+0xB8   0x0451  #CYRILLIC SMALL LETTER IO
+0xB9   0x2116  #NUMERO SIGN
+0xBA   0x0454  #CYRILLIC SMALL LETTER UKRAINIAN IE
+0xBB   0x00BB  #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x0458  #CYRILLIC SMALL LETTER JE
+0xBD   0x0405  #CYRILLIC CAPITAL LETTER DZE
+0xBE   0x0455  #CYRILLIC SMALL LETTER DZE
+0xBF   0x0457  #CYRILLIC SMALL LETTER YI
+0xC0   0x0410  #CYRILLIC CAPITAL LETTER A
+0xC1   0x0411  #CYRILLIC CAPITAL LETTER BE
+0xC2   0x0412  #CYRILLIC CAPITAL LETTER VE
+0xC3   0x0413  #CYRILLIC CAPITAL LETTER GHE
+0xC4   0x0414  #CYRILLIC CAPITAL LETTER DE
+0xC5   0x0415  #CYRILLIC CAPITAL LETTER IE
+0xC6   0x0416  #CYRILLIC CAPITAL LETTER ZHE
+0xC7   0x0417  #CYRILLIC CAPITAL LETTER ZE
+0xC8   0x0418  #CYRILLIC CAPITAL LETTER I
+0xC9   0x0419  #CYRILLIC CAPITAL LETTER SHORT I
+0xCA   0x041A  #CYRILLIC CAPITAL LETTER KA
+0xCB   0x041B  #CYRILLIC CAPITAL LETTER EL
+0xCC   0x041C  #CYRILLIC CAPITAL LETTER EM
+0xCD   0x041D  #CYRILLIC CAPITAL LETTER EN
+0xCE   0x041E  #CYRILLIC CAPITAL LETTER O
+0xCF   0x041F  #CYRILLIC CAPITAL LETTER PE
+0xD0   0x0420  #CYRILLIC CAPITAL LETTER ER
+0xD1   0x0421  #CYRILLIC CAPITAL LETTER ES
+0xD2   0x0422  #CYRILLIC CAPITAL LETTER TE
+0xD3   0x0423  #CYRILLIC CAPITAL LETTER U
+0xD4   0x0424  #CYRILLIC CAPITAL LETTER EF
+0xD5   0x0425  #CYRILLIC CAPITAL LETTER HA
+0xD6   0x0426  #CYRILLIC CAPITAL LETTER TSE
+0xD7   0x0427  #CYRILLIC CAPITAL LETTER CHE
+0xD8   0x0428  #CYRILLIC CAPITAL LETTER SHA
+0xD9   0x0429  #CYRILLIC CAPITAL LETTER SHCHA
+0xDA   0x042A  #CYRILLIC CAPITAL LETTER HARD SIGN
+0xDB   0x042B  #CYRILLIC CAPITAL LETTER YERU
+0xDC   0x042C  #CYRILLIC CAPITAL LETTER SOFT SIGN
+0xDD   0x042D  #CYRILLIC CAPITAL LETTER E
+0xDE   0x042E  #CYRILLIC CAPITAL LETTER YU
+0xDF   0x042F  #CYRILLIC CAPITAL LETTER YA
+0xE0   0x0430  #CYRILLIC SMALL LETTER A
+0xE1   0x0431  #CYRILLIC SMALL LETTER BE
+0xE2   0x0432  #CYRILLIC SMALL LETTER VE
+0xE3   0x0433  #CYRILLIC SMALL LETTER GHE
+0xE4   0x0434  #CYRILLIC SMALL LETTER DE
+0xE5   0x0435  #CYRILLIC SMALL LETTER IE
+0xE6   0x0436  #CYRILLIC SMALL LETTER ZHE
+0xE7   0x0437  #CYRILLIC SMALL LETTER ZE
+0xE8   0x0438  #CYRILLIC SMALL LETTER I
+0xE9   0x0439  #CYRILLIC SMALL LETTER SHORT I
+0xEA   0x043A  #CYRILLIC SMALL LETTER KA
+0xEB   0x043B  #CYRILLIC SMALL LETTER EL
+0xEC   0x043C  #CYRILLIC SMALL LETTER EM
+0xED   0x043D  #CYRILLIC SMALL LETTER EN
+0xEE   0x043E  #CYRILLIC SMALL LETTER O
+0xEF   0x043F  #CYRILLIC SMALL LETTER PE
+0xF0   0x0440  #CYRILLIC SMALL LETTER ER
+0xF1   0x0441  #CYRILLIC SMALL LETTER ES
+0xF2   0x0442  #CYRILLIC SMALL LETTER TE
+0xF3   0x0443  #CYRILLIC SMALL LETTER U
+0xF4   0x0444  #CYRILLIC SMALL LETTER EF
+0xF5   0x0445  #CYRILLIC SMALL LETTER HA
+0xF6   0x0446  #CYRILLIC SMALL LETTER TSE
+0xF7   0x0447  #CYRILLIC SMALL LETTER CHE
+0xF8   0x0448  #CYRILLIC SMALL LETTER SHA
+0xF9   0x0449  #CYRILLIC SMALL LETTER SHCHA
+0xFA   0x044A  #CYRILLIC SMALL LETTER HARD SIGN
+0xFB   0x044B  #CYRILLIC SMALL LETTER YERU
+0xFC   0x044C  #CYRILLIC SMALL LETTER SOFT SIGN
+0xFD   0x044D  #CYRILLIC SMALL LETTER E
+0xFE   0x044E  #CYRILLIC SMALL LETTER YU
+0xFF   0x044F  #CYRILLIC SMALL LETTER YA
diff --git a/basis/io/encodings/8-bit/CP1253.TXT b/basis/io/encodings/8-bit/CP1253.TXT
new file mode 100644 (file)
index 0000000..20a55b0
--- /dev/null
@@ -0,0 +1,274 @@
+#
+#    Name:     cp1253 to Unicode table
+#    Unicode version: 2.0
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          04/15/98
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp1253 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp1253 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80   0x20AC  #EURO SIGN
+0x81           #UNDEFINED
+0x82   0x201A  #SINGLE LOW-9 QUOTATION MARK
+0x83   0x0192  #LATIN SMALL LETTER F WITH HOOK
+0x84   0x201E  #DOUBLE LOW-9 QUOTATION MARK
+0x85   0x2026  #HORIZONTAL ELLIPSIS
+0x86   0x2020  #DAGGER
+0x87   0x2021  #DOUBLE DAGGER
+0x88           #UNDEFINED
+0x89   0x2030  #PER MILLE SIGN
+0x8A           #UNDEFINED
+0x8B   0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+0x8C           #UNDEFINED
+0x8D           #UNDEFINED
+0x8E           #UNDEFINED
+0x8F           #UNDEFINED
+0x90           #UNDEFINED
+0x91   0x2018  #LEFT SINGLE QUOTATION MARK
+0x92   0x2019  #RIGHT SINGLE QUOTATION MARK
+0x93   0x201C  #LEFT DOUBLE QUOTATION MARK
+0x94   0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x95   0x2022  #BULLET
+0x96   0x2013  #EN DASH
+0x97   0x2014  #EM DASH
+0x98           #UNDEFINED
+0x99   0x2122  #TRADE MARK SIGN
+0x9A           #UNDEFINED
+0x9B   0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+0x9C           #UNDEFINED
+0x9D           #UNDEFINED
+0x9E           #UNDEFINED
+0x9F           #UNDEFINED
+0xA0   0x00A0  #NO-BREAK SPACE
+0xA1   0x0385  #GREEK DIALYTIKA TONOS
+0xA2   0x0386  #GREEK CAPITAL LETTER ALPHA WITH TONOS
+0xA3   0x00A3  #POUND SIGN
+0xA4   0x00A4  #CURRENCY SIGN
+0xA5   0x00A5  #YEN SIGN
+0xA6   0x00A6  #BROKEN BAR
+0xA7   0x00A7  #SECTION SIGN
+0xA8   0x00A8  #DIAERESIS
+0xA9   0x00A9  #COPYRIGHT SIGN
+0xAA           #UNDEFINED
+0xAB   0x00AB  #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #NOT SIGN
+0xAD   0x00AD  #SOFT HYPHEN
+0xAE   0x00AE  #REGISTERED SIGN
+0xAF   0x2015  #HORIZONTAL BAR
+0xB0   0x00B0  #DEGREE SIGN
+0xB1   0x00B1  #PLUS-MINUS SIGN
+0xB2   0x00B2  #SUPERSCRIPT TWO
+0xB3   0x00B3  #SUPERSCRIPT THREE
+0xB4   0x0384  #GREEK TONOS
+0xB5   0x00B5  #MICRO SIGN
+0xB6   0x00B6  #PILCROW SIGN
+0xB7   0x00B7  #MIDDLE DOT
+0xB8   0x0388  #GREEK CAPITAL LETTER EPSILON WITH TONOS
+0xB9   0x0389  #GREEK CAPITAL LETTER ETA WITH TONOS
+0xBA   0x038A  #GREEK CAPITAL LETTER IOTA WITH TONOS
+0xBB   0x00BB  #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x038C  #GREEK CAPITAL LETTER OMICRON WITH TONOS
+0xBD   0x00BD  #VULGAR FRACTION ONE HALF
+0xBE   0x038E  #GREEK CAPITAL LETTER UPSILON WITH TONOS
+0xBF   0x038F  #GREEK CAPITAL LETTER OMEGA WITH TONOS
+0xC0   0x0390  #GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+0xC1   0x0391  #GREEK CAPITAL LETTER ALPHA
+0xC2   0x0392  #GREEK CAPITAL LETTER BETA
+0xC3   0x0393  #GREEK CAPITAL LETTER GAMMA
+0xC4   0x0394  #GREEK CAPITAL LETTER DELTA
+0xC5   0x0395  #GREEK CAPITAL LETTER EPSILON
+0xC6   0x0396  #GREEK CAPITAL LETTER ZETA
+0xC7   0x0397  #GREEK CAPITAL LETTER ETA
+0xC8   0x0398  #GREEK CAPITAL LETTER THETA
+0xC9   0x0399  #GREEK CAPITAL LETTER IOTA
+0xCA   0x039A  #GREEK CAPITAL LETTER KAPPA
+0xCB   0x039B  #GREEK CAPITAL LETTER LAMDA
+0xCC   0x039C  #GREEK CAPITAL LETTER MU
+0xCD   0x039D  #GREEK CAPITAL LETTER NU
+0xCE   0x039E  #GREEK CAPITAL LETTER XI
+0xCF   0x039F  #GREEK CAPITAL LETTER OMICRON
+0xD0   0x03A0  #GREEK CAPITAL LETTER PI
+0xD1   0x03A1  #GREEK CAPITAL LETTER RHO
+0xD2           #UNDEFINED
+0xD3   0x03A3  #GREEK CAPITAL LETTER SIGMA
+0xD4   0x03A4  #GREEK CAPITAL LETTER TAU
+0xD5   0x03A5  #GREEK CAPITAL LETTER UPSILON
+0xD6   0x03A6  #GREEK CAPITAL LETTER PHI
+0xD7   0x03A7  #GREEK CAPITAL LETTER CHI
+0xD8   0x03A8  #GREEK CAPITAL LETTER PSI
+0xD9   0x03A9  #GREEK CAPITAL LETTER OMEGA
+0xDA   0x03AA  #GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+0xDB   0x03AB  #GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+0xDC   0x03AC  #GREEK SMALL LETTER ALPHA WITH TONOS
+0xDD   0x03AD  #GREEK SMALL LETTER EPSILON WITH TONOS
+0xDE   0x03AE  #GREEK SMALL LETTER ETA WITH TONOS
+0xDF   0x03AF  #GREEK SMALL LETTER IOTA WITH TONOS
+0xE0   0x03B0  #GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+0xE1   0x03B1  #GREEK SMALL LETTER ALPHA
+0xE2   0x03B2  #GREEK SMALL LETTER BETA
+0xE3   0x03B3  #GREEK SMALL LETTER GAMMA
+0xE4   0x03B4  #GREEK SMALL LETTER DELTA
+0xE5   0x03B5  #GREEK SMALL LETTER EPSILON
+0xE6   0x03B6  #GREEK SMALL LETTER ZETA
+0xE7   0x03B7  #GREEK SMALL LETTER ETA
+0xE8   0x03B8  #GREEK SMALL LETTER THETA
+0xE9   0x03B9  #GREEK SMALL LETTER IOTA
+0xEA   0x03BA  #GREEK SMALL LETTER KAPPA
+0xEB   0x03BB  #GREEK SMALL LETTER LAMDA
+0xEC   0x03BC  #GREEK SMALL LETTER MU
+0xED   0x03BD  #GREEK SMALL LETTER NU
+0xEE   0x03BE  #GREEK SMALL LETTER XI
+0xEF   0x03BF  #GREEK SMALL LETTER OMICRON
+0xF0   0x03C0  #GREEK SMALL LETTER PI
+0xF1   0x03C1  #GREEK SMALL LETTER RHO
+0xF2   0x03C2  #GREEK SMALL LETTER FINAL SIGMA
+0xF3   0x03C3  #GREEK SMALL LETTER SIGMA
+0xF4   0x03C4  #GREEK SMALL LETTER TAU
+0xF5   0x03C5  #GREEK SMALL LETTER UPSILON
+0xF6   0x03C6  #GREEK SMALL LETTER PHI
+0xF7   0x03C7  #GREEK SMALL LETTER CHI
+0xF8   0x03C8  #GREEK SMALL LETTER PSI
+0xF9   0x03C9  #GREEK SMALL LETTER OMEGA
+0xFA   0x03CA  #GREEK SMALL LETTER IOTA WITH DIALYTIKA
+0xFB   0x03CB  #GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+0xFC   0x03CC  #GREEK SMALL LETTER OMICRON WITH TONOS
+0xFD   0x03CD  #GREEK SMALL LETTER UPSILON WITH TONOS
+0xFE   0x03CE  #GREEK SMALL LETTER OMEGA WITH TONOS
+0xFF           #UNDEFINED
diff --git a/basis/io/encodings/8-bit/CP1254.TXT b/basis/io/encodings/8-bit/CP1254.TXT
new file mode 100644 (file)
index 0000000..987ed98
--- /dev/null
@@ -0,0 +1,274 @@
+#
+#    Name:     cp1254 to Unicode table
+#    Unicode version: 2.0
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          04/15/98
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp1254 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp1254 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80   0x20AC  #EURO SIGN
+0x81           #UNDEFINED
+0x82   0x201A  #SINGLE LOW-9 QUOTATION MARK
+0x83   0x0192  #LATIN SMALL LETTER F WITH HOOK
+0x84   0x201E  #DOUBLE LOW-9 QUOTATION MARK
+0x85   0x2026  #HORIZONTAL ELLIPSIS
+0x86   0x2020  #DAGGER
+0x87   0x2021  #DOUBLE DAGGER
+0x88   0x02C6  #MODIFIER LETTER CIRCUMFLEX ACCENT
+0x89   0x2030  #PER MILLE SIGN
+0x8A   0x0160  #LATIN CAPITAL LETTER S WITH CARON
+0x8B   0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+0x8C   0x0152  #LATIN CAPITAL LIGATURE OE
+0x8D           #UNDEFINED
+0x8E           #UNDEFINED
+0x8F           #UNDEFINED
+0x90           #UNDEFINED
+0x91   0x2018  #LEFT SINGLE QUOTATION MARK
+0x92   0x2019  #RIGHT SINGLE QUOTATION MARK
+0x93   0x201C  #LEFT DOUBLE QUOTATION MARK
+0x94   0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x95   0x2022  #BULLET
+0x96   0x2013  #EN DASH
+0x97   0x2014  #EM DASH
+0x98   0x02DC  #SMALL TILDE
+0x99   0x2122  #TRADE MARK SIGN
+0x9A   0x0161  #LATIN SMALL LETTER S WITH CARON
+0x9B   0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+0x9C   0x0153  #LATIN SMALL LIGATURE OE
+0x9D           #UNDEFINED
+0x9E           #UNDEFINED
+0x9F   0x0178  #LATIN CAPITAL LETTER Y WITH DIAERESIS
+0xA0   0x00A0  #NO-BREAK SPACE
+0xA1   0x00A1  #INVERTED EXCLAMATION MARK
+0xA2   0x00A2  #CENT SIGN
+0xA3   0x00A3  #POUND SIGN
+0xA4   0x00A4  #CURRENCY SIGN
+0xA5   0x00A5  #YEN SIGN
+0xA6   0x00A6  #BROKEN BAR
+0xA7   0x00A7  #SECTION SIGN
+0xA8   0x00A8  #DIAERESIS
+0xA9   0x00A9  #COPYRIGHT SIGN
+0xAA   0x00AA  #FEMININE ORDINAL INDICATOR
+0xAB   0x00AB  #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #NOT SIGN
+0xAD   0x00AD  #SOFT HYPHEN
+0xAE   0x00AE  #REGISTERED SIGN
+0xAF   0x00AF  #MACRON
+0xB0   0x00B0  #DEGREE SIGN
+0xB1   0x00B1  #PLUS-MINUS SIGN
+0xB2   0x00B2  #SUPERSCRIPT TWO
+0xB3   0x00B3  #SUPERSCRIPT THREE
+0xB4   0x00B4  #ACUTE ACCENT
+0xB5   0x00B5  #MICRO SIGN
+0xB6   0x00B6  #PILCROW SIGN
+0xB7   0x00B7  #MIDDLE DOT
+0xB8   0x00B8  #CEDILLA
+0xB9   0x00B9  #SUPERSCRIPT ONE
+0xBA   0x00BA  #MASCULINE ORDINAL INDICATOR
+0xBB   0x00BB  #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x00BC  #VULGAR FRACTION ONE QUARTER
+0xBD   0x00BD  #VULGAR FRACTION ONE HALF
+0xBE   0x00BE  #VULGAR FRACTION THREE QUARTERS
+0xBF   0x00BF  #INVERTED QUESTION MARK
+0xC0   0x00C0  #LATIN CAPITAL LETTER A WITH GRAVE
+0xC1   0x00C1  #LATIN CAPITAL LETTER A WITH ACUTE
+0xC2   0x00C2  #LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0xC3   0x00C3  #LATIN CAPITAL LETTER A WITH TILDE
+0xC4   0x00C4  #LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x00C5  #LATIN CAPITAL LETTER A WITH RING ABOVE
+0xC6   0x00C6  #LATIN CAPITAL LETTER AE
+0xC7   0x00C7  #LATIN CAPITAL LETTER C WITH CEDILLA
+0xC8   0x00C8  #LATIN CAPITAL LETTER E WITH GRAVE
+0xC9   0x00C9  #LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x00CA  #LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+0xCB   0x00CB  #LATIN CAPITAL LETTER E WITH DIAERESIS
+0xCC   0x00CC  #LATIN CAPITAL LETTER I WITH GRAVE
+0xCD   0x00CD  #LATIN CAPITAL LETTER I WITH ACUTE
+0xCE   0x00CE  #LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0xCF   0x00CF  #LATIN CAPITAL LETTER I WITH DIAERESIS
+0xD0   0x011E  #LATIN CAPITAL LETTER G WITH BREVE
+0xD1   0x00D1  #LATIN CAPITAL LETTER N WITH TILDE
+0xD2   0x00D2  #LATIN CAPITAL LETTER O WITH GRAVE
+0xD3   0x00D3  #LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x00D4  #LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xD5   0x00D5  #LATIN CAPITAL LETTER O WITH TILDE
+0xD6   0x00D6  #LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x00D7  #MULTIPLICATION SIGN
+0xD8   0x00D8  #LATIN CAPITAL LETTER O WITH STROKE
+0xD9   0x00D9  #LATIN CAPITAL LETTER U WITH GRAVE
+0xDA   0x00DA  #LATIN CAPITAL LETTER U WITH ACUTE
+0xDB   0x00DB  #LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xDC   0x00DC  #LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x0130  #LATIN CAPITAL LETTER I WITH DOT ABOVE
+0xDE   0x015E  #LATIN CAPITAL LETTER S WITH CEDILLA
+0xDF   0x00DF  #LATIN SMALL LETTER SHARP S
+0xE0   0x00E0  #LATIN SMALL LETTER A WITH GRAVE
+0xE1   0x00E1  #LATIN SMALL LETTER A WITH ACUTE
+0xE2   0x00E2  #LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3   0x00E3  #LATIN SMALL LETTER A WITH TILDE
+0xE4   0x00E4  #LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x00E5  #LATIN SMALL LETTER A WITH RING ABOVE
+0xE6   0x00E6  #LATIN SMALL LETTER AE
+0xE7   0x00E7  #LATIN SMALL LETTER C WITH CEDILLA
+0xE8   0x00E8  #LATIN SMALL LETTER E WITH GRAVE
+0xE9   0x00E9  #LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x00EA  #LATIN SMALL LETTER E WITH CIRCUMFLEX
+0xEB   0x00EB  #LATIN SMALL LETTER E WITH DIAERESIS
+0xEC   0x00EC  #LATIN SMALL LETTER I WITH GRAVE
+0xED   0x00ED  #LATIN SMALL LETTER I WITH ACUTE
+0xEE   0x00EE  #LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF   0x00EF  #LATIN SMALL LETTER I WITH DIAERESIS
+0xF0   0x011F  #LATIN SMALL LETTER G WITH BREVE
+0xF1   0x00F1  #LATIN SMALL LETTER N WITH TILDE
+0xF2   0x00F2  #LATIN SMALL LETTER O WITH GRAVE
+0xF3   0x00F3  #LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x00F4  #LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5   0x00F5  #LATIN SMALL LETTER O WITH TILDE
+0xF6   0x00F6  #LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x00F7  #DIVISION SIGN
+0xF8   0x00F8  #LATIN SMALL LETTER O WITH STROKE
+0xF9   0x00F9  #LATIN SMALL LETTER U WITH GRAVE
+0xFA   0x00FA  #LATIN SMALL LETTER U WITH ACUTE
+0xFB   0x00FB  #LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC   0x00FC  #LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x0131  #LATIN SMALL LETTER DOTLESS I
+0xFE   0x015F  #LATIN SMALL LETTER S WITH CEDILLA
+0xFF   0x00FF  #LATIN SMALL LETTER Y WITH DIAERESIS
diff --git a/basis/io/encodings/8-bit/CP1255.TXT b/basis/io/encodings/8-bit/CP1255.TXT
new file mode 100644 (file)
index 0000000..585f993
--- /dev/null
@@ -0,0 +1,274 @@
+#
+#    Name:     cp1255 to Unicode table
+#    Unicode version: 2.0
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          1/7/2000
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp1255 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp1255 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80   0x20AC  #EURO SIGN
+0x81           #UNDEFINED
+0x82   0x201A  #SINGLE LOW-9 QUOTATION MARK
+0x83   0x0192  #LATIN SMALL LETTER F WITH HOOK
+0x84   0x201E  #DOUBLE LOW-9 QUOTATION MARK
+0x85   0x2026  #HORIZONTAL ELLIPSIS
+0x86   0x2020  #DAGGER
+0x87   0x2021  #DOUBLE DAGGER
+0x88   0x02C6  #MODIFIER LETTER CIRCUMFLEX ACCENT
+0x89   0x2030  #PER MILLE SIGN
+0x8A           #UNDEFINED
+0x8B   0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+0x8C           #UNDEFINED
+0x8D           #UNDEFINED
+0x8E           #UNDEFINED
+0x8F           #UNDEFINED
+0x90           #UNDEFINED
+0x91   0x2018  #LEFT SINGLE QUOTATION MARK
+0x92   0x2019  #RIGHT SINGLE QUOTATION MARK
+0x93   0x201C  #LEFT DOUBLE QUOTATION MARK
+0x94   0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x95   0x2022  #BULLET
+0x96   0x2013  #EN DASH
+0x97   0x2014  #EM DASH
+0x98   0x02DC  #SMALL TILDE
+0x99   0x2122  #TRADE MARK SIGN
+0x9A           #UNDEFINED
+0x9B   0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+0x9C           #UNDEFINED
+0x9D           #UNDEFINED
+0x9E           #UNDEFINED
+0x9F           #UNDEFINED
+0xA0   0x00A0  #NO-BREAK SPACE
+0xA1   0x00A1  #INVERTED EXCLAMATION MARK
+0xA2   0x00A2  #CENT SIGN
+0xA3   0x00A3  #POUND SIGN
+0xA4   0x20AA  #NEW SHEQEL SIGN
+0xA5   0x00A5  #YEN SIGN
+0xA6   0x00A6  #BROKEN BAR
+0xA7   0x00A7  #SECTION SIGN
+0xA8   0x00A8  #DIAERESIS
+0xA9   0x00A9  #COPYRIGHT SIGN
+0xAA   0x00D7  #MULTIPLICATION SIGN
+0xAB   0x00AB  #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #NOT SIGN
+0xAD   0x00AD  #SOFT HYPHEN
+0xAE   0x00AE  #REGISTERED SIGN
+0xAF   0x00AF  #MACRON
+0xB0   0x00B0  #DEGREE SIGN
+0xB1   0x00B1  #PLUS-MINUS SIGN
+0xB2   0x00B2  #SUPERSCRIPT TWO
+0xB3   0x00B3  #SUPERSCRIPT THREE
+0xB4   0x00B4  #ACUTE ACCENT
+0xB5   0x00B5  #MICRO SIGN
+0xB6   0x00B6  #PILCROW SIGN
+0xB7   0x00B7  #MIDDLE DOT
+0xB8   0x00B8  #CEDILLA
+0xB9   0x00B9  #SUPERSCRIPT ONE
+0xBA   0x00F7  #DIVISION SIGN
+0xBB   0x00BB  #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x00BC  #VULGAR FRACTION ONE QUARTER
+0xBD   0x00BD  #VULGAR FRACTION ONE HALF
+0xBE   0x00BE  #VULGAR FRACTION THREE QUARTERS
+0xBF   0x00BF  #INVERTED QUESTION MARK
+0xC0   0x05B0  #HEBREW POINT SHEVA
+0xC1   0x05B1  #HEBREW POINT HATAF SEGOL
+0xC2   0x05B2  #HEBREW POINT HATAF PATAH
+0xC3   0x05B3  #HEBREW POINT HATAF QAMATS
+0xC4   0x05B4  #HEBREW POINT HIRIQ
+0xC5   0x05B5  #HEBREW POINT TSERE
+0xC6   0x05B6  #HEBREW POINT SEGOL
+0xC7   0x05B7  #HEBREW POINT PATAH
+0xC8   0x05B8  #HEBREW POINT QAMATS
+0xC9   0x05B9  #HEBREW POINT HOLAM
+0xCA           #UNDEFINED
+0xCB   0x05BB  #HEBREW POINT QUBUTS
+0xCC   0x05BC  #HEBREW POINT DAGESH OR MAPIQ
+0xCD   0x05BD  #HEBREW POINT METEG
+0xCE   0x05BE  #HEBREW PUNCTUATION MAQAF
+0xCF   0x05BF  #HEBREW POINT RAFE
+0xD0   0x05C0  #HEBREW PUNCTUATION PASEQ
+0xD1   0x05C1  #HEBREW POINT SHIN DOT
+0xD2   0x05C2  #HEBREW POINT SIN DOT
+0xD3   0x05C3  #HEBREW PUNCTUATION SOF PASUQ
+0xD4   0x05F0  #HEBREW LIGATURE YIDDISH DOUBLE VAV
+0xD5   0x05F1  #HEBREW LIGATURE YIDDISH VAV YOD
+0xD6   0x05F2  #HEBREW LIGATURE YIDDISH DOUBLE YOD
+0xD7   0x05F3  #HEBREW PUNCTUATION GERESH
+0xD8   0x05F4  #HEBREW PUNCTUATION GERSHAYIM
+0xD9           #UNDEFINED
+0xDA           #UNDEFINED
+0xDB           #UNDEFINED
+0xDC           #UNDEFINED
+0xDD           #UNDEFINED
+0xDE           #UNDEFINED
+0xDF           #UNDEFINED
+0xE0   0x05D0  #HEBREW LETTER ALEF
+0xE1   0x05D1  #HEBREW LETTER BET
+0xE2   0x05D2  #HEBREW LETTER GIMEL
+0xE3   0x05D3  #HEBREW LETTER DALET
+0xE4   0x05D4  #HEBREW LETTER HE
+0xE5   0x05D5  #HEBREW LETTER VAV
+0xE6   0x05D6  #HEBREW LETTER ZAYIN
+0xE7   0x05D7  #HEBREW LETTER HET
+0xE8   0x05D8  #HEBREW LETTER TET
+0xE9   0x05D9  #HEBREW LETTER YOD
+0xEA   0x05DA  #HEBREW LETTER FINAL KAF
+0xEB   0x05DB  #HEBREW LETTER KAF
+0xEC   0x05DC  #HEBREW LETTER LAMED
+0xED   0x05DD  #HEBREW LETTER FINAL MEM
+0xEE   0x05DE  #HEBREW LETTER MEM
+0xEF   0x05DF  #HEBREW LETTER FINAL NUN
+0xF0   0x05E0  #HEBREW LETTER NUN
+0xF1   0x05E1  #HEBREW LETTER SAMEKH
+0xF2   0x05E2  #HEBREW LETTER AYIN
+0xF3   0x05E3  #HEBREW LETTER FINAL PE
+0xF4   0x05E4  #HEBREW LETTER PE
+0xF5   0x05E5  #HEBREW LETTER FINAL TSADI
+0xF6   0x05E6  #HEBREW LETTER TSADI
+0xF7   0x05E7  #HEBREW LETTER QOF
+0xF8   0x05E8  #HEBREW LETTER RESH
+0xF9   0x05E9  #HEBREW LETTER SHIN
+0xFA   0x05EA  #HEBREW LETTER TAV
+0xFB           #UNDEFINED
+0xFC           #UNDEFINED
+0xFD   0x200E  #LEFT-TO-RIGHT MARK
+0xFE   0x200F  #RIGHT-TO-LEFT MARK
+0xFF           #UNDEFINED
diff --git a/basis/io/encodings/8-bit/CP1256.TXT b/basis/io/encodings/8-bit/CP1256.TXT
new file mode 100644 (file)
index 0000000..244dcce
--- /dev/null
@@ -0,0 +1,274 @@
+#
+#    Name:     cp1256 to Unicode table
+#    Unicode version: 2.1
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          01/5/99
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp1256 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp1256 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80   0x20AC  #EURO SIGN
+0x81   0x067E  #ARABIC LETTER PEH
+0x82   0x201A  #SINGLE LOW-9 QUOTATION MARK
+0x83   0x0192  #LATIN SMALL LETTER F WITH HOOK
+0x84   0x201E  #DOUBLE LOW-9 QUOTATION MARK
+0x85   0x2026  #HORIZONTAL ELLIPSIS
+0x86   0x2020  #DAGGER
+0x87   0x2021  #DOUBLE DAGGER
+0x88   0x02C6  #MODIFIER LETTER CIRCUMFLEX ACCENT
+0x89   0x2030  #PER MILLE SIGN
+0x8A   0x0679  #ARABIC LETTER TTEH
+0x8B   0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+0x8C   0x0152  #LATIN CAPITAL LIGATURE OE
+0x8D   0x0686  #ARABIC LETTER TCHEH
+0x8E   0x0698  #ARABIC LETTER JEH
+0x8F   0x0688  #ARABIC LETTER DDAL
+0x90   0x06AF  #ARABIC LETTER GAF
+0x91   0x2018  #LEFT SINGLE QUOTATION MARK
+0x92   0x2019  #RIGHT SINGLE QUOTATION MARK
+0x93   0x201C  #LEFT DOUBLE QUOTATION MARK
+0x94   0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x95   0x2022  #BULLET
+0x96   0x2013  #EN DASH
+0x97   0x2014  #EM DASH
+0x98   0x06A9  #ARABIC LETTER KEHEH
+0x99   0x2122  #TRADE MARK SIGN
+0x9A   0x0691  #ARABIC LETTER RREH
+0x9B   0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+0x9C   0x0153  #LATIN SMALL LIGATURE OE
+0x9D   0x200C  #ZERO WIDTH NON-JOINER
+0x9E   0x200D  #ZERO WIDTH JOINER
+0x9F   0x06BA  #ARABIC LETTER NOON GHUNNA
+0xA0   0x00A0  #NO-BREAK SPACE
+0xA1   0x060C  #ARABIC COMMA
+0xA2   0x00A2  #CENT SIGN
+0xA3   0x00A3  #POUND SIGN
+0xA4   0x00A4  #CURRENCY SIGN
+0xA5   0x00A5  #YEN SIGN
+0xA6   0x00A6  #BROKEN BAR
+0xA7   0x00A7  #SECTION SIGN
+0xA8   0x00A8  #DIAERESIS
+0xA9   0x00A9  #COPYRIGHT SIGN
+0xAA   0x06BE  #ARABIC LETTER HEH DOACHASHMEE
+0xAB   0x00AB  #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #NOT SIGN
+0xAD   0x00AD  #SOFT HYPHEN
+0xAE   0x00AE  #REGISTERED SIGN
+0xAF   0x00AF  #MACRON
+0xB0   0x00B0  #DEGREE SIGN
+0xB1   0x00B1  #PLUS-MINUS SIGN
+0xB2   0x00B2  #SUPERSCRIPT TWO
+0xB3   0x00B3  #SUPERSCRIPT THREE
+0xB4   0x00B4  #ACUTE ACCENT
+0xB5   0x00B5  #MICRO SIGN
+0xB6   0x00B6  #PILCROW SIGN
+0xB7   0x00B7  #MIDDLE DOT
+0xB8   0x00B8  #CEDILLA
+0xB9   0x00B9  #SUPERSCRIPT ONE
+0xBA   0x061B  #ARABIC SEMICOLON
+0xBB   0x00BB  #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x00BC  #VULGAR FRACTION ONE QUARTER
+0xBD   0x00BD  #VULGAR FRACTION ONE HALF
+0xBE   0x00BE  #VULGAR FRACTION THREE QUARTERS
+0xBF   0x061F  #ARABIC QUESTION MARK
+0xC0   0x06C1  #ARABIC LETTER HEH GOAL
+0xC1   0x0621  #ARABIC LETTER HAMZA
+0xC2   0x0622  #ARABIC LETTER ALEF WITH MADDA ABOVE
+0xC3   0x0623  #ARABIC LETTER ALEF WITH HAMZA ABOVE
+0xC4   0x0624  #ARABIC LETTER WAW WITH HAMZA ABOVE
+0xC5   0x0625  #ARABIC LETTER ALEF WITH HAMZA BELOW
+0xC6   0x0626  #ARABIC LETTER YEH WITH HAMZA ABOVE
+0xC7   0x0627  #ARABIC LETTER ALEF
+0xC8   0x0628  #ARABIC LETTER BEH
+0xC9   0x0629  #ARABIC LETTER TEH MARBUTA
+0xCA   0x062A  #ARABIC LETTER TEH
+0xCB   0x062B  #ARABIC LETTER THEH
+0xCC   0x062C  #ARABIC LETTER JEEM
+0xCD   0x062D  #ARABIC LETTER HAH
+0xCE   0x062E  #ARABIC LETTER KHAH
+0xCF   0x062F  #ARABIC LETTER DAL
+0xD0   0x0630  #ARABIC LETTER THAL
+0xD1   0x0631  #ARABIC LETTER REH
+0xD2   0x0632  #ARABIC LETTER ZAIN
+0xD3   0x0633  #ARABIC LETTER SEEN
+0xD4   0x0634  #ARABIC LETTER SHEEN
+0xD5   0x0635  #ARABIC LETTER SAD
+0xD6   0x0636  #ARABIC LETTER DAD
+0xD7   0x00D7  #MULTIPLICATION SIGN
+0xD8   0x0637  #ARABIC LETTER TAH
+0xD9   0x0638  #ARABIC LETTER ZAH
+0xDA   0x0639  #ARABIC LETTER AIN
+0xDB   0x063A  #ARABIC LETTER GHAIN
+0xDC   0x0640  #ARABIC TATWEEL
+0xDD   0x0641  #ARABIC LETTER FEH
+0xDE   0x0642  #ARABIC LETTER QAF
+0xDF   0x0643  #ARABIC LETTER KAF
+0xE0   0x00E0  #LATIN SMALL LETTER A WITH GRAVE
+0xE1   0x0644  #ARABIC LETTER LAM
+0xE2   0x00E2  #LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3   0x0645  #ARABIC LETTER MEEM
+0xE4   0x0646  #ARABIC LETTER NOON
+0xE5   0x0647  #ARABIC LETTER HEH
+0xE6   0x0648  #ARABIC LETTER WAW
+0xE7   0x00E7  #LATIN SMALL LETTER C WITH CEDILLA
+0xE8   0x00E8  #LATIN SMALL LETTER E WITH GRAVE
+0xE9   0x00E9  #LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x00EA  #LATIN SMALL LETTER E WITH CIRCUMFLEX
+0xEB   0x00EB  #LATIN SMALL LETTER E WITH DIAERESIS
+0xEC   0x0649  #ARABIC LETTER ALEF MAKSURA
+0xED   0x064A  #ARABIC LETTER YEH
+0xEE   0x00EE  #LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF   0x00EF  #LATIN SMALL LETTER I WITH DIAERESIS
+0xF0   0x064B  #ARABIC FATHATAN
+0xF1   0x064C  #ARABIC DAMMATAN
+0xF2   0x064D  #ARABIC KASRATAN
+0xF3   0x064E  #ARABIC FATHA
+0xF4   0x00F4  #LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5   0x064F  #ARABIC DAMMA
+0xF6   0x0650  #ARABIC KASRA
+0xF7   0x00F7  #DIVISION SIGN
+0xF8   0x0651  #ARABIC SHADDA
+0xF9   0x00F9  #LATIN SMALL LETTER U WITH GRAVE
+0xFA   0x0652  #ARABIC SUKUN
+0xFB   0x00FB  #LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC   0x00FC  #LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x200E  #LEFT-TO-RIGHT MARK
+0xFE   0x200F  #RIGHT-TO-LEFT MARK
+0xFF   0x06D2  #ARABIC LETTER YEH BARREE
diff --git a/basis/io/encodings/8-bit/CP1257.TXT b/basis/io/encodings/8-bit/CP1257.TXT
new file mode 100644 (file)
index 0000000..0dc475e
--- /dev/null
@@ -0,0 +1,274 @@
+#
+#    Name:     cp1257 to Unicode table
+#    Unicode version: 2.0
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          04/15/98
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp1257 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp1257 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80   0x20AC  #EURO SIGN
+0x81           #UNDEFINED
+0x82   0x201A  #SINGLE LOW-9 QUOTATION MARK
+0x83           #UNDEFINED
+0x84   0x201E  #DOUBLE LOW-9 QUOTATION MARK
+0x85   0x2026  #HORIZONTAL ELLIPSIS
+0x86   0x2020  #DAGGER
+0x87   0x2021  #DOUBLE DAGGER
+0x88           #UNDEFINED
+0x89   0x2030  #PER MILLE SIGN
+0x8A           #UNDEFINED
+0x8B   0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+0x8C           #UNDEFINED
+0x8D   0x00A8  #DIAERESIS
+0x8E   0x02C7  #CARON
+0x8F   0x00B8  #CEDILLA
+0x90           #UNDEFINED
+0x91   0x2018  #LEFT SINGLE QUOTATION MARK
+0x92   0x2019  #RIGHT SINGLE QUOTATION MARK
+0x93   0x201C  #LEFT DOUBLE QUOTATION MARK
+0x94   0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x95   0x2022  #BULLET
+0x96   0x2013  #EN DASH
+0x97   0x2014  #EM DASH
+0x98           #UNDEFINED
+0x99   0x2122  #TRADE MARK SIGN
+0x9A           #UNDEFINED
+0x9B   0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+0x9C           #UNDEFINED
+0x9D   0x00AF  #MACRON
+0x9E   0x02DB  #OGONEK
+0x9F           #UNDEFINED
+0xA0   0x00A0  #NO-BREAK SPACE
+0xA1           #UNDEFINED
+0xA2   0x00A2  #CENT SIGN
+0xA3   0x00A3  #POUND SIGN
+0xA4   0x00A4  #CURRENCY SIGN
+0xA5           #UNDEFINED
+0xA6   0x00A6  #BROKEN BAR
+0xA7   0x00A7  #SECTION SIGN
+0xA8   0x00D8  #LATIN CAPITAL LETTER O WITH STROKE
+0xA9   0x00A9  #COPYRIGHT SIGN
+0xAA   0x0156  #LATIN CAPITAL LETTER R WITH CEDILLA
+0xAB   0x00AB  #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #NOT SIGN
+0xAD   0x00AD  #SOFT HYPHEN
+0xAE   0x00AE  #REGISTERED SIGN
+0xAF   0x00C6  #LATIN CAPITAL LETTER AE
+0xB0   0x00B0  #DEGREE SIGN
+0xB1   0x00B1  #PLUS-MINUS SIGN
+0xB2   0x00B2  #SUPERSCRIPT TWO
+0xB3   0x00B3  #SUPERSCRIPT THREE
+0xB4   0x00B4  #ACUTE ACCENT
+0xB5   0x00B5  #MICRO SIGN
+0xB6   0x00B6  #PILCROW SIGN
+0xB7   0x00B7  #MIDDLE DOT
+0xB8   0x00F8  #LATIN SMALL LETTER O WITH STROKE
+0xB9   0x00B9  #SUPERSCRIPT ONE
+0xBA   0x0157  #LATIN SMALL LETTER R WITH CEDILLA
+0xBB   0x00BB  #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x00BC  #VULGAR FRACTION ONE QUARTER
+0xBD   0x00BD  #VULGAR FRACTION ONE HALF
+0xBE   0x00BE  #VULGAR FRACTION THREE QUARTERS
+0xBF   0x00E6  #LATIN SMALL LETTER AE
+0xC0   0x0104  #LATIN CAPITAL LETTER A WITH OGONEK
+0xC1   0x012E  #LATIN CAPITAL LETTER I WITH OGONEK
+0xC2   0x0100  #LATIN CAPITAL LETTER A WITH MACRON
+0xC3   0x0106  #LATIN CAPITAL LETTER C WITH ACUTE
+0xC4   0x00C4  #LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x00C5  #LATIN CAPITAL LETTER A WITH RING ABOVE
+0xC6   0x0118  #LATIN CAPITAL LETTER E WITH OGONEK
+0xC7   0x0112  #LATIN CAPITAL LETTER E WITH MACRON
+0xC8   0x010C  #LATIN CAPITAL LETTER C WITH CARON
+0xC9   0x00C9  #LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x0179  #LATIN CAPITAL LETTER Z WITH ACUTE
+0xCB   0x0116  #LATIN CAPITAL LETTER E WITH DOT ABOVE
+0xCC   0x0122  #LATIN CAPITAL LETTER G WITH CEDILLA
+0xCD   0x0136  #LATIN CAPITAL LETTER K WITH CEDILLA
+0xCE   0x012A  #LATIN CAPITAL LETTER I WITH MACRON
+0xCF   0x013B  #LATIN CAPITAL LETTER L WITH CEDILLA
+0xD0   0x0160  #LATIN CAPITAL LETTER S WITH CARON
+0xD1   0x0143  #LATIN CAPITAL LETTER N WITH ACUTE
+0xD2   0x0145  #LATIN CAPITAL LETTER N WITH CEDILLA
+0xD3   0x00D3  #LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x014C  #LATIN CAPITAL LETTER O WITH MACRON
+0xD5   0x00D5  #LATIN CAPITAL LETTER O WITH TILDE
+0xD6   0x00D6  #LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x00D7  #MULTIPLICATION SIGN
+0xD8   0x0172  #LATIN CAPITAL LETTER U WITH OGONEK
+0xD9   0x0141  #LATIN CAPITAL LETTER L WITH STROKE
+0xDA   0x015A  #LATIN CAPITAL LETTER S WITH ACUTE
+0xDB   0x016A  #LATIN CAPITAL LETTER U WITH MACRON
+0xDC   0x00DC  #LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x017B  #LATIN CAPITAL LETTER Z WITH DOT ABOVE
+0xDE   0x017D  #LATIN CAPITAL LETTER Z WITH CARON
+0xDF   0x00DF  #LATIN SMALL LETTER SHARP S
+0xE0   0x0105  #LATIN SMALL LETTER A WITH OGONEK
+0xE1   0x012F  #LATIN SMALL LETTER I WITH OGONEK
+0xE2   0x0101  #LATIN SMALL LETTER A WITH MACRON
+0xE3   0x0107  #LATIN SMALL LETTER C WITH ACUTE
+0xE4   0x00E4  #LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x00E5  #LATIN SMALL LETTER A WITH RING ABOVE
+0xE6   0x0119  #LATIN SMALL LETTER E WITH OGONEK
+0xE7   0x0113  #LATIN SMALL LETTER E WITH MACRON
+0xE8   0x010D  #LATIN SMALL LETTER C WITH CARON
+0xE9   0x00E9  #LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x017A  #LATIN SMALL LETTER Z WITH ACUTE
+0xEB   0x0117  #LATIN SMALL LETTER E WITH DOT ABOVE
+0xEC   0x0123  #LATIN SMALL LETTER G WITH CEDILLA
+0xED   0x0137  #LATIN SMALL LETTER K WITH CEDILLA
+0xEE   0x012B  #LATIN SMALL LETTER I WITH MACRON
+0xEF   0x013C  #LATIN SMALL LETTER L WITH CEDILLA
+0xF0   0x0161  #LATIN SMALL LETTER S WITH CARON
+0xF1   0x0144  #LATIN SMALL LETTER N WITH ACUTE
+0xF2   0x0146  #LATIN SMALL LETTER N WITH CEDILLA
+0xF3   0x00F3  #LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x014D  #LATIN SMALL LETTER O WITH MACRON
+0xF5   0x00F5  #LATIN SMALL LETTER O WITH TILDE
+0xF6   0x00F6  #LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x00F7  #DIVISION SIGN
+0xF8   0x0173  #LATIN SMALL LETTER U WITH OGONEK
+0xF9   0x0142  #LATIN SMALL LETTER L WITH STROKE
+0xFA   0x015B  #LATIN SMALL LETTER S WITH ACUTE
+0xFB   0x016B  #LATIN SMALL LETTER U WITH MACRON
+0xFC   0x00FC  #LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x017C  #LATIN SMALL LETTER Z WITH DOT ABOVE
+0xFE   0x017E  #LATIN SMALL LETTER Z WITH CARON
+0xFF   0x02D9  #DOT ABOVE
diff --git a/basis/io/encodings/8-bit/CP1258.TXT b/basis/io/encodings/8-bit/CP1258.TXT
new file mode 100644 (file)
index 0000000..f402b34
--- /dev/null
@@ -0,0 +1,274 @@
+#
+#    Name:     cp1258 to Unicode table
+#    Unicode version: 2.0
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          04/15/98
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp1258 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp1258 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80   0x20AC  #EURO SIGN
+0x81           #UNDEFINED
+0x82   0x201A  #SINGLE LOW-9 QUOTATION MARK
+0x83   0x0192  #LATIN SMALL LETTER F WITH HOOK
+0x84   0x201E  #DOUBLE LOW-9 QUOTATION MARK
+0x85   0x2026  #HORIZONTAL ELLIPSIS
+0x86   0x2020  #DAGGER
+0x87   0x2021  #DOUBLE DAGGER
+0x88   0x02C6  #MODIFIER LETTER CIRCUMFLEX ACCENT
+0x89   0x2030  #PER MILLE SIGN
+0x8A           #UNDEFINED
+0x8B   0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+0x8C   0x0152  #LATIN CAPITAL LIGATURE OE
+0x8D           #UNDEFINED
+0x8E           #UNDEFINED
+0x8F           #UNDEFINED
+0x90           #UNDEFINED
+0x91   0x2018  #LEFT SINGLE QUOTATION MARK
+0x92   0x2019  #RIGHT SINGLE QUOTATION MARK
+0x93   0x201C  #LEFT DOUBLE QUOTATION MARK
+0x94   0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x95   0x2022  #BULLET
+0x96   0x2013  #EN DASH
+0x97   0x2014  #EM DASH
+0x98   0x02DC  #SMALL TILDE
+0x99   0x2122  #TRADE MARK SIGN
+0x9A           #UNDEFINED
+0x9B   0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+0x9C   0x0153  #LATIN SMALL LIGATURE OE
+0x9D           #UNDEFINED
+0x9E           #UNDEFINED
+0x9F   0x0178  #LATIN CAPITAL LETTER Y WITH DIAERESIS
+0xA0   0x00A0  #NO-BREAK SPACE
+0xA1   0x00A1  #INVERTED EXCLAMATION MARK
+0xA2   0x00A2  #CENT SIGN
+0xA3   0x00A3  #POUND SIGN
+0xA4   0x00A4  #CURRENCY SIGN
+0xA5   0x00A5  #YEN SIGN
+0xA6   0x00A6  #BROKEN BAR
+0xA7   0x00A7  #SECTION SIGN
+0xA8   0x00A8  #DIAERESIS
+0xA9   0x00A9  #COPYRIGHT SIGN
+0xAA   0x00AA  #FEMININE ORDINAL INDICATOR
+0xAB   0x00AB  #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #NOT SIGN
+0xAD   0x00AD  #SOFT HYPHEN
+0xAE   0x00AE  #REGISTERED SIGN
+0xAF   0x00AF  #MACRON
+0xB0   0x00B0  #DEGREE SIGN
+0xB1   0x00B1  #PLUS-MINUS SIGN
+0xB2   0x00B2  #SUPERSCRIPT TWO
+0xB3   0x00B3  #SUPERSCRIPT THREE
+0xB4   0x00B4  #ACUTE ACCENT
+0xB5   0x00B5  #MICRO SIGN
+0xB6   0x00B6  #PILCROW SIGN
+0xB7   0x00B7  #MIDDLE DOT
+0xB8   0x00B8  #CEDILLA
+0xB9   0x00B9  #SUPERSCRIPT ONE
+0xBA   0x00BA  #MASCULINE ORDINAL INDICATOR
+0xBB   0x00BB  #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x00BC  #VULGAR FRACTION ONE QUARTER
+0xBD   0x00BD  #VULGAR FRACTION ONE HALF
+0xBE   0x00BE  #VULGAR FRACTION THREE QUARTERS
+0xBF   0x00BF  #INVERTED QUESTION MARK
+0xC0   0x00C0  #LATIN CAPITAL LETTER A WITH GRAVE
+0xC1   0x00C1  #LATIN CAPITAL LETTER A WITH ACUTE
+0xC2   0x00C2  #LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0xC3   0x0102  #LATIN CAPITAL LETTER A WITH BREVE
+0xC4   0x00C4  #LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x00C5  #LATIN CAPITAL LETTER A WITH RING ABOVE
+0xC6   0x00C6  #LATIN CAPITAL LETTER AE
+0xC7   0x00C7  #LATIN CAPITAL LETTER C WITH CEDILLA
+0xC8   0x00C8  #LATIN CAPITAL LETTER E WITH GRAVE
+0xC9   0x00C9  #LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x00CA  #LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+0xCB   0x00CB  #LATIN CAPITAL LETTER E WITH DIAERESIS
+0xCC   0x0300  #COMBINING GRAVE ACCENT
+0xCD   0x00CD  #LATIN CAPITAL LETTER I WITH ACUTE
+0xCE   0x00CE  #LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0xCF   0x00CF  #LATIN CAPITAL LETTER I WITH DIAERESIS
+0xD0   0x0110  #LATIN CAPITAL LETTER D WITH STROKE
+0xD1   0x00D1  #LATIN CAPITAL LETTER N WITH TILDE
+0xD2   0x0309  #COMBINING HOOK ABOVE
+0xD3   0x00D3  #LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x00D4  #LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xD5   0x01A0  #LATIN CAPITAL LETTER O WITH HORN
+0xD6   0x00D6  #LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x00D7  #MULTIPLICATION SIGN
+0xD8   0x00D8  #LATIN CAPITAL LETTER O WITH STROKE
+0xD9   0x00D9  #LATIN CAPITAL LETTER U WITH GRAVE
+0xDA   0x00DA  #LATIN CAPITAL LETTER U WITH ACUTE
+0xDB   0x00DB  #LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xDC   0x00DC  #LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x01AF  #LATIN CAPITAL LETTER U WITH HORN
+0xDE   0x0303  #COMBINING TILDE
+0xDF   0x00DF  #LATIN SMALL LETTER SHARP S
+0xE0   0x00E0  #LATIN SMALL LETTER A WITH GRAVE
+0xE1   0x00E1  #LATIN SMALL LETTER A WITH ACUTE
+0xE2   0x00E2  #LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3   0x0103  #LATIN SMALL LETTER A WITH BREVE
+0xE4   0x00E4  #LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x00E5  #LATIN SMALL LETTER A WITH RING ABOVE
+0xE6   0x00E6  #LATIN SMALL LETTER AE
+0xE7   0x00E7  #LATIN SMALL LETTER C WITH CEDILLA
+0xE8   0x00E8  #LATIN SMALL LETTER E WITH GRAVE
+0xE9   0x00E9  #LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x00EA  #LATIN SMALL LETTER E WITH CIRCUMFLEX
+0xEB   0x00EB  #LATIN SMALL LETTER E WITH DIAERESIS
+0xEC   0x0301  #COMBINING ACUTE ACCENT
+0xED   0x00ED  #LATIN SMALL LETTER I WITH ACUTE
+0xEE   0x00EE  #LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF   0x00EF  #LATIN SMALL LETTER I WITH DIAERESIS
+0xF0   0x0111  #LATIN SMALL LETTER D WITH STROKE
+0xF1   0x00F1  #LATIN SMALL LETTER N WITH TILDE
+0xF2   0x0323  #COMBINING DOT BELOW
+0xF3   0x00F3  #LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x00F4  #LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5   0x01A1  #LATIN SMALL LETTER O WITH HORN
+0xF6   0x00F6  #LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x00F7  #DIVISION SIGN
+0xF8   0x00F8  #LATIN SMALL LETTER O WITH STROKE
+0xF9   0x00F9  #LATIN SMALL LETTER U WITH GRAVE
+0xFA   0x00FA  #LATIN SMALL LETTER U WITH ACUTE
+0xFB   0x00FB  #LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC   0x00FC  #LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x01B0  #LATIN SMALL LETTER U WITH HORN
+0xFE   0x20AB  #DONG SIGN
+0xFF   0x00FF  #LATIN SMALL LETTER Y WITH DIAERESIS
diff --git a/basis/io/encodings/8-bit/arabic/arabic-docs.factor b/basis/io/encodings/8-bit/arabic/arabic-docs.factor
new file mode 100644 (file)
index 0000000..5c86326
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.arabic
+
+HELP: latin/arabic
+{ $var-description "This is the ISO-8859-6 encoding, also called Latin/Arabic. It is an 8-bit superset of ASCII and provides the characters necessary for Arabic, though not other languages which use Arabic script." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.arabic" "Arabic encoding"
+"The " { $vocab-link "io.encodings.8-bit.arabic" }  " vocabulary provides the " { $link latin/arabic } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.arabic"
diff --git a/basis/io/encodings/8-bit/arabic/arabic.factor b/basis/io/encodings/8-bit/arabic/arabic.factor
new file mode 100644 (file)
index 0000000..5a80921
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.arabic
+
+8-BIT: latin/arabic ISO_8859-6:1987 8859-6
diff --git a/basis/io/encodings/8-bit/arabic/authors.txt b/basis/io/encodings/8-bit/arabic/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/cyrillic/authors.txt b/basis/io/encodings/8-bit/cyrillic/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/cyrillic/cyrillic-docs.factor b/basis/io/encodings/8-bit/cyrillic/cyrillic-docs.factor
new file mode 100644 (file)
index 0000000..741f1de
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.cyrillic
+
+HELP: latin/cyrillic
+{ $var-description "This is the ISO-8859-5 encoding, also called Latin/Cyrillic. It is an 8-bit superset of ASCII and provides the characters necessary for most languages which use Cyrilic, including Russian, Macedonian, Belarusian, Bulgarian, Serbian, and Ukrainian. KOI8-R is used much more commonly." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.cyrillic" "Cyrillic encoding"
+"The " { $vocab-link "io.encodings.8-bit.cyrillic" } " vocabulary provides the " { $link latin/cyrillic } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.cyrillic"
diff --git a/basis/io/encodings/8-bit/cyrillic/cyrillic.factor b/basis/io/encodings/8-bit/cyrillic/cyrillic.factor
new file mode 100644 (file)
index 0000000..13cfbc0
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.cyrillic
+
+8-BIT: latin/cyrillic ISO_8859-5:1988 8859-5
diff --git a/basis/io/encodings/8-bit/ebcdic/authors.txt b/basis/io/encodings/8-bit/ebcdic/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/ebcdic/ebcdic-docs.factor b/basis/io/encodings/8-bit/ebcdic/ebcdic-docs.factor
new file mode 100644 (file)
index 0000000..09646fd
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.ebcdic
+
+HELP: ebcdic
+{ $var-description "EBCDIC is an 8-bit legacy encoding designed for IBM mainframes like System/360 in the 1960s. It has since fallen into disuse. It contains large unallocated regions, and the version included here (code page 37) contains auxiliary characters in this region for English- and Portugese-speaking countries." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.ebcdic" "EBCDIC encoding"
+"The " { $vocab-link "io.encodings.8-bit.ebcdic" } " vocabulary provides the " { $link ebcdic } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.ebcdic"
diff --git a/basis/io/encodings/8-bit/ebcdic/ebcdic.factor b/basis/io/encodings/8-bit/ebcdic/ebcdic.factor
new file mode 100644 (file)
index 0000000..fd8f29c
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.ebcdic
+
+8-BIT: ebcdic IBM037 CP037
diff --git a/basis/io/encodings/8-bit/greek/authors.txt b/basis/io/encodings/8-bit/greek/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/greek/greek-docs.factor b/basis/io/encodings/8-bit/greek/greek-docs.factor
new file mode 100644 (file)
index 0000000..b7d658a
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.greek
+
+HELP: latin/greek
+{ $description "This is the ISO-8859-7 encoding, also called Latin/Greek. It is an 8-bit superset of ASCII and provides the characters necessary for Greek written in modern monotonic orthography, or ancient Greek without accent marks." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.greek" "Greek encoding"
+"The " { $vocab-link "io.encodings.8-bit.greek" }  " vocabulary provides the " { $link latin/greek } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.greek"
diff --git a/basis/io/encodings/8-bit/greek/greek.factor b/basis/io/encodings/8-bit/greek/greek.factor
new file mode 100644 (file)
index 0000000..98eb09a
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.greek
+
+8-BIT: latin/greek ISO_8859-7:1987 8859-7
diff --git a/basis/io/encodings/8-bit/hebrew/authors.txt b/basis/io/encodings/8-bit/hebrew/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/hebrew/hebrew-docs.factor b/basis/io/encodings/8-bit/hebrew/hebrew-docs.factor
new file mode 100644 (file)
index 0000000..43433e2
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.hebrew
+
+HELP: latin/hebrew
+{ $var-description "This is the ISO-8859-8 encoding, also called Latin/Hebrew. It is an 8-bit superset of ASCII and provides the characters necessary for modern Hebrew without explicit vowels. Generally, this is interpreted in logical order, making it ISO-8859-8-I, technically." }
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.hebrew" "Hebrew encoding"
+"The " { $vocab-link "io.encodings.8-bit.hebrew" } " vocabulary provides the " { $link latin/hebrew } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.hebrew"
diff --git a/basis/io/encodings/8-bit/hebrew/hebrew.factor b/basis/io/encodings/8-bit/hebrew/hebrew.factor
new file mode 100644 (file)
index 0000000..6619f64
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.hebrew
+
+8-BIT: latin/hebrew ISO_8859-8:1988 8859-8
diff --git a/basis/io/encodings/8-bit/koi8-r/authors.txt b/basis/io/encodings/8-bit/koi8-r/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/koi8-r/koi8-r-docs.factor b/basis/io/encodings/8-bit/koi8-r/koi8-r-docs.factor
new file mode 100644 (file)
index 0000000..94e2652
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.koi8-r
+
+HELP: koi8-r
+{ $var-description "KOI8-R is an 8-bit superset of ASCII which encodes the Cyrillic alphabet, as used in Russian and Bulgarian. Characters are in such an order that, if the eight bit is stripped, text is still interpretable as ASCII. Block-building characters also exist." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.koi8-r" "KOI8-R encoding"
+"The " { $vocab-link "io.encodings.8-bit.koi8-r" } " vocabulary provides the " { $link koi8-r } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.koi8-r"
diff --git a/basis/io/encodings/8-bit/koi8-r/koi8-r.factor b/basis/io/encodings/8-bit/koi8-r/koi8-r.factor
new file mode 100644 (file)
index 0000000..6203fbd
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.koi8-r
+
+8-BIT: koi8-r KOI8-R KOI8-R
diff --git a/basis/io/encodings/8-bit/latin1/authors.txt b/basis/io/encodings/8-bit/latin1/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin1/latin1-docs.factor b/basis/io/encodings/8-bit/latin1/latin1-docs.factor
new file mode 100644 (file)
index 0000000..90bc012
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin1
+
+HELP: latin1
+{ $var-description "This is the ISO-8859-1 encoding, also called Latin-1: Western European. It is an 8-bit superset of ASCII which is the default for a mimetype starting with 'text' and provides the characters necessary for most western European languages." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin1" "Latin1 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin1" } " vocabulary provides the " { $link latin1 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin1"
diff --git a/basis/io/encodings/8-bit/latin1/latin1.factor b/basis/io/encodings/8-bit/latin1/latin1.factor
new file mode 100644 (file)
index 0000000..17a2941
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin1
+
+8-BIT: latin1 ISO_8859-1:1987 8859-1
diff --git a/basis/io/encodings/8-bit/latin10/authors.txt b/basis/io/encodings/8-bit/latin10/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin10/latin10-docs.factor b/basis/io/encodings/8-bit/latin10/latin10-docs.factor
new file mode 100644 (file)
index 0000000..382b083
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin10
+
+HELP: latin10
+{ $var-description "This is the ISO-8859-16 encoding, also called Latin-10: South-Eastern European. It is an 8-bit superset of ASCII." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin10" "Latin10 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin10" } " vocabulary provides the " { $link latin10 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin10"
diff --git a/basis/io/encodings/8-bit/latin10/latin10.factor b/basis/io/encodings/8-bit/latin10/latin10.factor
new file mode 100644 (file)
index 0000000..86831d4
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin10
+
+8-BIT: latin10 ISO-8859-16 8859-16
diff --git a/basis/io/encodings/8-bit/latin2/authors.txt b/basis/io/encodings/8-bit/latin2/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin2/latin2-docs.factor b/basis/io/encodings/8-bit/latin2/latin2-docs.factor
new file mode 100644 (file)
index 0000000..1da488f
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin2
+
+HELP: latin2
+{ $var-description "This is the ISO-8859-2 encoding, also called Latin-2: Eastern European. It is an 8-bit superset of ASCII and provides the characters necessary for most eastern European languages." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin2" "Latin2 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin2" }  " vocabulary provides the " { $link latin2 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin2"
diff --git a/basis/io/encodings/8-bit/latin2/latin2.factor b/basis/io/encodings/8-bit/latin2/latin2.factor
new file mode 100644 (file)
index 0000000..52ecc64
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin2
+
+8-BIT: latin2 ISO_8859-2:1987 8859-2
diff --git a/basis/io/encodings/8-bit/latin3/authors.txt b/basis/io/encodings/8-bit/latin3/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin3/latin3-docs.factor b/basis/io/encodings/8-bit/latin3/latin3-docs.factor
new file mode 100644 (file)
index 0000000..8cb719b
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin3
+
+HELP: latin3
+{ $var-description "This is the ISO-8859-3 encoding, also called Latin-3: South European. It is an 8-bit superset of ASCII and provides the characters necessary for Turkish, Maltese and Esperanto." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin3" "Latin3 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin3" }  " vocabulary provides the " { $link latin3 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin3"
diff --git a/basis/io/encodings/8-bit/latin3/latin3.factor b/basis/io/encodings/8-bit/latin3/latin3.factor
new file mode 100644 (file)
index 0000000..a9a6333
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin3
+
+8-BIT: latin3 ISO_8859-3:1988 8859-3
diff --git a/basis/io/encodings/8-bit/latin4/authors.txt b/basis/io/encodings/8-bit/latin4/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin4/latin4-docs.factor b/basis/io/encodings/8-bit/latin4/latin4-docs.factor
new file mode 100644 (file)
index 0000000..cfb53d2
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin4
+
+HELP: latin4
+{ $description "This is the ISO-8859-4 encoding, also called Latin-4: North European. It is an 8-bit superset of ASCII and provides the characters necessary for Latvian, Lithuanian, Estonian, Greenlandic and Sami." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin4" "Latin4 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin4" }  " vocabulary provides the " { $link latin4 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin4"
diff --git a/basis/io/encodings/8-bit/latin4/latin4.factor b/basis/io/encodings/8-bit/latin4/latin4.factor
new file mode 100644 (file)
index 0000000..34a68a8
--- /dev/null
@@ -0,0 +1,7 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin4
+
+8-BIT: latin4 ISO_8859-4:1988 8859-4
+
diff --git a/basis/io/encodings/8-bit/latin5/authors.txt b/basis/io/encodings/8-bit/latin5/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin5/latin5-docs.factor b/basis/io/encodings/8-bit/latin5/latin5-docs.factor
new file mode 100644 (file)
index 0000000..60feed1
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin5
+
+HELP: latin5
+{ $var-description "This is the ISO-8859-9 encoding, also called Latin-5: Turkish. It is an 8-bit superset of ASCII and provides the characters necessary for Turkish, similar to Latin-1 but replacing the spots used for Icelandic with characters used in Turkish." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin5" "Latin5 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin5" }  " vocabulary provides the " { $link latin5 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin5"
diff --git a/basis/io/encodings/8-bit/latin5/latin5.factor b/basis/io/encodings/8-bit/latin5/latin5.factor
new file mode 100644 (file)
index 0000000..502c10f
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin5
+
+8-BIT: latin5 ISO_8859-9:1989 8859-9
diff --git a/basis/io/encodings/8-bit/latin6/authors.txt b/basis/io/encodings/8-bit/latin6/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin6/latin6-docs.factor b/basis/io/encodings/8-bit/latin6/latin6-docs.factor
new file mode 100644 (file)
index 0000000..f1866c3
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin6
+
+HELP: latin6
+{ $var-description "This is the ISO-8859-10 encoding, also called Latin-6: Nordic. It is an 8-bit superset of ASCII containing the same characters as Latin-4, but rearranged to be of better use to nordic languages." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin6" "Latin6 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin6" }  " vocabulary provides the " { $link latin6 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin6"
diff --git a/basis/io/encodings/8-bit/latin6/latin6.factor b/basis/io/encodings/8-bit/latin6/latin6.factor
new file mode 100644 (file)
index 0000000..5e71f75
--- /dev/null
@@ -0,0 +1,7 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin6
+
+8-BIT: latin6 ISO-8859-10 8859-10
+
diff --git a/basis/io/encodings/8-bit/latin7/authors.txt b/basis/io/encodings/8-bit/latin7/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin7/latin7-docs.factor b/basis/io/encodings/8-bit/latin7/latin7-docs.factor
new file mode 100644 (file)
index 0000000..ebd5eb6
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin7
+
+HELP: latin7
+{ $var-description "This is the ISO-8859-13 encoding, also called Latin-7: Baltic Rim. It is an 8-bit superset of ASCII containing all characters necessary to represent Baltic Rim languages, as previous character sets were incomplete." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin7" "Latin7 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin7" }  " vocabulary provides the " { $link latin7 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin7"
diff --git a/basis/io/encodings/8-bit/latin7/latin7.factor b/basis/io/encodings/8-bit/latin7/latin7.factor
new file mode 100644 (file)
index 0000000..862daae
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin7
+
+8-BIT: latin7 ISO-8859-13 8859-13
diff --git a/basis/io/encodings/8-bit/latin8/authors.txt b/basis/io/encodings/8-bit/latin8/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin8/latin8-docs.factor b/basis/io/encodings/8-bit/latin8/latin8-docs.factor
new file mode 100644 (file)
index 0000000..5dc2f1e
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin8
+
+HELP: latin8
+{ $var-description "This is the ISO-8859-14 encoding, also called Latin-8: Celtic. It is an 8-bit superset of ASCII designed for Celtic languages like Gaelic and Breton." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin8" "Latin8 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin8" }  " vocabulary provides the " { $link latin8 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin8"
diff --git a/basis/io/encodings/8-bit/latin8/latin8.factor b/basis/io/encodings/8-bit/latin8/latin8.factor
new file mode 100644 (file)
index 0000000..e925737
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin8
+
+8-BIT: latin8 ISO-8859-14 8859-14
diff --git a/basis/io/encodings/8-bit/latin9/authors.txt b/basis/io/encodings/8-bit/latin9/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/latin9/latin9-docs.factor b/basis/io/encodings/8-bit/latin9/latin9-docs.factor
new file mode 100644 (file)
index 0000000..2416db3
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.latin9
+
+HELP: latin9
+{ $var-description "This is the ISO-8859-15 encoding, also called Latin-9 and unoffically as Latin-0. It is an 8-bit superset of ASCII designed as a modification of Latin-1, removing little-used characters in favor of the Euro symbol and other characters." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.latin9" "Latin9 encoding"
+"The " { $vocab-link "io.encodings.8-bit.latin9" }  " vocabulary provides the " { $link latin9 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.latin9"
diff --git a/basis/io/encodings/8-bit/latin9/latin9.factor b/basis/io/encodings/8-bit/latin9/latin9.factor
new file mode 100644 (file)
index 0000000..b55ecb3
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.latin9
+
+8-BIT: latin9 ISO-8859-15 8859-15
diff --git a/basis/io/encodings/8-bit/mac-roman/authors.txt b/basis/io/encodings/8-bit/mac-roman/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/mac-roman/mac-roman-docs.factor b/basis/io/encodings/8-bit/mac-roman/mac-roman-docs.factor
new file mode 100644 (file)
index 0000000..3fd00fa
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.mac-roman
+
+HELP: mac-roman
+{ $var-description "Mac Roman is an 8-bit superset of ASCII which was the standard encoding on Mac OS prior to version 10. It is incompatible with Latin-1 in all but a few places and ASCII, and it is suitable for encoding many Western European languages." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.mac-roman" "Mac Roman encoding"
+"The " { $vocab-link "io.encodings.8-bit.mac-roman" } " vocabulary provides the " { $link mac-roman } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.mac-roman"
diff --git a/basis/io/encodings/8-bit/mac-roman/mac-roman.factor b/basis/io/encodings/8-bit/mac-roman/mac-roman.factor
new file mode 100644 (file)
index 0000000..0b70765
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.mac-roman
+
+8-BIT: mac-roman macintosh ROMAN
diff --git a/basis/io/encodings/8-bit/thai/authors.txt b/basis/io/encodings/8-bit/thai/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/thai/thai-docs.factor b/basis/io/encodings/8-bit/thai/thai-docs.factor
new file mode 100644 (file)
index 0000000..5d2640b
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.thai
+
+HELP: latin/thai
+{ $var-description "This is the ISO-8859-11 encoding, also called Latin/Thai. It is an 8-bit superset of ASCII containing the characters necessary to represent Thai. It is basically identical to TIS-620." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.thai" "Thai encoding"
+"The " { $vocab-link "io.encodings.8-bit.thai" }  " vocabulary provides the " { $link latin/thai } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.thai"
diff --git a/basis/io/encodings/8-bit/thai/thai.factor b/basis/io/encodings/8-bit/thai/thai.factor
new file mode 100644 (file)
index 0000000..8d119f6
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.thai
+
+8-BIT: latin/thai TIS-620 8859-11
diff --git a/basis/io/encodings/8-bit/windows-1250/authors.txt b/basis/io/encodings/8-bit/windows-1250/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1250/windows-1250.factor b/basis/io/encodings/8-bit/windows-1250/windows-1250.factor
new file mode 100644 (file)
index 0000000..745ebe4
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1250
+
+8-BIT: windows-1250 windows-1250 CP1250
diff --git a/basis/io/encodings/8-bit/windows-1251/authors.txt b/basis/io/encodings/8-bit/windows-1251/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1251/windows-1251.factor b/basis/io/encodings/8-bit/windows-1251/windows-1251.factor
new file mode 100644 (file)
index 0000000..3c50d3c
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1251
+
+8-BIT: windows-1251 windows-1251 CP1251
diff --git a/basis/io/encodings/8-bit/windows-1252/authors.txt b/basis/io/encodings/8-bit/windows-1252/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1252/windows-1252-docs.factor b/basis/io/encodings/8-bit/windows-1252/windows-1252-docs.factor
new file mode 100644 (file)
index 0000000..cd9461e
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: io.encodings.8-bit.windows-1252
+
+HELP: windows-1252
+{ $var-description "Windows 1252 is an 8-bit superset of ASCII which is closely related to Latin-1. Control characters in the 0x80 to 0x9F range are replaced with printable characters such as the Euro symbol." } 
+{ $see-also "encodings-introduction" } ;
+
+ARTICLE: "io.encodings.8-bit.windows-1252" "Windows 1252 encoding"
+"The " { $vocab-link "io.encodings.8-bit.windows-1252" } " vocabulary provides the " { $link windows-1252 } " encoding." ;
+
+ABOUT: "io.encodings.8-bit.windows-1252"
diff --git a/basis/io/encodings/8-bit/windows-1252/windows-1252.factor b/basis/io/encodings/8-bit/windows-1252/windows-1252.factor
new file mode 100644 (file)
index 0000000..ddcc4df
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1252
+
+8-BIT: windows-1252 windows-1252 CP1252
diff --git a/basis/io/encodings/8-bit/windows-1253/authors.txt b/basis/io/encodings/8-bit/windows-1253/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1253/windows-1253.factor b/basis/io/encodings/8-bit/windows-1253/windows-1253.factor
new file mode 100644 (file)
index 0000000..ba335be
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1253
+
+8-BIT: windows-1253 windows-1253 CP1253
diff --git a/basis/io/encodings/8-bit/windows-1254/authors.txt b/basis/io/encodings/8-bit/windows-1254/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1254/windows-1254.factor b/basis/io/encodings/8-bit/windows-1254/windows-1254.factor
new file mode 100644 (file)
index 0000000..982d21a
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1254
+
+8-BIT: windows-1254 windows-1254 CP1254
diff --git a/basis/io/encodings/8-bit/windows-1255/authors.txt b/basis/io/encodings/8-bit/windows-1255/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1255/windows-1255.factor b/basis/io/encodings/8-bit/windows-1255/windows-1255.factor
new file mode 100644 (file)
index 0000000..952e5fe
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1255
+
+8-BIT: windows-1255 windows-1255 CP1255
diff --git a/basis/io/encodings/8-bit/windows-1256/authors.txt b/basis/io/encodings/8-bit/windows-1256/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1256/windows-1256.factor b/basis/io/encodings/8-bit/windows-1256/windows-1256.factor
new file mode 100644 (file)
index 0000000..303d25c
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1256
+
+8-BIT: windows-1256 windows-1256 CP1256
diff --git a/basis/io/encodings/8-bit/windows-1257/authors.txt b/basis/io/encodings/8-bit/windows-1257/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1257/windows-1257.factor b/basis/io/encodings/8-bit/windows-1257/windows-1257.factor
new file mode 100644 (file)
index 0000000..80b21e8
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1257
+
+8-BIT: windows-1257 windows-1257 CP1257
diff --git a/basis/io/encodings/8-bit/windows-1258/authors.txt b/basis/io/encodings/8-bit/windows-1258/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/io/encodings/8-bit/windows-1258/windows-1258.factor b/basis/io/encodings/8-bit/windows-1258/windows-1258.factor
new file mode 100644 (file)
index 0000000..1c7bf63
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.8-bit ;
+IN: io.encodings.8-bit.windows-1258
+
+8-BIT: windows-1258 windows-1258 CP1258
index 594e245a9c11328ac17ca1d22a97ca24890f8fad..a2a919da0db276e1eeb473b6420dc253ed0f3c36 100644 (file)
@@ -57,4 +57,4 @@ e>n-table [ initial-e>n ] initialize
 ascii "ANSI_X3.4-1968" register-encoding
 utf16be "UTF-16BE" register-encoding
 utf16le "UTF-16LE" register-encoding
-utf16 "UTF-16" register-encoding
\ No newline at end of file
+utf16 "UTF-16" register-encoding
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 6bd3f77..cc6218a
@@ -2,10 +2,11 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: byte-arrays math io.backend io.files.info
 io.files.windows io.files.windows.nt kernel windows.kernel32
-windows.time windows accessors alien.c-types combinators
-generalizations system alien.strings io.encodings.utf16n
-sequences splitting windows.errors fry continuations destructors
-calendar ascii combinators.short-circuit locals classes.struct
+windows.time windows.types windows accessors alien.c-types
+combinators generalizations system alien.strings
+io.encodings.utf16n sequences splitting windows.errors fry
+continuations destructors calendar ascii
+combinators.short-circuit locals classes.struct
 specialized-arrays alien.data ;
 SPECIALIZED-ARRAY: ushort
 IN: io.files.info.windows
@@ -20,7 +21,7 @@ IN: io.files.info.windows
 TUPLE: windows-file-info < file-info attributes ;
 
 : get-compressed-file-size ( path -- n )
-    "DWORD" <c-object> [ GetCompressedFileSize ] keep
+    DWORD <c-object> [ GetCompressedFileSize ] keep
     over INVALID_FILE_SIZE = [
         win32-error-string throw
     ] [
@@ -100,9 +101,9 @@ M: windows link-info ( path -- info )
 
 : volume-information ( normalized-path -- volume-name volume-serial max-component flags type )
     MAX_PATH 1 + [ <ushort-array> ] keep
-    "DWORD" <c-object>
-    "DWORD" <c-object>
-    "DWORD" <c-object>
+    DWORD <c-object>
+    DWORD <c-object>
+    DWORD <c-object>
     MAX_PATH 1 + [ <ushort-array> ] keep
     [ GetVolumeInformation win32-error=0/f ] 7 nkeep
     drop 5 nrot drop
@@ -110,9 +111,9 @@ M: windows link-info ( path -- info )
     utf16n alien>string ;
 
 : file-system-space ( normalized-path -- available-space total-space free-space )
-    "ULARGE_INTEGER" <c-object>
-    "ULARGE_INTEGER" <c-object>
-    "ULARGE_INTEGER" <c-object>
+    ULARGE_INTEGER <c-object>
+    ULARGE_INTEGER <c-object>
+    ULARGE_INTEGER <c-object>
     [ GetDiskFreeSpaceEx win32-error=0/f ] 3keep ;
 
 : calculate-file-system-info ( file-system-info -- file-system-info' )
@@ -160,7 +161,7 @@ M: winnt file-system-info ( path -- file-system-info )
     ret 0 = [
         ret win32-error-string throw
     ] [
-        names names-length *uint "ushort" heap-size * head
+        names names-length *uint ushort heap-size * head
         utf16n alien>string CHAR: \0 split
     ] if ;
 
@@ -177,7 +178,7 @@ M: winnt file-system-info ( path -- file-system-info )
     handle buf buf-length FindNextVolume :> ret
     ret 0 = [
         GetLastError ERROR_NO_MORE_FILES =
-        [ drop f ] [ win32-error-string throw ] if
+        [ f ] [ win32-error-string throw ] if
     ] [
         buf utf16n alien>string
     ] if ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index ca5c9b3..c4c848c
@@ -3,10 +3,10 @@
 USING: alien.c-types io.binary io.backend io.files
 io.files.types io.buffers io.encodings.utf16n io.ports
 io.backend.windows kernel math splitting fry alien.strings
-windows windows.kernel32 windows.time calendar combinators
-math.functions sequences namespaces make words system
-destructors accessors math.bitwise continuations windows.errors
-arrays byte-arrays generalizations alien.data ;
+windows windows.kernel32 windows.time windows.types calendar
+combinators math.functions sequences namespaces make words
+system destructors accessors math.bitwise continuations
+windows.errors arrays byte-arrays generalizations alien.data ;
 IN: io.files.windows
 
 : open-file ( path access-mode create-mode flags -- handle )
@@ -64,7 +64,7 @@ C: <FileArgs> FileArgs
         [ handle>> handle>> ]
         [ buffer>> ]
         [ buffer>> buffer-length ]
-        [ drop "DWORD" <c-object> ]
+        [ drop DWORD <c-object> ]
         [ FileArgs-overlapped ]
     } cleave <FileArgs> ;
 
old mode 100755 (executable)
new mode 100644 (file)
index 3432578..cb20f78
@@ -75,15 +75,13 @@ SYMBOL: wait-flag
 [
     H{ } clone processes set-global
     start-wait-thread
-] "io.launcher" add-init-hook
+] "io.launcher" add-startup-hook
 
 : process-started ( process handle -- )
     >>handle
     V{ } clone swap processes get set-at
     wait-flag get-global raise-flag ;
 
-M: process hashcode* handle>> hashcode* ;
-
 : pass-environment? ( process -- ? )
     dup environment>> assoc-empty? not
     swap environment-mode>> +replace-environment+ eq? or ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index cec03cf6d33364a19be7978d2f25f8efc61038bb..7fce8b4de22bcab96332a5205a7cc11922ab10cf 100644 (file)
@@ -35,7 +35,7 @@ IN: io.pipes.windows.nt
         "-" %
         32 random-bits #
         "-" %
-        micros #
+        nano-count #
     ] "" make ;
 
 M: winnt (pipe) ( -- pipe )
diff --git a/basis/io/servers/packet/authors.txt b/basis/io/servers/packet/authors.txt
deleted file mode 100755 (executable)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/io/servers/packet/packet.factor b/basis/io/servers/packet/packet.factor
deleted file mode 100644 (file)
index 2a346b4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-USING: concurrency.combinators destructors fry
-io.sockets kernel logging ;
-IN: io.servers.packet
-
-<PRIVATE
-
-LOG: received-datagram NOTICE
-
-: datagram-loop ( quot datagram -- )
-    [
-        [ receive dup received-datagram [ swap call ] dip ] keep
-        pick [ send ] [ 3drop ] if
-    ] 2keep datagram-loop ; inline
-
-: spawn-datagrams ( quot addrspec -- )
-    <datagram> [ datagram-loop ] with-disposal ; inline
-
-\ spawn-datagrams NOTICE add-input-logging
-
-PRIVATE>
-
-: with-datagrams ( seq service quot -- )
-    '[ [ [ _ ] dip spawn-datagrams ] parallel-each ] with-logging ; inline
diff --git a/basis/io/servers/packet/summary.txt b/basis/io/servers/packet/summary.txt
deleted file mode 100644 (file)
index 29247a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Multi-threaded UDP/IP servers
diff --git a/basis/io/servers/packet/tags.txt b/basis/io/servers/packet/tags.txt
deleted file mode 100644 (file)
index 992ae12..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network
index 12f907acb59c6b108158d92ee2ea54a2b9835bda..b3cf28a497909e1b22c91992d15e82157f3e10df 100644 (file)
@@ -5,7 +5,7 @@ math.order combinators init alien alien.c-types alien.data
 alien.strings libc continuations destructors summary splitting
 assocs random math.parser locals unicode.case openssl
 openssl.libcrypto openssl.libssl io.backend io.ports io.pathnames
-io.encodings.8-bit io.timeouts io.sockets.secure ;
+io.encodings.8-bit.latin1 io.timeouts io.sockets.secure ;
 IN: io.sockets.secure.openssl
 
 GENERIC: ssl-method ( symbol -- method )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 6bf62a0..cdf7e54
@@ -17,7 +17,7 @@ IN: io.sockets.unix
     0 socket dup io-error <fd> init-fd |dispose ;
 
 : set-socket-option ( fd level opt -- )
-    [ handle-fd ] 2dip 1 <int> "int" heap-size setsockopt io-error ;
+    [ handle-fd ] 2dip 1 <int> dup byte-length setsockopt io-error ;
 
 M: unix addrinfo-error ( n -- )
     [ gai_strerror throw ] unless-zero ;
@@ -117,7 +117,7 @@ SYMBOL: receive-buffer
 
 CONSTANT: packet-size 65536
 
-[ packet-size malloc receive-buffer set-global ] "io.sockets.unix" add-init-hook
+[ packet-size malloc &free receive-buffer set-global ] "io.sockets.unix" add-startup-hook
 
 :: do-receive ( port -- packet sockaddr )
     port addr>> empty-sockaddr/size :> ( sockaddr len )
old mode 100755 (executable)
new mode 100644 (file)
index 7cc21c9..0dd8595
@@ -3,7 +3,8 @@ continuations destructors io.ports io.timeouts io.sockets
 io.sockets.private io namespaces io.streams.duplex
 io.backend.windows io.sockets.windows io.backend.windows.nt
 windows.winsock kernel libc math sequences threads system
-combinators accessors classes.struct windows.kernel32 ;
+combinators accessors classes.struct windows.kernel32
+windows.types ;
 IN: io.sockets.windows.nt
 
 : malloc-int ( n -- alien )
@@ -16,10 +17,10 @@ M: winnt WSASocket-flags ( -- DWORD )
     SIO_GET_EXTENSION_FUNCTION_POINTER
     WSAID_CONNECTEX
     GUID heap-size
-    "void*" <c-object>
+    void* <c-object>
     [
-        "void*" heap-size
-        "DWORD" <c-object>
+        void* heap-size
+        DWORD <c-object>
         f
         f
         WSAIoctl SOCKET_ERROR = [
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 022d20eb5e9e1effb7b90aa4c20c68fb911b07ad..047cd117a02907da5c659f391a695d5bd8fcdea1 100644 (file)
@@ -1,8 +1,9 @@
 USING: accessors continuations destructors io io.encodings
-io.encodings.8-bit io.encodings.ascii io.encodings.binary
+io.encodings.ascii io.encodings.binary
 io.encodings.string io.encodings.utf8 io.files io.pipes
 io.streams.byte-array io.streams.limited io.streams.string
-kernel namespaces strings tools.test system ;
+kernel namespaces strings tools.test system
+io.encodings.8-bit.latin1 ;
 IN: io.streams.limited.tests
 
 [ ] [
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 88db135f447c24975117ee9a579dddb384bae4a1..994dcd9c501f81d07dfe571f8a4b0f6f29432936 100644 (file)
@@ -17,4 +17,4 @@ SYMBOL: io-thread-running?
 [\r
     t io-thread-running? set-global\r
     start-io-thread\r
-] "io.thread" add-init-hook\r
+] "io.thread" add-startup-hook\r
old mode 100755 (executable)
new mode 100644 (file)
index b3894d7b496dfe867554160baa3994c7a0f5cb31..ca339a78ef2c3ea8308464118187942a1d6f2b0b 100644 (file)
@@ -1,7 +1,7 @@
 USING: iokit alien alien.syntax alien.c-types kernel system
 core-foundation core-foundation.arrays core-foundation.data
 core-foundation.dictionaries core-foundation.run-loop
-core-foundation.strings core-foundation.time ;
+core-foundation.strings core-foundation.time unix.types ;
 IN: iokit.hid
 
 CONSTANT: kIOHIDDeviceKey "IOHIDDevice"
old mode 100755 (executable)
new mode 100644 (file)
index 529db6b..2b31e5c
@@ -1,6 +1,6 @@
 USING: alien.syntax alien.c-types core-foundation
 core-foundation.bundles core-foundation.dictionaries system
-combinators kernel sequences io accessors ;
+combinators kernel sequences io accessors unix.types ;
 IN: iokit
 
 <<
@@ -99,19 +99,6 @@ CONSTANT: kOSBuildVersionKey   "OS Build Version"
 
 CONSTANT: kNilOptions 0
 
-TYPEDEF: uint mach_port_t
-TYPEDEF: int kern_return_t
-TYPEDEF: int boolean_t
-TYPEDEF: mach_port_t io_object_t
-TYPEDEF: io_object_t io_iterator_t
-TYPEDEF: io_object_t io_registry_entry_t
-TYPEDEF: io_object_t io_service_t
-TYPEDEF: char[128] io_name_t
-TYPEDEF: char[512] io_string_t
-TYPEDEF: kern_return_t IOReturn
-
-TYPEDEF: uint IOOptionBits
-
 CONSTANT: MACH_PORT_NULL 0
 CONSTANT: KERN_SUCCESS 0
 
index 7fba57a4bbfb3421dfa998663449df73d29f1600..53fde946872390a1e3b7365477e89994247220f6 100644 (file)
@@ -44,7 +44,6 @@ ARTICLE: { "lists" "combinators" } "Combinators for lists"
     foldl
     foldr
     lmap>array
-    traverse
 } ;
 
 ARTICLE: { "lists" "manipulation" } "Manipulating lists"
@@ -151,12 +150,6 @@ HELP: list>array
 { $values { "list" list } { "array" array } }
 { $description "Convert a list into an array." } ;
 
-HELP: traverse    
-{ $values { "list"  list } { "pred" { $quotation "( list/elt -- ? )" } }
-          { "quot" { $quotation "( list/elt -- result)" } }  { "result" "a new cons object" } }
-{ $description "Recursively traverses the list object, replacing any elements (which can themselves be sublists) that pred" 
- " returns true for with the result of applying quot to." } ;
-
 HELP: list
 { $class-description "The class of lists. All lists are expected to conform to " { $link { "lists" "protocol" } } "." } ;
 
index ddf1ab91098e2e7abab454a4424775fbc4af404b..f3475f960b54077a42142167f7d01a0991e256d5 100644 (file)
@@ -93,11 +93,5 @@ PRIVATE>
 : list>array ( list -- array )  
     [ ] lmap>array ;
 
-:: traverse ( list pred quot: ( list/elt -- result ) -- result )
-    list [| elt |
-        elt dup pred call [ quot call ] when
-        dup list? [ pred quot traverse ] when
-    ] lmap ; inline recursive
-
 INSTANCE: cons list
 INSTANCE: +nil+ list
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index ff6a491a79d7e2d13e8df2687633fa71ac1dba71..a2a1a6c17820ea684203978cdba1e4544b9694fc 100644 (file)
@@ -1,18 +1,21 @@
 ! Copyright (C) 2007, 2008 Slava Pestov, Eduardo Cavazos.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors fry fry.private generalizations kernel
-locals.types make sequences ;
+locals.types sequences ;
 IN: locals.fry
 
 ! Support for mixing locals with fry
 
 M: let count-inputs body>> count-inputs ;
-
 M: lambda count-inputs body>> count-inputs ;
 
-M: lambda deep-fry
-    clone [ shallow-fry swap ] change-body
-    [ [ vars>> length ] keep '[ _ _ mnswap @ ] , ] [ drop [ncurry] % ] 2bi ;
+M: lambda fry
+    clone [ [ count-inputs ] [ fry ] bi ] change-body
+    [ [ vars>> length ] keep '[ _ _ mnswap _ call ] ]
+    [ drop [ncurry] curry [ call ] compose ] 2bi ;
+
+M: let fry
+    clone [ fry ] change-body ;
 
-M: let deep-fry
-    clone [ fry '[ @ call ] ] change-body , ;
+INSTANCE: lambda fried
+INSTANCE: let    fried
index 581ed5de33329912f4acbbf9710b790346cdc833..7aa8032cddeefbdaf7d0e5d2abd5716a79758d73 100644 (file)
@@ -389,7 +389,7 @@ M:: integer lambda-method-forget-test ( a -- b ) a ;
     eval( -- ) call
 ] [ error>> >r/r>-in-fry-error? ] must-fail-with
     
-:: (funny-macro-test) ( obj quot -- ? ) obj { quot } 1&& ; inline
+:: (funny-macro-test) ( obj quot -- ? ) obj { [ quot call ] } 1&& ; inline
 : funny-macro-test ( n -- ? ) [ odd? ] (funny-macro-test) ;
 
 \ funny-macro-test def>> must-infer
index e64693f2a364588820836f4a08215cfcf6cd2aec..1f9525e5ebbe42259eebc02c40036cc940a7d4e8 100644 (file)
@@ -14,4 +14,4 @@ M: let expand-macros* expand-macros literal ;
 
 M: lambda condomize? drop t ;
 
-M: lambda condomize '[ @ ] ;
+M: lambda condomize [ call ] curry ;
old mode 100755 (executable)
new mode 100644 (file)
index 848ad5d40e8d160b8001d780c4ff3e7b189b5e74..f5539b281325aeae295f86e3aa308bee4c254b12 100644 (file)
@@ -106,4 +106,4 @@ CONSTANT: keep-logs 10
 [\r
     H{ } clone log-files set-global\r
     log-server\r
-] "logging" add-init-hook\r
+] "logging" add-startup-hook\r
old mode 100755 (executable)
new mode 100644 (file)
index 0e5ef30f51cf4a13d77a0071cb63a49bff5b75f9..0186f6181f802b18337c04204617cf71b1e96d0f 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: parser kernel sequences words effects combinators assocs
-definitions quotations namespaces memoize accessors ;
+definitions quotations namespaces memoize accessors
+compiler.units ;
 IN: macros
 
 <PRIVATE
@@ -28,3 +29,5 @@ M: macro definition "macro" word-prop ;
 
 M: macro reset-word
     [ call-next-method ] [ f "macro" set-word-prop ] bi ;
+
+M: macro bump-effect-counter* drop t ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8fa41c5..0834002
@@ -117,7 +117,7 @@ M: blas-vector-base equal?
 
 M: blas-vector-base length
     length>> ;
-M: blas-vector-base virtual-seq
+M: blas-vector-base virtual-exemplar
     (blas-direct-array) ;
 M: blas-vector-base virtual@
     [ inc>> * ] [ nip (blas-direct-array) ] 2bi ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 5c154a6..4dc29ad
@@ -1,7 +1,7 @@
 ! Copyright (C) 2006, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel locals math math.vectors math.matrices
-namespaces sequences ;
+namespaces sequences fry sorting ;
 IN: math.matrices.elimination
 
 SYMBOL: matrix
@@ -52,11 +52,8 @@ SYMBOL: matrix
     [ first-col ] keep
     dup 1 + rows-from clear-col ;
 
-: find-row ( row# quot -- i elt )
-    [ rows-from ] dip find ; inline
-
 : pivot-row ( col# row# -- n )
-    [ dupd nth-row nth zero? not ] find-row 2nip ;
+    rows-from swap '[ [ _ ] dip nth-row nth abs ] sort-with last ;
 
 : (echelon) ( col# row# -- )
     over cols < over rows < and [
old mode 100755 (executable)
new mode 100644 (file)
index 44907df68e2942c8021b70097f4c6852e2b6177e..cdb67f976fc9dad1048e224824c4b0a76bf4201c 100644 (file)
@@ -147,6 +147,7 @@ TUPLE: simd class elt-class ops special-wrappers schema-wrappers ctor rep ;
         [ [ underlying>> ] 2dip rep set-alien-vector ] >>setter
         16 >>size
         16 >>align
+        16 >>align-first
         rep >>rep
     class c:typedef ;
 
@@ -316,6 +317,7 @@ SLOT: underlying2
         ] >>setter
         32 >>size
         16 >>align
+        16 >>align-first
         rep >>rep
     class c:typedef ;
 
index 396b8da22a5660bdf5ccbc0f68d9359be0e291c5..46cced3cb7a7188744c7533346ab198014f565ab 100644 (file)
@@ -88,8 +88,8 @@ CONSTANT: simd-classes
         {
             [ "print-mr" get [ nip test-mr mr. ] [ 2drop ] if ]
             [ "print-checks" get [ [ . ] bi@ ] [ 2drop ] if ]
-            [ [ call ] dip call ]
-            [ [ call ] dip compile-call ]
+            [ [ [ call ] dip call ] call( quot quot -- result ) ]
+            [ [ [ call ] dip compile-call ] call( quot quot -- result ) ]
         } 2cleave
         @ not
     ] filter ; inline
@@ -233,7 +233,7 @@ simd-classes&reps [
     ] [ ] map-as
     word '[ _ execute ] ;
 
-: check-boolean-ops ( class elt-class compare-quot -- )
+: check-boolean-ops ( class elt-class compare-quot -- seq )
     [
         [ boolean-ops [ dup word-schema ] { } map>assoc ] 2dip
         '[ first2 inputs _ _ check-boolean-op ]
@@ -357,13 +357,15 @@ simd-classes [
     new [ drop 16 random ] map ;
 
 :: test-shift-vector ( class -- ? )
-    class random-int-vector :> src
-    char-16 random-shift-vector :> perm
-    { class char-16 } :> decl
-
-    src perm vshuffle
-    src perm [ decl declare vshuffle ] compile-call
-    = ; inline
+    [
+        class random-int-vector :> src
+        char-16 random-shift-vector :> perm
+        { class char-16 } :> decl
+    
+        src perm vshuffle
+        src perm [ decl declare vshuffle ] compile-call
+        =
+    ] call( -- ? ) ;
 
 { char-16 uchar-16 short-8 ushort-8 int-4 uint-4 longlong-2 ulonglong-2 }
 [ 10 swap '[ [ t ] [ _ test-shift-vector ] unit-test ] times ] each
@@ -371,19 +373,23 @@ simd-classes [
 "== Checking vector tests" print
 
 :: test-vector-tests-bool ( vector declaration -- none? any? all? )
-    vector
-    [ [ declaration declare vnone? ] compile-call ]
-    [ [ declaration declare vany?  ] compile-call ]
-    [ [ declaration declare vall?  ] compile-call ] tri ; inline
+    [
+        vector
+        [ [ declaration declare vnone? ] compile-call ]
+        [ [ declaration declare vany?  ] compile-call ]
+        [ [ declaration declare vall?  ] compile-call ] tri
+    ] call( -- none? any? all? ) ;
 
 : yes ( -- x ) t ;
 : no ( -- x ) f ;
 
 :: test-vector-tests-branch ( vector declaration -- none? any? all? )
-    vector
-    [ [ declaration declare vnone? [ yes ] [ no ] if ] compile-call ]
-    [ [ declaration declare vany?  [ yes ] [ no ] if ] compile-call ]
-    [ [ declaration declare vall?  [ yes ] [ no ] if ] compile-call ] tri ; inline
+    [
+        vector
+        [ [ declaration declare vnone? [ yes ] [ no ] if ] compile-call ]
+        [ [ declaration declare vany?  [ yes ] [ no ] if ] compile-call ]
+        [ [ declaration declare vall?  [ yes ] [ no ] if ] compile-call ] tri
+    ] call( -- none? any? all? ) ;
 
 TUPLE: inconsistent-vector-test bool branch ;
 
@@ -391,12 +397,14 @@ TUPLE: inconsistent-vector-test bool branch ;
     2dup = [ drop ] [ inconsistent-vector-test boa ] if ;
 
 :: test-vector-tests ( vector decl -- none? any? all? )
-    vector decl test-vector-tests-bool :> ( bool-none bool-any bool-all )
-    vector decl test-vector-tests-branch :> ( branch-none branch-any branch-all )
-    
-    bool-none branch-none ?inconsistent
-    bool-any  branch-any  ?inconsistent
-    bool-all  branch-all  ?inconsistent ; inline
+    [
+        vector decl test-vector-tests-bool :> ( bool-none bool-any bool-all )
+        vector decl test-vector-tests-branch :> ( branch-none branch-any branch-all )
+        
+        bool-none branch-none ?inconsistent
+        bool-any  branch-any  ?inconsistent
+        bool-all  branch-all  ?inconsistent
+    ] call( -- none? any? all? ) ;
 
 [ f t t ]
 [ float-4{ t t t t } { float-4 } test-vector-tests ] unit-test
@@ -470,7 +478,7 @@ TUPLE: inconsistent-vector-test bool branch ;
 "== Checking broadcast" print
 : test-broadcast ( seq -- failures )
     [ length >array ] keep
-    '[ [ _ 1quotation ] dip '[ _ vbroadcast ] ] [ = ] check-optimizer ; inline
+    '[ [ _ 1quotation ] dip '[ _ vbroadcast ] ] [ = ] check-optimizer ;
 
 [ { } ] [ float-4{ 1.0 2.0 3.0 4.0 } test-broadcast ] unit-test
 [ { } ] [ int-4{ HEX: 7fffffff 3 4 -8 } test-broadcast ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/basis/models/illusion/authors.txt b/basis/models/illusion/authors.txt
deleted file mode 100644 (file)
index ce0899f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
\ No newline at end of file
diff --git a/basis/models/illusion/illusion.factor b/basis/models/illusion/illusion.factor
deleted file mode 100644 (file)
index 0016979..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-USING: accessors models models.arrow inverse kernel ;
-IN: models.illusion
-
-TUPLE: illusion < arrow ;
-
-: <illusion> ( model quot -- illusion )
-    illusion new V{ } clone >>connections V{ } clone >>dependencies 0 >>ref
-    swap >>quot over >>model [ add-dependency ] keep ;
-
-: <activated-illusion> ( model quot -- illusion ) <illusion> dup activate-model ;
-
-: backtalk ( value object -- )
-   [ quot>> [undo] call( a -- b ) ] [ model>> ] bi set-model ;
-
-M: illusion update-model ( model -- ) [ [ value>> ] keep backtalk ] with-locked-model ;
\ No newline at end of file
diff --git a/basis/models/illusion/summary.txt b/basis/models/illusion/summary.txt
deleted file mode 100644 (file)
index 8ea7cf1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Two Way Arrows
\ No newline at end of file
index 1c03bb224c0e5a57850efe78e558d6de3bcffde2..f9927cfd4cc181b1f549a59a904117c525498cff 100644 (file)
@@ -17,8 +17,6 @@ value connections dependencies ref locked? ;
 : <model> ( value -- model )
     model new-model ;
 
-M: model hashcode* drop model hashcode* ;
-
 : add-dependency ( dep model -- )
     dependencies>> push ;
 
old mode 100755 (executable)
new mode 100644 (file)
index 6292a683e3066d4e44d928cff397ceb2a27018c5..540fba40f0294d84173e03437001bab8702d8f4d 100644 (file)
@@ -19,7 +19,7 @@ SYMBOL: +gl-function-pointers+
 : reset-gl-function-pointers ( -- )
     100 <hashtable> +gl-function-pointers+ set-global ;
     
-[ reset-gl-function-pointers ] "opengl.gl" add-init-hook
+[ reset-gl-function-pointers ] "opengl.gl" add-startup-hook
 reset-gl-function-pointers
 reset-gl-function-number-counter
 
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/basis/opengl/opengl-tests.factor b/basis/opengl/opengl-tests.factor
new file mode 100644 (file)
index 0000000..818d0db
--- /dev/null
@@ -0,0 +1,6 @@
+USING: tools.test math opengl opengl.gl ;
+IN: opengl.tests
+
+{ 2 1 } [ { GL_TEXTURE_2D } [ + ] all-enabled ] must-infer-as
+
+{ 2 1 } [ { GL_TEXTURE_2D } [ + ] all-enabled-client-state ] must-infer-as
old mode 100755 (executable)
new mode 100644 (file)
index 513ed91..1f6205e
@@ -56,7 +56,9 @@ TUPLE: gl-error function code string ;
     [ ?execute ] map ;
 
 : (all-enabled) ( seq quot -- )
-    over [ glEnable ] each dip [ glDisable ] each ; inline
+    [ dup [ glEnable ] each ] dip
+    dip
+    [ glDisable ] each ; inline
 
 : (all-enabled-client-state) ( seq quot -- )
     [ dup [ glEnableClientState ] each ] dip
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8f14c60e14abf4bda8766efc662bd932d5d43654..76806f9523c0151a1d0500ff17abbc6dbcb5c314 100644 (file)
@@ -34,4 +34,4 @@ SYMBOL: ssl-initialized?
         t ssl-initialized? set-global
     ] unless ;
 
-[ f ssl-initialized? set-global ] "openssl" add-init-hook
+[ f ssl-initialized? set-global ] "openssl" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 6fd8d57893183c9855b8a62acfed36ea752d2046..d6baaffe2e77da6557751c3b40d320e5ff6819e1 100644 (file)
@@ -240,4 +240,4 @@ SYMBOL: cached-layouts
 : cached-line ( font string -- line )
     cached-layout layout>> first-line ;
 
-[ <cache-assoc> cached-layouts set-global ] "pango.cairo" add-init-hook
+[ <cache-assoc> cached-layouts set-global ] "pango.cairo" add-startup-hook
index 280ddd20d6257881971dc915d05200bbe3ff9d8d..31a51e3f128013f8f6bac3a2bb2eb57c493464ba 100644 (file)
@@ -111,4 +111,4 @@ MEMO: (cache-font-description) ( font -- description )
 : cache-font-description ( font -- description )
     strip-font-colors (cache-font-description) ;
 
-[ \ (cache-font-description) reset-memoized ] "pango.fonts" add-init-hook
+[ \ (cache-font-description) reset-memoized ] "pango.fonts" add-startup-hook
index 9bfd8ce49936f120ceb42694ac18cb4b67bd3b66..6895a2bd7bc37c055d0dbe78fe846f4cf76644b5 100644 (file)
@@ -435,9 +435,11 @@ ARTICLE: "peg.ebnf" "EBNF"
 "The " { $vocab-link "peg.ebnf" } " vocabulary provides a DSL that allows writing PEG parsers that look like "
 "EBNF syntax. It provides three parsing words described below. These words all "
 "accept the same EBNF syntax. The difference is in how they are used. "
-{ $subsection POSTPONE: <EBNF }
-{ $subsection POSTPONE: [EBNF }
-{ $subsection POSTPONE: EBNF: }
+{ $subsections
+    POSTPONE: <EBNF
+    POSTPONE: [EBNF
+    POSTPONE: EBNF:
+}
 "The EBNF syntax is composed of a series of rules of the form: "
 { $code 
   "rule1 = ..."
@@ -447,20 +449,20 @@ ARTICLE: "peg.ebnf" "EBNF"
 "and it is expected that the remaining rules are used by that rule. Rules may be "
 "left recursive. "
 "Each rule can contain the following: "
-{ $subsection "peg.ebnf.strings" }
-{ $subsection "peg.ebnf.any" }
-{ $subsection "peg.ebnf.sequence" }
-{ $subsection "peg.ebnf.choice" }
-{ $subsection "peg.ebnf.option" }
-{ $subsection "peg.ebnf.one-or-more" }
-{ $subsection "peg.ebnf.zero-or-more" }
-{ $subsection "peg.ebnf.and" }
-{ $subsection "peg.ebnf.not" }
-{ $subsection "peg.ebnf.character-class" }
-{ $subsection "peg.ebnf.foreign-rules" }
-{ $subsection "peg.ebnf.action" }
-{ $subsection "peg.ebnf.semantic-action" }
-{ $subsection "peg.ebnf.variable" }
+{ $subsections "peg.ebnf.strings"
+"peg.ebnf.any"
+"peg.ebnf.sequence"
+"peg.ebnf.choice"
+"peg.ebnf.option"
+"peg.ebnf.one-or-more"
+"peg.ebnf.zero-or-more"
+"peg.ebnf.and"
+"peg.ebnf.not"
+"peg.ebnf.character-class"
+"peg.ebnf.foreign-rules"
+"peg.ebnf.action"
+"peg.ebnf.semantic-action"
+"peg.ebnf.variable" }
 "Grammars defined in EBNF need to handle each character, or sequence of "
 "characters in the input. This can be tedious for dealing with whitespace in "
 "grammars that have 'tokens' separated by whitespace. You can define your "
@@ -468,7 +470,7 @@ ARTICLE: "peg.ebnf" "EBNF"
 "those tokens, allowing you to ignore the whitespace issue. The tokenizer "
 "can be changed at various parts in the grammar as needed. The JavaScript grammar "
 "does this to define the optional semicolon rule for example." 
-{ $subsection "peg.ebnf.tokenizers" }
+{ $subsections "peg.ebnf.tokenizers" }
 ;
 
-ABOUT: "peg.ebnf"
\ No newline at end of file
+ABOUT: "peg.ebnf"
index 0ba1d38ae62054b0f3522f1eab5030a5595daa8c..04617a6c672cfeed553a89cbcaede6f22bb91e0a 100644 (file)
@@ -116,8 +116,7 @@ M: pathname pprint*
 : check-recursion ( obj quot -- )
     nesting-limit? [
         drop
-        "~" over class name>> "~" 3append
-        swap present-text
+        [ class name>> "~" dup surround ] keep present-text 
     ] [
         over recursion-check get member-eq? [
             drop "~circularity~" swap present-text
@@ -175,7 +174,7 @@ M: tuple pprint*
 : pprint-elements ( seq -- )
     do-length-limit
     [ [ pprint* ] each ] dip
-    [ "~" swap number>string " more~" 3append text ] when* ;
+    [ number>string "~" " more~" surround text ] when* ;
 
 M: quotation pprint-delims drop \ [ \ ] ;
 M: curry pprint-delims drop \ [ \ ] ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e258cb9a96d48327369e8708662ca376cb4a1863..2a3239c72faa20d0c12e654b63a1162e46122220 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
 USING: tools.test quoted-printable io.encodings.string
-sequences io.encodings.8-bit splitting kernel ;
+sequences splitting kernel io.encodings.8-bit.latin2 ;
 IN: quoted-printable.tests
 
 [ """José was the
index a0e40e5c382847d5b44a976b693b7097819fc8a6..90489d30521940781ef2c29e98c5a86dd9779247 100644 (file)
@@ -79,5 +79,5 @@ M: mersenne-twister random-32* ( mt -- r )
 
 [
     default-mersenne-twister random-generator set-global
-] "bootstrap.random" add-init-hook
+] "bootstrap.random" add-startup-hook
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 599cd5e0ad6b3cbc03e1015e3eac9c324935ef5b..fd93d6492cc73336460f934ad9a9ca2202cf2823 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types io io.files kernel namespaces random
-io.encodings.binary init accessors system ;
+io.encodings.binary init accessors system destructors ;
 IN: random.unix
 
 TUPLE: unix-random reader ;
@@ -9,17 +9,19 @@ TUPLE: unix-random reader ;
 : <unix-random> ( path -- random )
     binary <file-reader> unix-random boa ;
 
+M: unix-random dispose reader>> dispose ;
+
 M: unix-random random-bytes* ( n tuple -- byte-array )
     reader>> stream-read ;
 
 os openbsd? [
     [
-        "/dev/srandom" <unix-random> secure-random-generator set-global
-        "/dev/arandom" <unix-random> system-random-generator set-global
-    ] "random.unix" add-init-hook
+        "/dev/srandom" <unix-random> &dispose secure-random-generator set-global
+        "/dev/arandom" <unix-random> &dispose system-random-generator set-global
+    ] "random.unix" add-startup-hook
 ] [
     [
-        "/dev/random" <unix-random> secure-random-generator set-global
-        "/dev/urandom" <unix-random> system-random-generator set-global
-    ] "random.unix" add-init-hook
+        "/dev/random" <unix-random> &dispose secure-random-generator set-global
+        "/dev/urandom" <unix-random> &dispose system-random-generator set-global
+    ] "random.unix" add-startup-hook
 ] if
index d959b191c9993170f017167e9f031332992b3c16..c1d3010c0f1e1ea7f605633d0db45fec7b0e4805 100644 (file)
@@ -1,7 +1,7 @@
 USING: accessors alien.c-types alien.data byte-arrays
 combinators.short-circuit continuations destructors init kernel
 locals namespaces random windows.advapi32 windows.errors
-windows.kernel32 math.bitwise ;
+windows.kernel32 windows.types math.bitwise ;
 IN: random.windows
 
 TUPLE: windows-rng provider type ;
@@ -16,7 +16,7 @@ M: windows-crypto-context dispose ( tuple -- )
 CONSTANT: factor-crypto-container "FactorCryptoContainer"
 
 :: (acquire-crypto-context) ( provider type flags -- handle ret )
-    "HCRYPTPROV" <c-object> :> handle
+    HCRYPTPROV <c-object> :> handle
     handle
     factor-crypto-container
     provider
@@ -65,5 +65,11 @@ M: windows-rng random-bytes* ( n tuple -- bytes )
     [ MS_STRONG_PROV PROV_RSA_FULL <windows-rng> ]
     [ drop MS_ENH_RSA_AES_PROV PROV_RSA_AES <windows-rng> ] recover
     secure-random-generator set-global
+] "random.windows" add-startup-hook
 
-] "random.windows" add-init-hook
+[
+    [
+        ! system-random-generator get-global &dispose drop
+        ! secure-random-generator get-global &dispose drop
+    ] with-destructors
+] "random.windows" add-shutdown-hook
old mode 100755 (executable)
new mode 100644 (file)
index a510514e2344cbcd5e6c6f37eb8eb7c204301c7a..c7ab7fafd9177081f2407468dc5ae2bf86184326 100644 (file)
@@ -29,7 +29,7 @@ USING: arrays kernel math roman roman.private sequences tools.test ;
 [ 3444 ] [ 3444 >roman roman> ] unit-test
 [ 3999 ] [ 3999 >roman roman> ] unit-test
 [ 0 >roman ] must-fail
-[ 4000 >roman ] must-fail
+[ 40000 >roman ] must-fail
 [ "vi" ] [ "iii" "iii"  roman+ ] unit-test
 [ "viii" ] [ "x" "ii"  roman- ] unit-test
 [ "ix" ] [ "iii" "iii"  roman* ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index da0d340126fd61e67638564048e5fc40258a9885..9b98cd1ed816e96a1e26494aa3df8d910beec535 100644 (file)
@@ -20,7 +20,7 @@ HELP: merged
 
 HELP: <merged> ( seqs -- merged )
 { $values { "seqs" "a sequence of sequences to merge" } { "merged" "a virtual sequence" } }
-{ $description "Creates an instance of the " { $link merged } " virtual sequence." }
+{ $description "Creates an instance of the " { $link merged } " virtual sequence. The length of the created virtual sequences is the minimum length of the input sequences times the number of input sequences." }
 { $see-also <2merged> <3merged> merge } ;
 
 HELP: <2merged> ( seq1 seq2 -- merged )
index 13a46f0b722009979fe4a386b05ab6abb97afb3e..cbd4176bef40bb649acb01e1cfbdfc09a70c4de4 100644 (file)
@@ -15,3 +15,6 @@ IN: sequences.merged.tests
 [ 6 ] [ 5 { 1 2 3 } { 4 5 6 } <2merged> nth ] unit-test
 
 [ 4 ] [ 4 { 1 2 } { 3 4 } { 5 6 } 3merge nth ] unit-test
+
+[ "" ] [ "abcdefg" "" 2merge ] unit-test
+[ "a1b2" ] [ "abc" "12" <2merged> "" like ] unit-test
index d64da6efe6ce6f5b1fd25ac982aff5e07dd4b2b3..c14ccf2f20e0e46274b6f9d6def6a3895595b70b 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2008 Alex Chapman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays kernel math sequences ;
+USING: accessors arrays kernel math math.order sequences
+sequences.private ;
 IN: sequences.merged
 
 TUPLE: merged seqs ;
@@ -10,19 +11,21 @@ C: <merged> merged
 : <3merged> ( seq1 seq2 seq3 -- merged ) 3array <merged> ;
 
 : merge ( seqs -- seq )
-    dup <merged> swap first like ;
+    [ <merged> ] keep first like ;
 
 : 2merge ( seq1 seq2 -- seq )
-    dupd <2merged> swap like ;
+    [ <2merged> ] 2keep drop like ;
 
 : 3merge ( seq1 seq2 seq3 -- seq )
-    pick [ <3merged> ] dip like ;
+    [ <3merged> ] 3keep 2drop like ;
 
-M: merged length seqs>> [ length ] map sum ;
+M: merged length
+    seqs>> [ [ length ] [ min ] map-reduce ] [ length ] bi * ; inline
 
 M: merged virtual@ ( n seq -- n' seq' )
-    seqs>> [ length /mod ] [ nth ] bi ;
+    seqs>> [ length /mod ] [ nth-unsafe ] bi ; inline
 
-M: merged virtual-seq ( merged -- seq ) [ ] { } map-as ;
+M: merged virtual-exemplar ( merged -- seq )
+    seqs>> [ f ] [ first ] if-empty ; inline
 
 INSTANCE: merged virtual-sequence
index f788a6da6a5c8a7ec24cf0788a0ecf66f3c8f12b..0c4f1390bbac2dd4471dac1e65e9cfd44607fef7 100644 (file)
@@ -1,4 +1,4 @@
-USING: tools.test sequence-parser unicode.categories kernel
+USING: tools.test sequences.parser unicode.categories kernel
 accessors ;
 IN: sequences.parser.tests
 
index 4de858e811182d63593e8e2b32bf0deb951d8cdd..9b4b0ac46b9651be7bd68fafe8668728d35c66bf 100644 (file)
@@ -26,7 +26,7 @@ TUPLE: id obj ;
 
 C: <id> id
 
-M: id hashcode* obj>> hashcode* ;
+M: id hashcode* nip obj>> identity-hashcode ;
 
 M: id equal? over id? [ [ obj>> ] bi@ eq? ] [ 2drop f ] if ;
 
index 83457defa5350f066c0a1ecd2d936beff0fd6497..61ccd5c435c1d7401578927f2cdcd4ed1397d729 100644 (file)
@@ -187,7 +187,7 @@ ERROR: invalid-header-string string ;
         "<" %
         64 random-bits #
         "-" %
-        micros #
+        system-micros #
         "@" %
         smtp-domain get [ host-name ] unless* %
         ">" %
old mode 100755 (executable)
new mode 100644 (file)
index bc293b1..ef2654b
@@ -20,7 +20,7 @@ SPECIALIZED-ARRAYS: bool ushort char uint float ulonglong ;
 
 [ t ] [
     { t f t } >bool-array underlying>>
-    { 1 0 1 } "bool" heap-size {
+    { 1 0 1 } bool heap-size {
         { 1 [ >char-array ] }
         { 4 [ >uint-array ] }
     } case underlying>> =
@@ -153,3 +153,22 @@ SPECIALIZED-ARRAY: __does_not_exist__
         __does_not_exist__ specialized-array-vocab forget-vocab
     ] with-compilation-unit
 ] unit-test
+
+STRUCT: struct-resize-test { x int } ;
+
+SPECIALIZED-ARRAY: struct-resize-test
+
+[ 40 ] [ 10 <struct-resize-test-array> byte-length ] unit-test
+
+: struct-resize-test-usage ( seq -- seq )
+    [ struct-resize-test <struct> swap >>x ] map
+    >struct-resize-test-array
+    [ x>> ] { } map-as ;
+    
+[ { 10 20 30 } ] [ { 10 20 30 } struct-resize-test-usage ] unit-test
+
+[ ] [ "IN: specialized-arrays.tests USE: classes.struct USE: alien.c-types STRUCT: struct-resize-test { x int } { y int } ;" eval( -- ) ] unit-test
+
+[ 80 ] [ 10 <struct-resize-test-array> byte-length ] unit-test
+
+[ { 10 20 30 } ] [ { 10 20 30 } struct-resize-test-usage ] unit-test
index 2a20ba74cd79b0ced07da1cb47eee363cd2bc556..f9ab1ae96cb5017bbbad6e92505bf5be4afe5772 100644 (file)
@@ -69,6 +69,6 @@ TUPLE: alien-callback-params < alien-node-params quot xt ;
     pop-literal nip >>abi
     pop-literal nip >>parameters
     pop-literal nip >>return
-    "( callback )" f <word> >>xt
+    "( callback )" <uninterned-word> >>xt
     dup callback-bottom
     #alien-callback, ;
index 48cd10a7ee82243fd140efe8e35dc5efcbbcca30..b58998cb4904208e69b843995f3db6e6c4da02d1 100644 (file)
@@ -1,17 +1,21 @@
 USING: stack-checker.backend tools.test kernel namespaces
-stack-checker.state sequences ;
+stack-checker.state stack-checker.values sequences assocs ;
 IN: stack-checker.backend.tests
 
 [ ] [
     V{ } clone \ meta-d set
     V{ } clone \ meta-r set
     V{ } clone \ literals set
-    0 d-in set
+    H{ } clone known-values set
+    0 input-count set
 ] unit-test
 
 [ 0 ] [ 0 ensure-d length ] unit-test
 
 [ 2 ] [ 2 ensure-d length ] unit-test
+
+[ t ] [ meta-d [ known-values get at input-parameter? ] all? ] unit-test
+
 [ 2 ] [ meta-d length ] unit-test
 
 [ 3 ] [ 3 ensure-d length ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
index 5411c88..b2a99f0
@@ -5,15 +5,19 @@ parser sequences strings vectors words quotations effects classes
 continuations assocs combinators compiler.errors accessors math.order
 definitions sets hints macros stack-checker.state
 stack-checker.visitor stack-checker.errors stack-checker.values
-stack-checker.recursive-state summary ;
+stack-checker.recursive-state stack-checker.dependencies summary ;
 IN: stack-checker.backend
 
 : push-d ( obj -- ) meta-d push ;
 
+: introduce-values ( values -- )
+    [ [ [ input-parameter ] dip set-known ] each ]
+    [ length input-count +@ ]
+    [ #introduce, ]
+    tri ;
+
 : pop-d  ( -- obj )
-    meta-d [
-        <value> dup 1array #introduce, d-in inc
-    ] [ pop ] if-empty ;
+    meta-d [ <value> dup 1array introduce-values ] [ pop ] if-empty ;
 
 : peek-d ( -- obj ) pop-d dup push-d ;
 
@@ -24,7 +28,7 @@ IN: stack-checker.backend
     meta-d 2dup length > [
         2dup
         [ nip >array ] [ length - make-values ] [ nip delete-all ] 2tri
-        [ length d-in +@ ] [ #introduce, ] [ meta-d push-all ] tri
+        [ introduce-values ] [ meta-d push-all ] bi
         meta-d push-all
     ] when swap tail* ;
 
old mode 100755 (executable)
new mode 100644 (file)
index 8b0665a..99e5a70
@@ -11,7 +11,7 @@ IN: stack-checker.branches
 
 SYMBOLS: +bottom+ +top+ ;
 
-: unify-inputs ( max-d-in d-in meta-d -- new-meta-d )
+: unify-inputs ( max-input-count input-count meta-d -- new-meta-d )
     ! Introduced values can be anything, and don't unify with
     ! literals.
     dup [ [ - +top+ <repetition> ] dip append ] [ 3drop f ] if ;
@@ -24,7 +24,7 @@ SYMBOLS: +bottom+ +top+ ;
         '[ _ +bottom+ pad-head ] map
     ] unless ;
 
-: phi-inputs ( max-d-in pairs -- newseq )
+: phi-inputs ( max-input-count pairs -- newseq )
     dup empty? [ nip ] [
         swap '[ [ _ ] dip first2 unify-inputs ] map
         pad-with-bottom
@@ -61,9 +61,9 @@ SYMBOL: quotations
     branch-variable ;
 
 : datastack-phi ( seq -- phi-in phi-out )
-    [ d-in branch-variable ] [ \ meta-d active-variable ] bi
+    [ input-count branch-variable ] [ \ meta-d active-variable ] bi
     unify-branches
-    [ d-in set ] [ ] [ dup >vector \ meta-d set ] tri* ;
+    [ input-count set ] [ ] [ dup >vector \ meta-d set ] tri* ;
 
 : terminated-phi ( seq -- terminated )
     terminated? branch-variable ;
@@ -80,7 +80,7 @@ SYMBOL: quotations
 : copy-inference ( -- )
     \ meta-d [ clone ] change
     literals [ clone ] change
-    d-in [ ] change ;
+    input-count [ ] change ;
 
 GENERIC: infer-branch ( literal -- namespace )
 
diff --git a/basis/stack-checker/dependencies/authors.txt b/basis/stack-checker/dependencies/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/stack-checker/dependencies/dependencies-tests.factor b/basis/stack-checker/dependencies/dependencies-tests.factor
new file mode 100644 (file)
index 0000000..9bcec64
--- /dev/null
@@ -0,0 +1,37 @@
+IN: stack-checker.dependencies.tests
+USING: tools.test stack-checker.dependencies words kernel namespaces
+definitions ;
+
+: computing-dependencies ( quot -- dependencies )
+    H{ } clone [ dependencies rot with-variable ] keep ;
+    inline
+
+SYMBOL: a
+SYMBOL: b
+
+[ ] [ a called-dependency depends-on ] unit-test
+
+[ H{ { a called-dependency } } ] [
+    [ a called-dependency depends-on ] computing-dependencies
+] unit-test
+
+[ H{ { a called-dependency } { b inlined-dependency } } ] [
+    [
+        a called-dependency depends-on b inlined-dependency depends-on
+    ] computing-dependencies
+] unit-test
+
+[ H{ { a inlined-dependency } { b inlined-dependency } } ] [
+    [
+        a inlined-dependency depends-on
+        a called-dependency depends-on
+        b inlined-dependency depends-on
+    ] computing-dependencies
+] unit-test
+
+[ flushed-dependency ] [ f flushed-dependency strongest-dependency ] unit-test
+[ flushed-dependency ] [ flushed-dependency f strongest-dependency ] unit-test
+[ inlined-dependency ] [ flushed-dependency inlined-dependency strongest-dependency ] unit-test
+[ inlined-dependency ] [ called-dependency inlined-dependency strongest-dependency ] unit-test
+[ flushed-dependency ] [ called-dependency flushed-dependency strongest-dependency ] unit-test
+[ called-dependency ] [ called-dependency f strongest-dependency ] unit-test
diff --git a/basis/stack-checker/dependencies/dependencies.factor b/basis/stack-checker/dependencies/dependencies.factor
new file mode 100644 (file)
index 0000000..f0c77b8
--- /dev/null
@@ -0,0 +1,37 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: assocs classes.algebra fry kernel math namespaces
+sequences words ;
+IN: stack-checker.dependencies
+
+! Words that the current quotation depends on
+SYMBOL: dependencies
+
+SYMBOLS: inlined-dependency flushed-dependency called-dependency ;
+
+: index>= ( obj1 obj2 seq -- ? )
+    [ index ] curry bi@ >= ;
+
+: dependency>= ( how1 how2 -- ? )
+    { called-dependency flushed-dependency inlined-dependency }
+    index>= ;
+
+: strongest-dependency ( how1 how2 -- how )
+    [ called-dependency or ] bi@ [ dependency>= ] most ;
+
+: depends-on ( word how -- )
+    over primitive? [ 2drop ] [
+        dependencies get dup [
+            swap '[ _ strongest-dependency ] change-at
+        ] [ 3drop ] if
+    ] if ;
+
+! Generic words that the current quotation depends on
+SYMBOL: generic-dependencies
+
+: ?class-or ( class/f class -- class' )
+    swap [ class-or ] when* ;
+
+: depends-on-generic ( generic class -- )
+    generic-dependencies get dup
+    [ swap '[ _ ?class-or ] change-at ] [ 3drop ] if ;
old mode 100755 (executable)
new mode 100644 (file)
index 5da5197..4b432e7
@@ -12,10 +12,10 @@ HELP: do-not-compile
     }
 } ;
 
-HELP: literal-expected
-{ $error-description "Thrown when inference encounters a combinator or macro being applied to a value which is not known to be a literal, or constructed in a manner which can be analyzed statically. Such code needs changes before it can compile and run. See " { $link "inference-combinators" } " and " { $link "inference-escape" } " for details." }
+HELP: unknown-macro-input
+{ $error-description "Thrown when inference encounters a combinator or macro being applied to an input parameter of a non-" { $link POSTPONE: inline } " word. The word needs to be declared " { $link POSTPONE: inline } " before its callers can compile and run. See " { $link "inference-combinators" } " and " { $link "inference-escape" } " for details." }
 { $examples
-    "In this example, the words being defined cannot be called, because they fail to compile with a " { $link literal-expected } " error:"
+    "In this example, the words being defined cannot be called, because they fail to compile with a " { $link unknown-macro-input } " error:"
     { $code
         ": bad-example ( quot -- )"
         "    [ call ] [ call ] bi ;"
@@ -41,6 +41,27 @@ HELP: literal-expected
     }
 } ;
 
+HELP: bad-macro-input
+{ $error-description "Thrown when inference encounters a combinator or macro being applied to a value which is not known at compile time. Such code needs changes before it can compile and run. See " { $link "inference-combinators" } " and " { $link "inference-escape" } " for details." }
+{ $examples
+    "In this example, the words being defined cannot be called, because they fail to compile with a " { $link bad-macro-input } " error:"
+    { $code
+        ": bad-example ( quot -- )"
+        "    [ . ] append call ; inline"
+        ""
+        ": usage ( -- )"
+        "    2 2 [ + ] bad-example ;"
+    }
+    "One fix is to use " { $link compose } " instead of " { $link append } ":"
+    { $code
+        ": good-example ( quot -- )"
+        "    [ . ] compose call ; inline"
+        ""
+        ": usage ( -- )"
+        "    2 2 [ + ] good-example ;"
+    }
+} ;
+
 HELP: unbalanced-branches-error
 { $values { "in" "a sequence of integers" } { "out" "a sequence of integers" } }
 { $description "Throws an " { $link unbalanced-branches-error } "." }
@@ -121,7 +142,8 @@ ARTICLE: "inference-errors" "Stack checker errors"
 "Errors thrown when insufficient information is available to calculate the stack effect of a call to a combinator or macro (see " { $link "inference-combinators" } "):"
 { $subsections
     do-not-compile
-    literal-expected
+    unknown-macro-input
+    bad-macro-input
 }
 "Error thrown when a word's stack effect declaration does not match the composition of the stack effects of its factors:"
 { $subsections effect-error }
index b1071df7080d16ab8cc4d45d65c6731ff8635257..d476de84c50b3c073ea8805c992681815e108023 100644 (file)
@@ -1,13 +1,14 @@
 ! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel stack-checker.values ;
 IN: stack-checker.errors
 
 TUPLE: inference-error ;
 
 ERROR: do-not-compile < inference-error word ;
 
-ERROR: literal-expected < inference-error what ;
+ERROR: bad-macro-input < inference-error macro ;
+
+ERROR: unknown-macro-input < inference-error macro ;
 
 ERROR: unbalanced-branches-error < inference-error branches quots ;
 
@@ -31,8 +32,6 @@ ERROR: inconsistent-recursive-call-error < inference-error word ;
 
 ERROR: unknown-primitive-error < inference-error ;
 
-ERROR: transform-expansion-error < inference-error word error ;
-
-ERROR: bad-declaration-error < inference-error declaration ;
+ERROR: transform-expansion-error < inference-error error continuation word ;
 
-M: object (literal) "literal value" literal-expected ;
\ No newline at end of file
+ERROR: bad-declaration-error < inference-error declaration ;
\ No newline at end of file
index 5be5722c23f675815c25aee32932513fbbce4ebc..d008c4921d6519d9c092fa0cce8c404b1558995f 100644 (file)
@@ -4,10 +4,11 @@ USING: accessors kernel prettyprint io debugger
 sequences assocs stack-checker.errors summary effects ;
 IN: stack-checker.errors.prettyprint
 
-M: literal-expected summary
-    what>> "Got a computed value where a " " was expected" surround ;
+M: unknown-macro-input summary
+    macro>> name>> "Cannot apply “" "” to an input parameter of a non-inline word" surround ;
 
-M: literal-expected error. summary print ;
+M: bad-macro-input summary
+    macro>> name>> "Cannot apply “" "” to a run-time computed value" surround ;
 
 M: unbalanced-branches-error summary
     drop "Unbalanced branches" ;
@@ -50,13 +51,16 @@ M: inconsistent-recursive-call-error summary
     " calls itself with a different set of quotation parameters than were input" surround ;
 
 M: unknown-primitive-error summary
-    word>> name>> "The " " word cannot be called from optimized words" surround ;
+    drop "The do-primitive word cannot be called from here" ;
 
 M: transform-expansion-error summary
     word>> name>> "Macro expansion of " " threw an error" surround ;
 
 M: transform-expansion-error error.
-    [ summary print ] [ error>> error. ] bi ;
+    [ summary print ]
+    [ nl "The error was:" print error>> error. nl ]
+    [ continuation>> traceback-link. ]
+    tri ;
 
 M: do-not-compile summary
     word>> name>> "Cannot compile call to " prepend ;
\ No newline at end of file
index c99e0f02521032af919b3bd44407c3e9cd222b6e..38ac2b0e719a24fb66f63e9c35f6dd928da46fab 100644 (file)
@@ -10,6 +10,7 @@ stack-checker.visitor
 stack-checker.backend
 stack-checker.branches
 stack-checker.known-words
+stack-checker.dependencies
 stack-checker.recursive-state ;
 IN: stack-checker.inlining
 
@@ -28,8 +29,6 @@ fixed-point
 introductions
 loop? ;
 
-M: inline-recursive hashcode* id>> hashcode* ;
-
 : inlined-block? ( word -- ? ) "inlined-block" word-prop ;
 
 : <inline-recursive> ( word -- label )
@@ -81,7 +80,7 @@ SYMBOL: enter-out
     bi ;
 
 : recursive-word-inputs ( label -- n )
-    entry-stack-height d-in get + ;
+    entry-stack-height input-count get + ;
 
 : (inline-recursive-word) ( word -- label in out visitor terminated? )
     dup prepare-stack
index 154e67ebb1070d5b568aac4e0232308c679c83ad..40e41d1a8d68bb4a58a04a471670b3c986ab0d54 100644 (file)
@@ -21,6 +21,7 @@ stack-checker.visitor
 stack-checker.backend
 stack-checker.branches
 stack-checker.transforms
+stack-checker.dependencies
 stack-checker.recursive-state ;
 IN: stack-checker.known-words
 
@@ -97,8 +98,8 @@ M: composed infer-call*
     1 infer->r infer-call
     terminated? get [ 1 infer-r> infer-call ] unless ;
 
-M: object infer-call*
-    "literal quotation" literal-expected ;
+M: input-parameter infer-call* \ call unknown-macro-input ;
+M: object infer-call* \ call bad-macro-input ;
 
 : infer-ndip ( word n -- )
     [ literals get ] 2dip
@@ -230,7 +231,7 @@ M: bad-executable summary
 \ alien-callback [ infer-alien-callback ] "special" set-word-prop
 
 : infer-special ( word -- )
-    "special" word-prop call( -- ) ;
+    [ current-word set ] [ "special" word-prop call( -- ) ] bi ;
 
 : infer-local-reader ( word -- )
     (( -- value )) apply-word/effect ;
@@ -510,8 +511,11 @@ M: bad-executable summary
 \ code-room { } { byte-array } define-primitive
 \ code-room  make-flushable
 
-\ micros { } { integer } define-primitive
-\ micros make-flushable
+\ system-micros { } { integer } define-primitive
+\ system-micros make-flushable
+
+\ nano-count { } { integer } define-primitive
+\ nano-count make-flushable
 
 \ tag { object } { fixnum } define-primitive
 \ tag make-foldable
@@ -711,3 +715,7 @@ M: bad-executable summary
 \ disable-gc-events { } { object } define-primitive
 
 \ profiling { object } { } define-primitive
+
+\ (identity-hashcode) { object } { fixnum } define-primitive
+
+\ compute-identity-hashcode { object } { } define-primitive
index c806f98e2ed1ae7688fb94ef72a3419fc17f7f1c..cc4a688f7aea9dc510c46434dbfc7c899c74ad4f 100644 (file)
@@ -26,7 +26,7 @@ ARTICLE: "inference-combinators" "Combinator stack effects"
   { "The combinator must be called with a quotation that is either literal or built from literal quotations, " { $link curry } ", and " { $link compose } ". (Note that quotations that use " { $vocab-link "fry" } " or " { $vocab-link "locals" } " use " { $link curry } " and " { $link compose } " from the perspective of the stack checker.)" }
   { "If the word is declared " { $link POSTPONE: inline } ", the combinator may additionally be called on one of the word's input parameters or with quotations built from the word's input parameters, literal quotations, " { $link curry } ", and " { $link compose } ". When inline, a word is itself considered to be a combinator, and its callers must in turn satisfy these conditions." }
 }
-"If neither condition holds, the stack checker throws a " { $link literal-expected } " error. To make the code compile, a runtime checking combinator such as " { $link POSTPONE: call( } " must be used instead. See " { $link "inference-escape" } " for details. An inline combinator can be called with an unknown quotation by " { $link curry } "ing the quotation onto a literal quotation that uses " { $link POSTPONE: call( } "."
+"If neither condition holds, the stack checker throws a " { $link unknown-macro-input } " or " { $link bad-macro-input } " error. To make the code compile, a runtime checking combinator such as " { $link POSTPONE: call( } " must be used instead. See " { $link "inference-escape" } " for details. An inline combinator can be called with an unknown quotation by " { $link curry } "ing the quotation onto a literal quotation that uses " { $link POSTPONE: call( } "."
 { $heading "Examples" }
 { $subheading "Calling a combinator" }
 "The following usage of " { $link map } " passes the stack checker, because the quotation is the result of " { $link curry } ":"
@@ -51,13 +51,13 @@ ARTICLE: "inference-combinators" "Combinator stack effects"
 "However this fails to pass the stack checker since there is no guarantee the quotation has the right stack effect for " { $link map } ". It can be wrapped in a new quotation with a declaration:"
 { $code ": perform ( values action -- results )" "    quot>> [ call( value -- result ) ] curry map ;" }
 { $heading "Explanation" }
-"This restriction exists because without further information, one cannot say what the stack effect of " { $link call } " is; it depends on the given quotation. If the stack checker encounters a " { $link call } " without further information, a " { $link literal-expected } " error is raised."
+"This restriction exists because without further information, one cannot say what the stack effect of " { $link call } " is; it depends on the given quotation. If the stack checker encounters a " { $link call } " without further information, a " { $link unknown-macro-input } " or " { $link bad-macro-input } " error is raised."
 $nl
 "On the other hand, the stack effect of applying " { $link call } " to a literal quotation or a " { $link curry } " of a literal quotation is easy to compute; it behaves as if the quotation was substituted at that point."
 { $heading "Limitations" }
 "The stack checker cannot guarantee that a literal quotation is still literal if it is passed on the data stack to an inlined recursive combinator such as " { $link each } " or " { $link map } ". For example, the following will not infer:"
 { $example
-  "[ [ reverse ] swap [ reverse ] map swap call ] infer." "Got a computed value where a literal quotation was expected"
+  "[ [ reverse ] swap [ reverse ] map swap call ] infer." "Cannot apply “call” to a run-time computed value\nmacro call"
 }
 "To make this work, use " { $link dip } " to pass the quotation instead:"
 { $example
@@ -77,7 +77,7 @@ $nl
 "Combinators which are recursive require additional care. In addition to being declared " { $link POSTPONE: inline } ", they must be declared " { $link POSTPONE: recursive } ". There are three restrictions that only apply to combinators with this declaration:"
 { $heading "Input quotation declaration" }
 "Input parameters which are quotations must be annotated as much in the stack effect. For example, the following will not infer:"
-{ $example ": bad ( quot -- ) [ call ] keep bad ; inline recursive" "[ [ ] bad ] infer." "Got a computed value where a literal quotation was expected" }
+{ $unchecked-example ": bad ( quot -- ) [ call ] keep bad ; inline recursive" "[ [ ] bad ] infer." "Cannot apply “call” to a run-time computed value\nmacro call" }
 "The following is correct:"
 { $example ": good ( quot: ( -- ) -- ) [ call ] keep good ; inline recursive" "[ [ ] good ] infer." "( -- )" }
 "The effect of the nested quotation itself is only present for documentation purposes; the mere presence of a nested effect is sufficient to mark that value as a quotation parameter."
@@ -85,7 +85,7 @@ $nl
 "The stack checker does not trace data flow in two instances."
 $nl
 "An inline recursive word cannot pass a quotation on the data stack through the recursive call. For example, the following will not infer:"
-{ $example ": bad ( ? quot: ( ? -- ) -- ) 2dup [ not ] dip bad call ; inline recursive" "[ [ drop ] bad ] infer." "Got a computed value where a literal quotation was expected" }
+{ $unchecked-example ": bad ( ? quot: ( ? -- ) -- ) 2dup [ not ] dip bad call ; inline recursive" "[ [ drop ] bad ] infer." "Cannot apply “call” to a run-time computed value\nmacro call" }
 "However a small change can be made:"
 { $example ": good ( ? quot: ( ? -- ) -- ) [ good ] 2keep [ not ] dip call ; inline recursive" "[ [ drop ] good ] infer." "( object -- )" }
 "An inline recursive word must have a fixed stack effect in its base case. The following will not infer:"
index 274566c8680e17cd8a61969f05df6a66adf19115..6af0ec64e583ebe0df9347eca44e3c5ec581051e 100644 (file)
@@ -16,14 +16,18 @@ IN: stack-checker.tests
 { 1 2 } [ dup ] must-infer-as
 
 { 1 2 } [ [ dup ] call ] must-infer-as
-[ [ call ] infer ] must-fail
+[ [ call ] infer ] [ T{ unknown-macro-input f call } = ] must-fail-with
+[ [ curry call ] infer ] [ T{ unknown-macro-input f call } = ] must-fail-with
+[ [ { } >quotation call ] infer ] [ T{ bad-macro-input f call } = ] must-fail-with
+[ [ append curry call ] infer ] [ T{ bad-macro-input f call } = ] must-fail-with
 
 { 2 4 } [ 2dup ] must-infer-as
 
 { 1 0 } [ [ ] [ ] if ] must-infer-as
-[ [ if ] infer ] must-fail
-[ [ [ ] if ] infer ] must-fail
-[ [ [ 2 ] [ ] if ] infer ] must-fail
+[ [ if ] infer ] [ T{ unknown-macro-input f if } = ] must-fail-with
+[ [ { } >quotation { } >quotation if ] infer ] [ T{ bad-macro-input f if } = ] must-fail-with
+[ [ [ ] if ] infer ] [ T{ unknown-macro-input f if } = ] must-fail-with
+[ [ [ 2 ] [ ] if ] infer ] [ unbalanced-branches-error? ] must-fail-with
 { 4 3 } [ [ rot ] [ -rot ] if ] must-infer-as
 
 { 4 3 } [
@@ -46,7 +50,7 @@ IN: stack-checker.tests
 
 [
     [ [ [ 2 2 fixnum+ ] ] [ [ 2 2 fixnum* ] ] if call ] infer
-] must-fail
+] [ T{ bad-macro-input f call } = ] must-fail-with
 
 ! Test inference of termination of control flow
 : termination-test-1 ( -- * ) "foo" throw ;
@@ -198,42 +202,42 @@ DEFER: blah4
 
 ! This used to hang
 [ [ [ dup call ] dup call ] infer ]
-[ inference-error? ] must-fail-with
+[ recursive-quotation-error? ] must-fail-with
 
 : m ( q -- ) dup call ; inline
 
-[ [ [ m ] m ] infer ] [ inference-error? ] must-fail-with
+[ [ [ m ] m ] infer ] [ recursive-quotation-error? ] must-fail-with
 
 : m' ( quot -- ) dup curry call ; inline
 
-[ [ [ m' ] m' ] infer ] [ inference-error? ] must-fail-with
+[ [ [ m' ] m' ] infer ] [ recursive-quotation-error? ] must-fail-with
 
 : m'' ( -- q ) [ dup curry ] ; inline
 
 : m''' ( -- ) m'' call call ; inline
 
-[ [ [ m''' ] m''' ] infer ] [ inference-error? ] must-fail-with
+[ [ [ m''' ] m''' ] infer ] [ recursive-quotation-error? ] must-fail-with
 
-: m-if ( a b c -- ) t over if ; inline
+: m-if ( a b c -- ) t over when ; inline
 
-[ [ [ m-if ] m-if ] infer ] [ inference-error? ] must-fail-with
+[ [ [ m-if ] m-if ] infer ] [ recursive-quotation-error? ] must-fail-with
 
 ! This doesn't hang but it's also an example of the
 ! undedicable case
 [ [ [ [ drop 3 ] swap call ] dup call ] infer ]
-[ inference-error? ] must-fail-with
+[ recursive-quotation-error? ] must-fail-with
 
-[ [ 1 drop-locals ] infer ] [ inference-error? ] must-fail-with
+[ [ 1 drop-locals ] infer ] [ too-many-r>? ] must-fail-with
 
 ! Regression
-[ [ cleave ] infer ] [ inference-error? ] must-fail-with
+[ [ cleave ] infer ] [ T{ unknown-macro-input f cleave } = ] must-fail-with
 
 ! Test some curry stuff
 { 1 1 } [ 3 [ ] curry 4 [ ] curry if ] must-infer-as
 
 { 2 1 } [ [ ] curry 4 [ ] curry if ] must-infer-as
 
-[ [ 3 [ ] curry 1 2 [ ] 2curry if ] infer ] must-fail
+[ [ 3 [ ] curry 1 2 [ ] 2curry if ] infer ] [ unbalanced-branches-error? ] must-fail-with
 
 { 1 3 } [ [ 2drop f ] assoc-find ] must-infer-as
 
@@ -304,7 +308,7 @@ ERROR: custom-error ;
 ] unit-test
 
 ! Regression
-[ [ 1 load-locals ] infer ] must-fail
+[ [ 1 load-locals ] infer ] [ too-many->r? ] must-fail-with
 
 ! Corner case
 [ [ [ f dup ] [ dup ] produce ] infer ] must-fail
@@ -329,6 +333,8 @@ FORGET: bad-recursion-3
     dup bad-recursion-6 call ; inline recursive
 [ [ [ drop f ] bad-recursion-6 ] infer ] must-fail
 
+[ ] [ [ \ bad-recursion-6 forget ] with-compilation-unit ] unit-test
+
 { 3 0 } [ [ 2drop "A" throw ] [ ] if 2drop ] must-infer-as
 { 2 0 } [ drop f f [ 2drop "A" throw ] [ ] if 2drop ] must-infer-as
 
@@ -346,6 +352,9 @@ DEFER: eee'
 
 [ [ eee' ] infer ] [ inference-error? ] must-fail-with
 
+[ ] [ [ \ ddd' forget ] with-compilation-unit ] unit-test
+[ ] [ [ \ eee' forget ] with-compilation-unit ] unit-test
+
 : bogus-error ( x -- )
     dup "A" throw [ bogus-error ] [ drop ] if ; inline recursive
 
@@ -367,9 +376,9 @@ DEFER: eee'
 [ ] [ [ \ forget-test forget ] with-compilation-unit ] unit-test
 [ forget-test ] must-infer
 
-[ [ cond ] infer ] must-fail
-[ [ bi ] infer ] must-fail
-[ at ] must-infer
+[ [ cond ] infer ] [ T{ unknown-macro-input f cond } = ] must-fail-with
+[ [ bi ] infer ] [ T{ unknown-macro-input f call } = ] must-fail-with
+[ [ each ] infer ] [ T{ unknown-macro-input f call } = ] must-fail-with
 
 [ [ [ "OOPS" throw ] dip ] [ drop ] if ] must-infer
 
@@ -380,5 +389,8 @@ DEFER: eee'
 { 3 1 } [ call( a b -- c ) ] must-infer-as
 { 3 1 } [ execute( a b -- c ) ] must-infer-as
 
-[ [ call-effect ] infer ] must-fail
-[ [ execute-effect ] infer ] must-fail
+[ [ call-effect ] infer ] [ T{ unknown-macro-input f call-effect } = ] must-fail-with
+[ [ execute-effect ] infer ] [ T{ unknown-macro-input f execute-effect } = ] must-fail-with
+
+[ \ set-callstack def>> infer ] [ T{ unknown-primitive-error } = ] must-fail-with
+[ ] [ [ \ set-callstack def>> infer ] try ] unit-test
diff --git a/basis/stack-checker/state/state-tests.factor b/basis/stack-checker/state/state-tests.factor
deleted file mode 100644 (file)
index a4dea99..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-IN: stack-checker.state.tests
-USING: tools.test stack-checker.state words kernel namespaces
-definitions ;
-
-: computing-dependencies ( quot -- dependencies )
-    H{ } clone [ dependencies rot with-variable ] keep ;
-    inline
-
-SYMBOL: a
-SYMBOL: b
-
-[ ] [ a called-dependency depends-on ] unit-test
-
-[ H{ { a called-dependency } } ] [
-    [ a called-dependency depends-on ] computing-dependencies
-] unit-test
-
-[ H{ { a called-dependency } { b inlined-dependency } } ] [
-    [
-        a called-dependency depends-on b inlined-dependency depends-on
-    ] computing-dependencies
-] unit-test
-
-[ H{ { a inlined-dependency } { b inlined-dependency } } ] [
-    [
-        a inlined-dependency depends-on
-        a called-dependency depends-on
-        b inlined-dependency depends-on
-    ] computing-dependencies
-] unit-test
index a76d302a7ea469f628c18fff73d24cc712e162a7..1c527abfe49e63eb59f6ae889dd3911fb82049af 100644 (file)
@@ -2,14 +2,15 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs arrays namespaces sequences kernel definitions
 math effects accessors words fry classes.algebra
-compiler.units stack-checker.values stack-checker.visitor ;
+compiler.units stack-checker.values stack-checker.visitor
+stack-checker.errors ;
 IN: stack-checker.state
 
 ! Did the current control-flow path throw an error?
 SYMBOL: terminated?
 
 ! Number of inputs current word expects from the stack
-SYMBOL: d-in
+SYMBOL: input-count
 
 DEFER: commit-literals
 
@@ -34,33 +35,13 @@ SYMBOL: literals
         [ [ (push-literal) ] each ] [ delete-all ] bi
     ] unless-empty ;
 
-: current-stack-height ( -- n ) meta-d length d-in get - ;
+: current-stack-height ( -- n ) meta-d length input-count get - ;
 
 : current-effect ( -- effect )
-    d-in get meta-d length terminated? get effect boa ;
+    input-count get meta-d length terminated? get effect boa ;
 
 : init-inference ( -- )
     terminated? off
     V{ } clone \ meta-d set
     V{ } clone literals set
-    0 d-in set ;
-
-! Words that the current quotation depends on
-SYMBOL: dependencies
-
-: depends-on ( word how -- )
-    over primitive? [ 2drop ] [
-        dependencies get dup [
-            swap '[ _ strongest-dependency ] change-at
-        ] [ 3drop ] if
-    ] if ;
-
-! Generic words that the current quotation depends on
-SYMBOL: generic-dependencies
-
-: ?class-or ( class/f class -- class' )
-    swap [ class-or ] when* ;
-
-: depends-on-generic ( generic class -- )
-    generic-dependencies get dup
-    [ swap '[ _ ?class-or ] change-at ] [ 3drop ] if ;
+    0 input-count set ;
index 843083bd52b3c7735abc62cde31eef2c0094ff3c..bbe3cb2ed9a8959072060da2aa886d479846adfe 100644 (file)
@@ -1,15 +1,9 @@
 IN: stack-checker.transforms.tests
 USING: sequences stack-checker.transforms tools.test math kernel
-quotations stack-checker stack-checker.errors accessors combinators words arrays
-classes classes.tuple ;
+quotations stack-checker stack-checker.errors accessors
+combinators words arrays classes classes.tuple macros ;
 
-: compose-n ( quot n -- ) "OOPS" throw ;
-
-<<
-: compose-n-quot ( n word -- quot' ) <repetition> >quotation ;
-\ compose-n [ compose-n-quot ] 2 define-transform
-\ compose-n t "no-compile" set-word-prop
->>
+MACRO: compose-n ( n word -- quot' ) <repetition> >quotation ;
 
 : compose-n-test ( a b c -- x ) 2 \ + compose-n ;
 
@@ -64,14 +58,16 @@ DEFER: smart-combo ( quot -- )
 [ [ [ "a" "b" ] very-smart-combo "c" ] very-smart-combo ] must-infer
 
 ! Caveat found by Doug
-DEFER: curry-folding-test ( quot -- )
-
-\ curry-folding-test [ length \ drop <repetition> >quotation ] 1 define-transform
+MACRO: curry-folding-test ( quot -- )
+    length \ drop <repetition> >quotation ;
 
 { 3 0 } [ [ 1 2 3 ] curry-folding-test ] must-infer-as
 { 3 0 } [ 1 [ 2 3 ] curry curry-folding-test ] must-infer-as
 { 3 0 } [ [ 1 2 ] 3 [ ] curry compose curry-folding-test ] must-infer-as
 
+[ [ curry curry-folding-test ] infer ]
+[ T{ unknown-macro-input f curry-folding-test } = ] must-fail-with
+
 : member?-test ( a -- ? ) { 1 2 3 10 7 58 } member? ;
 
 [ f ] [ 1.0 member?-test ] unit-test
@@ -82,4 +78,8 @@ DEFER: curry-folding-test ( quot -- )
 
 \ bad-macro [ "OOPS" throw ] 0 define-transform
 
-[ [ bad-macro ] infer ] [ inference-error? ] must-fail-with
\ No newline at end of file
+[ [ bad-macro ] infer ] [ f >>continuation T{ transform-expansion-error f "OOPS" f bad-macro } = ] must-fail-with
+
+MACRO: two-params ( a b -- c ) + 1quotation ;
+
+[ [ 3 two-params ] infer ] [ T{ unknown-macro-input f two-params } = ] must-fail-with
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 11534c5..3fdf29b
@@ -7,40 +7,49 @@ classes.tuple.private effects summary hashtables classes sets
 definitions generic.standard slots.private continuations locals
 sequences.private generalizations stack-checker.backend
 stack-checker.state stack-checker.visitor stack-checker.errors
-stack-checker.values stack-checker.recursive-state ;
+stack-checker.values stack-checker.recursive-state
+stack-checker.dependencies ;
 IN: stack-checker.transforms
 
-: call-transformer ( word stack quot -- newquot )
-    '[ _ _ with-datastack [ length 1 assert= ] [ first ] bi nip ]
-    [ transform-expansion-error ]
+: call-transformer ( stack quot -- newquot )
+    '[ _ _ with-datastack [ length 1 assert= ] [ first ] bi ]
+    [ error-continuation get current-word get transform-expansion-error ]
     recover ;
 
-:: ((apply-transform)) ( word quot values stack rstate -- )
-    rstate recursive-state
-    [ word stack quot call-transformer ] with-variable
-    [
-        values [ length meta-d shorten-by ] [ #drop, ] bi
-        rstate infer-quot
-    ] [ word infer-word ] if* ;
-
-: literals? ( values -- ? ) [ literal-value? ] all? ;
-
-: (apply-transform) ( word quot n -- )
-    ensure-d dup literals? [
-        dup empty? [ dup recursive-state get ] [
-            [ ]
-            [ [ literal value>> ] map ]
-            [ first literal recursion>> ] tri
-        ] if
-        ((apply-transform))
-    ] [ 2drop infer-word ] if ;
+:: ((apply-transform)) ( quot values stack rstate -- )
+    rstate recursive-state [ stack quot call-transformer ] with-variable
+    values [ length meta-d shorten-by ] [ #drop, ] bi
+    rstate infer-quot ;
+
+: literal-values? ( values -- ? ) [ literal-value? ] all? ;
+
+: input-values? ( values -- ? )
+    [ { [ literal-value? ] [ input-value? ] } 1|| ] all? ;
+
+: (apply-transform) ( quot n -- )
+    ensure-d {
+        { [ dup literal-values? ] [
+            dup empty? [ dup recursive-state get ] [
+                [ ]
+                [ [ literal value>> ] map ]
+                [ first literal recursion>> ] tri
+            ] if
+            ((apply-transform))
+        ] }
+        { [ dup input-values? ] [ drop current-word get unknown-macro-input ] }
+        [ drop current-word get bad-macro-input ]
+    } cond ;
 
 : apply-transform ( word -- )
-    [ ] [ "transform-quot" word-prop ] [ "transform-n" word-prop ] tri
+    [ current-word set ]
+    [ "transform-quot" word-prop ]
+    [ "transform-n" word-prop ] tri
     (apply-transform) ;
 
 : apply-macro ( word -- )
-    [ ] [ "macro" word-prop ] [ "declared-effect" word-prop in>> length ] tri
+    [ current-word set ]
+    [ "macro" word-prop ]
+    [ "declared-effect" word-prop in>> length ] tri
     (apply-transform) ;
 
 : define-transform ( word quot n -- )
index 19db441381d021f51ce2db78b63ee6d26af184d4..7e11ec3edb57a85f51f73e1219e2d5299bdc0eea 100644 (file)
@@ -1,7 +1,7 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors namespaces kernel assocs sequences
-stack-checker.recursive-state ;
+stack-checker.recursive-state stack-checker.errors ;
 IN: stack-checker.values
 
 ! Values
@@ -28,21 +28,25 @@ SYMBOL: known-values
 
 GENERIC: (literal-value?) ( value -- ? )
 
-M: object (literal-value?) drop f ;
+: literal-value? ( value -- ? ) known (literal-value?) ;
+
+GENERIC: (input-value?) ( value -- ? )
+
+: input-value? ( value -- ? ) known (input-value?) ;
 
-GENERIC: (literal) ( value -- literal )
+GENERIC: (literal) ( known -- literal )
 
 ! Literal value
-TUPLE: literal < identity-tuple value recursion hashcode ;
+TUPLE: literal < identity-tuple value recursion ;
 
 : literal ( value -- literal ) known (literal) ;
 
-: literal-value? ( value -- ? ) known (literal-value?) ;
-
-M: literal hashcode* nip hashcode>> ;
+M: literal hashcode* nip value>> identity-hashcode ;
 
 : <literal> ( obj -- value )
-    recursive-state get over hashcode \ literal boa ;
+    recursive-state get \ literal boa ;
+
+M: literal (input-value?) drop f ;
 
 M: literal (literal-value?) drop t ;
 
@@ -51,7 +55,7 @@ M: literal (literal) ;
 : curried/composed-literal ( input1 input2 quot -- literal )
     [ [ literal ] bi@ ] dip
     [ [ [ value>> ] bi@ ] dip call ] [ drop nip recursion>> ] 3bi
-    over hashcode \ literal boa ; inline
+    \ literal boa ; inline
 
 ! Result of curry
 TUPLE: curried obj quot ;
@@ -61,7 +65,10 @@ C: <curried> curried
 : >curried< ( curried -- obj quot )
     [ obj>> ] [ quot>> ] bi ; inline
 
+M: curried (input-value?) >curried< [ input-value? ] either? ;
+
 M: curried (literal-value?) >curried< [ literal-value? ] both? ;
+
 M: curried (literal) >curried< [ curry ] curried/composed-literal ;
 
 ! Result of compose
@@ -72,5 +79,27 @@ C: <composed> composed
 : >composed< ( composed -- quot1 quot2 )
     [ quot1>> ] [ quot2>> ] bi ; inline
 
+M: composed (input-value?)
+    [ quot1>> input-value? ] [ quot2>> input-value? ] bi or ;
+
 M: composed (literal-value?) >composed< [ literal-value? ] both? ;
-M: composed (literal) >composed< [ compose ] curried/composed-literal ;
\ No newline at end of file
+
+M: composed (literal) >composed< [ compose ] curried/composed-literal ;
+
+! Input parameters
+SINGLETON: input-parameter
+
+SYMBOL: current-word
+
+M: input-parameter (input-value?) drop t ;
+
+M: input-parameter (literal-value?) drop f ;
+
+M: input-parameter (literal) current-word get unknown-macro-input ;
+
+! Computed values
+M: f (input-value?) drop f ;
+
+M: f (literal-value?) drop f ;
+
+M: f (literal) current-word get bad-macro-input ;
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8956051b251fd27634aeef7aeef4b40b8b3426e0..995fc867e71c94f9160fa25f607187ff032d241e 100644 (file)
@@ -1,6 +1,6 @@
 USING: help.markup help.syntax kernel kernel.private io
 threads.private continuations init quotations strings
-assocs heaps boxes namespaces deques dlists ;
+assocs heaps boxes namespaces deques dlists system ;
 IN: threads
 
 ARTICLE: "threads-start/stop" "Starting and stopping threads"
@@ -16,7 +16,7 @@ ARTICLE: "threads-start/stop" "Starting and stopping threads"
 }
 "Threads stop either when the quotation given to " { $link spawn } " returns, or when the following word is called:"
 { $subsections stop }
-"If the image is saved and started again, all runnable threads are stopped. Vocabularies wishing to have a background thread always running should use " { $link add-init-hook } "." ;
+"If the image is saved and started again, all runnable threads are stopped. Vocabularies wishing to have a background thread always running should use " { $link add-startup-hook } "." ;
 
 ARTICLE: "threads-yield" "Yielding and suspending threads"
 "Yielding to other threads:"
@@ -113,8 +113,8 @@ HELP: sleep-queue
 { $var-description "A " { $link min-heap } " storing the queue of sleeping threads." } ;
 
 HELP: sleep-time
-{ $values { "us/f" "a non-negative integer or " { $link f } } }
-{ $description "Outputs the time until the next sleeping thread is scheduled to wake up, which could be zero if there are threads in the run queue, or threads which need to wake up right now. If there are no runnable or sleeping threads, outputs " { $link f } "." } ;
+{ $values { "nanos/f" "a non-negative integer or " { $link f } } }
+{ $description "Returns the time until the next sleeping thread is scheduled to wake up, which could be zero if there are threads in the run queue, or threads which need to wake up right now. If there are no runnable or sleeping threads, returns " { $link f } "." } ;
 
 HELP: stop
 { $description "Stops the current thread. The thread may be started again from another thread using " { $link (spawn) } "." } ;
@@ -123,8 +123,8 @@ HELP: yield
 { $description "Adds the current thread to the end of the run queue, and switches to the next runnable thread." } ;
 
 HELP: sleep-until
-{ $values { "time/f" "a non-negative integer or " { $link f } } }
-{ $description "Suspends the current thread until the given time, or indefinitely if a value of " { $link f } " is passed in."
+{ $values { "n/f" "a non-negative integer or " { $link f } } }
+{ $description "Suspends the current thread until the given nanosecond count, returned by " { $link nano-count } ", is reached, or indefinitely if a value of " { $link f } " is passed in."
 $nl
 "Other threads may interrupt the sleep by calling " { $link interrupt } "." } ;
 
index dec44625f72a74b10a023942b46fcc9cabc5183f..af11d77f8458e89bc9090f99b5288c32317e2c17 100644 (file)
@@ -91,11 +91,11 @@ PRIVATE>
     f >>state
     check-registered 2array run-queue push-front ;
 
-: sleep-time ( -- us/f )
+: sleep-time ( -- nanos/f )
     {
         { [ run-queue deque-empty? not ] [ 0 ] }
         { [ sleep-queue heap-empty? ] [ f ] }
-        [ sleep-queue heap-peek nip micros [-] ]
+        [ sleep-queue heap-peek nip nano-count [-] ]
     } cond ;
 
 DEFER: stop
@@ -108,7 +108,7 @@ DEFER: stop
 
 : expire-sleep? ( heap -- ? )
     dup heap-empty?
-    [ drop f ] [ heap-peek nip micros <= ] if ;
+    [ drop f ] [ heap-peek nip nano-count <= ] if ;
 
 : expire-sleep ( thread -- )
     f >>sleep-entry resume ;
@@ -173,7 +173,7 @@ PRIVATE>
 
 : yield ( -- ) [ resume ] f suspend drop ;
 
-GENERIC: sleep-until ( time/f -- )
+GENERIC: sleep-until ( n/f -- )
 
 M: integer sleep-until
     '[ _ schedule-sleep ] "sleep" suspend drop ;
@@ -184,7 +184,7 @@ M: f sleep-until
 GENERIC: sleep ( dt -- )
 
 M: real sleep
-    micros + >integer sleep-until ;
+    >integer nano-count + sleep-until ;
 
 : interrupt ( thread -- )
     dup state>> [
@@ -225,4 +225,4 @@ GENERIC: error-in-thread ( error thread -- )
 
 PRIVATE>
 
-[ init-threads ] "threads" add-init-hook
+[ init-threads ] "threads" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
index 90fe7e8e9daee1a6715b8b55c2a56f066e1b8804..134395f1a85881e02a047c8f90f2fd3e8fa9659f 100644 (file)
@@ -135,6 +135,6 @@ SINGLETON: invalidate-crossref
 
 M: invalidate-crossref definitions-changed 2drop crossref global delete-at ;
 
-[ invalidate-crossref add-definition-observer ] "tools.crossref" add-init-hook
+[ invalidate-crossref add-definition-observer ] "tools.crossref" add-startup-hook
 
 PRIVATE>
old mode 100755 (executable)
new mode 100644 (file)
index 784b034665a68462193c223238b4cd08c1258fb0..1412e65f95f487a291598d5f94bbd43ba2e7b572 100644 (file)
@@ -5,32 +5,32 @@ io.launcher arrays namespaces continuations layouts accessors
 urls math.parser io.directories tools.deploy.test ;\r
 IN: tools.deploy.tests\r
 \r
-[ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test\r
+[ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test\r
 \r
-[ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test\r
+[ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test\r
 \r
-[ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test\r
+[ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test\r
 \r
 [ "staging.math-threads-compiler-ui.image" ] [\r
     "hello-ui" deploy-config\r
     [ bootstrap-profile staging-image-name file-name ] bind\r
 ] unit-test\r
 \r
-[ ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test\r
+[ ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test\r
 \r
-[ ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test\r
+[ ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test\r
 \r
-[ ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test\r
+[ ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test\r
 \r
-[ ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test\r
+[ ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test\r
 \r
-[ ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test\r
+[ ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test\r
 \r
 os macosx? [\r
-    [ ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test\r
+    [ ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test\r
 ] when\r
 \r
-[ ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test\r
+[ ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test\r
 \r
 {\r
     "tools.deploy.test.1"\r
@@ -115,3 +115,5 @@ os macosx? [
 ] unit-test\r
 \r
 [ ] [ "tools.deploy.test.16" shake-and-bake run-temp-image ] unit-test\r
+\r
+[ ] [ "tools.deploy.test.17" shake-and-bake run-temp-image ] unit-test\r
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e42f478..4e117e1
@@ -9,6 +9,7 @@ compiler.units definitions generic generic.standard
 generic.single tools.deploy.config combinators classes
 classes.builtin slots.private grouping command-line ;
 QUALIFIED: bootstrap.stage2
+QUALIFIED: compiler.crossref
 QUALIFIED: compiler.errors
 QUALIFIED: continuations
 QUALIFIED: definitions
@@ -23,28 +24,27 @@ IN: tools.deploy.shaker
 
 : add-command-line-hook ( -- )
     [ (command-line) command-line set-global ] "command-line"
-    init-hooks get set-at ;
+    startup-hooks get set-at ;
 
-: strip-init-hooks ( -- )
+: strip-startup-hooks ( -- )
     "Stripping startup hooks" show
     {
         "alien.strings"
         "cpu.x86"
-        "destructors"
         "environment"
         "libc"
     }
-    [ init-hooks get delete-at ] each
+    [ startup-hooks get delete-at ] each
     deploy-threads? get [
-        "threads" init-hooks get delete-at
+        "threads" startup-hooks get delete-at
     ] unless
     native-io? [
-        "io.thread" init-hooks get delete-at
+        "io.thread" startup-hooks get delete-at
     ] unless
     strip-io? [
-        "io.files" init-hooks get delete-at
-        "io.backend" init-hooks get delete-at
-        "io.thread" init-hooks get delete-at
+        "io.files" startup-hooks get delete-at
+        "io.backend" startup-hooks get delete-at
+        "io.thread" startup-hooks get delete-at
     ] when
     strip-dictionary? [
         {
@@ -52,7 +52,7 @@ IN: tools.deploy.shaker
             "vocabs"
             "vocabs.cache"
             "source-files.errors"
-        } [ init-hooks get delete-at ] each
+        } [ startup-hooks get delete-at ] each
     ] when ;
 
 : strip-debugger ( -- )
@@ -293,7 +293,7 @@ IN: tools.deploy.shaker
             continuations:error-continuation
             continuations:error-thread
             continuations:restarts
-            init:init-hooks
+            init:startup-hooks
             source-files:source-files
             input-stream
             output-stream
@@ -340,8 +340,8 @@ IN: tools.deploy.shaker
                 implementors-map
                 update-map
                 main-vocab-hook
-                compiled-crossref
-                compiled-generic-crossref
+                compiler.crossref:compiled-crossref
+                compiler.crossref:compiled-generic-crossref
                 compiler-impl
                 compiler.errors:compiler-errors
                 lexer-factory
@@ -445,10 +445,10 @@ SYMBOL: deploy-vocab
 
 : [print-error] ( -- word ) "print-error" "debugger" lookup ;
 
-: deploy-boot-quot ( word -- )
+: deploy-startup-quot ( word -- )
     [
         [ boot ] %
-        init-hooks get values concat %
+        startup-hooks get values concat %
         strip-debugger? [ , ] [
             ! Don't reference 'try' directly since we don't want
             ! to pull in the debugger and prettyprinter into every
@@ -465,9 +465,9 @@ SYMBOL: deploy-vocab
         strip-io? [ [ flush ] % ] unless
         [ 0 exit ] %
     ] [ ] make
-    set-boot-quot ;
+    set-startup-quot ;
 
-: init-stripper ( -- )
+: startup-stripper ( -- )
     t "quiet" set-global
     f output-stream set-global ;
 
@@ -506,7 +506,7 @@ SYMBOL: deploy-vocab
     [ clear-megamorphic-cache ] each ;
 
 : strip ( -- )
-    init-stripper
+    startup-stripper
     strip-libc
     strip-destructors
     strip-call
@@ -514,13 +514,13 @@ SYMBOL: deploy-vocab
     strip-debugger
     strip-specialized-arrays
     compute-next-methods
-    strip-init-hooks
+    strip-startup-hooks
     add-command-line-hook
     strip-c-io
     strip-default-methods
     strip-compiler-classes
     f 5 setenv ! we can't use the Factor debugger or Factor I/O anymore
-    deploy-vocab get vocab-main deploy-boot-quot
+    deploy-vocab get vocab-main deploy-startup-quot
     find-megamorphic-caches
     stripped-word-props
     stripped-globals strip-globals
index 133308b7329858a4f26656c6cce3d7933e5a7efb..d5c5bd54da5d5692a529f8ca2da9b0249279713f 100644 (file)
@@ -17,7 +17,7 @@ IN: cocoa.application
 
 : objc-error ( error -- ) die ;
 
-[ [ die ] 19 setenv ] "cocoa.application" add-init-hook
+[ [ die ] 19 setenv ] "cocoa.application" add-startup-hook
 
 H{ } clone \ pool [
     global [
@@ -46,4 +46,4 @@ H{ } clone \ pool [
 \ make-prepare-send reset-memoized
 \ <selector> reset-memoized
 
-\ (send) def>> second clear-assoc
\ No newline at end of file
+\ (send) def>> second clear-assoc
diff --git a/basis/tools/deploy/test/17/17.factor b/basis/tools/deploy/test/17/17.factor
new file mode 100644 (file)
index 0000000..a7cb0d2
--- /dev/null
@@ -0,0 +1,31 @@
+USING: accessors calendar db db.sqlite db.tuples db.types
+io.files.temp kernel urls ;
+IN: tools.deploy.test.17
+
+TUPLE: person name birthday homepage occupation ;
+
+person "PEOPLE" {
+    { "name" "NAME" { VARCHAR 256 } +not-null+ +user-assigned-id+ }
+    { "birthday" "BIRTHDAY" DATETIME +not-null+ }
+    { "homepage" "HOMEPAGE" URL +not-null+ }
+    { "occupation" "OCCUPATION" { VARCHAR 256 } +not-null+ }
+} define-persistent
+
+: db-deploy-test ( -- )
+    "test.db" temp-file <sqlite-db> [
+        person recreate-table
+        
+        person new
+            "Stephen Hawking" >>name
+            timestamp new 8 >>day 0 >>month 1942 >>year >>birthday
+            "http://en.wikipedia.org/wiki/Stephen_Hawking" >url >>homepage
+            "Dope MC" >>occupation
+        dup
+        insert-tuple
+        person new
+            "Stephen Hawking" >>name
+        select-tuple
+        assert=
+    ] with-db ;
+
+MAIN: db-deploy-test
diff --git a/basis/tools/deploy/test/17/deploy.factor b/basis/tools/deploy/test/17/deploy.factor
new file mode 100644 (file)
index 0000000..62cc2ca
--- /dev/null
@@ -0,0 +1,14 @@
+USING: tools.deploy.config ;
+H{
+    { deploy-name "tools.deploy.test.17" }
+    { deploy-ui? f }
+    { deploy-c-types? f }
+    { deploy-unicode? f }
+    { "stop-after-last-window?" t }
+    { deploy-io 3 }
+    { deploy-reflection 5 }
+    { deploy-word-props? f }
+    { deploy-math? t }
+    { deploy-threads? t }
+    { deploy-word-defs? f }
+}
index a9ee71131ceb70e74c8a487cbebced7308d240c0..fb005d2a4683b9aae04bfd13274641b542998653 100644 (file)
@@ -1,5 +1,5 @@
+USING: io.encodings.string kernel io.encodings.8-bit.latin7 ;
 IN: tools.deploy.test.4
-USING: io.encodings.8-bit io.encodings.string kernel ;
 
 : deploy-test-4 ( -- )
     "xyzthg" \ latin7 encode drop ;
index 9118fa3ca70f2f97daef6ec637f00201a2914f37..29ca4518e6cfff527d15b7c83a701f9086d1dc8a 100644 (file)
@@ -3,8 +3,7 @@ USING: accessors urls io.encodings.ascii io.files math.parser
 http.client kernel ;
 
 : deploy-test-5 ( -- )
-    URL" http://localhost/foo.html" clone
-    "resource:port-number" ascii file-contents string>number >>port
+    URL" http://apple.com" 
     http-get 2drop ;
 
 MAIN: deploy-test-5
index 3f9b7f15995be44007dbf86d4560e9356965755d..74f3a6942b8fcfa96007919f5aecdfafa6b70db4 100644 (file)
@@ -1,13 +1,14 @@
 USING: tools.deploy.config ;
 H{
-    { deploy-threads? t }
-    { deploy-c-types? f }
+    { deploy-name "tools.deploy.test.5" }
     { deploy-ui? f }
+    { deploy-c-types? f }
+    { deploy-unicode? f }
+    { "stop-after-last-window?" t }
+    { deploy-io 3 }
+    { deploy-reflection 2 }
     { deploy-word-props? f }
-    { deploy-word-defs? f }
     { deploy-math? t }
-    { deploy-io 3 }
-    { deploy-name "tools.deploy.test.5" }
-    { deploy-reflection 1 }
-    { "stop-after-last-window?" t }
+    { deploy-threads? t }
+    { deploy-word-defs? f }
 }
old mode 100755 (executable)
new mode 100644 (file)
index c799ec6..d8414ba
@@ -10,14 +10,16 @@ IN: tools.deploy.test
         dup deploy-config make-deploy-image
     ] with-directory ;
 
-: small-enough? ( n -- ? )
+ERROR: image-too-big actual-size max-size ;
+
+: small-enough? ( n -- )
     [ "test.image" temp-file file-info size>> ]
     [
         cell 4 / *
         cpu ppc? [ 100000 + ] when
         os windows? [ 150000 + ] when
     ] bi*
-    <= ;
+    2dup <= [ 2drop ] [ image-too-big ] if ;
 
 : deploy-test-command ( -- args )
     os macosx?
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 0ee60b06b5168c471797c88d562012a47169c4dc..8dbfda3011204cf9a06bfebfb0a6eac7dea3e808 100644 (file)
@@ -73,6 +73,6 @@ M: deprecation-observer definitions-changed
     [ drop initialize-deprecation-notes ] if ;
 
 [ \ deprecation-observer add-definition-observer ] 
-"tools.deprecation" add-init-hook
+"tools.deprecation" add-startup-hook
 
 initialize-deprecation-notes
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 9ad3dbbcc21f9999151cef79cd41218f1b80f110..df3ef413650ee23edb290071ae650936f4d56800 100644 (file)
@@ -2,8 +2,8 @@ IN: tools.disassembler.udis.tests
 USING: tools.disassembler.udis tools.test alien.c-types system combinators kernel ;
 
 {
-    { [ os linux? cpu x86.64? and ] [ [ 656 ] [ "ud" heap-size ] unit-test ] }
-    { [ os macosx? cpu x86.32? and ] [ [ 592 ] [ "ud" heap-size ] unit-test ] }
-    { [ os macosx? cpu x86.64? and ] [ [ 656 ] [ "ud" heap-size ] unit-test ] }
+    { [ os linux? cpu x86.64? and ] [ [ 656 ] [ ud heap-size ] unit-test ] }
+    { [ os macosx? cpu x86.32? and ] [ [ 592 ] [ ud heap-size ] unit-test ] }
+    { [ os macosx? cpu x86.64? and ] [ [ 656 ] [ ud heap-size ] unit-test ] }
     [ ]
 } cond
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index c874363fe68f49f449ecfb7f6e0894567cb14c27..b41d236fd7b89a36e0bf5bf2640f82cb43250776 100644 (file)
@@ -14,5 +14,5 @@ SINGLETON: updater
 
 M: updater errors-changed drop f (error-list-model) get-global set-model ;
 
-[ updater add-error-observer ] "ui.tools.error-list" add-init-hook
+[ updater add-error-observer ] "ui.tools.error-list" add-startup-hook
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index c147426a6fa8132c0d44491e88a9ec51d55f8648..6746031a3d1085d8bd3227ce77ccdcd99853d2d2 100644 (file)
@@ -4,8 +4,7 @@ USING: accessors arrays assocs classes classes.struct
 combinators combinators.smart continuations fry generalizations
 generic grouping io io.styles kernel make math math.parser
 math.statistics memory namespaces parser prettyprint sequences
-sorting specialized-arrays splitting strings system vm words ;
-SPECIALIZED-ARRAY: gc-event
+sorting splitting strings system vm words ;
 IN: tools.memory
 
 <PRIVATE
@@ -19,8 +18,8 @@ IN: tools.memory
 : kilobytes ( n -- str )
     1024 /i commas " KB" append ;
 
-: micros>string ( n -- str )
-    commas " µs" append ;
+: nanos>string ( n -- str )
+    1000 /i commas " µs" append ;
 
 : copying-room. ( copying-sizes -- )
     {
@@ -101,7 +100,7 @@ SYMBOL: gc-events
 : collect-gc-events ( quot -- )
     enable-gc-events
     [ ] [ disable-gc-events drop ] cleanup
-    disable-gc-events byte-array>gc-event-array gc-events set ; inline
+    disable-gc-events [ gc-event memory>struct ] map gc-events set ; inline
 
 <PRIVATE
 
@@ -154,11 +153,11 @@ TUPLE: gc-stats collections times ;
             [ collections>> ]
             [
                 times>> {
-                    [ sum micros>string ]
-                    [ mean >integer micros>string ]
-                    [ median >integer micros>string ]
-                    [ infimum micros>string ]
-                    [ supremum micros>string ]
+                    [ sum nanos>string ]
+                    [ mean >integer nanos>string ]
+                    [ median >integer nanos>string ]
+                    [ infimum nanos>string ]
+                    [ supremum nanos>string ]
                 } cleave
             ] bi
         ] bi
@@ -173,7 +172,7 @@ PRIVATE>
 : gc-event. ( event -- )
     {
         { "Event type:" [ op>> gc-op-string ] }
-        { "Total time:" [ total-time>> micros>string ] }
+        { "Total time:" [ total-time>> nanos>string ] }
         { "Space reclaimed:" [ space-reclaimed kilobytes ] }
     } object-table. ;
 
@@ -189,10 +188,10 @@ PRIVATE>
         { "Cards scanned:" [ [ cards-scanned>> ] map-sum commas ] }
         { "Decks scanned:" [ [ decks-scanned>> ] map-sum commas ] }
         { "Code blocks scanned:" [ [ code-blocks-scanned>> ] map-sum commas ] }
-        { "Total time:" [ [ total-time>> ] map-sum micros>string ] }
-        { "Card scan time:" [ [ card-scan-time>> ] map-sum micros>string ] }
-        { "Code block scan time:" [ [ code-scan-time>> ] map-sum micros>string ] }
-        { "Data heap sweep time:" [ [ data-sweep-time>> ] map-sum micros>string ] }
-        { "Code heap sweep time:" [ [ code-sweep-time>> ] map-sum micros>string ] }
-        { "Compaction time:" [ [ compaction-time>> ] map-sum micros>string ] }
+        { "Total time:" [ [ total-time>> ] map-sum nanos>string ] }
+        { "Card scan time:" [ [ card-scan-time>> ] map-sum nanos>string ] }
+        { "Code block scan time:" [ [ code-scan-time>> ] map-sum nanos>string ] }
+        { "Data heap sweep time:" [ [ data-sweep-time>> ] map-sum nanos>string ] }
+        { "Code heap sweep time:" [ [ code-sweep-time>> ] map-sum nanos>string ] }
+        { "Compaction time:" [ [ compaction-time>> ] map-sum nanos>string ] }
     } object-table. ;
index 7f44a6138c2e6d8822c435a3af5687490a559755..8f3260d649bfbe40ebe9cd7eac11f0f1077c4da4 100644 (file)
@@ -60,7 +60,15 @@ IN: tools.profiler.tests
 
 [ [ gensym execute ] profile ] [ T{ undefined } = ] must-fail-with
 
-: crash-bug-1 ( -- x ) "hi" "bye" <word> ;
+: crash-bug-1 ( -- x ) "hi" <uninterned-word> ;
 : crash-bug-2 ( -- ) 100000 [ crash-bug-1 drop ] times ;
 
 [ ] [ [ crash-bug-2 ] profile ] unit-test
+
+[ 1 ] [
+    [
+        [ [ ] (( -- )) define-temp ] with-compilation-unit
+        dup execute( -- )
+    ] profile
+    counter>>
+] unit-test
index 626fdab826475b3d3122974cce7cb195015e2585..8279a905147003a2260b37f46117cd1d1350c349 100644 (file)
@@ -1,9 +1,10 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors words sequences math prettyprint kernel arrays io
-io.styles namespaces assocs kernel.private strings combinators
-sorting math.parser vocabs definitions tools.profiler.private
-tools.crossref continuations generic compiler.units sets classes fry ;
+USING: accessors words sequences math prettyprint kernel arrays
+io io.styles namespaces assocs kernel.private strings
+combinators sorting math.parser vocabs definitions
+tools.profiler.private tools.crossref continuations generic
+compiler.units compiler.crossref sets classes fry ;
 IN: tools.profiler
 
 : profile ( quot -- )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 009789a739aba4561725934c46a636741fb9fac5..559b1357c80ac34188d9e962d94a244444e071ba 100644 (file)
@@ -121,9 +121,6 @@ SYNTAX: TEST:
         vocab-tests [ run-test-file ] each
     ] [ drop ] if ;
 
-: traceback-button. ( failure -- )
-    "[" write [ "Traceback" ] dip continuation>> write-object "]" print ;
-
 PRIVATE>
 
 TEST: unit-test
@@ -137,7 +134,7 @@ M: test-failure error. ( error -- )
         [ error-location print nl ]
         [ asset>> [ experiment. nl ] when* ]
         [ error>> error. ]
-        [ traceback-button. ]
+        [ continuation>> traceback-link. ]
     } cleave ;
 
 : :test-failures ( -- ) test-failures get errors. ;
index 18dd8ce2b793a53228686eb6cbd77a18a5b9c6f4..ea85fb1129c3e02ecb8e29bf39abed0784e02f8f 100644 (file)
@@ -14,8 +14,8 @@ IN: tools.threads
     ] with-cell\r
     [\r
         sleep-entry>> [\r
-            key>> micros [-] number>string write\r
-            " us" write\r
+            key>> nano-count [-] number>string write\r
+            " nanos" write\r
         ] when*\r
     ] with-cell ;\r
 \r
index 9e892c33eccf24f2834f64704358971253602706..d28202f8440a20c0b23a84f0ba7c1f8a41e8ce85 100644 (file)
@@ -9,8 +9,7 @@ ARTICLE: "timing" "Timing code and collecting statistics"
 { $subsections dispatch-stats. gc-events. gc-stats. gc-summary. }
 "A lower-level word puts timings on the stack, intead of printing:"
 { $subsections benchmark }
-"You can also read the system clock directly:"
-{ $subsections micros }
+"You can also read the system clock directly; see " { $link "system" } "."
 { $see-also "profiling" "calendar" } ;
 
 ABOUT: "timing"
@@ -25,7 +24,7 @@ HELP: time
 { $values { "quot" quotation } }
 { $description "Runs a quotation, gathering statistics about method dispatch and garbage collection, and then prints the total run time." } ;
 
-{ benchmark micros time } related-words
+{ benchmark system-micros time } related-words
 
 HELP: collect-gc-events
 { $values { "quot" quotation } }
index 3724a741b7f6e068e5b8173961cdecff20a03efc..0bd97f563dbf3bbc5b0e8468f21446938bb54675 100644 (file)
@@ -5,10 +5,10 @@ tools.dispatch ;
 IN: tools.time
 
 : benchmark ( quot -- runtime )
-    micros [ call micros ] dip - ; inline
+    nano-count [ call nano-count ] dip - ; inline
 
 : time. ( time -- )
-    "Running time: " write 1000000 /f pprint " seconds" print ;
+    "Running time: " write 1000000000 /f pprint " seconds" print ;
 
 : time-banner. ( -- )
     "Additional information was collected." print
index ec96902d727de909e6a84f0ec4ea53fa97b28bff..0b3ac9d5f8f96107a4261e9c6e50d91e146badf3 100644 (file)
@@ -3,7 +3,7 @@ USING: accessors arrays classes classes.tuple combinators
 combinators.short-circuit definitions effects fry hints
 math kernel kernel.private namespaces parser quotations
 sequences slots words locals 
-locals.parser macros stack-checker.state ;
+locals.parser macros stack-checker.dependencies ;
 IN: typed
 
 ERROR: type-mismatch-error word expected-types ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 9759dbf..8eeca89
@@ -225,9 +225,9 @@ CLASS: {
 : install-app-delegate ( -- )
     NSApp FactorApplicationDelegate install-delegate ;
 
-SYMBOL: cocoa-init-hook
+SYMBOL: cocoa-startup-hook
 
-cocoa-init-hook [
+cocoa-startup-hook [
     [ "MiniFactor.nib" load-nib install-app-delegate ]
 ] initialize
 
@@ -235,7 +235,7 @@ M: cocoa-ui-backend (with-ui)
     "UI" assert.app [
         [
             init-clipboard
-            cocoa-init-hook get call( -- )
+            cocoa-startup-hook get call( -- )
             start-ui
             f io-thread-running? set-global
             init-thread-timer
index d04bcededac38e52d8f0fe4f4dff7b091523cdb5..00c1ad35831b3cbf639eb60daa864e574076f9d3 100644 (file)
@@ -101,4 +101,4 @@ FUNCTION: void NSUpdateDynamicServices ;
     install-app-delegate
     "Factor.nib" load-nib
     register-services
-] cocoa-init-hook set-global
+] cocoa-startup-hook set-global
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 12d0ef580d68419d06625a5a50e0a4109f34016d..8eb11a7753c7ca8e802de6246bdd01c301b4e199 100644 (file)
@@ -11,7 +11,6 @@ CONSTANT: horizontal { 1 0 }
 CONSTANT: vertical { 0 1 }
 
 TUPLE: gadget < rect
-id
 pref-dim
 parent
 children
@@ -29,7 +28,7 @@ model ;
 
 M: gadget equal? 2drop f ;
 
-M: gadget hashcode* nip [ [ \ gadget counter ] unless* ] change-id id>> ;
+M: gadget hashcode* nip identity-hashcode ;
 
 M: gadget model-changed 2drop ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 3deb0c619dfca0610ae1d4095d68a5317688e9bc..bb33e28da3c281060772b3ac57abbb8dbf81bc1d 100644 (file)
@@ -174,7 +174,7 @@ HELP: hand-last-button
 { $var-description "Global variable. The mouse button most recently pressed." } ;
 
 HELP: hand-last-time
-{ $var-description "Global variable. The timestamp of the most recent mouse button click. This timestamp has the same format as the output value of " { $link micros } "." } ;
+{ $var-description "Global variable. The timestamp of the most recent mouse button click. This timestamp has the same format as the output value of " { $link system-micros } "." } ;
 
 HELP: hand-buttons
 { $var-description "Global variable. A vector of mouse buttons currently held down." } ;
index 8e982f8e4596e7322d361117997989fe878aff98..f33b6ec6da8ebb38cf21cec403e38ed90c23fc7e 100644 (file)
@@ -156,7 +156,7 @@ SYMBOL: hand-click#
 SYMBOL: hand-last-button
 SYMBOL: hand-last-time
 0 hand-last-button set-global
-<zero> hand-last-time set-global
+0 hand-last-time set-global
 
 SYMBOL: hand-buttons
 V{ } clone hand-buttons set-global
@@ -184,7 +184,7 @@ SYMBOL: drag-timer
 : start-drag-timer ( -- )
     hand-buttons get-global empty? [
         [ drag-gesture ]
-        300 milliseconds hence
+        300 milliseconds
         100 milliseconds
         add-alarm drag-timer get-global >box
     ] when ;
@@ -246,7 +246,8 @@ SYMBOL: drag-timer
     hand-click-loc get-global swap screen-loc v- ;
 
 : multi-click-timeout? ( -- ? )
-    now hand-last-time get time- double-click-timeout get before=? ;
+    nano-count hand-last-time get - nanoseconds
+    double-click-timeout get before=? ;
 
 : multi-click-button? ( button -- button ? )
     dup hand-last-button get = ;
@@ -269,7 +270,7 @@ SYMBOL: drag-timer
             1 hand-click# set
         ] if
         hand-last-button set
-        now hand-last-time set
+        nano-count hand-last-time set
     ] bind ;
 
 : update-clicked ( -- )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 6de303089efcde3e71f1ed38f1e18999e2090660..8260608cd4cb40ccb492cc1bd464ce5010264945 100644 (file)
@@ -236,7 +236,7 @@ M: object close-window
 [
     f \ ui-running set-global
     <flag> ui-notify-flag set-global
-] "ui" add-init-hook
+] "ui" add-startup-hook
 
 : with-ui ( quot -- )
     ui-running? [ call( -- ) ] [ '[ init-ui @ ] (with-ui) ] if ;
old mode 100755 (executable)
new mode 100644 (file)
index 15b173c311d32095fb536132deb6533dfeb9cab2..6bef08abe3dc18224126c42c5bd7699d574825e2 100644 (file)
@@ -130,7 +130,7 @@ CONSTANT: _UTX_HOSTSIZE   256
 CONSTANT: _SS_MAXSIZE 128
 
 : _SS_ALIGNSIZE ( -- n )
-    "__int64_t" heap-size ; inline
+    __int64_t heap-size ; inline
     
 : _SS_PAD1SIZE ( -- n )
     _SS_ALIGNSIZE 2 - ; inline
index 4f5ac9930966cd4ee5acfebf1d58a285b79e928a..0a63965c20179fda605ac448a88183708c923ac9 100644 (file)
@@ -18,8 +18,8 @@ STRUCT: timespec
         swap >>usec
         swap >>sec ;
 
-: make-timespec ( us -- timespec )
-    1000000 /mod 1000 *
+: make-timespec ( nanos -- timespec )
+    1000000000 /mod
     timespec <struct>
         swap >>nsec
         swap >>sec ;
index 421efa60bc6d66d62f227f675366ca97bc7f207b..2bebc981f95baf00e39b5fae00747624ac972052 100644 (file)
@@ -21,5 +21,19 @@ TYPEDEF: __int32_t  blksize_t
 TYPEDEF: long       ssize_t
 TYPEDEF: __int32_t  pid_t
 TYPEDEF: long       time_t
+TYPEDEF: uint mach_port_t
+TYPEDEF: int kern_return_t
+TYPEDEF: int boolean_t
+TYPEDEF: mach_port_t io_object_t
+TYPEDEF: io_object_t io_iterator_t
+TYPEDEF: io_object_t io_registry_entry_t
+TYPEDEF: io_object_t io_service_t
+TYPEDEF: char[128] io_name_t
+TYPEDEF: char[512] io_string_t
+TYPEDEF: kern_return_t IOReturn
 
-ALIAS: <time_t> <long>
\ No newline at end of file
+TYPEDEF: uint IOOptionBits
+
+
+
+ALIAS: <time_t> <long>
index 7650e9962f64af74f762d0e4b6af93d02e777916..ec638e6f31933885128257c56c6ecdc9cbd0a9d4 100644 (file)
@@ -36,6 +36,7 @@ TYPEDEF: __uint64_t fsfilcnt_t
 TYPEDEF: fsfilcnt_t __fsfilcnt_t
 TYPEDEF: __uint64_t rlim_t
 TYPEDEF: uint32_t id_t
+TYPEDEF: long clockid_t
 
 C-TYPE: DIR
 C-TYPE: FILE
index 11792d91a72320eb80065fdcd0d7e6bd0ee12a31..a672c850d29914a8cacab1b40dc4d371e0e7b243 100644 (file)
@@ -5,7 +5,7 @@ USING: alien alien.c-types alien.syntax kernel libc
 sequences continuations byte-arrays strings math namespaces
 system combinators vocabs.loader accessors
 stack-checker macros locals generalizations unix.types
-io vocabs classes.struct unix.time ;
+io vocabs classes.struct unix.time alien.libraries ;
 IN: unix
 
 CONSTANT: PROT_NONE   0
@@ -220,3 +220,4 @@ FUNCTION: int utimes ( char* path, timeval[2] times ) ;
 
 FUNCTION: ssize_t write ( int fd, void* buf, size_t nbytes ) ;
 
+"librt" "librt.so" "cdecl" add-library
index 4d284a1a40653ddeedbf61871bb57e50c654c7e1..118db67d907eed15410fa524f4dbe932637d6b70 100644 (file)
@@ -12,7 +12,7 @@ IN: uuid
     ! 0x01b21dd213814000L is the number of 100-ns intervals
     ! between the UUID epoch 1582-10-15 00:00:00 and the 
     ! Unix epoch 1970-01-01 00:00:00.
-    micros 10 * HEX: 01b21dd213814000 +
+    system-micros 10 * HEX: 01b21dd213814000 +
     [ -48 shift HEX: 0fff bitand ] 
     [ -32 shift HEX: ffff bitand ]
     [ HEX: ffffffff bitand ]
index 86ff4497b8f379a98b13b73eedf339ef0f9f3f1f..e3585952db4d7d5d6c00ee1b092ca429cca7f4b6 100644 (file)
@@ -65,7 +65,7 @@ STRUCT: gc-event
 { data-sweep-time cell }
 { code-sweep-time cell }
 { compaction-time cell }
-{ temp-time cell } ;
+{ temp-time ulonglong } ;
 
 STRUCT: dispatch-statistics
 { megamorphic-cache-hits cell }
index 24ccd391f19dd00d4d93edee04cc4f3254f40cd6..1f62f02ddee23d0924f6231efc06309bf5abf67c 100644 (file)
@@ -18,4 +18,4 @@ M: cache-observer vocabs-changed drop reset-cache ;
 [
     f changed-vocabs set-global
     cache-observer add-vocab-observer
-] "vocabs.cache" add-init-hook
\ No newline at end of file
+] "vocabs.cache" add-startup-hook
index 1445b9f882e8788902a6ac15e6044b284a1a69e6..1bf73862e6b58b0da3dcff4cbe08a0c22d331df0 100644 (file)
@@ -56,4 +56,4 @@ TR: convert-separators "/\\" ".." ;
 [\r
     "-no-monitors" (command-line) member?\r
     [ start-monitor-thread ] unless\r
-] "vocabs.refresh.monitor" add-init-hook\r
+] "vocabs.refresh.monitor" add-startup-hook\r
old mode 100755 (executable)
new mode 100644 (file)
index 25e30829c091f13bf77cad24a4a2bbf0092e0d79..329a84ef137de327c06e94e8734c5fd2ed094df7 100644 (file)
@@ -1,7 +1,7 @@
 USING: kernel windows.com windows.com.syntax windows.ole32
-alien alien.syntax tools.test libc alien.c-types 
+alien alien.syntax tools.test libc alien.c-types
 namespaces arrays continuations accessors math windows.com.wrapper
-windows.com.wrapper.private destructors effects ;
+windows.com.wrapper.private destructors effects compiler.units ;
 IN: windows.com.tests
 
 COM-INTERFACE: ISimple IUnknown {216fb341-0eb2-44b1-8edb-60b76e353abc}
@@ -34,68 +34,70 @@ SYMBOL: +orig-wrapped-objects+
 +wrapped-objects+ get-global clone +orig-wrapped-objects+ set-global
 
 TUPLE: test-implementation x ;
-C: <test-implementation> test-implementation 
-
-{
-    { IInherited {
-        [ drop S_OK ] ! ISimple::returnOK
-        [ drop E_FAIL ] ! ISimple::returnError
-        [ x>> ] ! IInherited::getX
-        [ >>x drop ] ! IInherited::setX
-    } }
-    { IUnrelated {
-        [ [ x>> ] [ + ] bi* ] ! IUnrelated::xPlus
-        [ [ x>> ] [ * ] [ + ] tri* ] ! IUnrelated::xMulAdd
-    } }
-} <com-wrapper>
-dup +test-wrapper+ set [
-
-    0 <test-implementation> swap com-wrap
-    dup +guinea-pig-implementation+ set [ drop
-
-        S_OK 1array [ +guinea-pig-implementation+ get ISimple::returnOK ] unit-test
-        E_FAIL <long> *long 1array [ +guinea-pig-implementation+ get ISimple::returnError ] unit-test
-        20 1array [
-            +guinea-pig-implementation+ get
-            [ 20 IInherited::setX ]
-            [ IInherited::getX ] bi
-        ] unit-test
-        420 1array [
-            +guinea-pig-implementation+ get
-            IUnrelated-iid com-query-interface
-            [ 20 20 IUnrelated::xMulAdd ] with-com-interface
-        ] unit-test
-        40 1array [
-            +guinea-pig-implementation+ get
-            IUnrelated-iid com-query-interface
-            [ 20 IUnrelated::xPlus ] with-com-interface
-        ] unit-test
-
-        +guinea-pig-implementation+ get 1array [
-            +guinea-pig-implementation+ get com-add-ref
-        ] unit-test
-
-        { } [ +guinea-pig-implementation+ get com-release ] unit-test
-
-        +guinea-pig-implementation+ get 1array [
-            +guinea-pig-implementation+ get IUnknown-iid com-query-interface
-            dup com-release
-        ] unit-test
-        +guinea-pig-implementation+ get 1array [
-            +guinea-pig-implementation+ get ISimple-iid com-query-interface
-            dup com-release
-        ] unit-test
-        void* heap-size +guinea-pig-implementation+ get <displaced-alien>
-        +guinea-pig-implementation+ get
-        2array [
-            +guinea-pig-implementation+ get IUnrelated-iid com-query-interface
-            dup ISimple-iid com-query-interface
-            over com-release dup com-release
-        ] unit-test
-
-    ] with-com-interface
-
-] with-disposal
+C: <test-implementation> test-implementation
+
+[
+    {
+        { IInherited {
+            [ drop S_OK ] ! ISimple::returnOK
+            [ drop E_FAIL ] ! ISimple::returnError
+            [ x>> ] ! IInherited::getX
+            [ >>x drop ] ! IInherited::setX
+        } }
+        { IUnrelated {
+            [ [ x>> ] [ + ] bi* ] ! IUnrelated::xPlus
+            [ [ x>> ] [ * ] [ + ] tri* ] ! IUnrelated::xMulAdd
+        } }
+    } <com-wrapper>
+    dup +test-wrapper+ set [
+
+        0 <test-implementation> swap com-wrap
+        dup +guinea-pig-implementation+ set [ drop
+
+            S_OK 1array [ +guinea-pig-implementation+ get ISimple::returnOK ] unit-test
+            E_FAIL <long> *long 1array [ +guinea-pig-implementation+ get ISimple::returnError ] unit-test
+            20 1array [
+                +guinea-pig-implementation+ get
+                [ 20 IInherited::setX ]
+                [ IInherited::getX ] bi
+            ] unit-test
+            420 1array [
+                +guinea-pig-implementation+ get
+                IUnrelated-iid com-query-interface
+                [ 20 20 IUnrelated::xMulAdd ] with-com-interface
+            ] unit-test
+            40 1array [
+                +guinea-pig-implementation+ get
+                IUnrelated-iid com-query-interface
+                [ 20 IUnrelated::xPlus ] with-com-interface
+            ] unit-test
+
+            +guinea-pig-implementation+ get 1array [
+                +guinea-pig-implementation+ get com-add-ref
+            ] unit-test
+
+            { } [ +guinea-pig-implementation+ get com-release ] unit-test
+
+            +guinea-pig-implementation+ get 1array [
+                +guinea-pig-implementation+ get IUnknown-iid com-query-interface
+                dup com-release
+            ] unit-test
+            +guinea-pig-implementation+ get 1array [
+                +guinea-pig-implementation+ get ISimple-iid com-query-interface
+                dup com-release
+            ] unit-test                                              
+            void* heap-size +guinea-pig-implementation+ get <displaced-alien>
+            +guinea-pig-implementation+ get                                           
+            2array [
+                +guinea-pig-implementation+ get IUnrelated-iid com-query-interface
+                dup ISimple-iid com-query-interface
+                over com-release dup com-release
+            ] unit-test
+
+        ] with-com-interface
+
+    ] with-disposal
+] with-compilation-unit
 
 ! Ensure that we freed +guinea-pig-implementation
 +orig-wrapped-objects+ get-global 1array [ +wrapped-objects+ get-global ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
index 9628b89..33164f5
@@ -35,7 +35,7 @@ FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ;
 
 : com-query-interface ( interface iid -- interface' )
     [
-        "void*" malloc-object &free
+        void* malloc-object &free
         [ IUnknown::QueryInterface ole32-error ] keep *void*
     ] with-destructors ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 39f5ce1..6969024
@@ -141,11 +141,11 @@ unless
     dup callbacks>> (callbacks>vtbls) >>vtbls
     f >>disposed drop ;
 
-: (init-hook) ( -- )
+: com-startup-hook ( -- )
     +live-wrappers+ get-global [ (allocate-wrapper) ] each
     H{ } +wrapped-objects+ set-global ;
 
-[ (init-hook) ] "windows.com.wrapper" add-init-hook
+[ com-startup-hook ] "windows.com.wrapper" add-startup-hook
 
 PRIVATE>
 
old mode 100755 (executable)
new mode 100644 (file)
index adbf29d..4e97cb0
@@ -831,7 +831,7 @@ M: array array-base-type first ;
     define-guid-constants
     define-format-constants ;
 
-[ define-constants ] "windows.dinput.constants" add-init-hook
+[ define-constants ] "windows.dinput.constants" add-startup-hook
 
 : uninitialize ( variable quot -- )
     '[ _ when* f ] change-global ; inline
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 9e113e8..65a08ce
@@ -37,7 +37,7 @@ MEMO:: (cache-font) ( font -- HFONT )
 
 : cache-font ( font -- HFONT ) strip-font-colors (cache-font) ;
 
-[ \ (cache-font) reset-memoized ] "windows.fonts" add-init-hook
+[ \ (cache-font) reset-memoized ] "windows.fonts" add-startup-hook
 
 : TEXTMETRIC>metrics ( TEXTMETRIC -- metrics )
     [ metrics new 0 >>width ] dip {
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 54d3fe6..80f50ef
@@ -1622,8 +1622,8 @@ FUNCTION: HANDLE OpenProcess ( DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD
 ! FUNCTION: QueryDosDeviceW
 ! FUNCTION: QueryInformationJobObject
 ! FUNCTION: QueryMemoryResourceNotification
-! FUNCTION: QueryPerformanceCounter
-! FUNCTION: QueryPerformanceFrequency
+FUNCTION: BOOL QueryPerformanceCounter ( LARGE_INTEGER* lpPerformanceCount ) ;
+FUNCTION: BOOL QueryPerformanceFrequency ( LARGE_INTEGER* lpFrequency ) ;
 ! FUNCTION: QueryWin31IniFilesMappedToRegistry
 ! FUNCTION: QueueUserAPC
 ! FUNCTION: QueueUserWorkItem
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 1fe3ad065cb881eefd316f1e16f8d0d5443ba889..dfe12aaf3c21e7147e017400933ac2f33e2c4cbe 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2007 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types kernel math windows.errors
-windows.kernel32 namespaces calendar math.bitwise accessors
-classes.struct ;
+windows.kernel32 windows.types namespaces calendar math.bitwise
+accessors classes.struct ;
 IN: windows.time
 
 : >64bit ( lo hi -- n )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 9555927..87540dc
@@ -113,5 +113,5 @@ SYMBOL: cached-script-strings
 : cached-script-string ( font string -- script-string )
     cached-script-strings get-global [ <script-string> ] 2cache ;
 
-[ <cache-assoc> cached-script-strings set-global ]
-"windows.uniscribe" add-init-hook
+[ <cache-assoc> &dispose cached-script-strings set-global ]
+"windows.uniscribe" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 7bd86c8..b8d1f09
@@ -442,4 +442,7 @@ CONSTANT: WSAID_CONNECTEX GUID: {25a207b9-ddf3-4660-8ee9-76e58c74063e}
 : init-winsock ( -- )
     HEX: 0202 <wsadata> WSAStartup winsock-return-check ;
 
-[ init-winsock ] "windows.winsock" add-init-hook
+: shutdown-winsock ( -- ) WSACleanup winsock-return-check ;
+
+[ init-winsock ] "windows.winsock" add-startup-hook
+[ shutdown-winsock ] "windows.winsock" add-shutdown-hook
index 04c0b66063f311d8745b3f0b18823d178817c06d..fd8480307a6626d6610a9e1045d8eb21a9047ffe 100644 (file)
@@ -11,8 +11,8 @@ VALUE: html-entities
 
 : get-html ( -- table )
     { "lat1" "special" "symbol" } [
-        "vocab:xml/entities/html/xhtml-"
-        swap ".ent" 3append read-entities-file
+        "vocab:xml/entities/html/xhtml-" ".ent" surround
+        read-entities-file
     ] map first3 assoc-union assoc-union ;
 
 get-html to: html-entities
index 2f1d73f9ca8087840b2cc3640dc985bbc9c2fabf..6149910a558694dceafe79d33d76227e8bdfb81a 100644 (file)
@@ -1,5 +1,4 @@
-USING: xml xml.data xml.traversal tools.test accessors kernel
-io.encodings.8-bit ;
+USING: xml xml.data xml.traversal tools.test accessors kernel ;
 
 [ "\u000131" ] [ "vocab:xml/tests/latin5.xml" file>xml children>string ] unit-test
 [ "\u0000e9" ] [ "vocab:xml/tests/latin1.xml" file>xml children>string ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index f008a4bd599ace290acf22c8b771c2e12b656b94..91dd150e8f14f0924754fb57ae64e640734bc763 100644 (file)
@@ -63,7 +63,7 @@ ERROR: alien-invoke-error library symbol ;
 ! cleared on startup.
 SYMBOL: callbacks
 
-[ H{ } clone callbacks set-global ] "alien" add-init-hook
+[ H{ } clone callbacks set-global ] "alien" add-startup-hook
 
 <PRIVATE
 
index c1b5a9e159f25c67ab3536cce186d6345e69a24e..c6516d3839bf4f80fb962df72d3b4b91520e12c7 100644 (file)
@@ -1,6 +1,6 @@
-USING: alien.strings alien.c-types alien.data tools.test kernel libc
-io.encodings.8-bit io.encodings.utf8 io.encodings.utf16
-io.encodings.utf16n io.encodings.ascii alien io.encodings.string ;
+USING: alien.strings alien.c-types alien.data tools.test
+kernel libc io.encodings.utf8 io.encodings.utf16 io.encodings.utf16n
+io.encodings.ascii alien io.encodings.string io.encodings.8-bit.latin1 ;
 IN: alien.strings.tests
 
 [ "\u0000ff" ]
index 83758cd8666ab53a047bc5f9784203feb0068e7f..8e09fa8c2c24ea6b9563d37be834d49602c5df7f 100644 (file)
@@ -69,5 +69,4 @@ M: sequence string>symbol [ string>symbol* ] map ;
 [
     8 getenv utf8 alien>string string>cpu \ cpu set-global
     9 getenv utf8 alien>string string>os \ os set-global
-] "alien.strings" add-init-hook
-
+] "alien.strings" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8b6547ce5c42251e9acc1d25df9f432569a533fc..61bff382019b98e00253424911683a2cd764e9b1 100644 (file)
@@ -30,3 +30,5 @@ H{
     { word 12 }
     { dll 13 }
 } type-numbers set
+
+2 header-bits set
index 702590516cb1ade9ebdc8e90c5831cbc65c605b2..3dcd5969c9fa67532b88e4886945e57086909d4d 100644 (file)
@@ -16,7 +16,7 @@ H{ } clone sub-primitives set
 
 "vocab:bootstrap/syntax.factor" parse-file
 
-"vocab:cpu/" architecture get {
+architecture get {
     { "x86.32" "x86/32" }
     { "winnt-x86.64" "x86/64/winnt" }
     { "unix-x86.64" "x86/64/unix" }
@@ -24,7 +24,7 @@ H{ } clone sub-primitives set
     { "macosx-ppc" "ppc/macosx" }
     { "arm" "arm" }
 } ?at [ "Bad architecture: " prepend throw ] unless
-"/bootstrap.factor" 3append parse-file
+"vocab:cpu/" "/bootstrap.factor" surround parse-file
 
 "vocab:bootstrap/layouts/layouts.factor" parse-file
 
@@ -55,6 +55,8 @@ num-types get f <array> builtins set
 
 bootstrapping? on
 
+[
+
 ! Create some empty vocabs where the below primitives and
 ! classes will go
 {
@@ -427,10 +429,11 @@ tuple
     { "set-datastack" "kernel" (( ds -- )) }
     { "set-retainstack" "kernel" (( rs -- )) }
     { "set-callstack" "kernel" (( cs -- )) }
-    { "exit" "system" (( n -- )) }
+    { "(exit)" "system" (( n -- )) }
     { "data-room" "memory" (( -- data-room )) }
     { "code-room" "memory" (( -- code-room )) }
-    { "micros" "system" (( -- us )) }
+    { "system-micros" "system" (( -- us )) }
+    { "nano-count" "system" (( -- ns )) }
     { "modify-code-heap" "compiler.units" (( alist -- )) }
     { "(dlopen)" "alien.libraries" (( path -- dll )) }
     { "(dlsym)" "alien.libraries" (( name dll -- alien )) }
@@ -492,7 +495,7 @@ tuple
     { "<tuple>" "classes.tuple.private" (( layout -- tuple )) }
     { "profiling" "tools.profiler.private" (( ? -- )) }
     { "become" "kernel.private" (( old new -- )) }
-    { "(sleep)" "threads.private" (( us -- )) }
+    { "(sleep)" "threads.private" (( nanos -- )) }
     { "<tuple-boa>" "classes.tuple.private" (( ... layout -- tuple )) }
     { "callstack>array" "kernel" (( callstack -- array )) }
     { "innermost-frame-executing" "kernel.private" (( callstack -- obj )) }
@@ -518,7 +521,11 @@ tuple
     { "<callback>" "alien" (( word -- alien )) }
     { "enable-gc-events" "memory" (( -- )) }
     { "disable-gc-events" "memory" (( -- events )) }
+    { "(identity-hashcode)" "kernel.private" (( obj -- code )) }
+    { "compute-identity-hashcode" "kernel.private" (( obj -- )) }
 } [ [ first3 ] dip swap make-primitive ] each-index
 
 ! Bump build number
 "build" "kernel" create build 1 + [ ] curry (( -- n )) define-declared
+
+] with-compilation-unit
index 1a2cdf6a70318426c44571625abe4aeddd7d6bb7..78658206de42af07531195fa573d21ab40a63634 100644 (file)
@@ -3,7 +3,7 @@
 USING: arrays assocs continuations debugger generic hashtables
 init io io.files kernel kernel.private make math memory
 namespaces parser prettyprint sequences splitting system
-vectors vocabs vocabs.loader words ;
+vectors vocabs vocabs.loader words destructors ;
 QUALIFIED: bootstrap.image.private
 IN: bootstrap.stage1
 
@@ -14,7 +14,8 @@ IN: bootstrap.stage1
 load-help? off
 { "resource:core" } vocab-roots set
 
-! Create a boot quotation for the target
+! Create a boot quotation for the target by collecting all top-level
+! forms into a quotation, surrounded by some boilerplate.
 [
     [
         ! Rehash hashtables first, since bootstrap.image creates
@@ -41,8 +42,8 @@ load-help? off
             "Cannot find " write write "." print
             "Please move " write image write " to the same directory as the Factor sources," print
             "and try again." print
-            1 exit
+            1 (exit)
         ] if
     ] %
 ] [ ] make
-bootstrap.image.private:bootstrap-boot-quot set
+bootstrap.image.private:bootstrap-startup-quot set
index 57be2fb90f25b059dc64babaad361fbaddf52a02..bb159f04df985a28c2826e6623cdf5ac2f5ac7f2 100644 (file)
@@ -1,90 +1,93 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: words words.symbol sequences vocabs kernel ;
+USING: words words.symbol sequences vocabs kernel
+compiler.units ;
 IN: bootstrap.syntax
 
-"syntax" create-vocab drop
+[
+    "syntax" create-vocab drop
 
-{
-    "!"
-    "\""
-    "#!"
-    "("
-    "(("
-    ":"
-    ";"
-    "<PRIVATE"
-    "BIN:"
-    "B{"
-    "BV{"
-    "C:"
-    "CHAR:"
-    "DEFER:"
-    "ERROR:"
-    "FORGET:"
-    "GENERIC#"
-    "GENERIC:"
-    "HEX:"
-    "HOOK:"
-    "H{"
-    "IN:"
-    "INSTANCE:"
-    "M:"
-    "MAIN:"
-    "MATH:"
-    "MIXIN:"
-    "NAN:"
-    "OCT:"
-    "P\""
-    "POSTPONE:"
-    "PREDICATE:"
-    "PRIMITIVE:"
-    "PRIVATE>"
-    "SBUF\""
-    "SINGLETON:"
-    "SINGLETONS:"
-    "SYMBOL:"
-    "SYMBOLS:"
-    "CONSTANT:"
-    "TUPLE:"
-    "SLOT:"
-    "T{"
-    "UNION:"
-    "INTERSECTION:"
-    "USE:"
-    "UNUSE:"
-    "USING:"
-    "QUALIFIED:"
-    "QUALIFIED-WITH:"
-    "FROM:"
-    "EXCLUDE:"
-    "RENAME:"
-    "ALIAS:"
-    "SYNTAX:"
-    "V{"
-    "W{"
-    "["
-    "\\"
-    "M\\"
-    "]"
-    "delimiter"
-    "deprecated"
-    "f"
-    "flushable"
-    "foldable"
-    "inline"
-    "recursive"
-    "t"
-    "{"
-    "}"
-    "CS{"
-    "<<"
-    ">>"
-    "call-next-method"
-    "initial:"
-    "read-only"
-    "call("
-    "execute("
-} [ "syntax" create drop ] each
+    {
+        "!"
+        "\""
+        "#!"
+        "("
+        "(("
+        ":"
+        ";"
+        "<PRIVATE"
+        "BIN:"
+        "B{"
+        "BV{"
+        "C:"
+        "CHAR:"
+        "DEFER:"
+        "ERROR:"
+        "FORGET:"
+        "GENERIC#"
+        "GENERIC:"
+        "HEX:"
+        "HOOK:"
+        "H{"
+        "IN:"
+        "INSTANCE:"
+        "M:"
+        "MAIN:"
+        "MATH:"
+        "MIXIN:"
+        "NAN:"
+        "OCT:"
+        "P\""
+        "POSTPONE:"
+        "PREDICATE:"
+        "PRIMITIVE:"
+        "PRIVATE>"
+        "SBUF\""
+        "SINGLETON:"
+        "SINGLETONS:"
+        "SYMBOL:"
+        "SYMBOLS:"
+        "CONSTANT:"
+        "TUPLE:"
+        "SLOT:"
+        "T{"
+        "UNION:"
+        "INTERSECTION:"
+        "USE:"
+        "UNUSE:"
+        "USING:"
+        "QUALIFIED:"
+        "QUALIFIED-WITH:"
+        "FROM:"
+        "EXCLUDE:"
+        "RENAME:"
+        "ALIAS:"
+        "SYNTAX:"
+        "V{"
+        "W{"
+        "["
+        "\\"
+        "M\\"
+        "]"
+        "delimiter"
+        "deprecated"
+        "f"
+        "flushable"
+        "foldable"
+        "inline"
+        "recursive"
+        "t"
+        "{"
+        "}"
+        "CS{"
+        "<<"
+        ">>"
+        "call-next-method"
+        "initial:"
+        "read-only"
+        "call("
+        "execute("
+    } [ "syntax" create drop ] each
 
-"t" "syntax" lookup define-symbol
+    "t" "syntax" lookup define-symbol
+] with-compilation-unit
index 65e6f856786e7ced5e99e775fcf6c3a21b0403ad..7b931c80e8260326e2eb1bfe6f76d579671d16f7 100644 (file)
@@ -11,12 +11,7 @@ ARTICLE: "class-operations" "Class operations"
     class-and\r
     class-or\r
     classes-intersect?\r
-}\r
-"Low-level implementation detail:"\r
-{ $subsections\r
     flatten-class\r
-    flatten-builtin-class\r
-    class-types\r
 } ;\r
 \r
 ARTICLE: "class-linearization" "Class linearization"\r
@@ -45,18 +40,10 @@ $nl
 "Metaclass order:"\r
 { $subsections rank-class } ;\r
 \r
-HELP: flatten-builtin-class\r
-{ $values { "class" class } { "assoc" "an assoc whose keys are classes" } }\r
-{ $description "Outputs a set of tuple classes whose union is the smallest cover of " { $snippet "class" } " intersected with " { $link tuple } "." } ;\r
-\r
 HELP: flatten-class\r
 { $values { "class" class } { "assoc" "an assoc whose keys are classes" } }\r
 { $description "Outputs a set of builtin and tuple classes whose union is the smallest cover of " { $snippet "class" } "." } ;\r
 \r
-HELP: class-types\r
-{ $values { "class" class } { "seq" "an increasing sequence of integers" } }\r
-{ $description "Outputs a sequence of builtin type numbers whose instances can possibly be instances of the given class." } ;\r
-\r
 HELP: class<=\r
 { $values { "first" "a class" } { "second" "a class" } { "?" "a boolean" } }\r
 { $description "Tests if all instances of " { $snippet "class1" } " are also instances of " { $snippet "class2" } "." }\r
index 72c2dd575cd08684300149a6269f70cde8c8cb6b..c016b0169bf22808088a86abbd700c94c738fa78 100644 (file)
@@ -7,36 +7,42 @@ stack-checker effects kernel.private sbufs math.order
 classes.tuple accessors generic.private ;\r
 IN: classes.algebra.tests\r
 \r
-: class-and* ( cls1 cls2 cls3 -- ? ) [ class-and ] dip class= ;\r
+TUPLE: first-one ;\r
+TUPLE: second-one ;\r
+UNION: both first-one union-class ;\r
 \r
-: class-or* ( cls1 cls2 cls3 -- ? ) [ class-or ] dip class= ;\r
+PREDICATE: no-docs < word "documentation" word-prop not ;\r
 \r
-[ t ] [ object  object  object class-and* ] unit-test\r
-[ t ] [ fixnum  object  fixnum class-and* ] unit-test\r
-[ t ] [ object  fixnum  fixnum class-and* ] unit-test\r
-[ t ] [ fixnum  fixnum  fixnum class-and* ] unit-test\r
-[ t ] [ fixnum  integer fixnum class-and* ] unit-test\r
-[ t ] [ integer fixnum  fixnum class-and* ] unit-test\r
+UNION: no-docs-union no-docs integer ;\r
 \r
-[ t ] [ vector    fixnum   null   class-and* ] unit-test\r
-[ t ] [ number    object   number class-and* ] unit-test\r
-[ t ] [ object    number   number class-and* ] unit-test\r
-[ t ] [ slice     reversed null   class-and* ] unit-test\r
-[ t ] [ \ f class-not \ f      null   class-and* ] unit-test\r
-[ t ] [ \ f class-not \ f      object class-or*  ] unit-test\r
+TUPLE: a ;\r
+TUPLE: b ;\r
+UNION: c a b ;\r
 \r
-TUPLE: first-one ;\r
-TUPLE: second-one ;\r
-UNION: both first-one union-class ;\r
+TUPLE: tuple-example ;\r
 \r
-[ t ] [ both tuple classes-intersect? ] unit-test\r
-[ t ] [ vector virtual-sequence null class-and* ] unit-test\r
-[ f ] [ vector virtual-sequence classes-intersect? ] unit-test\r
+TUPLE: a1 ;\r
+TUPLE: b1 ;\r
+TUPLE: c1 ;\r
 \r
-[ t ] [ number vector class-or sequence classes-intersect? ] unit-test\r
+UNION: x1 a1 b1 ;\r
+UNION: y1 a1 c1 ;\r
+UNION: z1 b1 c1 ;\r
 \r
-[ f ] [ number vector class-and sequence classes-intersect? ] unit-test\r
+SINGLETON: sa\r
+SINGLETON: sb\r
+SINGLETON: sc\r
+\r
+INTERSECTION: empty-intersection ;\r
+\r
+INTERSECTION: generic-class generic class ;\r
 \r
+UNION: union-with-one-member a ;\r
+\r
+MIXIN: mixin-with-one-member\r
+INSTANCE: union-with-one-member mixin-with-one-member\r
+\r
+! class<=\r
 [ t ] [ \ fixnum \ integer class<= ] unit-test\r
 [ t ] [ \ fixnum \ fixnum class<= ] unit-test\r
 [ f ] [ \ integer \ fixnum class<= ] unit-test\r
@@ -50,71 +56,41 @@ UNION: both first-one union-class ;
 [ f ] [ \ reversed \ slice class<= ] unit-test\r
 [ f ] [ \ slice \ reversed class<= ] unit-test\r
 \r
-PREDICATE: no-docs < word "documentation" word-prop not ;\r
-\r
-UNION: no-docs-union no-docs integer ;\r
-\r
 [ t ] [ no-docs no-docs-union class<= ] unit-test\r
 [ f ] [ no-docs-union no-docs class<= ] unit-test\r
 \r
-TUPLE: a ;\r
-TUPLE: b ;\r
-UNION: c a b ;\r
-\r
 [ t ] [ \ c \ tuple class<= ] unit-test\r
 [ f ] [ \ tuple \ c class<= ] unit-test\r
 \r
 [ t ] [ \ tuple-class \ class class<= ] unit-test\r
 [ f ] [ \ class \ tuple-class class<= ] unit-test\r
 \r
-TUPLE: tuple-example ;\r
-\r
 [ t ] [ \ null \ tuple-example class<= ] unit-test\r
 [ f ] [ \ object \ tuple-example class<= ] unit-test\r
 [ f ] [ \ object \ tuple-example class<= ] unit-test\r
 [ t ] [ \ tuple-example \ tuple class<= ] unit-test\r
 [ f ] [ \ tuple \ tuple-example class<= ] unit-test\r
 \r
-TUPLE: a1 ;\r
-TUPLE: b1 ;\r
-TUPLE: c1 ;\r
-\r
-UNION: x1 a1 b1 ;\r
-UNION: y1 a1 c1 ;\r
-UNION: z1 b1 c1 ;\r
-\r
 [ f ] [ z1 x1 y1 class-and class<= ] unit-test\r
 \r
 [ t ] [ x1 y1 class-and a1 class<= ] unit-test\r
 \r
-[ f ] [ y1 z1 class-and x1 classes-intersect? ] unit-test\r
-\r
 [ f ] [ b1 c1 class-or a1 b1 class-or a1 c1 class-and class-and class<= ] unit-test\r
 \r
 [ t ] [ a1 b1 class-or a1 c1 class-or class-and a1 class<= ] unit-test\r
 \r
-[ f ] [ a1 c1 class-or b1 c1 class-or class-and a1 b1 class-or classes-intersect? ] unit-test\r
-\r
-[ t ] [\r
-    growable tuple sequence class-and class<=\r
-] unit-test\r
+[ t ] [ growable tuple sequence class-and class<= ] unit-test\r
 \r
-[ t ] [\r
-    growable assoc class-and tuple class<=\r
-] unit-test\r
+[ t ] [ growable assoc class-and tuple class<= ] unit-test\r
 \r
 [ t ] [ object \ f \ f class-not class-or class<= ] unit-test\r
 \r
 [ t ] [ fixnum class-not integer class-and bignum class= ] unit-test\r
 \r
-[ f ] [ integer integer class-not classes-intersect? ] unit-test\r
-\r
 [ t ] [ array number class-not class<= ] unit-test\r
 \r
 [ f ] [ bignum number class-not class<= ] unit-test\r
 \r
-[ vector ] [ vector class-not class-not ] unit-test\r
-\r
 [ t ] [ fixnum fixnum bignum class-or class<= ] unit-test\r
 \r
 [ f ] [ fixnum class-not integer class-and array class<= ] unit-test\r
@@ -127,12 +103,99 @@ UNION: z1 b1 c1 ;
 \r
 [ t ] [ number class-not integer class-not class<= ] unit-test\r
 \r
-[ t ] [ vector array class-not class-and vector class= ] unit-test\r
+[ f ] [ fixnum class-not integer class<= ] unit-test\r
+\r
+[ t ] [ object empty-intersection class<= ] unit-test\r
+[ t ] [ empty-intersection object class<= ] unit-test\r
+[ t ] [ \ f class-not empty-intersection class<= ] unit-test\r
+[ f ] [ empty-intersection \ f class-not class<= ] unit-test\r
+[ t ] [ \ number empty-intersection class<= ] unit-test\r
+[ t ] [ empty-intersection class-not null class<= ] unit-test\r
+[ t ] [ null empty-intersection class-not class<= ] unit-test\r
+\r
+[ t ] [ \ f class-not \ f class-or empty-intersection class<= ] unit-test\r
+[ t ] [ empty-intersection \ f class-not \ f class-or class<= ] unit-test\r
+\r
+[ t ] [ object \ f class-not \ f class-or class<= ] unit-test\r
+\r
+[ t ] [\r
+    fixnum class-not\r
+    fixnum fixnum class-not class-or\r
+    class<=\r
+] unit-test\r
+\r
+[ t ] [ generic-class generic class<= ] unit-test\r
+[ t ] [ generic-class \ class class<= ] unit-test\r
+\r
+[ t ] [ a union-with-one-member class<= ] unit-test\r
+[ f ] [ union-with-one-member class-not integer class<= ] unit-test\r
+\r
+! class-and\r
+: class-and* ( cls1 cls2 cls3 -- ? ) [ class-and ] dip class= ;\r
+\r
+[ t ] [ object  object  object class-and* ] unit-test\r
+[ t ] [ fixnum  object  fixnum class-and* ] unit-test\r
+[ t ] [ object  fixnum  fixnum class-and* ] unit-test\r
+[ t ] [ fixnum  fixnum  fixnum class-and* ] unit-test\r
+[ t ] [ fixnum  integer fixnum class-and* ] unit-test\r
+[ t ] [ integer fixnum  fixnum class-and* ] unit-test\r
+\r
+[ t ] [ vector    fixnum   null   class-and* ] unit-test\r
+[ t ] [ number    object   number class-and* ] unit-test\r
+[ t ] [ object    number   number class-and* ] unit-test\r
+[ t ] [ slice     reversed null   class-and* ] unit-test\r
+[ t ] [ \ f class-not \ f      null   class-and* ] unit-test\r
+\r
+[ t ] [ vector virtual-sequence null class-and* ] unit-test\r
+\r
+[ t ] [ vector array class-not vector class-and* ] unit-test\r
+\r
+! class-or\r
+: class-or* ( cls1 cls2 cls3 -- ? ) [ class-or ] dip class= ;\r
+\r
+[ t ] [ \ f class-not \ f      object class-or*  ] unit-test\r
+\r
+! class-not\r
+[ vector ] [ vector class-not class-not ] unit-test\r
+\r
+! classes-intersect?\r
+[ t ] [ both tuple classes-intersect? ] unit-test\r
+[ f ] [ vector virtual-sequence classes-intersect? ] unit-test\r
+\r
+[ t ] [ number vector class-or sequence classes-intersect? ] unit-test\r
+\r
+[ f ] [ number vector class-and sequence classes-intersect? ] unit-test\r
+\r
+[ f ] [ y1 z1 class-and x1 classes-intersect? ] unit-test\r
+\r
+[ f ] [ a1 c1 class-or b1 c1 class-or class-and a1 b1 class-or classes-intersect? ] unit-test\r
+\r
+[ f ] [ integer integer class-not classes-intersect? ] unit-test\r
 \r
 [ f ] [ fixnum class-not number class-and array classes-intersect? ] unit-test\r
 \r
-[ f ] [ fixnum class-not integer class<= ] unit-test\r
+[ t ] [ \ word generic-class classes-intersect? ] unit-test\r
+[ f ] [ number generic-class classes-intersect? ] unit-test\r
+\r
+[ f ] [ sa sb classes-intersect? ] unit-test\r
 \r
+[ t ] [ a union-with-one-member classes-intersect? ] unit-test\r
+[ f ] [ fixnum union-with-one-member classes-intersect? ] unit-test\r
+[ t ] [ object union-with-one-member classes-intersect? ] unit-test\r
+\r
+[ t ] [ union-with-one-member a classes-intersect? ] unit-test\r
+[ f ] [ union-with-one-member fixnum classes-intersect? ] unit-test\r
+[ t ] [ union-with-one-member object classes-intersect? ] unit-test\r
+\r
+[ t ] [ a mixin-with-one-member classes-intersect? ] unit-test\r
+[ f ] [ fixnum mixin-with-one-member classes-intersect? ] unit-test\r
+[ t ] [ object mixin-with-one-member classes-intersect? ] unit-test\r
+\r
+[ t ] [ mixin-with-one-member a classes-intersect? ] unit-test\r
+[ f ] [ mixin-with-one-member fixnum classes-intersect? ] unit-test\r
+[ t ] [ mixin-with-one-member object classes-intersect? ] unit-test\r
+\r
+! class=\r
 [ t ] [ null class-not object class= ] unit-test\r
 \r
 [ t ] [ object class-not null class= ] unit-test\r
@@ -141,13 +204,14 @@ UNION: z1 b1 c1 ;
 \r
 [ f ] [ null class-not null class= ] unit-test\r
 \r
-[ t ] [\r
-    fixnum class-not\r
-    fixnum fixnum class-not class-or\r
-    class<=\r
-] unit-test\r
+! class<=>\r
 \r
-! Test method inlining\r
+[ +lt+ ] [ integer sequence class<=> ] unit-test\r
+[ +lt+ ] [ sequence object class<=> ] unit-test\r
+[ +gt+ ] [ object sequence class<=> ] unit-test\r
+[ +eq+ ] [ integer integer class<=> ] unit-test\r
+\r
+! smallest-class etc\r
 [ real ] [ { real sequence } smallest-class ] unit-test\r
 [ real ] [ { sequence real } smallest-class ] unit-test\r
 \r
@@ -266,59 +330,10 @@ TUPLE: xh < xb ;
 \r
 [ t ] [ { xa xb xc xd xe xf xg xh } sort-classes dup sort-classes = ] unit-test\r
 \r
-INTERSECTION: generic-class generic class ;\r
-\r
-[ t ] [ generic-class generic class<= ] unit-test\r
-[ t ] [ generic-class \ class class<= ] unit-test\r
-\r
-! Later\r
-[\r
-    [ t ] [ \ class generic class-and generic-class class<= ] unit-test\r
-    [ t ] [ \ class generic class-and generic-class swap class<= ] unit-test\r
-] drop\r
-\r
-[ t ] [ \ word generic-class classes-intersect? ] unit-test\r
-[ f ] [ number generic-class classes-intersect? ] unit-test\r
-\r
 [ H{ { word word } } ] [ \r
     generic-class flatten-class\r
 ] unit-test\r
 \r
-[ \ + flatten-class ] must-fail\r
-\r
-INTERSECTION: empty-intersection ;\r
-\r
-[ t ] [ object empty-intersection class<= ] unit-test\r
-[ t ] [ empty-intersection object class<= ] unit-test\r
-[ t ] [ \ f class-not empty-intersection class<= ] unit-test\r
-[ f ] [ empty-intersection \ f class-not class<= ] unit-test\r
-[ t ] [ \ number empty-intersection class<= ] unit-test\r
-[ t ] [ empty-intersection class-not null class<= ] unit-test\r
-[ t ] [ null empty-intersection class-not class<= ] unit-test\r
-\r
-[ t ] [ \ f class-not \ f class-or empty-intersection class<= ] unit-test\r
-[ t ] [ empty-intersection \ f class-not \ f class-or class<= ] unit-test\r
-\r
-[ t ] [ object \ f class-not \ f class-or class<= ] unit-test\r
-\r
-[ ] [ object flatten-builtin-class drop ] unit-test\r
-\r
-SINGLETON: sa\r
-SINGLETON: sb\r
-SINGLETON: sc\r
-\r
 [ sa ] [ sa { sa sb sc } min-class ] unit-test\r
 \r
-[ f ] [ sa sb classes-intersect? ] unit-test\r
-\r
-[ +lt+ ] [ integer sequence class<=> ] unit-test\r
-[ +lt+ ] [ sequence object class<=> ] unit-test\r
-[ +gt+ ] [ object sequence class<=> ] unit-test\r
-[ +eq+ ] [ integer integer class<=> ] unit-test\r
-\r
-! Limitations:\r
-\r
-! UNION: u1 sa sb ;\r
-! UNION: u2 sc ;\r
-\r
-! [ f ] [ u1 u2 classes-intersect? ] unit-test\r
+[ \ + flatten-class ] must-fail\r
old mode 100755 (executable)
new mode 100644 (file)
index 06857d3..e98470c
@@ -5,18 +5,44 @@ vectors assocs namespaces words sorting layouts math hashtables
 kernel.private sets math.order ;\r
 IN: classes.algebra\r
 \r
-TUPLE: anonymous-union members ;\r
+<PRIVATE\r
 \r
-C: <anonymous-union> anonymous-union\r
+TUPLE: anonymous-union { members read-only } ;\r
 \r
-TUPLE: anonymous-intersection participants ;\r
+: <anonymous-union> ( members -- class )\r
+    [ null eq? not ] filter prune\r
+    dup length 1 = [ first ] [ anonymous-union boa ] if ;\r
 \r
-C: <anonymous-intersection> anonymous-intersection\r
+TUPLE: anonymous-intersection { participants read-only } ;\r
 \r
-TUPLE: anonymous-complement class ;\r
+: <anonymous-intersection> ( participants -- class )\r
+    prune dup length 1 = [ first ] [ anonymous-intersection boa ] if ;\r
+\r
+TUPLE: anonymous-complement { class read-only } ;\r
 \r
 C: <anonymous-complement> anonymous-complement\r
 \r
+DEFER: (class<=)\r
+\r
+DEFER: (class-not)\r
+\r
+GENERIC: (classes-intersect?) ( first second -- ? )\r
+\r
+DEFER: (class-and)\r
+\r
+DEFER: (class-or)\r
+\r
+GENERIC: (flatten-class) ( class -- )\r
+\r
+: normalize-class ( class -- class' )\r
+    {\r
+        { [ dup members ] [ members <anonymous-union> normalize-class ] }\r
+        { [ dup participants ] [ participants <anonymous-intersection> normalize-class ] }\r
+        [ ]\r
+    } cond ;\r
+\r
+PRIVATE>\r
+\r
 GENERIC: valid-class? ( obj -- ? )\r
 \r
 M: class valid-class? drop t ;\r
@@ -25,40 +51,42 @@ M: anonymous-intersection valid-class? participants>> [ valid-class? ] all? ;
 M: anonymous-complement valid-class? class>> valid-class? ;\r
 M: word valid-class? drop f ;\r
 \r
-DEFER: (class<=)\r
-\r
 : class<= ( first second -- ? )\r
     class<=-cache get [ (class<=) ] 2cache ;\r
 \r
-DEFER: (class-not)\r
-\r
-: class-not ( class -- complement )\r
-    class-not-cache get [ (class-not) ] cache ;\r
-\r
-GENERIC: (classes-intersect?) ( first second -- ? )\r
+: class< ( first second -- ? )\r
+    {\r
+        { [ 2dup class<= not ] [ 2drop f ] }\r
+        { [ 2dup swap class<= not ] [ 2drop t ] }\r
+        [ [ rank-class ] bi@ < ]\r
+    } cond ;\r
 \r
-: normalize-class ( class -- class' )\r
+: class<=> ( first second -- ? )\r
     {\r
-        { [ dup members ] [ members <anonymous-union> ] }\r
-        { [ dup participants ] [ participants <anonymous-intersection> ] }\r
-        [ ]\r
+        { [ 2dup class<= not ] [ 2drop +gt+ ] }\r
+        { [ 2dup swap class<= not ] [ 2drop +lt+ ] }\r
+        [ [ rank-class ] bi@ <=> ]\r
     } cond ;\r
 \r
+: class= ( first second -- ? )\r
+    [ class<= ] [ swap class<= ] 2bi and ;\r
+\r
+: class-not ( class -- complement )\r
+    class-not-cache get [ (class-not) ] cache ;\r
+\r
 : classes-intersect? ( first second -- ? )\r
     classes-intersect-cache get [\r
         normalize-class (classes-intersect?)\r
     ] 2cache ;\r
 \r
-DEFER: (class-and)\r
-\r
 : class-and ( first second -- class )\r
     class-and-cache get [ (class-and) ] 2cache ;\r
 \r
-DEFER: (class-or)\r
-\r
 : class-or ( first second -- class )\r
     class-or-cache get [ (class-or) ] 2cache ;\r
 \r
+<PRIVATE\r
+\r
 : superclass<= ( first second -- ? )\r
     swap superclass dup [ swap class<= ] [ 2drop f ] if ;\r
 \r
@@ -89,6 +117,7 @@ DEFER: (class-or)
             [ class-not normalize-class ] map\r
             <anonymous-union>\r
         ] }\r
+        [ <anonymous-complement> ]\r
     } cond ;\r
 \r
 : left-anonymous-complement<= ( first second -- ? )\r
@@ -108,8 +137,10 @@ PREDICATE: empty-intersection < anonymous-intersection participants>> empty? ;
 \r
 : (class<=) ( first second -- ? )\r
     2dup eq? [ 2drop t ] [\r
+        [ normalize-class ] bi@\r
         2dup superclass<= [ 2drop t ] [\r
-            [ normalize-class ] bi@ {\r
+            {\r
+                { [ 2dup eq? ] [ 2drop t ] }\r
                 { [ dup empty-intersection? ] [ 2drop t ] }\r
                 { [ over empty-union? ] [ 2drop t ] }\r
                 { [ 2dup [ anonymous-complement? ] both? ] [ anonymous-complement<= ] }\r
@@ -185,22 +216,10 @@ M: anonymous-complement (classes-intersect?)
         [ <anonymous-complement> ]\r
     } cond ;\r
 \r
-: class< ( first second -- ? )\r
-    {\r
-        { [ 2dup class<= not ] [ 2drop f ] }\r
-        { [ 2dup swap class<= not ] [ 2drop t ] }\r
-        [ [ rank-class ] bi@ < ]\r
-    } cond ;\r
-\r
-: class<=> ( first second -- ? )\r
-    {\r
-        { [ 2dup class<= not ] [ 2drop +gt+ ] }\r
-        { [ 2dup swap class<= not ] [ 2drop +lt+ ] }\r
-        [ [ rank-class ] bi@ <=> ]\r
-    } cond ;\r
+M: anonymous-union (flatten-class)\r
+    members>> [ (flatten-class) ] each ;\r
 \r
-: class= ( first second -- ? )\r
-    [ class<= ] [ swap class<= ] 2bi and ;\r
+PRIVATE>\r
 \r
 ERROR: topological-sort-failed ;\r
 \r
@@ -211,7 +230,7 @@ ERROR: topological-sort-failed ;
 : sort-classes ( seq -- newseq )\r
     [ name>> ] sort-with >vector\r
     [ dup empty? not ]\r
-    [ dup largest-class [ over remove-nth! drop ] dip ]\r
+    [ dup largest-class [ swap remove-nth! ] dip ]\r
     produce nip ;\r
 \r
 : smallest-class ( classes -- class/f )\r
@@ -220,22 +239,5 @@ ERROR: topological-sort-failed ;
         [ ] [ [ class<= ] most ] map-reduce\r
     ] if-empty ;\r
 \r
-GENERIC: (flatten-class) ( class -- )\r
-\r
-M: anonymous-union (flatten-class)\r
-    members>> [ (flatten-class) ] each ;\r
-\r
 : flatten-class ( class -- assoc )\r
     [ (flatten-class) ] H{ } make-assoc ;\r
-\r
-: flatten-builtin-class ( class -- assoc )\r
-    flatten-class [\r
-        dup tuple class<= [ 2drop tuple tuple ] when\r
-    ] assoc-map ;\r
-\r
-: class-types ( class -- seq )\r
-    flatten-builtin-class keys\r
-    [ "type" word-prop ] map natural-sort ;\r
-\r
-: class-type ( class -- tag/f )\r
-    class-types dup length 1 = [ first ] [ drop f ] if ;\r
old mode 100755 (executable)
new mode 100644 (file)
index 6185e4f24dabc603b13848c39ab0f6a0fb84b17b..028225ec490aada25e0b56d4de2650fcc1c9c2be 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors classes classes.algebra words kernel
-kernel.private namespaces sequences math math.private
-combinators assocs quotations ;
+USING: accessors classes classes.algebra classes.algebra.private
+words kernel kernel.private namespaces sequences math
+math.private combinators assocs quotations ;
 IN: classes.builtin
 
 SYMBOL: builtins
@@ -36,6 +36,6 @@ M: builtin-class (classes-intersect?)
         [ swap classes-intersect? ]
     } cond ;
 
-: full-cover ( -- ) builtins get sift [ (flatten-class) ] each ;
+: full-cover ( -- ) builtins get [ (flatten-class) ] each ;
 
 M: anonymous-complement (flatten-class) drop full-cover ;
index a0481a62a730963f14d6ed06d0d9ba64db29ff0d..36514f3cb2e8aef18bb4055142b400ac6b4ae6a8 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: words accessors sequences kernel assocs combinators classes
-classes.algebra classes.builtin namespaces arrays math quotations ;
+classes.algebra classes.algebra.private classes.builtin
+namespaces arrays math quotations ;
 IN: classes.intersection
 
 PREDICATE: intersection-class < class
index e544c7f8aba361cc10715b5bcf2808e335e01556..eab2746dea985427c49e487e7a1fbbfcae773086 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2004, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: classes classes.algebra kernel namespaces make words
-sequences quotations arrays kernel.private assocs combinators ;
+USING: classes classes.algebra classes.algebra.private kernel
+namespaces make words sequences quotations arrays kernel.private
+assocs combinators ;
 IN: classes.predicate
 
 PREDICATE: predicate-class < class
index 0db49cefa05c8eed35fccc35f6b2954ed7d7137b..e1caf4f46b67270d9e6eb3f3410c3210247312d4 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008, 2009 Doug Coleman, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: classes classes.algebra classes.predicate kernel
-sequences words ;
+USING: classes classes.algebra classes.algebra.private
+classes.predicate kernel sequences words ;
 IN: classes.singleton
 
 : singleton-predicate-quot ( class -- quot ) [ eq? ] curry ;
index 355514754295321047b8dfd8655c5e04b8949f61..eb033edfe41f14957dde2995343b0d7e191d5cbe 100644 (file)
@@ -6,7 +6,7 @@ io.streams.string kernel kernel.private math math.constants
 math.order namespaces parser parser.notes prettyprint
 quotations random see sequences sequences.private slots
 slots.private splitting strings summary threads tools.test
-vectors vocabs words words.symbol ;
+vectors vocabs words words.symbol fry ;
 IN: classes.tuple.tests
 
 TUPLE: rect x y w h ;
@@ -734,3 +734,11 @@ ERROR: base-error x y ;
 ERROR: derived-error < base-error z ;
 
 [ (( x y z -- * )) ] [ \ derived-error stack-effect ] unit-test
+
+USE: classes.struct
+
+[ { } ] [
+    classes
+    [ "prototype" word-prop ] map
+    [ '[ _ hashcode drop f ] [ drop t ] recover ] filter
+] unit-test
old mode 100755 (executable)
new mode 100644 (file)
index 3e449e6..d5c8b4d
@@ -3,8 +3,9 @@
 USING: arrays definitions hashtables kernel kernel.private math
 namespaces make sequences sequences.private strings vectors
 words quotations memory combinators generic classes
-classes.algebra classes.builtin classes.private slots.private
-slots math.private accessors assocs effects ;
+classes.algebra classes.algebra.private classes.builtin
+classes.private slots.private slots math.private accessors
+assocs effects ;
 IN: classes.tuple
 
 PREDICATE: tuple-class < class
old mode 100755 (executable)
new mode 100644 (file)
index e0e86e4..4615d31
@@ -1,7 +1,8 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: words sequences kernel assocs combinators classes
-classes.algebra namespaces arrays math quotations ;
+classes.algebra classes.algebra.private namespaces arrays math
+quotations ;
 IN: classes.union
 
 PREDICATE: union-class < class
old mode 100755 (executable)
new mode 100644 (file)
index 2e9440a..f8a23e1
@@ -58,7 +58,7 @@ $nl
 "A generalization of the above combinators to any number of quotations can be found in " { $link "combinators" } "." ;
 
 ARTICLE: "apply-combinators" "Apply combinators"
-"The apply combinators apply a single quotation to multiple values. The asterisk (" { $snippet "*" } ") suffixed to these words' names signifies that they are apply combinators."
+"The apply combinators apply a single quotation to multiple values. The asterisk (" { $snippet "@" } ") suffixed to these words' names signifies that they are apply combinators."
 $nl
 "Two quotations:"
 { $subsections bi@ 2bi@ }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8dce12f4114b5042df7ec93aa059cc3de0b0b5fb..eccc292f26b94155a9b89b87d9b31ce7efa5b2fe 100644 (file)
@@ -5,16 +5,9 @@ IN: compiler.units.tests
 [ [ [ ] define-temp ] with-compilation-unit ] must-infer
 [ [ [ ] define-temp ] with-nested-compilation-unit ] must-infer
 
-[ flushed-dependency ] [ f flushed-dependency strongest-dependency ] unit-test
-[ flushed-dependency ] [ flushed-dependency f strongest-dependency ] unit-test
-[ inlined-dependency ] [ flushed-dependency inlined-dependency strongest-dependency ] unit-test
-[ inlined-dependency ] [ called-dependency inlined-dependency strongest-dependency ] unit-test
-[ flushed-dependency ] [ called-dependency flushed-dependency strongest-dependency ] unit-test
-[ called-dependency ] [ called-dependency f strongest-dependency ] unit-test
-
 ! Non-optimizing compiler bugs
 [ 1 1 ] [
-    "A" "B" <word> [ [ [ 1 ] dip ] 2array 1array modify-code-heap ] keep
+    "A" <uninterned-word> [ [ [ 1 ] dip ] 2array 1array modify-code-heap ] keep
     1 swap execute
 ] unit-test
 
index 8b6625d01457b4fcbf2345914361503f7ca4735a..bc372d8d90c9df66b873e7b4a5d7e3217dfa6dec 100644 (file)
@@ -3,7 +3,8 @@
 USING: accessors arrays kernel continuations assocs namespaces
 sequences words vocabs definitions hashtables init sets
 math math.order classes classes.algebra classes.tuple
-classes.tuple.private generic source-files.errors ;
+classes.tuple.private generic source-files.errors
+kernel.private ;
 IN: compiler.units
 
 SYMBOL: old-definitions
@@ -15,12 +16,16 @@ TUPLE: redefine-error def ;
     \ redefine-error boa
     { { "Continue" t } } throw-restarts drop ;
 
+<PRIVATE
+
 : add-once ( key assoc -- )
     2dup key? [ over redefine-error ] when conjoin ;
 
 : (remember-definition) ( definition loc assoc -- )
     [ over set-where ] dip add-once ;
 
+PRIVATE>
+
 : remember-definition ( definition loc -- )
     new-definitions get first (remember-definition) ;
 
@@ -40,8 +45,21 @@ SYMBOL: compiler-impl
 
 HOOK: recompile compiler-impl ( words -- alist )
 
+HOOK: to-recompile compiler-impl ( -- words )
+
+HOOK: process-forgotten-words compiler-impl ( words -- )
+
+: compile ( words -- ) recompile modify-code-heap ;
+
 ! Non-optimizing compiler
-M: f recompile [ dup def>> ] { } map>assoc ;
+M: f recompile
+    [ dup def>> ] { } map>assoc ;
+
+M: f to-recompile
+    changed-definitions get [ drop word? ] assoc-filter
+    changed-generics get assoc-union keys ;
+
+M: f process-forgotten-words drop ;
 
 : without-optimizer ( quot -- )
     [ f compiler-impl ] dip with-variable ; inline
@@ -50,8 +68,12 @@ M: f recompile [ dup def>> ] { } map>assoc ;
 ! during stage1 bootstrap, it would just waste time.
 SINGLETON: dummy-compiler
 
+M: dummy-compiler to-recompile f ;
+
 M: dummy-compiler recompile drop { } ;
 
+M: dummy-compiler process-forgotten-words drop ;
+
 : <definitions> ( -- pair ) { H{ } H{ } } [ clone ] map ;
 
 SYMBOL: definition-observers
@@ -59,11 +81,11 @@ SYMBOL: definition-observers
 GENERIC: definitions-changed ( assoc obj -- )
 
 [ V{ } clone definition-observers set-global ]
-"compiler.units" add-init-hook
+"compiler.units" add-startup-hook
 
 ! This goes here because vocabs cannot depend on init
 [ V{ } clone vocab-observers set-global ]
-"vocabs" add-init-hook
+"vocabs" add-startup-hook
 
 : add-definition-observer ( obj -- )
     definition-observers get push ;
@@ -75,6 +97,17 @@ GENERIC: definitions-changed ( assoc obj -- )
     definition-observers get
     [ definitions-changed ] with each ;
 
+! Incremented each time stack effects potentially changed, used
+! by compiler.tree.propagation.call-effect for call( and execute(
+! inline caching
+: effect-counter ( -- n ) 46 getenv ; inline
+
+GENERIC: bump-effect-counter* ( defspec -- ? )
+
+M: object bump-effect-counter* drop f ;
+
+<PRIVATE
+
 : changed-vocabs ( assoc -- vocabs )
     [ drop word? ] assoc-filter
     [ drop vocabulary>> dup [ vocab ] when dup ] assoc-map ;
@@ -87,72 +120,34 @@ GENERIC: definitions-changed ( assoc obj -- )
     dup changed-definitions get update
     dup dup changed-vocabs update ;
 
-: compile ( words -- ) recompile modify-code-heap ;
-
-: index>= ( obj1 obj2 seq -- ? )
-    [ index ] curry bi@ >= ;
-
-: dependency>= ( how1 how2 -- ? )
-    { called-dependency flushed-dependency inlined-dependency }
-    index>= ;
-
-: strongest-dependency ( how1 how2 -- how )
-    [ called-dependency or ] bi@ [ dependency>= ] most ;
-
-: weakest-dependency ( how1 how2 -- how )
-    [ inlined-dependency or ] bi@ [ dependency>= not ] most ;
-
-: compiled-usage ( word -- assoc )
-    compiled-crossref get at ;
-
-: (compiled-usages) ( word -- assoc )
-    #! If the word is not flushable anymore, we have to recompile
-    #! all words which flushable away a call (presumably when the
-    #! word was still flushable). If the word is flushable, we
-    #! don't have to recompile words that folded this away.
-    [ compiled-usage ]
-    [ "flushable" word-prop inlined-dependency flushed-dependency ? ] bi
-    [ dependency>= nip ] curry assoc-filter ;
-
-: compiled-usages ( assoc -- assocs )
-    [ drop word? ] assoc-filter
-    [ [ drop (compiled-usages) ] { } assoc>map ] keep suffix ;
-
-: compiled-generic-usage ( word -- assoc )
-    compiled-generic-crossref get at ;
-
-: (compiled-generic-usages) ( generic class -- assoc )
-    [ compiled-generic-usage ] dip
-    [
-        2dup [ valid-class? ] both?
-        [ classes-intersect? ] [ 2drop f ] if nip
-    ] curry assoc-filter ;
-
-: compiled-generic-usages ( assoc -- assocs )
-    [ (compiled-generic-usages) ] { } assoc>map ;
-
-: words-only ( assoc -- assoc' )
-    [ drop word? ] assoc-filter ;
-
-: to-recompile ( -- seq )
-    changed-definitions get compiled-usages
-    changed-generics get compiled-generic-usages
-    append assoc-combine keys ;
-
 : process-forgotten-definitions ( -- )
     forgotten-definitions get keys
-    [ [ word? ] filter [ delete-compiled-xref ] each ]
+    [ [ word? ] filter process-forgotten-words ]
     [ [ delete-definition-errors ] each ]
     bi ;
 
+: bump-effect-counter? ( -- ? )
+    changed-effects get new-words get assoc-diff assoc-empty? not
+    changed-definitions get [ drop bump-effect-counter* ] assoc-any?
+    or ;
+
+: bump-effect-counter ( -- )
+    bump-effect-counter? [ 46 getenv 0 or 1 + 46 setenv ] when ;
+
+: notify-observers ( -- )
+    updated-definitions dup assoc-empty?
+    [ drop ] [ notify-definition-observers notify-error-observers ] if ;
+
 : finish-compilation-unit ( -- )
     remake-generics
     to-recompile recompile
     update-tuples
     process-forgotten-definitions
     modify-code-heap
-    updated-definitions dup assoc-empty?
-    [ drop ] [ notify-definition-observers notify-error-observers ] if ;
+    bump-effect-counter
+    notify-observers ;
+
+PRIVATE>
 
 : with-nested-compilation-unit ( quot -- )
     [
@@ -161,6 +156,7 @@ GENERIC: definitions-changed ( assoc obj -- )
         H{ } clone changed-effects set
         H{ } clone outdated-generics set
         H{ } clone outdated-tuples set
+        H{ } clone new-words set
         H{ } clone new-classes set
         [ finish-compilation-unit ] [ ] cleanup
     ] with-scope ; inline
@@ -173,6 +169,7 @@ GENERIC: definitions-changed ( assoc obj -- )
         H{ } clone outdated-generics set
         H{ } clone forgotten-definitions set
         H{ } clone outdated-tuples set
+        H{ } clone new-words set
         H{ } clone new-classes set
         <definitions> new-definitions set
         <definitions> old-definitions set
index f40769ae395ecd4a34becc9d986792dcd1ec207b..0d207d9cc670dea1c1313c0a3c99a5f730e49f7e 100644 (file)
@@ -20,7 +20,7 @@ $nl
 { $see-also "see" } ;
 
 ARTICLE: "definition-checking" "Definition sanity checking"
-"When a source file is reloaded, the parser compares the previous list of definitions with the current list; any definitions which are no longer present in the file are removed by a call to " { $link forget } ". A warning message is printed if any other definitions still depend on the removed definitions."
+"When a source file is reloaded, the parser compares the previous list of definitions with the current list; any definitions which are no longer present in the file are removed by a call to " { $link forget } "."
 $nl
 "The parser also catches forward references when reloading source files. This is best illustrated with an example. Suppose we load a source file " { $snippet "a.factor" } ":"
 { $code
index e2fb4b8161395867af8767dbb9f274e15e5aeb5e..597b195c36036475e6f8f52e43536b7eeda504c7 100644 (file)
@@ -7,15 +7,13 @@ MIXIN: definition
 
 ERROR: no-compilation-unit definition ;
 
-SYMBOLS: inlined-dependency flushed-dependency called-dependency ;
-
 : set-in-unit ( value key assoc -- )
     [ set-at ] [ no-compilation-unit ] if* ;
 
 SYMBOL: changed-definitions
 
 : changed-definition ( defspec -- )
-    inlined-dependency swap changed-definitions get set-in-unit ;
+    dup changed-definitions get set-in-unit ;
 
 SYMBOL: changed-effects
 
@@ -23,8 +21,16 @@ SYMBOL: changed-generics
 
 SYMBOL: outdated-generics
 
+SYMBOL: new-words
+
 SYMBOL: new-classes
 
+: new-word ( word -- )
+    dup new-words get set-in-unit ;
+
+: new-word? ( word -- ? )
+    new-words get key? ;
+
 : new-class ( word -- )
     dup new-classes get set-in-unit ;
 
index 3e57f498af6698f28ecd111d60388eafc0982cd9..ac3751e32ed8bf40fc96656de69ab7b935f5e701 100644 (file)
@@ -6,8 +6,6 @@ IN: destructors
 
 SYMBOL: disposables
 
-[ H{ } clone disposables set-global ] "destructors" add-init-hook
-
 ERROR: already-unregistered disposable ;
 
 SYMBOL: debug-leaks?
@@ -26,15 +24,11 @@ SLOT: continuation
 PRIVATE>
 
 TUPLE: disposable < identity-tuple
-{ id integer }
 { disposed boolean }
 continuation ;
 
-M: disposable hashcode* nip id>> ;
-
 : new-disposable ( class -- disposable )
-    new \ disposable counter >>id
-    dup register-disposable ; inline
+    new dup register-disposable ; inline
 
 GENERIC: dispose* ( disposable -- )
 
@@ -91,3 +85,14 @@ PRIVATE>
         [ do-error-destructors ]
         cleanup
     ] with-scope ; inline
+
+[
+    H{ } clone disposables set-global
+    V{ } clone always-destructors set-global
+    V{ } clone error-destructors set-global
+] "destructors" add-startup-hook
+
+[
+    do-always-destructors
+    do-error-destructors
+] "destructors" add-shutdown-hook
index d57fbd97074bf1e54548e17b975aac67a619235a..a77ea34c30c8d9230e5ca8de30b881499cff9168 100644 (file)
@@ -25,7 +25,7 @@ ERROR: bad-effect ;
 : parse-effect-tokens ( end -- tokens )
     [ parse-effect-token dup ] curry [ ] produce nip ;
 
-ERROR: stack-effect-omits-dashes effect ;
+ERROR: stack-effect-omits-dashes tokens ;
 
 : parse-effect ( end -- effect )
     parse-effect-tokens { "--" } split1 dup
old mode 100755 (executable)
new mode 100644 (file)
index f5c2018..5a98173
@@ -3,7 +3,8 @@ classes.tuple classes.union compiler.units continuations
 definitions eval generic generic.math generic.standard
 hashtables io io.streams.string kernel layouts math math.order
 namespaces parser prettyprint quotations sequences sorting
-strings tools.test vectors words generic.single ;
+strings tools.test vectors words generic.single
+compiler.crossref ;
 IN: generic.tests
 
 GENERIC: foobar ( x -- y )
old mode 100755 (executable)
new mode 100644 (file)
index 37d6de0..f239458
@@ -46,7 +46,8 @@ $nl
 $nl
 "In certain advanced applications, this cannot be avoided and the best design involves mutating hashtable keys. In this case, a custom " { $link hashcode* } " method must be defined which only depends on immutable slots."
 $nl
-"In addition, the " { $link equal? } " and " { $link hashcode* } " methods must be congruent, and if one is defined the other should be defined also. This is documented in detail in the documentation for these respective words." ;
+"In addition, the " { $link equal? } " and " { $link hashcode* } " methods must be congruent, and if one is defined the other should be defined also. This is documented in detail in the documentation for these respective words."
+{ $subsections hashcode hashcode* identity-hashcode } ;
 
 ARTICLE: "hashtables.utilities" "Hashtable utilities"
 "Utility words to create a new hashtable from a single key/value pair:"
index 9faf587b51114d8e3c9dc6529a0f45875b1c62b7..e31ed925d15e55672974c115833368181f52c73f 100644 (file)
@@ -115,9 +115,7 @@ M: hashtable assoc-size ( hash -- n )
     [ count>> ] [ deleted>> ] bi - ; inline
 
 : rehash ( hash -- )
-    dup >alist [
-    dup clear-assoc
-    ] dip (rehash) ;
+    dup >alist [ dup clear-assoc ] dip (rehash) ;
 
 M: hashtable set-at ( value key hash -- )
     dup ?grow-hash
index e76b6e8fee053d8e7a3ceb2f9570ed64716c7988..0382c38dffb420ee114f50b4d3007148366a5b80 100644 (file)
@@ -4,40 +4,50 @@ IN: init
 HELP: boot
 { $description "Called on startup as part of the boot quotation  to initialize the runtime and prepare it for running user code." } ;
 
-{ boot boot-quot set-boot-quot } related-words
+{ boot startup-quot set-startup-quot } related-words
 
-HELP: boot-quot
+HELP: startup-quot
 { $values { "quot" quotation } }
 { $description "Outputs the initial quotation called by the VM on startup." } ;
 
-HELP: set-boot-quot
+HELP: set-startup-quot
 { $values { "quot" quotation } }
 { $description "Sets the initial quotation called by the VM on startup. This quotation must begin with a call to " { $link boot } ". The image must be saved for changes to the boot quotation to take effect." }
 { $notes "The " { $link "tools.deploy" } " tool uses this word." } ;
 
-HELP: init-hooks
+HELP: startup-hooks
 { $var-description "An association list mapping string identifiers to quotations to be run on startup." } ;
 
-HELP: do-init-hooks
+HELP: shutdown-hooks
+{ $var-description "An association list mapping string identifiers to quotations to be run on shutdown." } ;
+
+HELP: do-startup-hooks
 { $description "Calls all initialization hook quotations." } ;
 
-HELP: add-init-hook
+HELP: do-shutdown-hooks
+{ $description "Calls all shutdown hook quotations." } ;
+
+HELP: add-startup-hook
 { $values { "quot" quotation } { "name" string } }
 { $description "Registers a startup hook. The hook will always run when Factor is started. If the hook was not already defined, this word also calls it immediately." } ;
 
-{ init-hooks do-init-hooks add-init-hook } related-words
+{ startup-hooks do-startup-hooks add-startup-hook add-shutdown-hook do-shutdown-hooks shutdown-hooks } related-words
 
 ARTICLE: "init" "Initialization and startup"
 "When Factor starts, the first thing it does is call a word:"
 { $subsections boot }
 "Next, initialization hooks are called:"
-{ $subsections do-init-hooks }
+{ $subsections do-startup-hooks }
 "Initialization hooks can be defined:"
-{ $subsections add-init-hook }
+{ $subsections add-startup-hook }
+"Corresponding shutdown hooks may also be defined:"
+{ $subsections add-shutdown-hook }
 "The boot quotation can be changed:"
 { $subsections
-    boot-quot
-    set-boot-quot
-} ;
+    startup-quot
+    set-startup-quot
+}
+"When quitting Factor, shutdown hooks are called:"
+{ $subsection do-shutdown-hooks } ;
 
 ABOUT: "init"
index 5d8e88b85f5b2ee4a78109e618f868d8773cf913..40e5806fd594cdf9ccdfce2d60d17156e6cc887c 100644 (file)
@@ -4,19 +4,35 @@ USING: continuations continuations.private kernel
 kernel.private sequences assocs namespaces namespaces.private ;
 IN: init
 
-SYMBOL: init-hooks
+SYMBOL: startup-hooks
+SYMBOL: shutdown-hooks
 
-init-hooks global [ drop V{ } clone ] cache drop
+startup-hooks global [ drop V{ } clone ] cache drop
+shutdown-hooks global [ drop V{ } clone ] cache drop
 
-: do-init-hooks ( -- )
-    init-hooks get [ nip call( -- ) ] assoc-each ;
+: do-hooks ( symbol -- )
+    get [ nip call( -- ) ] assoc-each ;
 
-: add-init-hook ( quot name -- )
-    dup init-hooks get at [ over call( -- ) ] unless
-    init-hooks get set-at ;
+: do-startup-hooks ( -- ) startup-hooks do-hooks ;
+
+: do-shutdown-hooks ( -- ) shutdown-hooks do-hooks ;
+
+: add-startup-hook ( quot name -- )
+    startup-hooks get
+    [ at [ drop ] [ call( -- ) ] if ]
+    [ set-at ] 3bi ;
+
+: add-shutdown-hook ( quot name -- )
+    shutdown-hooks get set-at ;
 
 : boot ( -- ) init-namespaces init-catchstack init-error-handler ;
 
-: boot-quot ( -- quot ) 20 getenv ;
+: startup-quot ( -- quot ) 20 getenv ;
+
+: set-startup-quot ( quot -- ) 20 setenv ;
+
+: shutdown-quot ( -- quot ) 22 getenv ;
+
+: set-shutdown-quot ( quot -- ) 22 setenv ;
 
-: set-boot-quot ( quot -- ) 20 setenv ;
+[ do-shutdown-hooks ] set-shutdown-quot
index 494ccbff22853c73eb35ef983894ddf5ee846135..ee50500754cb329f7b4c75c3229ef32f20b03c56 100644 (file)
@@ -29,9 +29,9 @@ M: object normalize-directory normalize-path ;
 
 : set-io-backend ( io-backend -- )
     io-backend set-global init-io init-stdio
-    "io.files" init-hooks get at call( -- ) ;
+    "io.files" startup-hooks get at call( -- ) ;
 
 ! Note that we have 'alien' in our using list so that the alien
 ! init hook runs before this one.
 [ init-io embedded? [ init-stdio ] unless ]
-"io.backend" add-init-hook
+"io.backend" add-startup-hook
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 6387e47dfc3bb97d4db856a2ceceb07a6110be6e..23d974254de1255bb82d8f6cc0a38e6b83e0a2c6 100644 (file)
@@ -1,7 +1,8 @@
 USING: arrays debugger.threads destructors io io.directories
-io.encodings.8-bit io.encodings.ascii io.encodings.binary
+io.encodings.ascii io.encodings.binary
 io.files io.files.private io.files.temp io.files.unique kernel
-make math sequences system threads tools.test generic.single ;
+make math sequences system threads tools.test generic.single
+io.encodings.8-bit.latin1 ;
 IN: io.files.tests
 
 [ ] [ "append-test" temp-file dup exists? [ delete-file ] [ drop ] if ] unit-test
@@ -158,4 +159,4 @@ USE: debugger.threads
 [ ] [
     "closing-twice" unique-file ascii <file-writer>
     [ dispose ] [ dispose ] bi
-] unit-test
\ No newline at end of file
+] unit-test
index 6779c6d09429bc14bc4d055354a2ed709e59bf22..9824fba18cdcb49c3cd1a903f12aaa44b3b38959 100644 (file)
@@ -60,4 +60,4 @@ PRIVATE>
     13 getenv alien>native-string cwd prepend-path \ image set-global
     14 getenv alien>native-string cwd prepend-path \ vm set-global
     image parent-directory "resource-path" set-global
-] "io.files" add-init-hook
+] "io.files" add-startup-hook
index d722c71747f227cc2f3eb5b0f0b5a8c86d6fc3a7..8dacef6f8c5699f0277281a0312da233f104761b 100644 (file)
@@ -1,5 +1,5 @@
-USING: help.markup help.syntax io.backend io.files io.directories strings
-sequences io.pathnames.private ;
+USING: help.markup help.syntax io.backend io.files
+io.directories strings system sequences io.pathnames.private ;
 IN: io.pathnames
 
 HELP: path-separator?
@@ -90,7 +90,7 @@ HELP: pathname
 
 HELP: normalize-path
 { $values { "path" "a pathname string" } { "path'" "a new pathname string" } }
-{ $description "Prepends the " { $link current-directory } " to the pathname, resolves a " { $snippet "resource:" } " or " { $snippet "voacb:" } " prefix, if present, and performs any platform-specific pathname normalization." }
+{ $description "Prepends the " { $link current-directory } " to the pathname, resolves a " { $snippet "resource:" } " or " { $snippet "vocab:" } " prefix, if present (see " { $link "io.pathnames.special" } "). Also converts the path into a UNC path on Windows." }
 { $notes "High-level words, such as " { $link <file-reader> } " and " { $link delete-file } " call this word for you. It only needs to be called directly when passing pathnames to C functions or external processes. This is because Factor does not use the operating system's notion of a current directory, and instead maintains its own dynamically-scoped " { $link current-directory } " variable." }
 { $notes "On Windows NT platforms, this word does prepends the Unicode path prefix." }
 { $examples
@@ -106,7 +106,7 @@ HELP: absolute-path
     { "path" "a pathname string" }
     { "path'" "a pathname string" }
 }
-{ $description "Prepends the " { $link current-directory } " to the pathname and resolves a " { $snippet "resource:" } " prefix, if present." }
+{ $description "Prepends the " { $link current-directory } " to the pathname and resolves a " { $snippet "resource:" } " or " { $snippet "voacb:" } " prefix, if present (see " { $link "io.pathnames.special" } ")." }
 { $notes "This word is exaclty the same as " { $link normalize-path } ", except on Windows NT platforms, where it does not prepend the Unicode path prefix. Most code should call " { $link normalize-path } " instead." } ;
 
 HELP: resolve-symlinks
@@ -128,8 +128,24 @@ HELP: home
     }
 } ;
 
+ARTICLE: "io.pathnames.special" "Special pathnames"
+"If a pathname begins with " { $snippet "resource:" } ", it is resolved relative to the directory containing the current image (see " { $link image } ")."
+$nl
+"If a pathname begins with " { $snippet "vocab:" } ", then it will be searched for in all current vocabulary roots (see " { $link "add-vocab-roots" } ")." ;
+
+ARTICLE: "io.pathnames.presentations" "Pathname presentations"
+"Pathname presentations are objects that wrap a pathname string. Clicking a pathname presentation in the UI brings up the file in one of the supported editors. See " { $link "editor" } " for more details."
+{ $subsections
+    pathname
+    <pathname>
+}
+"Literal pathname presentations:"
+{ $subsections POSTPONE: P" }
+"Many words that accept pathname strings can also work on pathname presentations." ;
+    
 ARTICLE: "io.pathnames" "Pathnames"
-"Pathnames are objects that contain a string representing the path to a file on disk. Pathnames are cross-platform; Windows accepts both forward and backward slashes as directory separators and new separators are added as a forward slash on all platforms. Clicking a pathname object in the UI brings up the file in one of the supported editors, but otherwise, pathnames and strings are interchangeable. See " { $link "editor" } " for more details." $nl
+"Pathnames are strings that refer to a file on disk. Pathname semantics are platform-specific, and Factor makes no attempt to abstract away the differences. Note that on Windows, both forward and backward slashes are accepted as directory separators."
+$nl
 "Pathname introspection:"
 { $subsections
     parent-directory
@@ -143,18 +159,9 @@ ARTICLE: "io.pathnames" "Pathnames"
     prepend-path
     append-path
 }
-"Pathname presentations:"
-{ $subsections
-    pathname
-    <pathname>
-}
-"Literal pathnames:"
-{ $subsections POSTPONE: P" }
-"Normalizing pathnames for use with native APIs:"
-{ $subsections normalize-path }
-"Outputting an absolute path from a path:"
-{ $subsection absolute-path }
-"Removing symlinks from a path:"
-{ $subsections resolve-symlinks } ;
+"Normalizing pathnames:"
+{ $subsections normalize-path absolute-path resolve-symlinks }
+"Additional topics:"
+{ $subsections "io.pathnames.presentations" "io.pathnames.special" } ;
 
 ABOUT: "io.pathnames"
index 25eefd1105bef391bcefa27cfb1df829d37a1732..b307128efb2287bbd60d9a36ffa7866aac42ab9b 100644 (file)
@@ -102,8 +102,8 @@ PRIVATE>
             [ 2 head ] dip append
         ] }
         [
-            [ trim-tail-separators "/" ] dip
-            trim-head-separators 3append
+            [ trim-tail-separators ]
+            [ trim-head-separators ] bi* "/" glue
         ]
     } cond ;
 
old mode 100755 (executable)
new mode 100644 (file)
index 9a4fd4495ac1c07780227ba2769528f3fc544cb6..0e8c3368ff55a34b047adcae73c3a150f9af1b3b 100644 (file)
@@ -72,7 +72,11 @@ HELP: hashcode
 { $values { "obj" object } { "code" fixnum } }
 { $description "Computes the hashcode of an object with a default hashing depth. See " { $link hashcode* } " for the hashcode contract." } ;
 
-{ hashcode hashcode* } related-words
+HELP: identity-hashcode
+{ $values { "obj" object } { "code" fixnum } }
+{ $description "Outputs the identity hashcode of an object. The identity hashcode is not guaranteed to be unique, however it will not change during the object's lifetime." } ;
+
+{ hashcode hashcode* identity-hashcode } related-words
 
 HELP: =
 { $values { "obj1" object } { "obj2" object } { "?" "a boolean" } }
index 726fa1f5bb95a4d42133e938a27c7035a6ad6528..ded2ee970294496376f419b42a1963ab2c716426 100644 (file)
@@ -169,3 +169,7 @@ IN: kernel.tests
 [ 3 -1 5/6 ] [ 1 2 3 4 5 6 [ + ] [ - ] [ / ] 2tri* ] unit-test
 
 [ { 1 2 } { 3 4 } { 5 6 } ] [ 1 2 3 4 5 6 [ 2array ] 2tri@ ] unit-test
+
+[ t ] [ { } identity-hashcode fixnum? ] unit-test
+[ 123 ] [ 123 identity-hashcode ] unit-test
+[ t ] [ f identity-hashcode fixnum? ] unit-test
index bb27f7e57e499983f0f8dbb971a6ed3033a1da96..69d082ed2f954f32fa9076059a520093af440c30 100644 (file)
@@ -192,6 +192,16 @@ M: f hashcode* 2drop 31337 ; inline
 
 : hashcode ( obj -- code ) 3 swap hashcode* ; inline
 
+: identity-hashcode ( obj -- code )
+    dup tag 0 eq? [
+        dup tag 1 eq? [ drop 0 ] [
+            dup (identity-hashcode) dup 0 eq? [
+                drop dup compute-identity-hashcode
+                (identity-hashcode)
+            ] [ nip ] if
+        ] if
+    ] unless ; inline
+
 GENERIC: equal? ( obj1 obj2 -- ? )
 
 M: object equal? 2drop f ; inline
@@ -200,6 +210,8 @@ TUPLE: identity-tuple ;
 
 M: identity-tuple equal? 2drop f ; inline
 
+M: identity-tuple hashcode* nip identity-hashcode ; inline
+
 : = ( obj1 obj2 -- ? )
     2dup eq? [ 2drop t ] [
         2dup both-fixnums? [ 2drop f ] [ equal? ] if
index 7518dbf0cb13e5890e5110c9373f38eaeb0563c6..05fe03315cc0ea603c396d384c38ed458d4555a7 100644 (file)
@@ -16,15 +16,23 @@ SYMBOL: type-numbers
 
 SYMBOL: mega-cache-size
 
+SYMBOL: header-bits
+
 : type-number ( class -- n )
     type-numbers get at ;
 
 : tag-fixnum ( n -- tagged )
     tag-bits get shift ;
 
+: tag-header ( n -- tagged )
+    header-bits get shift ;
+
 : untag-fixnum ( n -- tagged )
     tag-bits get neg shift ;
 
+: hashcode-shift ( -- n )
+    tag-bits get header-bits get + ;
+
 ! We do this in its own compilation unit so that they can be
 ! folded below
 <<
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8ecf673..45e6090
@@ -31,4 +31,4 @@ TUPLE: testing x y z ;
 2 [ [ [ 3 throw ] instances ] must-fail ] times
 
 ! Bug found on Windows build box, having too many words in the image breaks 'become'
-[ ] [ 100000 [ f f <word> ] replicate { } { } become drop ] unit-test
+[ ] [ 100000 [ f <uninterned-word> ] replicate { } { } become drop ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
index 844581c6d98ae07b7f06350456962aa50b8a7cf0..97dbab384e5ec1ed9d052e44849e7d144f3d9606 100644 (file)
@@ -216,7 +216,7 @@ HELP: filter-moved
 { $description "Removes all definitions from " { $snippet "assoc2" } " which are in " { $snippet "assoc1" } " or are are no longer present in the current " { $link file } "." } ;
 
 HELP: forget-smudged
-{ $description "Forgets removed definitions and prints a warning message if any of them are still referenced from other source files." } ;
+{ $description "Forgets removed definitions." } ;
 
 HELP: finish-parsing
 { $values { "lines" "the lines of text just parsed" } { "quot" "the quotation just parsed" } }
index f2b17b3f9da989da2b5e86d88a3a387401979072..2af94159f831ddb598a183ee0000e889187a9c87 100644 (file)
@@ -61,7 +61,7 @@ INSTANCE: curry immutable-sequence
 M: compose length
     [ first>> length ] [ second>> length ] bi + ;
 
-M: compose virtual-seq first>> ;
+M: compose virtual-exemplar first>> ;
 
 M: compose virtual@
     2dup first>> length < [
old mode 100755 (executable)
new mode 100644 (file)
index e50614a..6d7ff24
@@ -1175,17 +1175,17 @@ HELP: partition
     }
 } ;
 
-HELP: virtual-seq
+HELP: virtual-exemplar
 { $values
      { "seq" sequence }
      { "seq'" sequence } }
-{ $description "Part of the virtual sequence protocol, this word is used to return an underlying array from which to look up a value at an index given by " { $link virtual@ } "." } ;
+{ $description "Part of the virtual sequence protocol, this word is used to return an exemplar of the underlying storage. This is used in words like " { $link new-sequence } "." } ;
 
 HELP: virtual@
 { $values
      { "n" integer } { "seq" sequence }
      { "n'" integer } { "seq'" sequence } }
-{ $description "Part of the sequence protocol, this word translates the input index " { $snippet "n" } " into an index into the underlying storage returned by " { $link virtual-seq } "." } ;
+{ $description "Part of the sequence protocol, this word translates the input index " { $snippet "n" } " into an index and the underlying storage this index points into." } ;
 
 HELP: 2map-reduce
 { $values
@@ -1397,9 +1397,9 @@ $nl
 ARTICLE: "virtual-sequences-protocol" "Virtual sequence protocol"
 "Virtual sequences must know their length:"
 { $subsections length }
-"The underlying sequence to look up a value in:"
-{ $subsections virtual-seq }
-"The index of the value in the underlying sequence:"
+"An exemplar of the underlying storage:"
+{ $subsections virtual-exemplar }
+"The index and the underlying storage where the value is located:"
 { $subsections virtual@ } ;
 
 ARTICLE: "virtual-sequences" "Virtual sequences"
old mode 100755 (executable)
new mode 100644 (file)
index 1bcedb1..5017e52
@@ -182,15 +182,15 @@ PRIVATE>
     2dup bounds-check? [ nth-unsafe ] [ 2drop f ] if ; inline
 
 MIXIN: virtual-sequence
-GENERIC: virtual-seq ( seq -- seq' )
+GENERIC: virtual-exemplar ( seq -- seq' )
 GENERIC: virtual@ ( n seq -- n' seq' )
 
 M: virtual-sequence nth virtual@ nth ; inline
 M: virtual-sequence set-nth virtual@ set-nth ; inline
 M: virtual-sequence nth-unsafe virtual@ nth-unsafe ; inline
 M: virtual-sequence set-nth-unsafe virtual@ set-nth-unsafe ; inline
-M: virtual-sequence like virtual-seq like ; inline
-M: virtual-sequence new-sequence virtual-seq new-sequence ; inline
+M: virtual-sequence like virtual-exemplar like ; inline
+M: virtual-sequence new-sequence virtual-exemplar new-sequence ; inline
 
 INSTANCE: virtual-sequence sequence
 
@@ -199,7 +199,7 @@ TUPLE: reversed { seq read-only } ;
 
 C: <reversed> reversed
 
-M: reversed virtual-seq seq>> ; inline
+M: reversed virtual-exemplar seq>> ; inline
 M: reversed virtual@ seq>> [ length swap - 1 - ] keep ; inline
 M: reversed length seq>> length ; inline
 
@@ -231,7 +231,7 @@ TUPLE: slice-error from to seq reason ;
     check-slice
     slice boa ; inline
 
-M: slice virtual-seq seq>> ; inline
+M: slice virtual-exemplar seq>> ; inline
 
 M: slice virtual@ [ from>> + ] [ seq>> ] bi ; inline
 
@@ -659,9 +659,9 @@ PRIVATE>
         [ 0 swap copy ] keep
     ] new-like ;
 
-: suffix! ( seq elt -- seq ) over push ;
+: suffix! ( seq elt -- seq ) over push ; inline
 
-: append! ( seq1 seq2 -- seq1 ) over push-all ;
+: append! ( seq1 seq2 -- seq1 ) over push-all ; inline
 
 : last ( seq -- elt ) [ length 1 - ] [ nth ] bi ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index ebacc90f633c7b906bc9447847b9520630e94134..4f5473ce9de921869ee2e94e7245102c19d90943 100644 (file)
@@ -68,7 +68,7 @@ GENERIC: errors-changed ( observer -- )
 
 SYMBOL: error-observers
 
-[ V{ } clone error-observers set-global ] "source-files.errors" add-init-hook
+[ V{ } clone error-observers set-global ] "source-files.errors" add-startup-hook
 
 : add-error-observer ( observer -- ) error-observers get push ;
 
index 558018a147d404fef479c267564c1c1319fbfa65..4991a0860a6fde24f9fd88e58c6ba375bafc1479 100644 (file)
@@ -3,7 +3,7 @@
 USING: arrays definitions generic assocs kernel math namespaces
 sequences strings vectors words quotations io io.files
 io.pathnames combinators sorting splitting math.parser effects
-continuations checksums checksums.crc32 vocabs hashtables graphs
+continuations checksums checksums.crc32 vocabs hashtables
 compiler.units io.encodings.utf8 accessors source-files.errors ;
 IN: source-files
 
index 10fea15a6499bf082571d87bb2ead8401919d3e3..50855713121181367d318f1c2bb49efafce9ce1c 100644 (file)
@@ -13,6 +13,7 @@ ARTICLE: "sequences-split" "Splitting sequences"
     split1-last
     split1-last-slice
     split
+    split-when
 }
 "Splitting a string into lines:"
 { $subsections string-lines } ;
@@ -37,9 +38,14 @@ HELP: split1-last-slice
 
 { split1 split1-slice split1-last split1-last-slice } related-words
 
+HELP: split-when
+{ $values { "seq" "a sequence" } { "quot" { $quotation "( elt -- ? )" } } { "pieces" "a new array" } }
+{ $description "Splits " { $snippet "seq" } " at each occurrence of an element for which " { $snippet "quot" } " gives a true output and outputs an array of pieces. The pieces do not include the elements along which the sequence was split." }
+{ $examples { $example "USING: ascii kernel prettyprint splitting ;" "\"hello,world-how.are:you\" [ letter? not ] split-when ." "{ \"hello\" \"world\" \"how\" \"are\" \"you\" }" } } ;
+
 HELP: split
 { $values { "seq" "a sequence" } { "separators" "a sequence" } { "pieces" "a new array" } }
-{ $description "Splits " { $snippet "seq" } " at each occurrence of an element of " { $snippet "separators" } ", and outputs an array of pieces. The pieces do not include the elements along which the sequence was split." }
+{ $description "Splits " { $snippet "seq" } " at each occurrence of an element of " { $snippet "separators" } " and outputs an array of pieces. The pieces do not include the elements along which the sequence was split." }
 { $examples { $example "USING: prettyprint splitting ;" "\"hello world-how are you?\" \" -\" split ." "{ \"hello\" \"world\" \"how\" \"are\" \"you?\" }" } } ;
 
 HELP: ?head
index ed68038fa6ddc5579c48fc0c93cda31cec0772ac..e672624d9677363893a7704648b205b431f761c6 100644 (file)
@@ -1,4 +1,4 @@
-USING: splitting tools.test kernel sequences arrays strings ;
+USING: splitting tools.test kernel sequences arrays strings ascii ;
 IN: splitting.tests
 
 [ "hello" "world ." ] [ "hello world ." " " split1 ] unit-test
@@ -57,3 +57,6 @@ unit-test
 [ { "hello" "hi" } ] [ "hello\nhi" string-lines ] unit-test
 [ { "hello" "hi" } ] [ "hello\rhi" string-lines ] unit-test
 [ { "hello" "hi" } ] [ "hello\r\nhi" string-lines ] unit-test
+
+[ { "hey" "world" "what's" "happening" } ]
+[ "heyAworldBwhat'sChappening" [ LETTER? ] split-when ] unit-test
index 7aae30f20b356667fab9f1ef25ee456ff7ecc93d..7b805dffe55a2b169b87821c5329e4ae2a36eb2d 100644 (file)
@@ -55,17 +55,21 @@ PRIVATE>
 
 <PRIVATE
 
-: (split) ( separators n seq -- )
-    3dup rot [ member? ] curry find-from drop
-    [ [ swap subseq , ] 2keep 1 + swap (split) ]
-    [ swap [ tail ] unless-zero , drop ] if* ; inline recursive
+: (split) ( n seq quot: ( elt -- ? ) -- )
+    [ find-from drop ]
+    [ [ [ 3dup swapd subseq , ] dip [ drop 1 + ] 2dip (split) ] 3curry ]
+    [ drop [ swap [ tail ] unless-zero , ] 2curry ]
+    3tri if* ; inline recursive
 
-: split, ( seq separators -- ) 0 rot (split) ;
+: split, ( seq quot -- ) [ 0 ] 2dip (split) ; inline
 
 PRIVATE>
 
 : split ( seq separators -- pieces )
-    [ split, ] { } make ;
+    [ [ member? ] curry split, ] { } make ;
+
+: split-when ( seq quot -- pieces )
+    [ split, ] { } make ; inline
 
 GENERIC: string-lines ( str -- seq )
 
index ba9411fac69ccf41cd2952226807398f7549ee87..8ef3b3e42a4b5b9960ba27869705e39b4bbd3379 100644 (file)
@@ -16,9 +16,10 @@ ARTICLE: "system" "System interface"
 }
 "Getting the current time:"
 { $subsections
-    micros
-    millis
+    system-micros
 }
+"Getting a monotonically increasing nanosecond count:"
+{ $subsections nano-count }
 "Exiting the Factor VM:"
 { $subsections exit } ;
 
@@ -77,15 +78,15 @@ HELP: exit ( n -- )
 { $values { "n" "an integer exit code" } }
 { $description "Exits the Factor process." } ;
 
-HELP: micros ( -- us )
+HELP: system-micros ( -- us )
 { $values { "us" integer } }
-{ $description "Outputs the number of microseconds ellapsed since midnight January 1, 1970." }
-{ $notes "This is a low-level word. The " { $vocab-link "calendar" } " vocabulary provides features for date/time arithmetic and formatting." } ;
+{ $description "Outputs the number of microseconds elapsed since midnight January 1, 1970." }
+{ $notes "This is a low-level word. The " { $vocab-link "calendar" } " vocabulary provides features for date/time arithmetic and formatting. For timing code, use " { $link nano-count } "." } ;
 
-HELP: millis ( -- ms )
-{ $values { "ms" integer } }
-{ $description "Outputs the number of milliseconds ellapsed since midnight January 1, 1970." }
-{ $notes "This is a low-level word. The " { $vocab-link "calendar" } " vocabulary provides features for date/time arithmetic and formatting." } ;
+HELP: nano-count ( -- ns )
+{ $values { "ns" integer } }
+{ $description "Outputs a monotonically increasing count of nanoseconds elapsed since an arbitrary starting time. The difference of two calls to this word allows timing. This word is unaffected by system clock changes." }
+{ $notes "This is a low-level word. The " { $vocab-link "tools.time" } " vocabulary defines words to time code execution time. For system time, use " { $link system-micros } "." } ;
 
 HELP: image
 { $values { "path" "a pathname string" } }
index 38b4a5fd9bb5d9473d093856e31aa78edff8ef7b..59f2a030ceee8fcb44a3dee3a4925f52a5a3c6fd 100644 (file)
@@ -55,4 +55,4 @@ PRIVATE>
 
 : embedded? ( -- ? ) 15 getenv ;
 
-: millis ( -- ms ) micros 1000 /i ;
+: exit ( n -- ) do-shutdown-hooks (exit) ;
index 352ccdebd45fa2d864265aabc59819aec54cafbe..02a604ac320cdc9bc8c3610386f1ea390e2c65d6 100644 (file)
@@ -102,7 +102,7 @@ HELP: load-docs
 
 HELP: reload
 { $values { "name" "a vocabulary name" } }
-{ $description "Loads it's source code and documentation." }
+{ $description "Reloads the source code and documentation for a vocabulary." }
 { $errors "Throws a " { $link no-vocab } " error if the vocabulary does not exist on disk." } ;
 
 HELP: require
old mode 100755 (executable)
new mode 100644 (file)
index d88761db1fade3ff2b9e6c8054f722f7699e98ff..a13bfb0740015a37f6949f5987de5f875446b213 100644 (file)
@@ -238,7 +238,8 @@ $low-level-note
 
 HELP: <word> ( name vocab -- word )
 { $values { "name" string } { "vocab" string } { "word" word } }
-{ $description "Allocates an uninterned word with the specified name and vocabulary, and a blank word property hashtable. User code should call " { $link gensym } " to create uninterned words and " { $link create } " to create interned words." } ;
+{ $description "Allocates an uninterned word with the specified name and vocabulary, and a blank word property hashtable. User code should call " { $link gensym } " to create uninterned words and " { $link create } " to create interned words." }
+{ $notes "This word must be called from inside " { $link with-compilation-unit } "." } ;
 
 HELP: gensym
 { $values { "word" word } }
@@ -279,12 +280,14 @@ HELP: check-create
 
 HELP: create
 { $values { "name" string } { "vocab" string } { "word" word } }
-{ $description "Creates a new word. If the vocabulary already contains a word with the requested name, outputs the existing word. The vocabulary must exist already; if it does not, you must call " { $link create-vocab } " first." } ;
+{ $description "Creates a new word. If the vocabulary already contains a word with the requested name, outputs the existing word. The vocabulary must exist already; if it does not, you must call " { $link create-vocab } " first." }
+{ $notes "This word must be called from inside " { $link with-compilation-unit } ". Parsing words should call " { $link create-in } " instead of this word." } ;
 
 HELP: constructor-word
 { $values { "name" string } { "vocab" string } { "word" word } }
 { $description "Creates a new word, surrounding " { $snippet "name" } " in angle brackets." }
-{ $examples { $example "USING: prettyprint words ;" "\"salmon\" \"scratchpad\" constructor-word ." "<salmon>" } } ;
+{ $notes "This word must be called from inside " { $link with-compilation-unit } "." }
+{ $examples { $example "USING: compiler.units prettyprint words ;" "[ \"salmon\" \"scratchpad\" constructor-word ] with-compilation-unit ." "<salmon>" } } ;
 
 { POSTPONE: FORGET: forget forget* forget-vocab } related-words
 
old mode 100755 (executable)
new mode 100644 (file)
index b9d6e80..cb4ecb1
@@ -1,7 +1,7 @@
 USING: arrays generic assocs kernel math namespaces
 sequences tools.test words definitions parser quotations
 vocabs continuations classes.tuple compiler.units
-io.streams.string accessors eval words.symbol ;
+io.streams.string accessors eval words.symbol grouping ;
 IN: words.tests
 
 [ 4 ] [
@@ -25,7 +25,8 @@ DEFER: plist-test
     \ plist-test "sample-property" word-prop
 ] unit-test
 
-"create-test" "scratchpad" create { 1 2 } "testing" set-word-prop
+[ ] [ [ "create-test" "scratchpad" create { 1 2 } "testing" set-word-prop ] with-compilation-unit ] unit-test
+
 [ { 1 2 } ] [
     "create-test" "scratchpad" lookup "testing" word-prop
 ] unit-test
@@ -33,7 +34,7 @@ DEFER: plist-test
 [
     [ t ] [ \ array? "array?" "arrays" lookup = ] unit-test
 
-    [ ] [ "test-scope" "scratchpad" create drop ] unit-test
+    [ ] [ [ "test-scope" "scratchpad" create drop ] with-compilation-unit ] unit-test
 ] with-scope
 
 [ "test-scope" ] [
@@ -67,7 +68,7 @@ FORGET: another-forgotten
 DEFER: x
 [ x ] [ undefined? ] must-fail-with
 
-[ ] [ "no-loc" "words.tests" create drop ] unit-test
+[ ] [ [ "no-loc" "words.tests" create drop ] with-compilation-unit ] unit-test
 [ f ] [ "no-loc" "words.tests" lookup where ] unit-test
 
 [ ] [ "IN: words.tests : no-loc-2 ( -- ) ;" eval( -- ) ] unit-test
@@ -121,7 +122,7 @@ DEFER: x
 [ { } ]
 [
     all-words [
-        "compiled-uses" word-prop
+        "compiled-uses" word-prop 2 <groups>
         keys [ "forgotten" word-prop ] filter
     ] map harvest
 ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
index 45e014f..3dbfb3c
@@ -1,9 +1,9 @@
 ! Copyright (C) 2004, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays definitions graphs kernel
-kernel.private slots.private math namespaces sequences
-strings vectors sbufs quotations assocs hashtables sorting vocabs
-math.order sets words.private ;
+USING: accessors arrays definitions kernel kernel.private
+slots.private math namespaces sequences strings vectors sbufs
+quotations assocs hashtables sorting vocabs math.order sets
+words.private ;
 IN: words
 
 : word ( -- word ) \ word get-global ;
@@ -64,41 +64,6 @@ GENERIC: crossref? ( word -- ? )
 M: word crossref?
     dup "forgotten" word-prop [ drop f ] [ vocabulary>> >boolean ] if ;
 
-SYMBOL: compiled-crossref
-
-compiled-crossref [ H{ } clone ] initialize
-
-SYMBOL: compiled-generic-crossref
-
-compiled-generic-crossref [ H{ } clone ] initialize
-
-: (compiled-xref) ( word dependencies word-prop variable -- )
-    [ [ set-word-prop ] curry ]
-    [ [ get add-vertex* ] curry ]
-    bi* 2bi ;
-
-: compiled-xref ( word dependencies generic-dependencies -- )
-    [ [ drop crossref? ] { } assoc-filter-as f like ] bi@
-    [ "compiled-uses" compiled-crossref (compiled-xref) ]
-    [ "compiled-generic-uses" compiled-generic-crossref (compiled-xref) ]
-    bi-curry* bi ;
-
-: (compiled-unxref) ( word word-prop variable -- )
-    [ [ [ dupd word-prop ] dip get remove-vertex* ] 2curry ]
-    [ drop [ remove-word-prop ] curry ]
-    2bi bi ;
-
-: compiled-unxref ( word -- )
-    [ "compiled-uses" compiled-crossref (compiled-unxref) ]
-    [ "compiled-generic-uses" compiled-generic-crossref (compiled-unxref) ]
-    bi ;
-
-: delete-compiled-xref ( word -- )
-    [ compiled-unxref ]
-    [ compiled-crossref get delete-at ]
-    [ compiled-generic-crossref get delete-at ]
-    tri ;
-
 : inline? ( word -- ? ) "inline" word-prop ; inline
 
 GENERIC: subwords ( word -- seq )
@@ -170,10 +135,13 @@ M: word reset-word
     ] tri ;
 
 : <word> ( name vocab -- word )
-    2dup [ hashcode ] bi@ bitxor >fixnum (word) ;
+    2dup [ hashcode ] bi@ bitxor >fixnum (word) dup new-word ;
+
+: <uninterned-word> ( name -- word )
+    f \ <uninterned-word> counter >fixnum (word) ;
 
 : gensym ( -- word )
-    "( gensym )" f \ gensym counter >fixnum (word) ;
+    "( gensym )" <uninterned-word> ;
 
 : define-temp ( quot effect -- word )
     [ gensym dup ] 2dip define-declared ;
diff --git a/extra/animations/animations-docs.factor b/extra/animations/animations-docs.factor
deleted file mode 100644 (file)
index 3e426a2..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-USING: help.markup help.syntax ;
-IN: animations
-
-HELP: animate ( quot duration -- )
-
-{ $values
-    { "quot" "a quot which uses " { $link progress } }
-    { "duration" "a duration of time" }
-}
-{ $description
-    { $link animate } " calls " { $link reset-progress }
-    " , then continously calls the given quot until the"
-    " duration of time has elapsed. The quot should use "
-    { $link progress } " at least once."
-}
-{ $examples
-    { $unchecked-example 
-        "USING: animations calendar threads prettyprint ;"
-        "[ 1 sleep progress unparse write \" ms elapsed\" print ] "
-        "1/20 seconds animate ;"
-        "46 ms elapsed\n17 ms elapsed"
-    }
-    { $notes "The amount of time elapsed between these iterations will very." }
-} ;
-
-HELP: reset-progress ( -- )
-{ $description
-    "Initiates the timer. Call this before using "
-    "a loop which makes use of " { $link progress } "."
-} ;
-
-HELP: progress
-{ $values { "time" "an integer" } }
-{ $description
-    "Gives the time elapsed since the last time"
-    " this word was called, in milliseconds." 
-}
-{ $examples
-    { $unchecked-example
-        "USING: animations threads prettyprint ;"
-        "reset-progress 3 "
-        "[ 1 sleep progress unparse write \"ms elapsed\" print ] "
-        "times ;"
-        "31 ms elapsed\n18 ms elapsed\n16 ms elapsed"
-    }
-    { $notes "The amount of time elapsed between these iterations will very." }
-} ;
-
-ARTICLE: "animations" "Animations"
-"Provides a lightweight framework for properly simulating continuous"
-" functions of real time. This framework helps one create animations "
-"that use rates which do not change across platforms. The speed of the "
-"computer should correlate with the smoothness of the animation, not "
-"the speed of the animation!"
-{ $subsections
-    animate
-    reset-progress
-    progress
-}
-! A little talk about when to use progress and when to use animate
-    { $link progress } " specifically provides the length of time since "
-    { $link reset-progress } " was called, and also calls "
-    { $link reset-progress } " as its last action. This can be directly "
-    "used when one's quote runs for a specific number of iterations, instead "
-    "of a length of time. If the animation is like most, and is expected to "
-    "run for a specific length of time, " { $link animate } " should be used." ;
-ABOUT: "animations"
\ No newline at end of file
diff --git a/extra/animations/animations.factor b/extra/animations/animations.factor
deleted file mode 100644 (file)
index 8f416dc..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-! Small library for cross-platform continuous functions of real time
-
-USING: kernel shuffle system locals
-prettyprint math io namespaces threads calendar ;
-IN: animations
-
-SYMBOL: last-loop
-SYMBOL: sleep-period
-
-: reset-progress ( -- ) millis last-loop set ;
-! : my-progress ( -- progress ) millis 
-: progress ( -- time ) millis last-loop get - reset-progress ;
-: progress-peek ( -- progress ) millis last-loop get - ;
-: set-end ( duration -- end-time ) duration>milliseconds millis + ;
-: loop ( quot end -- ) dup millis > [ [ dup call ] dip loop ] [ 2drop ] if ; inline
-: animate ( quot duration -- ) reset-progress set-end loop ; inline
-: sample ( revs quot -- avg ) reset-progress dupd times progress swap / ; inline
diff --git a/extra/animations/authors.txt b/extra/animations/authors.txt
deleted file mode 100644 (file)
index 137b160..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Reginald Ford
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index ee9285a..ebffd4a
@@ -46,7 +46,7 @@ PRIVATE>
         [
             [
                 [ [ 1array $vocab-link ] with-cell ]
-                [ 1000000 /f pprint-cell ]
+                [ 1,000,000,000 /f pprint-cell ]
                 bi*
             ] with-row
         ] assoc-each
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 40dd54ca9974187b0b9cd908d8c1275e82472395..f3a41ca4a98dcc38e694dd9d789b76a0f74956fc 100644 (file)
@@ -24,7 +24,7 @@ IN: benchmark.fannkuch
 
 : fannkuch ( n -- )
     [
-        [ 0 0 ] dip [ 1 + ] B{ } map-as
+        [ 0 0 ] dip iota [ 1 + ] B{ } map-as
         [ fannkuch-step ] each-permutation nip
     ] keep
     "Pfannkuchen(" write pprint ") = " write . ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 7cf6a3e..1289caa
@@ -1,13 +1,14 @@
 USING: tools.deploy.config ;
 H{
-    { deploy-io 3 }
-    { deploy-word-defs? f }
-    { deploy-reflection 1 }
-    { deploy-c-types? f }
     { deploy-name "Bunny" }
-    { deploy-word-props? f }
-    { deploy-threads? t }
-    { "stop-after-last-window?" t }
     { deploy-ui? t }
+    { deploy-c-types? f }
+    { deploy-unicode? f }
+    { "stop-after-last-window?" t }
+    { deploy-io 3 }
+    { deploy-reflection 2 }
+    { deploy-word-props? f }
     { deploy-math? t }
+    { deploy-threads? t }
+    { deploy-word-defs? f }
 }
old mode 100755 (executable)
new mode 100644 (file)
index b9923d5..cfe9595
@@ -93,7 +93,7 @@ M: bunny-buffers bunny-geom
         { GL_VERTEX_ARRAY GL_NORMAL_ARRAY } [
             GL_FLOAT 0 0 buffer-offset glNormalPointer
             [
-                nv>> "float" heap-size * buffer-offset
+                nv>> c:float heap-size * buffer-offset
                 [ 3 GL_FLOAT 0 ] dip glVertexPointer
             ] [
                 ni>>
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/calendar/holidays/authors.txt b/extra/calendar/holidays/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/extra/calendar/holidays/canada/authors.txt b/extra/calendar/holidays/canada/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/extra/calendar/holidays/canada/canada-tests.factor b/extra/calendar/holidays/canada/canada-tests.factor
new file mode 100644 (file)
index 0000000..916f5ee
--- /dev/null
@@ -0,0 +1,7 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: calendar.holidays calendar.holidays.canada kernel
+tools.test ;
+IN: calendar.holidays.canada.tests
+
+[ ] [ 2009 canada holidays drop ] unit-test
diff --git a/extra/calendar/holidays/canada/canada.factor b/extra/calendar/holidays/canada/canada.factor
new file mode 100644 (file)
index 0000000..304388f
--- /dev/null
@@ -0,0 +1,11 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: calendar calendar.holidays ;
+IN: calendar.holidays.canada
+
+SINGLETONS: canada canadian-federal ;
+
+HOLIDAY: canadian-thanksgiving-day october 2 monday-of-month ;
+HOLIDAY-NAME: canadian-thanksgiving-day canadian-federal "Thanksgiving Day"
+
+HOLIDAY-NAME: armistice-day commonwealth-of-nations "Remembrance Day"
diff --git a/extra/calendar/holidays/holidays.factor b/extra/calendar/holidays/holidays.factor
new file mode 100644 (file)
index 0000000..0b8a1bb
--- /dev/null
@@ -0,0 +1,55 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors assocs calendar fry kernel parser sequences
+shuffle vocabs words memoize ;
+IN: calendar.holidays
+
+SINGLETONS: all world commonwealth-of-nations ;
+
+<<
+SYNTAX: HOLIDAY:
+    CREATE-WORD
+    dup "holiday" word-prop [
+        dup H{ } clone "holiday" set-word-prop
+    ] unless
+    parse-definition (( timestamp/n -- timestamp )) define-declared ;
+
+SYNTAX: HOLIDAY-NAME:
+    scan-word "holiday" word-prop scan-word scan-object spin set-at ;
+>>
+
+GENERIC: holidays ( n singleton -- seq )
+
+<PRIVATE
+
+: (holidays) ( singleton -- seq )
+    all-words swap '[ "holiday" word-prop _ swap key? ] filter ;
+
+M: object holidays
+    (holidays) [ execute( timestamp -- timestamp' ) ] with map ;
+
+PRIVATE>
+
+M: all holidays
+    drop
+    all-words [ "holiday" word-prop key? ] with filter ;
+
+: holiday? ( timestamp/n singleton -- ? )
+    [ holidays ] [ drop ] 2bi '[ _ same-day? ] any? ;
+
+: holiday-assoc ( timestamp singleton -- assoc )
+    (holidays) swap
+    '[ [ _ swap execute( ts -- ts' ) >gmt midnight ] keep ] { } map>assoc ;
+
+: holiday-name ( singleton word -- string/f )
+    "holiday" word-prop at ;
+
+: holiday-names ( timestamp/n singleton -- seq )
+    [
+        [ >gmt midnight ] dip
+        [ drop ] [ holiday-assoc ] 2bi swap
+        '[ drop _ same-day? ] assoc-filter values
+    ] keep '[ _ swap "holiday" word-prop at ] map ;
+
+HOLIDAY: armistice-day november 11 >>day ;
+HOLIDAY-NAME: armistice-day world "Armistice Day"
diff --git a/extra/calendar/holidays/us/authors.txt b/extra/calendar/holidays/us/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/extra/calendar/holidays/us/us-tests.factor b/extra/calendar/holidays/us/us-tests.factor
new file mode 100644 (file)
index 0000000..23ab535
--- /dev/null
@@ -0,0 +1,7 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: calendar.holidays calendar.holidays.us kernel sequences
+tools.test ;
+IN: calendar.holidays.us.tests
+
+[ 10 ] [ 2009 us-federal holidays length ] unit-test
diff --git a/extra/calendar/holidays/us/us.factor b/extra/calendar/holidays/us/us.factor
new file mode 100644 (file)
index 0000000..a4fb19c
--- /dev/null
@@ -0,0 +1,117 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors assocs calendar calendar.holidays
+calendar.holidays.private combinators combinators.short-circuit
+fry kernel lexer math namespaces parser sequences shuffle
+vocabs words ;
+IN: calendar.holidays.us
+
+SINGLETONS: us us-federal ;
+
+<PRIVATE
+
+: adjust-federal-holiday ( timestamp -- timestamp' )
+    {
+        { [ dup saturday? ] [ 1 days time- ] }
+        { [ dup sunday? ] [ 1 days time+ ] }
+        [ ]
+    } cond ;
+
+PRIVATE>
+
+M: us-federal holidays
+    (holidays)
+    [ execute( timestamp -- timestamp' ) adjust-federal-holiday ] with map ;
+
+: us-post-office-open? ( timestamp -- ? )
+    { [ sunday? not ] [ us-federal holiday? not ] } 1&& ;
+
+HOLIDAY: new-years-day january 1 >>day ;
+HOLIDAY-NAME: new-years-day world "New Year's Day"
+HOLIDAY-NAME: new-years-day us-federal "New Year's Day"
+
+HOLIDAY: martin-luther-king-day january 3 monday-of-month ;
+HOLIDAY-NAME: martin-luther-king-day us-federal "Martin Luther King Day"
+
+HOLIDAY: inauguration-day year dup 4 neg rem + january 20 >>day ;
+HOLIDAY-NAME: inauguration-day us "Inauguration Day"
+
+HOLIDAY: washingtons-birthday february 3 monday-of-month ;
+HOLIDAY-NAME: washingtons-birthday us-federal "Washington's Birthday"
+
+HOLIDAY: memorial-day may last-monday-of-month ;
+HOLIDAY-NAME: memorial-day us-federal "Memorial Day"
+
+HOLIDAY: independence-day july 4 >>day ;
+HOLIDAY-NAME: independence-day us-federal "Independence Day"
+
+HOLIDAY: labor-day september 1 monday-of-month ;
+HOLIDAY-NAME: labor-day us-federal "Labor Day"
+
+HOLIDAY: columbus-day october 2 monday-of-month ;
+HOLIDAY-NAME: columbus-day us-federal "Columbus Day"
+
+HOLIDAY-NAME: armistice-day us-federal "Veterans Day"
+
+HOLIDAY: thanksgiving-day november 4 thursday-of-month ;
+HOLIDAY-NAME: thanksgiving-day us-federal "Thanksgiving Day"
+
+HOLIDAY: christmas-day december 25 >>day ;
+HOLIDAY-NAME: christmas-day world "Christmas Day"
+HOLIDAY-NAME: christmas-day us-federal "Christmas Day"
+
+HOLIDAY: belly-laugh-day january 24 >>day ;
+
+HOLIDAY: groundhog-day february 2 >>day ;
+
+HOLIDAY: lincolns-birthday february 12 >>day ;
+
+HOLIDAY: valentines-day february 14 >>day ;
+
+HOLIDAY: st-patricks-day march 17 >>day ;
+
+HOLIDAY: ash-wednesday easter 46 days time- ;
+
+ALIAS: first-day-of-lent ash-wednesday
+
+HOLIDAY: fat-tuesday ash-wednesday 1 days time- ;
+
+HOLIDAY: good-friday easter 2 days time- ;
+
+HOLIDAY: tax-day april 15 >>day ;
+
+HOLIDAY: earth-day april 22 >>day ;
+
+HOLIDAY: administrative-professionals-day april last-saturday-of-month wednesday ;
+
+HOLIDAY: cinco-de-mayo may 5 >>day ;
+
+HOLIDAY: mothers-day may 2 sunday-of-month ;
+
+HOLIDAY: armed-forces-day may 3 saturday-of-month ;
+
+HOLIDAY: flag-day june 14 >>day ;
+
+HOLIDAY: parents-day july 4 sunday-of-month ;
+
+HOLIDAY: grandparents-day labor-day 1 weeks time+ ;
+
+HOLIDAY: patriot-day september 11 >>day ;
+
+HOLIDAY: stepfamily-day september 16 >>day ;
+
+HOLIDAY: citizenship-day september 17 >>day ;
+
+HOLIDAY: bosss-day october 16 >>day ;
+
+HOLIDAY: sweetest-day october 3 saturday-of-month ;
+
+HOLIDAY: halloween october 31 >>day ;
+
+HOLIDAY: election-day november 1 monday-of-month 1 days time+ ;
+
+HOLIDAY: black-friday thanksgiving-day 1 days time+ ;
+
+HOLIDAY: pearl-harbor-remembrance-day december 7 >>day ;
+
+HOLIDAY: new-years-eve december 31 >>day ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 23adf31700097386e3791260da53ad2092df328c..69c6503aa282346657e3e6b760591b55ea658a37 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.strings assocs byte-arrays
 combinators continuations destructors fry io.encodings.8-bit
-io io.encodings.string io.encodings.utf8 kernel math
+io io.encodings.string io.encodings.utf8 kernel locals math
 namespaces prettyprint sequences classes.struct
 strings threads curses.ffi ;
 IN: curses
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/drills/deployed/deploy.factor b/extra/drills/deployed/deploy.factor
deleted file mode 100644 (file)
index c1e9307..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-USING: tools.deploy.config ;
-H{
-    { deploy-name "drills" }
-    { deploy-c-types? t }
-    { "stop-after-last-window?" t }
-    { deploy-unicode? t }
-    { deploy-threads? t }
-    { deploy-reflection 6 }
-    { deploy-word-defs? t }
-    { deploy-math? t }
-    { deploy-ui? t }
-    { deploy-word-props? t }
-    { deploy-io 3 }
-}
diff --git a/extra/drills/deployed/deployed.factor b/extra/drills/deployed/deployed.factor
deleted file mode 100644 (file)
index 5681c73..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-USING: arrays cocoa.dialogs combinators continuations
-fry grouping io.encodings.utf8 io.files io.styles kernel math
-math.parser models models.arrow models.history namespaces random
-sequences splitting ui ui.gadgets.alerts ui.gadgets.book-extras
-ui.gadgets.books ui.gadgets.buttons ui.gadgets.frames
-ui.gadgets.grids ui.gadgets.labels ui.gadgets.tracks fonts
-wrap.strings system ;
-EXCLUDE: accessors => change-model ;
-IN: drills.deployed
-SYMBOLS: it startLength ;
-: big ( gadget -- gadget ) T{ font { name "sans-serif" } { size 30 } } >>font ;
-: card ( model quot -- button ) <arrow> <label-control> big [ next ] <book-btn> ;
-: op ( quot str -- gadget ) <label> big swap <book-bevel-btn> ;
-
-: show ( model -- gadget ) dup it set-global [ random ] <arrow>
-   { [ [ first ] card ]
-     [ [ second ] card ]
-     [ '[ |<< it get _ model-changed ] "No" op ]
-          [ '[ |<< [ it get [
-        _ value>> swap remove
-        [ [ it get go-back ] "Drill Complete" alert return ] when-empty
-     ] change-model ] with-return ] "Yes" op ]
-   } cleave
-2array { 1 0 } <track> swap [ 0.5 track-add ] each
-3array <book*> 3 3 <frame> { 1 1 } >>filled-cell { 450 175 } >>pref-dim swap { 1 1 } grid-add
-it get [ length startLength get swap - number>string "/" startLength get number>string 3append ] <arrow> <label-control> { 1 2 } grid-add ;
-
-: drill ( -- ) [
-   open-panel [
-         [ utf8 file-lines [ "\t" split [ 25 wrap-string ] map ] map dup [ first2 swap 2array ] map append ] map concat
-            [ length startLength set-global ] keep <history> [ add-history ] [ show ] bi
-         "Got it?" open-window
-   ] [ 0 exit ] if*
-] with-ui ;
-
-MAIN: drill
\ No newline at end of file
diff --git a/extra/drills/deployed/tags.txt b/extra/drills/deployed/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/drills/drills.factor b/extra/drills/drills.factor
deleted file mode 100644 (file)
index 1da1fca..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-USING: arrays cocoa.dialogs combinators continuations
-fry grouping io.encodings.utf8 io.files io.styles kernel math
-math.parser models models.arrow models.history namespaces random
-sequences splitting ui ui.gadgets.alerts ui.gadgets.book-extras
-ui.gadgets.books ui.gadgets.buttons ui.gadgets.frames
-ui.gadgets.grids ui.gadgets.labels ui.gadgets.tracks fonts
-wrap.strings ;
-EXCLUDE: accessors => change-model ;
-
-IN: drills
-SYMBOLS: it startLength ;
-: big ( gadget -- gadget ) T{ font { name "sans-serif" } { size 30 } } >>font ;
-: card ( model quot -- button ) <arrow> <label-control> big [ next ] <book-btn> ;
-: op ( quot str -- gadget ) <label> big swap <book-border-btn> ;
-
-: show ( model -- gadget ) dup it set-global [ random ] <arrow>
-   { [ [ first ] card ]
-     [ [ second ] card ]
-     [ '[ |<< it get _ model-changed ] "No" op ]
-          [ '[ |<< [ it get [
-        _ value>> swap remove
-        [ [ it get go-back ] "Drill Complete" alert return ] when-empty
-     ] change-model ] with-return ] "Yes" op ]
-   } cleave
-2array { 1 0 } <track> swap [ 0.5 track-add ] each
-3array <book*> 3 3 <frame> { 1 1 } >>filled-cell { 450 175 } >>pref-dim swap { 1 1 } grid-add
-it get [ length startLength get swap - number>string "/" startLength get number>string 3append ] <arrow> <label-control> { 1 2 } grid-add ;
-
-: drill ( -- ) [
-   open-panel [
-         [ utf8 file-lines [ "\t" split [ 25 wrap-string ] map ] map dup [ first2 swap 2array ] map append ] map concat
-            [ length startLength set-global ] keep <history> [ add-history ] [ show ] bi
-         "Got it?" open-window
-   ] when*
-] with-ui ;
-
-MAIN: drill
\ No newline at end of file
diff --git a/extra/drills/tags.txt b/extra/drills/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 1346988fd187c7bf50a6f2222199498cbf968dfc..c0f36d0294ddef784ea9e9964144e3c7f0151759 100644 (file)
@@ -20,8 +20,8 @@ GENERIC: draw* ( tick-slice delegate -- )
 
 SYMBOL: game-loop
 
-: since-last-tick ( loop -- milliseconds )
-    last-tick>> millis swap - ;
+: since-last-tick ( loop -- microseconds )
+    last-tick>> system-micros swap - ;
 
 : tick-slice ( loop -- slice )
     [ since-last-tick ] [ tick-length>> ] bi /f 1.0 min ;
@@ -53,7 +53,7 @@ TUPLE: game-loop-error game-loop error ;
     drop ;
 
 : ?tick ( loop count -- )
-    [ millis >>last-tick drop ] [
+    [ system-micros >>last-tick drop ] [
         over [ since-last-tick ] [ tick-length>> ] bi >=
         [ [ drop increment-tick ] [ drop tick ] [ 1 - ?tick ] 2tri ]
         [ 2drop ] if
@@ -69,24 +69,24 @@ TUPLE: game-loop-error game-loop error ;
     [ [ (run-loop) ] [ game-loop-error ] recover ]
     with-variable ;
 
-: benchmark-millis ( loop -- millis )
-    millis swap benchmark-time>> - ;
+: benchmark-micros ( loop -- micros )
+    system-micros swap benchmark-time>> - ;
 
 PRIVATE>
 
 : reset-loop-benchmark ( loop -- )
-    millis >>benchmark-time
+    system-micros >>benchmark-time
     dup tick-number>> >>benchmark-tick-number
     dup frame-number>> >>benchmark-frame-number
     drop ;
 
 : benchmark-ticks-per-second ( loop -- n )
-    [ tick-number>> ] [ benchmark-tick-number>> - ] [ benchmark-millis ] tri /f ;
+    [ tick-number>> ] [ benchmark-tick-number>> - ] [ benchmark-micros ] tri /f ;
 : benchmark-frames-per-second ( loop -- n )
-    [ frame-number>> ] [ benchmark-frame-number>> - ] [ benchmark-millis ] tri /f ;
+    [ frame-number>> ] [ benchmark-frame-number>> - ] [ benchmark-micros ] tri /f ;
 
 : start-loop ( loop -- )
-    millis >>last-tick
+    system-micros >>last-tick
     t >>running?
     [ reset-loop-benchmark ]
     [ [ run-loop ] curry "game loop" spawn ]
@@ -98,7 +98,7 @@ PRIVATE>
     drop ;
 
 : <game-loop> ( tick-length delegate -- loop )
-    millis f f 0 0 millis 0 0
+    system-micros f f 0 0 system-micros 0 0
     game-loop boa ;
 
 M: game-loop dispose
index 399c5d19027689ec688a91b53ad81b03fee82a30..308b5006cf2ed14593949737b96dbf4245c7b5fb 100644 (file)
@@ -6,7 +6,7 @@ TUPLE: game-world < world
     game-loop
     { tick-slice float initial: 0.0 } ;
 
-GENERIC: tick-length ( world -- millis )
+GENERIC: tick-length ( world -- micros )
 
 M: game-world draw*
     swap >>tick-slice relayout-1 yield ;
index bbd16b7ff47ffd51a95d1af271445210f4061b8a..c398bdde7aae956df300231a05e2da432d152182 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators combinators.smart csv io.encodings.8-bit
-math.parser memoize sequences kernel unicode.categories money ;
+math.parser memoize sequences kernel unicode.categories money
+io.encodings.8-bit.latin1 ;
 IN: geobytes
 
 ! GeoBytes is not free software.
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 0985326..7b778f0
@@ -295,7 +295,7 @@ AFTER: bunny-world resize-world
     [ sobel>> framebuffer>> ] [ dim>> ] bi resize-framebuffer ;
 
 M: bunny-world pref-dim* drop { 1024 768 } ;
-M: bunny-world tick-length drop 1000 30 /i ;
+M: bunny-world tick-length drop 1000000 30 /i ;
 M: bunny-world wasd-movement-speed drop 1/160. ;
 M: bunny-world wasd-near-plane drop 1/32. ;
 M: bunny-world wasd-far-plane drop 256.0 ;
index 5a3d5864fb09216fdde98b90785bf3d04e689def..94a8d179259ff34c305f4edeb08396dabf3322a9 100644 (file)
@@ -93,7 +93,7 @@ M: raytrace-world draw-world*
     } <render-set> render ;
 
 M: raytrace-world pref-dim* drop { 1024 768 } ;
-M: raytrace-world tick-length drop 1000 30 /i ;
+M: raytrace-world tick-length drop 1000000 30 /i ;
 M: raytrace-world wasd-movement-speed drop 1/4. ;
 
 : raytrace-window ( -- )
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 784c34cf7076a509216b1d5ec5d4505d153ccce1..13d4dba8f17d923016b2bcd0cc2dd4c4767ae97a 100644 (file)
@@ -1,14 +1,14 @@
 USING: tools.deploy.config ;
 H{
+    { deploy-name "Hello world" }
+    { deploy-ui? t }
     { deploy-c-types? f }
     { deploy-unicode? f }
-    { deploy-word-defs? f }
-    { deploy-name "Hello world" }
     { "stop-after-last-window?" t }
-    { deploy-reflection 1 }
-    { deploy-ui? t }
-    { deploy-math? t }
     { deploy-io 1 }
+    { deploy-reflection 2 }
     { deploy-word-props? f }
+    { deploy-math? t }
     { deploy-threads? t }
+    { deploy-word-defs? f }
 }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 1d1e217ba0ce9ee9102749da0c1366fcd8e6b49d..172786126914ed5e37c54c1add614a6ce03964f0 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax classes.struct kernel sequences system ;
+USING: alien.c-types alien.syntax classes.struct kernel
+sequences system ;
 IN: io.serial.unix.termios
 
 CONSTANT: NCCS 20
index 0982339cf8994913072a4105f018ad86f858c191..1e9dce49c7174248846dfe570b2e31dd2cfaa4d8 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax classes.struct kernel system unix ;
+USING: alien.c-types alien.syntax classes.struct kernel system
+unix ;
 IN: io.serial.unix.termios
 
 CONSTANT: NCCS 32
old mode 100755 (executable)
new mode 100644 (file)
index 3f6cf4945d8df49402d5b558584383c92bd46895..8a87c1a6132b9151b0ace18ebb4bf4a5f1110fd7 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Bruno Deferrari
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors concurrency.mailboxes kernel calendar io.sockets io.encodings.8-bit
-destructors arrays sequences ;
+USING: accessors concurrency.mailboxes kernel calendar io.sockets
+destructors arrays sequences io.encodings.8-bit.latin1 ;
 IN: irc.client.chats
 
 CONSTANT: irc-port 6667 ! Default irc port
old mode 100755 (executable)
new mode 100644 (file)
index ef1695f5634ed6a588a645f4c59dd8a2aa53a8c9..f2030e87b018bab93d3c9059668ee4638e8eaa84 100644 (file)
@@ -26,7 +26,7 @@ IN: irc.client.internals
     irc> [ connect>> ] [ reconnect-attempts>> ] bi do-connect ;
 
 : /JOIN ( channel password -- )
-    [ " :" swap 3append ] when* "JOIN " prepend irc-print ;
+    [ " :" glue ] when* "JOIN " prepend irc-print ;
 
 : try-connect ( -- stream/f )
     irc> profile>> [ server>> ] [ port>> ] bi /CONNECT ;
index 161a81d555cca122d66373cedcd1941b82246e5d..0963765482275ba61681a2b3411f9df6a4000579 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: fry irc.client irc.client.chats kernel namespaces
-sequences threads io.encodings.8-bit io.launcher io splitting
-make mason.common mason.updates calendar math alarms ;
+sequences threads io.launcher io splitting
+make mason.common mason.updates calendar math alarms
+io.encodings.8-bit.latin1 ;
 IN: irc.gitbot
 
 : bot-profile ( -- obj )
index 976a3832f47fdbe0b210bafe651e1c345357f8e1..0bc4d71707c3aa9084a2fda6ac5d6d5fc5d718dc 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors calendar calendar.format destructors fry io io.encodings.8-bit
 io.files io.pathnames irc.client irc.client.chats irc.messages
 irc.messages.base kernel make namespaces sequences threads
-irc.logbot.log-line ;
+irc.logbot.log-line io.encodings.8-bit.latin1 ;
 IN: irc.logbot
 
 CONSTANT: bot-channel "#concatenative"
old mode 100755 (executable)
new mode 100644 (file)
index ecce29180c2bd6611ea218452e250d1d14dac8da..49536e257058cf5dbdcdc6bc2eb979cd0a4a20dd 100644 (file)
@@ -38,14 +38,10 @@ CONSTANT: max-speed 30.0
 : play-in-tunnel ( player segments -- )
     >>tunnel to-tunnel-start ;
 
-: update-nearest-segment ( player -- )
-    [ tunnel>> ] [ dup nearest-segment>> nearest-segment ]
-    [ (>>nearest-segment) ] tri ;
-
 : update-time ( player -- seconds-passed )
-    millis swap [ last-move>> - 1000 / ] [ (>>last-move) ] 2bi ;
+    system-micros swap [ last-move>> - 1000000 / ] [ (>>last-move) ] 2bi ;
 
-: moved ( player -- ) millis swap (>>last-move) ;
+: moved ( player -- ) system-micros swap (>>last-move) ;
 
 : speed-range ( -- range )
     max-speed [0,b] ;
index e2e1c2012254509d31cefa8cff5aa0912e4f32cf..ac696f54445bcaafcbb5e9481ce6e193c111e509 100644 (file)
@@ -6,19 +6,6 @@ alien.c-types ;
 SPECIALIZED-ARRAY: float
 IN: jamshred.tunnel.tests
 
-[ 0 ] [ T{ segment f { 0 0 0 } f f f 0 }
-        T{ segment f { 1 1 1 } f f f 1 }
-        T{ oint f { 0 0 0.25 } }
-        nearer-segment number>> ] unit-test
-
-[ 0 ] [ T{ oint f { 0 0 0 } } <straight-tunnel> find-nearest-segment number>> ] unit-test
-[ 1 ] [ T{ oint f { 0 0 -1 } } <straight-tunnel> find-nearest-segment number>> ] unit-test
-[ 2 ] [ T{ oint f { 0 0.1 -2.1 } } <straight-tunnel> find-nearest-segment number>> ] unit-test
-
-[ 3 ] [ <straight-tunnel> T{ oint f { 0 0 -3.25 } } 0 nearest-segment-forward number>> ] unit-test
-
-[ float-array{ 0 0 0 } ] [ <straight-tunnel> T{ oint f { 0 0 -0.25 } } over first nearest-segment location>> ] unit-test
-
 : test-segment-oint ( -- oint )
     { 0 0 0 } { 0 0 -1 } { 0 1 0 } { -1 0 0 } <oint> ;
 
index 7f8646b778d9e8ec4dc8f4e610f0c4ac4ff42a52..f94fc979ce630961f78d8272d383763473d777f2 100644 (file)
@@ -63,33 +63,6 @@ CONSTANT: default-segment-radius 1
     #! valid values
     [ '[ _ clamp-length ] bi@ ] keep <slice> ;
 
-:: nearer-segment ( seg-a seg-b oint -- segment )
-    seg-a oint distance
-    seg-b oint distance <
-    seg-a seg-b ? ;
-
-: (find-nearest-segment) ( nearest next oint -- nearest ? )
-    #! find the nearest of 'next' and 'nearest' to 'oint', and return
-    #! t if the nearest hasn't changed
-    pick [ nearer-segment dup ] dip = ;
-
-: find-nearest-segment ( oint segments -- segment )
-    dup first swap rest-slice rot [ (find-nearest-segment) ] curry
-    find 2drop ;
-    
-: nearest-segment-forward ( segments oint start -- segment )
-    rot tail-slice find-nearest-segment ;
-
-: nearest-segment-backward ( segments oint start -- segment )
-    1 + rot head-slice <reversed> find-nearest-segment ;
-
-: nearest-segment ( segments oint start-segment -- segment )
-    #! find the segment nearest to 'oint', and return it.
-    #! start looking at segment 'start-segment'
-    number>> over [
-        [ nearest-segment-forward ] 3keep nearest-segment-backward
-    ] dip nearer-segment ;
-
 : get-segment ( segments n -- segment )
     over clamp-length swap nth ;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 095cbd1a80aa16ed726bc7085679db377ba17326..6d7f9732962e706127b76c140baadefd65472163 100644 (file)
@@ -2,7 +2,7 @@ IN: mason.common.tests
 USING: prettyprint mason.common mason.config
 namespaces calendar tools.test io.files io.files.temp io.encodings.utf8 ;
 
-[ "00:01:01" ] [ 61000 milli-seconds>time ] unit-test
+[ "00:01:02" ] [ 62,000,000,000 nanos>time ] unit-test
 
 [ "/home/bobby/builds/factor" ] [
     [
old mode 100755 (executable)
new mode 100644 (file)
index 71ac313..e77daca
@@ -3,7 +3,7 @@
 USING: kernel namespaces sequences splitting system accessors
 math.functions make io io.files io.pathnames io.directories
 io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint
-combinators.short-circuit parser combinators calendar
+combinators.short-circuit parser combinators math calendar
 calendar.format arrays mason.config locals debugger fry
 continuations strings io.sockets ;
 IN: mason.common
@@ -57,10 +57,8 @@ M: unix really-delete-tree delete-tree ;
         } cleave
     ] { } make [ pad-00 ] map "-" join ;
 
-: milli-seconds>time ( n -- string )
-    millis>timestamp
-    [ hour>> ] [ minute>> ] [ second>> floor ] tri 3array
-    [ pad-00 ] map ":" join ;
+: nanos>time ( n -- string )
+    1,000,000,000 /i 60 /mod [ 60 /mod ] dip 3array [ pad-00 ] map ":" join ;
 
 SYMBOL: stamp
 
index d6be8654c5473d313eb4343e476ba2ce16fc0835..2a33c5240b572c25572daf0f31fdd0822e4d30cb 100644 (file)
@@ -17,4 +17,4 @@ IN: mason.platform
     target-os get target-cpu get arch ;
 
 : boot-image-name ( -- string )
-    "boot." boot-image-arch ".image" 3append ;
+    boot-image-arch "boot." ".image" surround ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 4a2138323c117cef4de157bbe4f014d0e9a3a627..c5567c9c970fb287b319b2f32386096f14c47034 100644 (file)
@@ -7,12 +7,16 @@ prettyprint sequences xml.syntax xml.writer combinators.short-circuit
 literals splitting ;
 IN: mason.report
 
+: git-link ( id -- link )
+    [ "http://github.com/slavapestov/factor/commit/" prepend ] keep
+    [XML <a href=<->><-></a> XML] ;
+
 : common-report ( -- xml )
     target-os get
     target-cpu get
     short-host-name
     build-dir
-    current-git-id get
+    current-git-id get git-link
     [XML
     <h1>Build report for <->/<-></h1>
     <table>
@@ -67,7 +71,7 @@ IN: mason.report
         benchmark-time-file
         html-help-time-file
     } [
-        dup eval-file milli-seconds>time
+        dup eval-file nanos>time
         [XML <tr><td><-></td><td><-></td></tr> XML]
     ] map [XML <h2>Timings</h2> <table><-></table> XML] ;
 
@@ -82,9 +86,16 @@ IN: mason.report
 
 : benchmarks-table ( assoc -- xml )
     [
-        1000000 /f
+        1,000,000,000 /f
         [XML <tr><td><-></td><td><-></td></tr> XML]
-    ] { } assoc>map [XML <h2>Benchmarks</h2> <table><-></table> XML] ;
+    ] { } assoc>map
+    [XML
+        <h2>Benchmarks</h2>
+        <table>
+            <tr><th>Benchmark</th><th>Time (seconds)</th></tr>
+            <->
+        </table>
+    XML] ;
 
 : successful-report ( -- )
     [
index d50c77f71b8cac7a125561858e6f2e71e670ba6e..034d86b9c68c905ea28054fab2e460c2fe520719 100644 (file)
@@ -51,9 +51,6 @@ M: method-body word-vocabulary "method-generic" word-prop word-vocabulary ;
     compiler-error-messages-file
     do-step ;
 
-: benchmark-ms ( quot -- ms )
-    benchmark 1000 /i ; inline
-
 : check-boot-image ( -- )
     "" to-refresh drop 2dup [ empty? not ] either?
     [
@@ -67,12 +64,12 @@ M: method-body word-vocabulary "method-generic" word-prop word-vocabulary ;
     ".." [
         bootstrap-time get boot-time-file to-file
         check-boot-image
-        [ do-load ] benchmark-ms load-time-file to-file
-        [ generate-help ] benchmark-ms html-help-time-file to-file
-        [ do-tests ] benchmark-ms test-time-file to-file
-        [ do-help-lint ] benchmark-ms help-lint-time-file to-file
-        [ do-benchmarks ] benchmark-ms benchmark-time-file to-file
+        [ do-load ] benchmark load-time-file to-file
+        [ generate-help ] benchmark html-help-time-file to-file
+        [ do-tests ] benchmark test-time-file to-file
+        [ do-help-lint ] benchmark help-lint-time-file to-file
+        [ do-benchmarks ] benchmark benchmark-time-file to-file
         do-compile-errors
     ] with-directory ;
 
-MAIN: do-all
\ No newline at end of file
+MAIN: do-all
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/models/combinators/authors.txt b/extra/models/combinators/authors.txt
deleted file mode 100644 (file)
index 2300f69..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
diff --git a/extra/models/combinators/combinators-docs.factor b/extra/models/combinators/combinators-docs.factor
deleted file mode 100644 (file)
index 8ac3657..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-USING: help.markup help.syntax models models.arrow sequences monads ;
-IN: models.combinators
-
-HELP: merge
-{ $values { "models" "a list of models" } { "model" basic-model } }
-{ $description "Creates a model that merges the updates of others" } ;
-
-HELP: filter-model
-{ $values { "model" model } { "quot" "quotation with stack effect ( a b -- c )" } { "filter-model" filter-model } }
-{ $description "Creates a model that uses the updates of another model only when they satisfy a given predicate" } ;
-
-HELP: fold
-{ $values { "model" model } { "oldval" "starting value" } { "quot" "applied to update and previous values" } { "model" model } }
-{ $description "Similar to " { $link reduce } " but works on models, applying a quotation to the previous and new values at each update" } ;
-
-HELP: switch-models
-{ $values { "model1" model } { "model2" model } { "model'" model } }
-{ $description "Creates a model that starts with the behavior of model2 and switches to the behavior of model1 on its update" } ;
-
-HELP: <mapped>
-{ $values { "model" model } { "quot" "applied to model's value on updates" } { "model" model } }
-{ $description "An expanded version of " { $link <arrow> } ". Use " { $link fmap } " instead." } ;
-
-HELP: when-model
-{ $values { "model" model } { "quot" "called on the model if the quot yields true" } { "cond" "a quotation called on the model's value, yielding a boolean value"  } }
-{ $description "Calls quot when model updates if its value meets the condition set in cond" } ;
-
-HELP: with-self
-{ $values { "quot" "quotation that recieves its own return value" } { "model" model } }
-{ $description "Fixed points for models: the quot reacts to the same model to gives" } ;
-
-HELP: #1
-{ $values { "model" model } { "model'" model } }
-{ $description "Moves a model to the top of its dependencies' connections, thus being notified before the others" } ;
-
-ARTICLE: "models.combinators" "Extending models"
-"The " { $vocab-link "models.combinators" } " library expands models to have discrete start and end times. "
-"Also, it provides methods of manipulating and combining models, expecially useful when programming user interfaces: "
-"The output models of some gadgets (see " { $vocab-link "ui.gadgets.controls" } " ) can be manipulated and used as the input models of others. " ;
-
-ABOUT: "models.combinators"
diff --git a/extra/models/combinators/combinators.factor b/extra/models/combinators/combinators.factor
deleted file mode 100644 (file)
index 4896910..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-USING: accessors arrays kernel models models.product monads
-sequences sequences.extras shuffle ;
-FROM: syntax => >> ;
-IN: models.combinators
-
-TUPLE: multi-model < model important? ;
-GENERIC: (model-changed) ( model observer -- )
-: <multi-model> ( models kind -- model ) f swap new-model [ [ add-dependency ] curry each ] keep ;
-M: multi-model model-changed over value>> [ (model-changed) ] [ 2drop ] if ;
-M: multi-model model-activated dup dependencies>> [ value>> ] find nip
-   [ swap model-changed ] [ drop ] if* ;
-
-: #1 ( model -- model' ) t >>important? ;
-
-IN: models
-: notify-connections ( model -- )
-    dup connections>> dup [ dup multi-model? [ important?>> ] [ drop f ] if ] find-all
-    [ second tuck [ remove ] dip prefix ] each
-    [ model-changed ] with each ;
-IN: models.combinators
-
-TUPLE: basic-model < multi-model ;
-M: basic-model (model-changed) [ value>> ] dip set-model ;
-: merge ( models -- model ) basic-model <multi-model> ;
-: 2merge ( model1 model2 -- model ) 2array merge ;
-: <basic> ( value -- model ) basic-model new-model ;
-
-TUPLE: filter-model < multi-model quot ;
-M: filter-model (model-changed) [ value>> ] dip 2dup quot>> call( a -- ? )
-   [ set-model ] [ 2drop ] if ;
-: filter-model ( model quot -- filter-model ) [ 1array \ filter-model <multi-model> ] dip >>quot ;
-
-TUPLE: fold-model < multi-model quot base values ;
-M: fold-model (model-changed) 2dup base>> =
-    [ [ [ value>> ] [ [ values>> ] [ quot>> ] bi ] bi* swapd reduce* ] keep set-model ]
-    [ [ [ value>> ] [ values>> ] bi* push ]
-      [ [ [ value>> ] [ [ value>> ] [ quot>> ] bi ] bi* call( val oldval -- newval ) ] keep set-model ] 2bi
-    ] if ;
-M: fold-model model-activated drop ;
-: new-fold-model ( deps -- model ) fold-model <multi-model> V{ } clone >>values ;
-: fold ( model oldval quot -- model ) rot 1array new-fold-model swap >>quot
-   swap >>value ;
-: fold* ( model oldmodel quot -- model ) over [ [ 2array new-fold-model ] dip >>quot ]
-    dip [ >>base ] [ value>> >>value ] bi ;
-
-TUPLE: updater-model < multi-model values updates ;
-M: updater-model (model-changed) [ tuck updates>> =
-   [ [ values>> value>> ] keep set-model ]
-   [ drop ] if ] keep f swap (>>value) ;
-: updates ( values updates -- model ) [ 2array updater-model <multi-model> ] 2keep
-   [ >>values ] [ >>updates ] bi* ;
-
-SYMBOL: switch
-TUPLE: switch-model < multi-model original switcher on ;
-M: switch-model (model-changed) 2dup switcher>> =
-   [ [ value>> ] dip over switch = [ nip [ original>> ] keep f >>on model-changed ] [ t >>on set-model ] if ]
-   [ dup on>> [ 2drop ] [ [ value>> ] dip over [ set-model ] [ 2drop ] if ] if ] if ;
-: switch-models ( model1 model2 -- model' ) swap [ 2array switch-model <multi-model> ] 2keep
-   [ [ value>> >>value ] [ >>original ] bi ] [ >>switcher ] bi* ;
-M: switch-model model-activated [ original>> ] keep model-changed ;
-: >behavior ( event -- behavior ) t >>value ;
-
-TUPLE: mapped-model < multi-model model quot ;
-: new-mapped-model ( model quot class -- mapped-model ) [ over 1array ] dip
-   <multi-model> swap >>quot swap >>model ;
-: <mapped> ( model quot -- model ) mapped-model new-mapped-model ;
-M: mapped-model (model-changed)
-    [ [ value>> ] [ quot>> ] bi* call( old -- new ) ] [ nip ] 2bi
-    set-model ;
-
-TUPLE: side-effect-model < mapped-model ;
-M: side-effect-model (model-changed) [ value>> ] dip [ quot>> call( old -- ) ] 2keep set-model ;
-
-TUPLE: quot-model < mapped-model ;
-M: quot-model (model-changed) nip [ quot>> call( -- b ) ] keep set-model ;
-
-TUPLE: action-value < basic-model parent ;
-: <action-value> ( parent value -- model ) action-value new-model swap >>parent ;
-M: action-value model-activated dup parent>> dup activate-model model-changed ; ! a fake dependency of sorts
-
-TUPLE: action < multi-model quot ;
-M: action (model-changed) [ [ value>> ] [ quot>> ] bi* call( a -- b ) ] keep value>>
-   [ swap add-connection ] 2keep model-changed ;
-: <action> ( model quot -- action-model ) [ 1array action <multi-model> ] dip >>quot dup f <action-value> >>value value>> ;
-
-TUPLE: collection < multi-model ;
-: <collection> ( models -- product ) collection <multi-model> ;
-M: collection (model-changed)
-    nip
-    dup dependencies>> [ value>> ] all?
-    [ dup [ value>> ] product-value swap set-model ]
-    [ drop ] if ;
-M: collection model-activated dup (model-changed) ;
-
-! for side effects
-TUPLE: (when-model) < multi-model quot cond ;
-: when-model ( model quot cond -- model ) rot 1array (when-model) <multi-model> swap >>cond swap >>quot ;
-M: (when-model) (model-changed) [ quot>> ] 2keep
-    [ value>> ] [ cond>> ] bi* call( a -- ? ) [ call( model -- ) ] [ 2drop ] if ;
-
-! only used in construction
-: with-self ( quot: ( model -- model ) -- model ) [ f <basic> dup ] dip call swap [ add-dependency ] keep ; inline
-
-USE: models.combinators.templates
-<< { "$>" "<$" "fmap" } [ fmaps ] each >>
diff --git a/extra/models/combinators/summary.txt b/extra/models/combinators/summary.txt
deleted file mode 100644 (file)
index 1e5347e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Model combination and manipulation
\ No newline at end of file
diff --git a/extra/models/combinators/templates/templates.factor b/extra/models/combinators/templates/templates.factor
deleted file mode 100644 (file)
index 685ad93..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-USING: kernel sequences functors fry macros generalizations ;
-IN: models.combinators.templates
-FROM: models.combinators => <collection> #1 ;
-FUNCTOR: fmaps ( W -- )
-W        IS ${W}
-w-n      DEFINES ${W}-n
-w-2      DEFINES 2${W}
-w-3      DEFINES 3${W}
-w-4      DEFINES 4${W}
-w-n*     DEFINES ${W}-n*
-w-2*     DEFINES 2${W}*
-w-3*     DEFINES 3${W}*
-w-4*     DEFINES 4${W}*
-WHERE
-MACRO: w-n ( int -- quot ) dup '[ [ _ narray <collection> ] dip [ _ firstn ] prepend W ] ;
-: w-2 ( a b quot -- mapped ) 2 w-n ; inline
-: w-3 ( a b c quot -- mapped ) 3 w-n ; inline
-: w-4 ( a b c d quot -- mapped ) 4 w-n ; inline
-MACRO: w-n* ( int -- quot ) dup '[ [ _ narray <collection> #1 ] dip [ _ firstn ] prepend W ] ;
-: w-2* ( a b quot -- mapped ) 2 w-n* ; inline
-: w-3* ( a b c quot -- mapped ) 3 w-n* ; inline
-: w-4* ( a b c d quot -- mapped ) 4 w-n* ; inline
-;FUNCTOR
\ No newline at end of file
diff --git a/extra/models/illusion/authors.txt b/extra/models/illusion/authors.txt
new file mode 100644 (file)
index 0000000..ce0899f
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
\ No newline at end of file
diff --git a/extra/models/illusion/illusion.factor b/extra/models/illusion/illusion.factor
new file mode 100644 (file)
index 0000000..0016979
--- /dev/null
@@ -0,0 +1,15 @@
+USING: accessors models models.arrow inverse kernel ;
+IN: models.illusion
+
+TUPLE: illusion < arrow ;
+
+: <illusion> ( model quot -- illusion )
+    illusion new V{ } clone >>connections V{ } clone >>dependencies 0 >>ref
+    swap >>quot over >>model [ add-dependency ] keep ;
+
+: <activated-illusion> ( model quot -- illusion ) <illusion> dup activate-model ;
+
+: backtalk ( value object -- )
+   [ quot>> [undo] call( a -- b ) ] [ model>> ] bi set-model ;
+
+M: illusion update-model ( model -- ) [ [ value>> ] keep backtalk ] with-locked-model ;
\ No newline at end of file
diff --git a/extra/models/illusion/summary.txt b/extra/models/illusion/summary.txt
new file mode 100644 (file)
index 0000000..8ea7cf1
--- /dev/null
@@ -0,0 +1 @@
+Two Way Arrows
\ No newline at end of file
index fc521eca3ef375378e5d846c19fe3629d29d198b..9ea66fba520b875a881b317a55a2a32971c11cba 100644 (file)
@@ -50,13 +50,13 @@ TUPLE: cond-value value quot ;
 
 CONSTRUCTOR: cond-value ( value quot -- cond-value ) ;
 
-: write-mdb-persistent ( value quot: ( tuple -- assoc ) -- value' )
+: write-mdb-persistent ( value quot -- value' )
    over [ call( tuple -- assoc ) ] dip 
    [ [ tuple-collection name>> ] [ >toid ] bi ] keep
    [ add-storable ] dip
-   [ tuple-collection name>> ] [ id>> ] bi <objref> ; inline
+   [ tuple-collection name>> ] [ id>> ] bi <objref> ;
 
-: write-field ( value quot: ( tuple -- assoc ) -- value' )
+: write-field ( value quot -- value' )
    <cond-value> {
       { [ dup value>> mdb-special-value? ] [ value>> ]  }
       { [ dup value>> mdb-persistent? ]
@@ -66,7 +66,7 @@ CONSTRUCTOR: cond-value ( value quot -- cond-value ) ;
       { [ dup value>> [ hashtable? ] [ linked-assoc? ] bi or ]
         [ [ value>> ] [ quot>> ] bi '[ _ write-field ] assoc-map ] }
       [ value>> ]
-   } cond ; inline recursive
+   } cond ;
 
 : write-tuple-fields ( mirror tuple assoc quot: ( tuple -- assoc ) -- )
    swap ! m t q q a 
old mode 100755 (executable)
new mode 100644 (file)
index a483a492b3f1ed69f073ea9dca760c082318b343..b0ab2c1bc3499788995bfbd99a83eb7f83153f77 100644 (file)
@@ -6,14 +6,14 @@ DEFER: fake
 \ fake H{ } clone "multi-methods" set-word-prop
 << (( -- )) \ fake set-stack-effect >>
 
-[ "fake-{ }" ] [ { } \ fake method-word-name ] unit-test
+[
+    [ "fake-{ }" ] [ { } \ fake method-word-name ] unit-test
 
-[ H{ { "multi-method-generic" fake } { "multi-method-specializer" { } } } ]
-[ { } \ fake method-word-props ] unit-test
+    [ H{ { "multi-method-generic" fake } { "multi-method-specializer" { } } } ]
+    [ { } \ fake method-word-props ] unit-test
 
-[ t ] [ { } \ fake <method> method-body? ] unit-test
+    [ t ] [ { } \ fake <method> method-body? ] unit-test
 
-[
     [ { } [ ] ] [ \ fake methods prepare-methods [ sort-methods ] dip ] unit-test
 
     [ t ] [ { } \ fake multi-dispatch-quot callable? ] unit-test
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d6fdefd1aa2b0fd474d4319ee8590c7cdb9530c5..e3d8cb7fd91036be60d2c339b8c006b60142ae54 100644 (file)
@@ -1,12 +1,12 @@
 USING: namespaces math partial-continuations tools.test
-kernel sequences ;
+kernel sequences fry ;
 IN: partial-continuations.tests
 
 SYMBOL: sum
 
 : range ( r from to -- n )
     over - 1 + rot [ 
-        -rot [ over + pick call drop ] each 2drop f  
+        '[ over + @ drop ] each drop f
     ] bshift 2nip ; inline
 
 [ 55 ] [
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/project-euler/062/062-tests.factor b/extra/project-euler/062/062-tests.factor
new file mode 100644 (file)
index 0000000..d8e0b96
--- /dev/null
@@ -0,0 +1,4 @@
+USING: project-euler.062 tools.test ;
+IN: project-euler.062.tests
+
+[ 127035954683 ] [ euler062 ] unit-test
diff --git a/extra/project-euler/062/062.factor b/extra/project-euler/062/062.factor
new file mode 100644 (file)
index 0000000..037cdc1
--- /dev/null
@@ -0,0 +1,54 @@
+! Copyright (c) 2009 Guillaume Nargeot.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays assocs hashtables kernel math math.functions
+project-euler.common sequences sorting ;
+IN: project-euler.062
+
+! http://projecteuler.net/index.php?section=problems&id=062
+
+! DESCRIPTION
+! -----------
+
+! The cube, 41063625 (345^3), can be permuted to produce two
+! other cubes: 56623104 (384^3) and 66430125 (405^3). In
+! fact, 41063625 is the smallest cube which has exactly three
+! permutations of its digits which are also cube.
+
+! Find the smallest cube for which exactly five permutations of
+! its digits are cube.
+
+
+! SOLUTION
+! --------
+
+<PRIVATE
+
+: cube ( n -- n^3 ) 3 ^ ; inline
+: >key ( n -- k ) cube number>digits natural-sort ; inline
+: has-entry? ( n assoc -- ? ) [ >key ] dip key? ; inline
+
+: (euler062) ( n assoc -- n )
+    2dup has-entry? [
+        2dup [ >key ] dip
+        [ dup 0 swap [ 1 + ] change-nth ] change-at
+        2dup [ >key ] dip at first 5 =
+        [ 
+            [ >key ] dip at second
+        ] [
+            [ 1 + ] dip (euler062)
+        ] if
+    ] [
+        2dup 1 pick cube 2array -rot
+        [ >key ] dip set-at [ 1 + ] dip
+        (euler062)
+    ] if ;
+
+PRIVATE>
+
+: euler062 ( -- answer )
+    1 1 <hashtable> (euler062) ;
+
+! [ euler062 ] 100 ave-time
+! 78 ms ave run time - 0.9 SD (100 trials)
+
+SOLUTION: euler062
diff --git a/extra/project-euler/062/authors.txt b/extra/project-euler/062/authors.txt
new file mode 100644 (file)
index 0000000..6eb6698
--- /dev/null
@@ -0,0 +1 @@
+Guillaume Nargeot
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index f2d6b89afcb1c215768cc7bdf3ca7e35aa4d3df0..1fb41b61c0d799f135b1d522fc7c2fb65908bbe3 100644 (file)
@@ -9,14 +9,6 @@ HELP: collect-benchmarks
     $nl
     "A nicer word for interactive use is " { $link ave-time } "." } ;
 
-HELP: nth-place
-{ $values { "x" float } { "n" integer } { "y" float } }
-{ $description "Rounds a floating point number to " { $snippet "n" } " decimal places." }
-{ $examples
-    "This word is useful for display purposes when showing 15 decimal places is not desired:"
-    { $unchecked-example "3.141592653589793 3 nth-place number>string" "\"3.142\"" }
-} ;
-
 HELP: ave-time
 { $values { "quot" quotation } { "n" integer } }
 { $description "Runs a quotation " { $snippet "n" } " times, then prints the average run time and standard deviation." }
diff --git a/extra/project-euler/ave-time/ave-time-tests.factor b/extra/project-euler/ave-time/ave-time-tests.factor
new file mode 100644 (file)
index 0000000..86b0048
--- /dev/null
@@ -0,0 +1,5 @@
+IN: project-euler.ave-time.tests
+USING: tools.test math arrays project-euler.ave-time ;
+
+{ 0 3 } [ 1 2 [ + ] 10 collect-benchmarks ] must-infer-as
+[ 1 2 t ] [ 1 2 [ + ] 10 collect-benchmarks array? ] unit-test
index cc326c1afe9bd40c14e5c4e914d07cdd81116e0a..ec190fed187da15b7c51c00c970a1b1cc855f3c2 100644 (file)
@@ -1,24 +1,16 @@
 ! Copyright (c) 2007, 2008 Aaron Schaefer.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: continuations fry io kernel make math math.functions
-math.parser math.statistics memory tools.time ;
+USING: combinators.smart formatting fry io kernel macros math
+math.functions math.statistics memory sequences tools.time ;
 IN: project-euler.ave-time
 
-: nth-place ( x n -- y )
-    10^ [ * round >integer ] keep /f ;
-
-: collect-benchmarks ( quot n -- seq )
-    [
-        [ datastack ]
-        [
-            '[ _ gc benchmark 1000 / , ]
-            [ '[ _ _ with-datastack drop ] ] keep swap
-        ]
-        [ 1 - ] tri* swap times call
-    ] { } make ; inline
+MACRO: collect-benchmarks ( quot n -- seq )
+    swap '[ _ [ [ [ _ nullary ] preserving ] gc benchmark 1000 / ] replicate ] ;
 
 : ave-time ( quot n -- )
-    [ collect-benchmarks ] keep swap
-    [ std 2 nth-place ] [ mean round >integer ] bi [
-        # " ms ave run time - " % # " SD (" % # " trials)" %
-    ] "" make print flush ; inline
+    [
+        collect-benchmarks
+        [ mean round >integer ]
+        [ std ] bi
+    ] keep
+    "%d ms ave run time - %.2f SD (%d trials)\n" printf flush ; inline
index e64bd618522f3b2c8b541134e5b1f4fe318a3916..66f42968273d3fd6466e88cbf088d04efa9e9cdd 100644 (file)
@@ -16,16 +16,16 @@ USING: definitions io io.files io.pathnames kernel math math.parser
     project-euler.045 project-euler.046 project-euler.047 project-euler.048
     project-euler.049 project-euler.051 project-euler.052 project-euler.053
     project-euler.054 project-euler.055 project-euler.056 project-euler.057
-    project-euler.058 project-euler.059 project-euler.063 project-euler.065
-    project-euler.067 project-euler.069 project-euler.071 project-euler.072
-    project-euler.073 project-euler.074 project-euler.075 project-euler.076
-    project-euler.079 project-euler.081 project-euler.085 project-euler.092
-    project-euler.097 project-euler.099 project-euler.100 project-euler.102
-    project-euler.112 project-euler.116 project-euler.117 project-euler.124
-    project-euler.134 project-euler.148 project-euler.150 project-euler.151
-    project-euler.164 project-euler.169 project-euler.173 project-euler.175
-    project-euler.186 project-euler.188 project-euler.190 project-euler.203
-    project-euler.215 ;
+    project-euler.058 project-euler.059 project-euler.062 project-euler.063
+    project-euler.065 project-euler.067 project-euler.069 project-euler.071
+    project-euler.072 project-euler.073 project-euler.074 project-euler.075
+    project-euler.076 project-euler.079 project-euler.081 project-euler.085
+    project-euler.092 project-euler.097 project-euler.099 project-euler.100
+    project-euler.102 project-euler.112 project-euler.116 project-euler.117
+    project-euler.124 project-euler.134 project-euler.148 project-euler.150
+    project-euler.151 project-euler.164 project-euler.169 project-euler.173
+    project-euler.175 project-euler.186 project-euler.188 project-euler.190
+    project-euler.203 project-euler.215 ;
 IN: project-euler
 
 <PRIVATE
diff --git a/extra/recipes/authors.txt b/extra/recipes/authors.txt
deleted file mode 100644 (file)
index ce0899f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
\ No newline at end of file
diff --git a/extra/recipes/icons/back.tiff b/extra/recipes/icons/back.tiff
deleted file mode 100644 (file)
index 27b8112..0000000
Binary files a/extra/recipes/icons/back.tiff and /dev/null differ
diff --git a/extra/recipes/icons/hate.tiff b/extra/recipes/icons/hate.tiff
deleted file mode 100644 (file)
index d7d5f8e..0000000
Binary files a/extra/recipes/icons/hate.tiff and /dev/null differ
diff --git a/extra/recipes/icons/love.tiff b/extra/recipes/icons/love.tiff
deleted file mode 100644 (file)
index ae2fa7b..0000000
Binary files a/extra/recipes/icons/love.tiff and /dev/null differ
diff --git a/extra/recipes/icons/more.tiff b/extra/recipes/icons/more.tiff
deleted file mode 100644 (file)
index b4ec27b..0000000
Binary files a/extra/recipes/icons/more.tiff and /dev/null differ
diff --git a/extra/recipes/icons/submit.tiff b/extra/recipes/icons/submit.tiff
deleted file mode 100644 (file)
index 7c98267..0000000
Binary files a/extra/recipes/icons/submit.tiff and /dev/null differ
diff --git a/extra/recipes/recipes.factor b/extra/recipes/recipes.factor
deleted file mode 100644 (file)
index d546859..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-USING: accessors arrays colors.constants combinators
-db.sqlite db.tuples db.types kernel locals math
-monads persistency sequences sequences.extras ui ui.gadgets.controls
-ui.gadgets.layout models.combinators ui.gadgets.labels
-ui.gadgets.scrollers ui.pens.solid io.files.temp ;
-FROM: sets => prune ;
-IN: recipes
-
-STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } { genre { VARCHAR 100 } } ;
-: <recipe> ( title genre text -- recipe ) recipe new swap >>txt swap >>genre swap >>title 0 >>votes ;
-"recipes.db" temp-file <sqlite-db> recipe define-db
-: top-recipes ( offset search -- recipes ) <query> T{ recipe } rot >>title >>tuple
-    "votes" >>order 30 >>limit swap >>offset get-tuples ;
-: top-genres ( -- genres ) f f top-recipes [ genre>> ] map prune 4 short head-slice ;
-
-: interface ( -- book ) [ 
-     [
-        [ $ TOOLBAR $ ] <hbox> COLOR: AliceBlue <solid> >>interior ,
-        [ "Genres:" <label> , <spacer> $ ALL $ $ GENRES $ ] <hbox>
-            { 5 0 } >>gap COLOR: gray <solid> >>interior ,
-        $ RECIPES $
-     ] <vbox> ,
-     [
-        [ "Title:" <label> , $ TITLE $ "Genre:" <label> , $ GENRE $ ] <hbox> ,
-        $ BODY $
-        $ BUTTON $
-     ] <vbox> ,
-  ] <book*> { 350 245 } >>pref-dim ;
-  
-:: recipe-browser ( -- ) [ [
-    interface
-      <table*> :> tbl
-      "okay" <model-border-btn> BUTTON -> :> ok
-      IMG-MODEL-BTN: submit [ store-tuple ] >>value TOOLBAR -> :> submit
-      IMG-MODEL-BTN: love 1 >>value TOOLBAR ->
-      IMG-MODEL-BTN: hate -1 >>value -> 2array merge :> votes
-      IMG-MODEL-BTN: back -> [ -30 ] <$
-      IMG-MODEL-BTN: more -> [ 30 ] <$ 2array merge :> viewed
-      <spacer> <model-field*> ->% 1 :> search
-      submit ok [ [ drop ] ] <$ 2array merge [ drop ] >>value :> quot
-      viewed 0 [ + ] fold search ok t <basic> "all" <model-btn> ALL ->
-      tbl selection>> votes [ [ + ] curry change-votes modify-tuple ] 2$>
-        4array merge
-        [ drop [ f ] [ "%" dup surround <pattern> ] if-empty top-recipes ] 3fmap :> ups
-      ups [ top-genres [ <model-btn> GENRES -> ] map merge ] bind*
-        [ text>> T{ recipe } swap >>genre get-tuples ] fmap
-      tbl swap ups 2merge >>model
-        [ [ title>> ] [ genre>> ] bi 2array ] >>quot
-        { "Title" "Genre" } >>column-titles dup <scroller> RECIPES ,% 1 actions>>
-      submit [ "" dup dup <recipe> ] <$ 2array merge
-        { [ [ title>> ] fmap <model-field> TITLE ->% .5 ]
-          [ [ genre>> ] fmap <model-field> GENRE ->% .5 ]
-          [ [ txt>> ] fmap <model-editor> BODY ->% 1 ]
-        } cleave
-        [ <recipe> ] 3fmap
-      [ [ 1 ] <$ ]
-      [ quot ok updates #1 [ call( recipe -- ) 0 ] 2fmap ] bi
-      2merge 0 <basic> switch-models >>model
-   ] with-interface "recipes" open-window ] with-ui ;
-
-MAIN: recipe-browser
\ No newline at end of file
diff --git a/extra/recipes/summary.txt b/extra/recipes/summary.txt
deleted file mode 100644 (file)
index 98b1ece..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Database backed recipe sharing
\ No newline at end of file
index 466fdc9937ae709f2ee2f7f3992ac40e86a0a8bb..51d0c21a94e3fed17204af2e2d4368cad9bef631 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2009 Bruno Deferrari
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors io io.encodings.8-bit io.sockets
-io.streams.duplex kernel redis.command-writer
-redis.response-parser splitting ;
+USING: accessors io io.sockets io.streams.duplex kernel
+redis.command-writer redis.response-parser splitting
+io.encodings.8-bit.latin1 ;
 IN: redis
 
 #! Connection
old mode 100755 (executable)
new mode 100644 (file)
index dda3e7f2009e67e67f91dba5987f845fb1397440..6f9c10010da2d4e06031979aa53e60528f906a93 100644 (file)
@@ -108,13 +108,14 @@ $nl
 "To use the api you must set the variables " { $link key-id } " and " \r
 { $link secret-key } " to your Amazon S3 key and secret key respectively. Once "\r
 "this is done you can call any of the words below."\r
-{ $subsection buckets }\r
-{ $subsection create-bucket }\r
-{ $subsection delete-bucket }\r
-{ $subsection keys }\r
-{ $subsection get-object }\r
-{ $subsection put-object }\r
-{ $subsection delete-object }\r
+{ $subsections buckets\r
+    create-bucket\r
+    delete-bucket\r
+    keys\r
+    get-object\r
+    put-object\r
+    delete-object\r
+}\r
 ;\r
 \r
-ABOUT: "s3"
\ No newline at end of file
+ABOUT: "s3"\r
index 3fb87feaf8da17a5663009c9634232fe43ce8eb1..73fcc651bda4ef2de50b06751743de0de069c421 100644 (file)
@@ -21,7 +21,7 @@ TUPLE: 1modified < modified seq ;
 M: modified length seq>> length ;
 M: modified set-length seq>> set-length ;
 
-M: 1modified virtual-seq seq>> ;
+M: 1modified virtual-exemplar seq>> ;
 
 TUPLE: scaled < 1modified c ;
 C: <scaled> scaled
@@ -71,7 +71,8 @@ M: summed modified-set-nth ( elt n seq -- ) immutable ;
 M: summed set-length ( n seq -- )
     seqs>> [ set-length ] with each ;
 
-M: summed virtual-seq ( summed -- seq ) [ ] { } map-as ;
+M: summed virtual-exemplar ( summed -- seq )
+    seqs>> [ f ] [ first ] if-empty ;
 
 : <2summed> ( seq seq -- summed-seq ) 2array <summed> ;
 : <3summed> ( seq seq seq -- summed-seq ) 3array <summed> ;
index 77fddd551021305a9e52eebca18dc040d3422609..7157e3f025a059f1cc51f3de1061ac838bf43d12 100644 (file)
@@ -16,6 +16,6 @@ M: repeating set-length (>>len) ;
 
 M: repeating virtual@ ( n seq -- n' seq' ) circular>> ;
 
-M: repeating virtual-seq circular>> ;
+M: repeating virtual-exemplar circular>> ;
 
 INSTANCE: repeating virtual-sequence
index 535c8cd6261e942548cd35f027b07ed5fc475114..dcae438679e80c4eacd9e2adbd7e17e0ab1a8899 100644 (file)
@@ -10,7 +10,7 @@ SYMBOL: site-watcher-frequency
 5 minutes site-watcher-frequency set-global
  
 SYMBOL: running-site-watcher
-[ f running-site-watcher set-global ] "site-watcher" add-init-hook
+[ f running-site-watcher set-global ] "site-watcher" add-startup-hook
 
 <PRIVATE
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 3d03691..17e277f
@@ -72,16 +72,16 @@ CONSTANT: SOUND-UFO-HIT      8
 : init-sounds ( cpu -- )
   init-openal
   [ 9 gen-sources swap (>>sounds) ] keep
-  [ SOUND-SHOT        "resource:extra/space-invaders/resources/Shot.wav" init-sound ] keep 
-  [ SOUND-UFO         "resource:extra/space-invaders/resources/Ufo.wav" init-sound ] keep 
+  [ SOUND-SHOT        "vocab:space-invaders/resources/Shot.wav" init-sound ] keep 
+  [ SOUND-UFO         "vocab:space-invaders/resources/Ufo.wav" init-sound ] keep 
   [ sounds>> SOUND-UFO swap nth AL_LOOPING AL_TRUE set-source-param ] keep
-  [ SOUND-BASE-HIT    "resource:extra/space-invaders/resources/BaseHit.wav" init-sound ] keep 
-  [ SOUND-INVADER-HIT "resource:extra/space-invaders/resources/InvHit.Wav" init-sound ] keep 
-  [ SOUND-WALK1       "resource:extra/space-invaders/resources/Walk1.wav" init-sound ] keep 
-  [ SOUND-WALK2       "resource:extra/space-invaders/resources/Walk2.wav" init-sound ] keep 
-  [ SOUND-WALK3       "resource:extra/space-invaders/resources/Walk3.wav" init-sound ] keep 
-  [ SOUND-WALK4       "resource:extra/space-invaders/resources/Walk4.wav" init-sound ] keep 
-  [ SOUND-UFO-HIT    "resource:extra/space-invaders/resources/UfoHit.wav" init-sound ] keep
+  [ SOUND-BASE-HIT    "vocab:space-invaders/resources/BaseHit.wav" init-sound ] keep 
+  [ SOUND-INVADER-HIT "vocab:space-invaders/resources/InvHit.Wav" init-sound ] keep 
+  [ SOUND-WALK1       "vocab:space-invaders/resources/Walk1.wav" init-sound ] keep 
+  [ SOUND-WALK2       "vocab:space-invaders/resources/Walk2.wav" init-sound ] keep 
+  [ SOUND-WALK3       "vocab:space-invaders/resources/Walk3.wav" init-sound ] keep 
+  [ SOUND-WALK4       "vocab:space-invaders/resources/Walk4.wav" init-sound ] keep 
+  [ SOUND-UFO-HIT    "vocab:space-invaders/resources/UfoHit.wav" init-sound ] keep
   f swap (>>looping?) ;
 
 : cpu-init ( cpu -- cpu )
@@ -356,12 +356,12 @@ M: space-invaders update-video ( value addr cpu -- )
     3drop
   ] if ;
 
-: sync-frame ( millis -- millis )
+: sync-frame ( micros -- micros )
   #! Sleep until the time for the next frame arrives.
-  1000 60 / >fixnum + system:millis - dup 0 >
-  [ milliseconds threads:sleep ] [ drop threads:yield ] if system:millis ;
+  1000 60 / >fixnum + system:system-micros - dup 0 >
+  [ milliseconds threads:sleep ] [ drop threads:yield ] if system:system-micros ;
 
-: invaders-process ( millis gadget -- )
+: invaders-process ( micros gadget -- )
   #! Run a space invaders gadget inside a 
   #! concurrent process. Messages can be sent to
   #! signal key presses, etc.
@@ -377,7 +377,7 @@ M: space-invaders update-video ( value addr cpu -- )
 M: invaders-gadget graft* ( gadget -- )
   dup cpu>> init-sounds
   f over (>>quit?)
-  [ system:millis swap invaders-process ] curry
+  [ system:system-micros swap invaders-process ] curry
   "Space invaders" threads:spawn drop ;
 
 M: invaders-gadget ungraft* ( gadget -- )
old mode 100755 (executable)
new mode 100644 (file)
index 9003b56b15939e64f90c8b864cfd9c14fed76d9a..f660674b63c7232fda7797fe6c732f7d5605d78e 100644 (file)
@@ -30,7 +30,7 @@ TUPLE: unique-deque assoc deque ;
 
 : peek-url ( unique-deque -- todo-url ) deque>> peek-front ;
 
-:: slurp-deque-when ( deque quot1 quot2: ( value -- ) -- )
+:: slurp-deque-when ( deque quot1: ( value -- ) quot2: ( value -- ) -- )
     deque deque-empty? [
         deque pop-front dup quot1 call
         [ quot2 call t ] [ drop f ] if
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/sudokus/authors.txt b/extra/sudokus/authors.txt
deleted file mode 100644 (file)
index ce0899f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
\ No newline at end of file
diff --git a/extra/sudokus/sudokus.factor b/extra/sudokus/sudokus.factor
deleted file mode 100644 (file)
index c7bc694..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-USING: accessors arrays combinators.short-circuit grouping kernel lists
-lists.lazy locals math math.functions math.parser math.ranges
-models.product monads random sequences sets ui ui.gadgets.controls
-ui.gadgets.layout models.combinators ui.gadgets.alerts vectors fry
-ui.gadgets.labels shuffle ;
-IN: sudokus
-
-: row ( index -- row ) 1 + 9 / ceiling ;
-: col ( index -- col ) 9 mod 1 + ;
-: sq ( index -- square ) [ row ] [ col ] bi [ 3 / ceiling ] bi@ 2array ;
-: near ( a pos -- ? ) { [ [ row ] bi@ = ] [ [ col ] bi@ = ] [ [ sq ] bi@ = ] } 2|| ;
-: nth-or-lower ( n seq -- elt ) [ length 1 - 2dup > [ nip ] [ drop ] if ] keep nth ;
-
-:: solutions ( puzzle random? -- solutions )
-    f puzzle random? [ indices [ f ] [ random? swap nth-or-lower ] if-empty ] [ index ] if
-    [ :> pos
-      1 9 [a,b] 80 iota [ pos near ] filter [ puzzle nth ] map prune diff
-      [ 1array puzzle pos cut-slice rest surround ] map >list [ random? solutions ] bind
-    ] [ puzzle list-monad return ] if* ;
-
-: solution ( puzzle random? -- solution ) dupd solutions dup +nil+ = [ drop "Unsolvable" alert* ] [ nip car ] if ;
-: hint ( puzzle -- puzzle' ) [ [ f swap indices random dup ] [ f solution ] bi nth ] keep swapd >vector [ set-nth ] keep ;
-: create ( difficulty -- puzzle ) 81 [ f ] replicate
-    40 random solution [ [ f swap [ length random ] keep set-nth ] curry times ] keep ;
-
-: do-sudoku ( -- ) [ [
-        [
-            81 [ "" ] replicate <basic> switch-models [ [ <basic> ] map 9 group [ 3 group ] map 3 group
-               [ [ [ <spacer> [ [ <model-field> ->% 2 [ string>number ] fmap ]
-                    map <spacer> ] map concat ] <hbox> , ] map concat <spacer> ] map concat <product>
-               [ "Difficulty:" <label> , "1" <basic> <model-field> -> [ string>number 1 or 1 + 10 * ] fmap
-               "Generate" <model-border-btn> -> updates [ create ] fmap <spacer>
-               "Hint" <model-border-btn> -> "Solve" <model-border-btn> -> ] <hbox> ,
-               roll [ swap updates ] curry bi@
-               [ [ hint ] fmap ] [ [ f solution ] fmap ] bi* 3array merge [ [ [ number>string ] [ "" ] if* ] map ] fmap
-           ] bind
-        ] with-self , ] <vbox> { 280 220 } >>pref-dim
-    "Sudoku Sleuth" open-window ] with-ui ;
-
-MAIN: do-sudoku
diff --git a/extra/sudokus/summary.txt b/extra/sudokus/summary.txt
deleted file mode 100644 (file)
index d66e7be..0000000
+++ /dev/null
@@ -1 +0,0 @@
-graphical sudoku solver
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index f1da877c3e0ce04c5eff7d1ccd54860b131b32bb..3f342f69713a20334c98ecfcea9e17ce676f112a 100644 (file)
@@ -57,7 +57,7 @@ TUPLE: terrain-world < game-world
         VELOCITY-MODIFIER-NORMAL >>velocity-modifier ;
 
 M: terrain-world tick-length
-    drop 1000 30 /i ;
+    drop 1000000 30 /i ;
 
 : frustum ( dim -- -x x -y y near far )
     dup first2 min v/n
old mode 100755 (executable)
new mode 100644 (file)
index c9e235ff7953ef71350d8b78cf2e4608d842c39d..a45e6551317ebc44cf97f256eedd9ebd92ce22ff 100644 (file)
@@ -35,7 +35,7 @@ CONSTANT: default-height 20
     rows>> 1 + 10 / ceiling ;
 
 : update-interval ( tetris -- interval )
-    level>> 1 - 60 * 1000 swap - ;
+    level>> 1 - 60 * 1000000 swap - ;
 
 : add-block ( tetris block -- )
     over [ board>> ] 2dip current-piece tetromino>> colour>> set-block ;
@@ -104,10 +104,10 @@ CONSTANT: default-height 20
     dup { 0 1 } tetris-move [ move-drop ] [ lock-piece ] if ;
 
 : update ( tetris -- )
-    millis over last-update>> -
+    system-micros over last-update>> -
     over update-interval > [
         dup move-down
-        millis >>last-update
+        system-micros >>last-update
     ] when drop ;
 
 : ?update ( tetris -- )
index dbdb666e4a39042aedff5c9276023441a3567b0a..66df0cdb2d7161f82549b5891ec92c045f60abef 100644 (file)
@@ -13,8 +13,9 @@ M: tetris-gadget pref-dim* drop { 200 400 } ;
 
 : update-status ( gadget -- )
     dup tetris>> [
-        "Level: " % dup level>> #
-        " Score: " % score>> #
+        [ "Level: " % level>> # ]
+        [ " Score: " % score>> # ]
+        [ paused?>> [ " (Paused)" % ] when ] tri
     ] "" make swap show-status ;
 
 M: tetris-gadget draw-gadget* ( gadget -- )
@@ -25,17 +26,24 @@ M: tetris-gadget draw-gadget* ( gadget -- )
 : new-tetris ( gadget -- gadget )
     [ <new-tetris> ] change-tetris ;
 
+: unless-paused ( tetris quot -- )
+    over tetris>> paused?>> [
+        2drop
+    ] [
+        call
+    ] if ; inline
+
 tetris-gadget H{
     { T{ button-down f f 1 }     [ request-focus ] }
-    { T{ key-down f f "UP" }     [ tetris>> rotate-right ] }
-    { T{ key-down f f "d" }      [ tetris>> rotate-left ] }
-    { T{ key-down f f "f" }      [ tetris>> rotate-right ] }
-    { T{ key-down f f "e" }      [ tetris>> rotate-left ] } ! dvorak d
-    { T{ key-down f f "u" }      [ tetris>> rotate-right ] } ! dvorak f
-    { T{ key-down f f "LEFT" }   [ tetris>> move-left ] }
-    { T{ key-down f f "RIGHT" }  [ tetris>> move-right ] }
-    { T{ key-down f f "DOWN" }   [ tetris>> move-down ] }
-    { T{ key-down f f " " }      [ tetris>> move-drop ] }
+    { T{ key-down f f "UP" }     [ [ tetris>> rotate-right ] unless-paused ] }
+    { T{ key-down f f "d" }      [ [ tetris>> rotate-left ] unless-paused ] }
+    { T{ key-down f f "f" }      [ [ tetris>> rotate-right ] unless-paused ] }
+    { T{ key-down f f "e" }      [ [ tetris>> rotate-left ] unless-paused ] }
+    { T{ key-down f f "u" }      [ [ tetris>> rotate-right ] unless-paused ] }
+    { T{ key-down f f "LEFT" }   [ [ tetris>> move-left ] unless-paused ] }
+    { T{ key-down f f "RIGHT" }  [ [ tetris>> move-right ] unless-paused ] }
+    { T{ key-down f f "DOWN" }   [ [ tetris>> move-down ] unless-paused ] }
+    { T{ key-down f f " " }      [ [ tetris>> move-drop ] unless-paused ] }
     { T{ key-down f f "p" }      [ tetris>> toggle-pause ] }
     { T{ key-down f f "n" }      [ new-tetris drop ] }
 } set-gestures
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/ui/gadgets/alerts/alerts.factor b/extra/ui/gadgets/alerts/alerts.factor
deleted file mode 100644 (file)
index 70943e6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-USING: accessors models monads macros generalizations kernel
-ui ui.gadgets.controls models.combinators ui.gadgets.layout ui.gadgets
-ui.gadgets.labels ui.gadgets.editors ui.gadgets.buttons
-ui.gadgets.packs locals sequences fonts io.styles
-wrap.strings ;
-
-IN: ui.gadgets.alerts
-:: alert ( quot string -- ) <pile> { 10 10 } >>gap 1 >>align
-   string 22 wrap-lines <label> T{ font { name "sans-serif" } { size 18 } } >>font { 200 100 } >>pref-dim add-gadget 
-   "okay" [ close-window ] quot append <border-button> add-gadget "" open-window ;
-
-: alert* ( str -- ) [ ] swap alert ;
-
-:: ask-user ( string -- model' )
-    [
-        string <label>  T{ font { name "sans-serif" } { size 14 } } >>font dup , :> lbl
-        <model-field*> ->% 1 :> fldm
-        "okay" <model-border-btn> :> btn
-        btn -> [ fldm swap updates ]
-               [ [ drop lbl close-window ] $> , ] bi
-    ] <vbox> { 161 86 } >>pref-dim "" open-window ;
-
-MACRO: ask-buttons ( buttons -- quot ) dup length [
-      [ swap
-         [ 22 wrap-lines <label> T{ font { name "sans-serif" } { size 18 } } >>font ,
-         [ [ <model-border-btn> [ close-window ] >>hook -> ] map ] <hbox> , ] <vbox>
-         "" open-window
-      ] dip firstn
-   ] 2curry ;
diff --git a/extra/ui/gadgets/alerts/authors.txt b/extra/ui/gadgets/alerts/authors.txt
deleted file mode 100644 (file)
index ce0899f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
\ No newline at end of file
diff --git a/extra/ui/gadgets/alerts/summary.txt b/extra/ui/gadgets/alerts/summary.txt
deleted file mode 100644 (file)
index f1cd420..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Really simple dialog boxes
\ No newline at end of file
diff --git a/extra/ui/gadgets/comboboxes/authors.txt b/extra/ui/gadgets/comboboxes/authors.txt
deleted file mode 100644 (file)
index ce0899f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
\ No newline at end of file
diff --git a/extra/ui/gadgets/comboboxes/comboboxes.factor b/extra/ui/gadgets/comboboxes/comboboxes.factor
deleted file mode 100644 (file)
index 3eb1180..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-USING: accessors arrays kernel math.rectangles sequences
-ui.gadgets.controls models.combinators ui.gadgets ui.gadgets.glass
-ui.gadgets.labels ui.gestures ;
-QUALIFIED-WITH: ui.gadgets.tables tbl
-IN: ui.gadgets.comboboxes
-
-TUPLE: combo-table < table spawner ;
-
-M: combo-table handle-gesture [ call-next-method drop ] 2keep swap
-   T{ button-up } = [
-      [ spawner>> ]
-      [ tbl:selected-row [ swap set-control-value ] [ 2drop ] if ]
-      [ hide-glass ] tri
-   ] [ drop ] if t ;
-
-TUPLE: combobox < label-control table ;
-combobox H{
-   { T{ button-down } [ dup table>> over >>spawner <zero-rect> show-glass ] }
-} set-gestures
-
-: <combobox> ( options -- combobox ) [ first [ combobox new-label ] keep <basic> >>model ] keep
-    <basic> combo-table new-table [ 1array ] >>quot >>table ;
\ No newline at end of file
diff --git a/extra/ui/gadgets/comboboxes/summary.txt b/extra/ui/gadgets/comboboxes/summary.txt
deleted file mode 100644 (file)
index 0f2ce2b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Combo boxes have a model choosen from a list of options
\ No newline at end of file
diff --git a/extra/ui/gadgets/controls/authors.txt b/extra/ui/gadgets/controls/authors.txt
deleted file mode 100644 (file)
index 2300f69..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
diff --git a/extra/ui/gadgets/controls/controls-docs.factor b/extra/ui/gadgets/controls/controls-docs.factor
deleted file mode 100644 (file)
index 1df6005..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-USING: accessors help.markup help.syntax ui.gadgets.buttons
-ui.gadgets.editors models ui.gadgets ;
-IN: ui.gadgets.controls
-
-HELP: <model-btn>
-{ $values { "gadget" "the button's label" } { "button" button } }
-{ $description "Creates an button whose signal updates on clicks.  " } ;
-
-HELP: <model-border-btn>
-{ $values { "text" "the button's label" } { "button" button } }
-{ $description "Creates an button whose signal updates on clicks.  " } ;
-
-HELP: <table>
-{ $values { "model" "values the table is to display" } { "table" table } }
-{ $description "Creates an " { $link table } } ;
-
-HELP: <table*>
-{ $values { "table" table } }
-{ $description "Creates an " { $link table } " with no initial values to display" } ;
-
-HELP: <list>
-{ $values { "column-model" "values the table is to display" } { "table" table } }
-{ $description "Creates an " { $link table } " with a val-quot that renders each element as its own row" } ;
-
-HELP: <list*>
-{ $values { "table" table } }
-{ $description "Creates an model-list with no initial values to display" } ;
-
-HELP: indexed
-{ $values { "table" table } }
-{ $description "Sets the output model of an table to the selected-index, rather than the selected-value" } ;
-
-HELP: <model-field>
-{ $values { "model" model } { "gadget" model-field } }
-{ $description "Creates a field with an initial value" } ;
-
-HELP: <model-field*>
-{ $values { "field" model-field } }
-{ $description "Creates a field with an empty initial value" } ;
-
-HELP: <empty-field>
-{ $values { "model" model } { "field" model-field } }
-{ $description "Creates a field with an empty initial value that switches to another signal on its update" } ;
-
-HELP: <model-editor>
-{ $values { "model" model } { "gadget" model-field } }
-{ $description "Creates an editor with an initial value" } ;
-
-HELP: <model-editor*>
-{ $values { "editor" "an editor" } }
-{ $description "Creates a editor with an empty initial value" } ;
-
-HELP: <empty-editor>
-{ $values { "model" model } { "editor" "an editor" } }
-{ $description "Creates a field with an empty initial value that switches to another signal on its update" } ;
-
-HELP: <model-action-field>
-{ $values { "field" action-field } }
-{ $description "Field that updates its model with its contents when the user hits the return key" } ;
-
-HELP: IMG-MODEL-BTN:
-{ $syntax "IMAGE-MODEL-BTN: filename" }
-{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path" } ;
-
-HELP: IMG-BTN:
-{ $syntax "[ do-something ] IMAGE-BTN: filename" }
-{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path, calling the specified quotation on click" } ;
-
-HELP: output-model
-{ $values { "gadget" gadget } { "model" model } }
-{ $description "Returns the model a gadget uses for output. Often the same as " { $link model>> } } ;
\ No newline at end of file
diff --git a/extra/ui/gadgets/controls/controls.factor b/extra/ui/gadgets/controls/controls.factor
deleted file mode 100644 (file)
index 5de6da8..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-USING: accessors assocs arrays kernel models monads sequences
-models.combinators ui.gadgets ui.gadgets.borders ui.gadgets.buttons
-ui.gadgets.buttons.private ui.gadgets.editors ui.gadgets.editors.private
-words images.loader ui.gadgets.scrollers ui.images vocabs.parser lexer
-models.range ui.gadgets.sliders ;
-QUALIFIED-WITH: ui.gadgets.sliders slider
-QUALIFIED-WITH: ui.gadgets.tables tbl
-EXCLUDE: ui.gadgets.editors => model-field ;
-IN: ui.gadgets.controls
-
-TUPLE: model-btn < button hook value ;
-: <model-btn> ( gadget -- button ) [
-      [ dup hook>> [ call( button -- ) ] [ drop ] if* ]
-      [ [ [ value>> ] [ ] bi or ] keep set-control-value ]
-      [ model>> f swap (>>value) ] tri
-   ] model-btn new-button f <basic> >>model ;
-: <model-border-btn> ( text -- button ) <model-btn> border-button-theme ;
-
-TUPLE: table < tbl:table { quot initial: [ ] } { val-quot initial: [ ] } color-quot column-titles column-alignment actions ;
-M: table tbl:column-titles column-titles>> ;
-M: table tbl:column-alignment column-alignment>> ;
-M: table tbl:row-columns quot>> [ call( a -- b ) ] [ drop f ] if* ;
-M: table tbl:row-value val-quot>> [ call( a -- b ) ]  [ drop f ] if* ;
-M: table tbl:row-color color-quot>> [ call( a -- b ) ]  [ drop f ] if* ;
-
-: new-table ( model class -- table ) f swap tbl:new-table dup >>renderer
-   f <basic> >>actions dup actions>> [ set-model ] curry >>action ;
-: <table> ( model -- table ) table new-table ;
-: <table*> ( -- table ) V{ } clone <model> <table> ;
-: <list> ( column-model -- table ) <table> [ 1array ] >>quot ;
-: <list*> ( -- table ) V{ } clone <model> <list> ;
-: indexed ( table -- table ) f >>val-quot ;
-
-TUPLE: model-field < field model* ;
-: init-field ( model -- model' ) [ [ ] [ "" ] if* ] change-value ;
-: <model-field> ( model -- gadget ) model-field new-field swap init-field >>model* ;
-M: model-field graft*
-    [ [ model*>> value>> ] [ editor>> ] bi set-editor-string ]
-    [ dup editor>> model>> add-connection ]
-    [ dup model*>> add-connection ] tri ;
-M: model-field ungraft*
-   [ dup editor>> model>> remove-connection ]
-   [ dup model*>> remove-connection ] bi ;
-M: model-field model-changed 2dup model*>> =
-    [ [ value>> ] [ editor>> ] bi* set-editor-string ]
-    [ nip [ editor>> editor-string ] [ model*>> ] bi set-model ] if ;
-: (new-field) ( editor field -- gadget ) [ new-editor ] dip new-border dup gadget-child >>editor
-    field-theme { 1 0 } >>align ; inline
-: <model-field*> ( -- field ) "" <model> <model-field> ;
-: <empty-field> ( model -- field ) "" <model> switch-models <model-field> ;
-: <model-editor> ( model -- gadget ) multiline-editor model-field (new-field) swap init-field >>model* ;
-: <model-editor*> ( -- editor ) "" <model> <model-editor> ;
-: <empty-editor> ( model -- editor ) "" <model> switch-models <model-editor> ;
-
-: <model-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
-    f <model> >>model ;
-
-: <slider> ( init page min max step -- slider ) <range> horizontal slider:<slider> ;
-
-: image-prep ( -- image ) scan current-vocab name>> "vocab:" "/icons/" surround ".tiff" surround <image-name> dup cached-image drop ;
-SYNTAX: IMG-MODEL-BTN: image-prep [ <model-btn> ] curry append! ;
-
-SYNTAX: IMG-BTN: image-prep [ swap <button> ] curry append! ;
-
-GENERIC: output-model ( gadget -- model )
-M: gadget output-model model>> ;
-M: table output-model dup val-quot>> [ selection>> ] [ selection-index>> ] if ;
-M: model-field output-model model*>> ;
-M: scroller output-model viewport>> children>> first output-model ;
-M: slider output-model model>> range-model ;
-
-IN: accessors
-M: model-btn text>> children>> first text>> ;
-
-IN: ui.gadgets.controls
-
-SINGLETON: gadget-monad
-INSTANCE: gadget-monad monad
-INSTANCE: gadget monad
-M: gadget monad-of drop gadget-monad ;
-M: gadget-monad return drop <gadget> swap >>model ;
-M: gadget >>= output-model [ swap call( x -- y ) ] curry ; 
diff --git a/extra/ui/gadgets/controls/summary.txt b/extra/ui/gadgets/controls/summary.txt
deleted file mode 100644 (file)
index eeef94d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Gadgets with expanded model usage
\ No newline at end of file
diff --git a/extra/ui/gadgets/layout/authors.txt b/extra/ui/gadgets/layout/authors.txt
deleted file mode 100644 (file)
index 2300f69..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
diff --git a/extra/ui/gadgets/layout/layout-docs.factor b/extra/ui/gadgets/layout/layout-docs.factor
deleted file mode 100644 (file)
index cd8f62b..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-USING: help.markup help.syntax models ui.gadgets.tracks ;
-IN: ui.gadgets.layout
-
-HELP: ,
-{ $values { "item" "a gadget or model" } }
-{ $description "Used in a series of gadgets created by a box, accumulating the gadget" } ;
-
-HELP: ,%
-{ $syntax "gadget ,% width" }
-{ $description "Like ',' but stretches the gadget to always fill a percent of the parent" } ;
-
-HELP: ->
-{ $values { "uiitem" "a gadget or model" } { "model" model } }
-{ $description "Like ',' but passes its model on for further use." } ;
-
-HELP: ->%
-{ $syntax "gadget ,% width" }
-{ $description "Like '->' but stretches the gadget to always fill a percent of the parent" } ;
-
-HELP: <spacer>
-{ $description "Grows to fill any empty space in a box" } ;
-
-HELP: <hbox>
-{ $values { "gadgets" "a list of gadgets" } { "track" track } }
-{ $syntax "[ gadget , gadget , ... ] <hbox>" }
-{ $description "Creates an horizontal track containing the gadgets listed in the quotation" } ;
-
-HELP: <vbox>
-{ $values { "gadgets" "a list of gadgets" } { "track" track } }
-{ $syntax "[ gadget , gadget , ... ] <hbox>" }
-{ $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
-
-HELP: $
-{ $syntax "$ PLACEHOLDER-NAME $" }
-{ $description "Defines an insertion point in a template named PLACEHOLDER-NAME which can be used by calling its name" } ;
-
-HELP: with-interface
-{ $values { "quot" "quotation that builds a template and inserts into it" } }
-{ $description "Create templates, used with " { $link POSTPONE: $ } } ;
-
-ARTICLE: "ui.gadgets.layout" "GUI Layout"
-"Laying out GUIs works the same way as building lists with " { $vocab-link "make" }
-". Gadgets are layed out using " { $vocab-link "ui.gadgets.tracks" } " through " { $link <hbox> } " and " { $link <vbox> } ", which allow both fixed and percentage widths. "
-{ $link , } " and " { $link -> }  " add a model or gadget to the gadget you're building. "
-"Also, books can be made with " { $link <book> } ". "
-{ $link <spacer> } "s add flexable space between items. " $nl
-"Using " { $link with-interface } ", one can pre-build templates to add items to later: "
-"Like in the StringTemplate framework for java, placeholders are defined using $ PLACERHOLDER-NAME $ "
-"Using PLACEHOLDER-NAME again sets it as the current insertion point. "
-"For examples using normal layout, see the " { $vocab-link "sudokus" } " demo. "
-"For examples of templating, see the " { $vocab-link "recipes" } " demo. " ;
-
-ABOUT: "ui.gadgets.layout"
\ No newline at end of file
diff --git a/extra/ui/gadgets/layout/layout.factor b/extra/ui/gadgets/layout/layout.factor
deleted file mode 100644 (file)
index c287b9a..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-USING: accessors assocs arrays fry kernel lexer make math.parser
-models monads namespaces parser sequences
-sequences.extras models.combinators ui.gadgets
-ui.gadgets.tracks words ui.gadgets.controls ;
-QUALIFIED: make
-QUALIFIED-WITH: ui.gadgets.books book
-IN: ui.gadgets.layout
-
-SYMBOL: templates
-TUPLE: layout gadget size ; C: <layout> layout
-TUPLE: placeholder < gadget members ;
-: <placeholder> ( -- placeholder ) placeholder new V{ } clone >>members ;
-
-: (remove-members) ( placeholder members -- ) [ [ model? ] filter swap parent>> model>> [ remove-connection ] curry each ]
-    [ nip [ gadget? ] filter [ unparent ] each ] 2bi ;
-
-: remove-members ( placeholder -- ) dup members>> [ drop ] [ [ (remove-members) ] keep delete-all ] if-empty ;
-: add-member ( obj placeholder -- ) over layout? [ [ gadget>> ] dip ] when members>> push ;
-
-: , ( item -- ) make:, ;
-: make* ( quot -- list ) { } make ; inline
-
-! Just take the previous mentioned placeholder and use it
-! If there is no previously mentioned placeholder, we're probably making a box, and will create the placeholder ourselves
-DEFER: with-interface
-: insertion-quot ( quot -- quot' )
-    make:building get [ [ placeholder? ] find-last nip [ <placeholder> dup , ] unless*
-    [ templates get ] 2dip swap '[ [ _ templates set _ , @ ] with-interface ] ] when* ;
-
-SYNTAX: ,% scan string>number [ <layout> , ] curry append! ;
-SYNTAX: ->% scan string>number '[ [ _ <layout> , ] [ output-model ] bi ] append! ;
-
-GENERIC: -> ( uiitem -- model )
-M: gadget -> dup , output-model ;
-M: model -> dup , ;
-
-: <spacer> ( -- ) <gadget> 1 <layout> , ;
-
-: add-layout ( track layout -- track ) [ gadget>> ] [ size>> ] bi track-add ;
-: layouts ( sized? gadgets -- layouts ) [ [ gadget? ] [ layout? ] bi or ] filter swap
-   [ [ dup layout? [ f <layout> ] unless ] map ]
-   [ [ dup gadget? [ gadget>> ] unless ] map ] if ;
-: make-layout ( building sized? -- models layouts ) [ swap layouts ] curry
-   [ make* [ [ model? ] filter ] ] dip bi ; inline
-: <box> ( gadgets type -- track )
-   [ t make-layout ] dip <track>
-   swap [ add-layout ] each
-   swap [ <collection> >>model ] unless-empty ; inline
-: <hbox> ( gadgets -- track ) horizontal <box> ; inline
-: <vbox> ( gadgets -- track ) vertical <box> ; inline
-
-: make-book ( models gadgets model -- book ) book:<book> swap [ "No models in books" throw ] unless-empty ;
-: <book> ( quot: ( -- model ) -- book ) f make-layout rot 0 >>value make-book ; inline
-: <book*> ( quot -- book ) f make-layout f make-book ; inline
-
-ERROR: not-in-template word ;
-SYNTAX: $ CREATE-WORD dup
-    [ [ dup templates get at [ nip , ] [ not-in-template ] if* ] curry (( -- )) define-declared "$" expect ]
-    [ [ <placeholder> [ swap templates get set-at ] keep , ] curry ] bi append! ;
-
-: insert-gadget ( number parent gadget -- ) -rot [ but-last insert-nth ] change-children drop ;
-: insert-size ( number parent size -- ) -rot [ but-last insert-nth ] change-sizes drop ;
-: insertion-point ( placeholder -- number parent ) dup parent>> [ children>> index ] keep ;
-
-GENERIC: >layout ( gadget -- layout )
-M: gadget >layout f <layout> ;
-M: layout >layout ;
-
-GENERIC# (add-gadget-at) 2 ( parent item n -- )
-M: gadget (add-gadget-at) -rot [ add-gadget ] keep insert-gadget ;
-M: track (add-gadget-at) -rot >layout [ add-layout ] keep [ gadget>> insert-gadget ] [ size>> insert-size ] 3bi ;
-
-GENERIC# add-gadget-at 1 ( item location -- )
-M: object add-gadget-at insertion-point -rot (add-gadget-at) ;
-M: model add-gadget-at parent>> dup book:book? [ "No models in books" throw ]
-   [ dup model>> dup collection? [ nip swap add-connection ] [ drop [ 1array <collection> ] dip (>>model) ] if ] if ;
-: track-add-at ( item location size -- ) swap [ <layout> ] dip add-gadget-at ;
-: (track-add-at) ( parent item n size -- ) swap [ <layout> ] dip (add-gadget-at) ;
-
-: insert-item ( item location -- ) [ dup get [ drop ] [ remove-members ] if ] [ on ] [ ] tri
-    [ add-member ] 2keep add-gadget-at ;
-
-: insert-items ( makelist -- ) t swap [ dup placeholder? [ nip ] [ over insert-item ] if ] each drop ;
-
-: with-interface ( quot -- ) [ make* ] curry H{ } clone templates rot with-variable [ insert-items ] with-scope ; inline
-
-M: model >>= [ swap insertion-quot <action> ] curry ;
-M: model fmap insertion-quot <mapped> ;
-M: model $> insertion-quot side-effect-model new-mapped-model ;
-M: model <$ insertion-quot quot-model new-mapped-model ;
diff --git a/extra/ui/gadgets/layout/summary.txt b/extra/ui/gadgets/layout/summary.txt
deleted file mode 100644 (file)
index 30b5ef5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Syntax for easily building GUIs and using templates
\ No newline at end of file
diff --git a/extra/ui/gadgets/poppers/authors.txt b/extra/ui/gadgets/poppers/authors.txt
deleted file mode 100644 (file)
index ce0899f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Sam Anklesaria
\ No newline at end of file
diff --git a/extra/ui/gadgets/poppers/poppers.factor b/extra/ui/gadgets/poppers/poppers.factor
deleted file mode 100644 (file)
index 1c815d5..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-! Copyright (C) 2009 Sam Anklesaria
-! See http://factorcode.org/license.txt for BSD license.
-USING: arrays accessors combinators kernel math
-models models.combinators namespaces sequences
-ui.gadgets ui.gadgets.controls ui.gadgets.layout
-ui.gadgets.tracks ui.gestures ui.gadgets.line-support ;
-EXCLUDE: ui.gadgets.editors => model-field ;
-IN: ui.gadgets.poppers
-
-TUPLE: popped < model-field { fatal? initial: t } ;
-TUPLE: popped-editor < multiline-editor ;
-: <popped> ( text -- gadget ) <basic> init-field popped-editor popped (new-field) swap >>model* ;
-
-: set-expansion ( popped size -- ) over dup parent>> [ children>> index ] [ sizes>> ] bi set-nth relayout ;
-: new-popped ( popped -- ) insertion-point "" <popped>
-    [ rot 1 + f (track-add-at) ] keep [ relayout ] [ request-focus ] bi ;
-: focus-prev ( popped -- ) dup parent>> children>> length 1 =
-    [ drop ] [
-        insertion-point [ 1 - dup -1 = [ drop 1 ] when ] [ children>> ] bi* nth
-        [ request-focus ] [ editor>> end-of-document ] bi
-    ] if ;
-: initial-popped ( popper -- ) "" <popped> [ f track-add drop ] keep request-focus ;
-
-TUPLE: popper < track { unfocus-hook initial: [ drop ] } ;
-! list of strings is model (make shown objects implement sequence protocol)
-: <popper> ( model -- popper ) vertical popper new-track swap >>model ;
-
-M: popped handle-gesture swap {
-    { gain-focus [ 1 set-expansion f ] }
-    { lose-focus [ dup parent>>
-        [ [ unfocus-hook>> call( a -- ) ] curry [ f set-expansion ] bi ]
-        [ drop ] if* f
-    ] }
-    { T{ key-up f f "RET" } [ dup editor>> delete-previous-character new-popped f ] }
-    { T{ key-up f f "BACKSPACE" } [ dup editor>> editor-string "" =
-        [ dup fatal?>> [ [ focus-prev ] [ unparent ] bi ] [ t >>fatal? drop ] if ]
-        [ f >>fatal? drop ] if f
-    ] }
-    [ swap call-next-method ]
-} case ;
-
-M: popper handle-gesture swap T{ button-down f f 1 } =
-    [ hand-click# get 2 = [ initial-popped ] [ drop ] if ] [ drop ] if f ;
-
-M: popper model-changed
-    [ children>> [ unparent ] each ]
-    [ [ value>> [ <popped> ] map ] dip [ f track-add ] reduce request-focus ] bi ;
-
-M: popped pref-dim* editor>> [ pref-dim* first ] [ line-height ] bi 2array ;
-M: popper focusable-child* children>> [ t ] [ first ] if-empty ;
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/vocabs/git/authors.txt b/extra/vocabs/git/authors.txt
new file mode 100644 (file)
index 0000000..f13c9c1
--- /dev/null
@@ -0,0 +1 @@
+Joe Groff
diff --git a/extra/vocabs/git/git.factor b/extra/vocabs/git/git.factor
new file mode 100644 (file)
index 0000000..eb945b5
--- /dev/null
@@ -0,0 +1,28 @@
+! (c)2009 Joe Groff bsd license
+USING: fry io io.directories io.encodings.ascii
+io.encodings.utf8 io.launcher io.pathnames kernel lexer
+namespaces parser sequences splitting vocabs vocabs.loader ;
+IN: vocabs.git
+
+<PRIVATE
+: git-object-id ( filename rev -- id/f )
+    [ [ parent-directory ] [ file-name ] bi ] dip swap '[
+        { "git" "ls-tree" } _ suffix _ suffix ascii [
+            readln
+            [ " " split1 nip " " split1 nip "\t" split1 drop ]
+            [ f ] if*
+        ] with-process-reader
+    ] with-directory ;
+
+: with-git-object-stream ( id quot -- )
+    [ { "git" "cat-file" "-p" } swap suffix utf8 ] dip with-process-reader ; inline
+PRIVATE>
+
+ERROR: git-revision-not-found path ;
+
+: use-vocab-rev ( vocab-name rev -- )
+    [ create-vocab vocab-source-path dup ] dip git-object-id 
+    [ [ input-stream get swap parse-stream call( -- ) ] with-git-object-stream ]
+    [ git-revision-not-found ] if* ;
+
+SYNTAX: USE-REV: scan scan use-vocab-rev ;
old mode 100755 (executable)
new mode 100644 (file)
index 637ffa6dd81f700b664f1be56d608199393df214..42f15d28731cbe8fd0c9d707d4add87dffd910b0 100644 (file)
@@ -83,10 +83,6 @@ CONSTANT: cpus
     [ validate-os/cpu ] >>init
     [ current-builder last-report>> "text/html" <content> ] >>display ;
 
-: git-link ( id -- link )
-    [ "http://github.com/slavapestov/factor/commit/" prepend ] keep
-    [XML <a href=<->><-></a> XML] ;
-
 : building ( builder string -- xml )
     swap current-git-id>> git-link
     [XML <-> for <-> XML] ;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/extra/zoneinfo/africa b/extra/zoneinfo/africa
new file mode 100644 (file)
index 0000000..0a6185d
--- /dev/null
@@ -0,0 +1,915 @@
+# @(#)africa   8.18
+# <pre>
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+#
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Another source occasionally used is Edward W. Whitman, World Time Differences,
+# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
+# I found in the UCLA library.
+#
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#
+# Previous editions of this database used WAT, CAT, SAT, and EAT
+# for +0:00 through +3:00, respectively,
+# but Mark R V Murray reports that
+# `SAST' is the official abbreviation for +2:00 in the country of South Africa,
+# `CAT' is commonly used for +2:00 in countries north of South Africa, and
+# `WAT' is probably the best name for +1:00, as the common phrase for
+# the area that includes Nigeria is ``West Africa''.
+# He has heard of ``Western Sahara Time'' for +0:00 but can find no reference.
+#
+# To make things confusing, `WAT' seems to have been used for -1:00 long ago;
+# I'd guess that this was because people needed _some_ name for -1:00,
+# and at the time, far west Africa was the only major land area in -1:00.
+# This usage is now obsolete, as the last use of -1:00 on the African
+# mainland seems to have been 1976 in Western Sahara.
+#
+# To summarize, the following abbreviations seem to have some currency:
+#      -1:00   WAT     West Africa Time (no longer used)
+#       0:00   GMT     Greenwich Mean Time
+#       2:00   CAT     Central Africa Time
+#       2:00   SAST    South Africa Standard Time
+# and Murray suggests the following abbreviation:
+#       1:00   WAT     West Africa Time
+# I realize that this leads to `WAT' being used for both -1:00 and 1:00
+# for times before 1976, but this is the best I can think of
+# until we get more information.
+#
+# I invented the following abbreviations; corrections are welcome!
+#       2:00   WAST    West Africa Summer Time
+#       2:30   BEAT    British East Africa Time (no longer used)
+#       2:44:45 BEAUT  British East Africa Unified Time (no longer used)
+#       3:00   CAST    Central Africa Summer Time (no longer used)
+#       3:00   SAST    South Africa Summer Time (no longer used)
+#       3:00   EAT     East Africa Time
+#       4:00   EAST    East Africa Summer Time (no longer used)
+
+# Algeria
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Algeria 1916    only    -       Jun     14      23:00s  1:00    S
+Rule   Algeria 1916    1919    -       Oct     Sun>=1  23:00s  0       -
+Rule   Algeria 1917    only    -       Mar     24      23:00s  1:00    S
+Rule   Algeria 1918    only    -       Mar      9      23:00s  1:00    S
+Rule   Algeria 1919    only    -       Mar      1      23:00s  1:00    S
+Rule   Algeria 1920    only    -       Feb     14      23:00s  1:00    S
+Rule   Algeria 1920    only    -       Oct     23      23:00s  0       -
+Rule   Algeria 1921    only    -       Mar     14      23:00s  1:00    S
+Rule   Algeria 1921    only    -       Jun     21      23:00s  0       -
+Rule   Algeria 1939    only    -       Sep     11      23:00s  1:00    S
+Rule   Algeria 1939    only    -       Nov     19       1:00   0       -
+Rule   Algeria 1944    1945    -       Apr     Mon>=1   2:00   1:00    S
+Rule   Algeria 1944    only    -       Oct      8       2:00   0       -
+Rule   Algeria 1945    only    -       Sep     16       1:00   0       -
+Rule   Algeria 1971    only    -       Apr     25      23:00s  1:00    S
+Rule   Algeria 1971    only    -       Sep     26      23:00s  0       -
+Rule   Algeria 1977    only    -       May      6       0:00   1:00    S
+Rule   Algeria 1977    only    -       Oct     21       0:00   0       -
+Rule   Algeria 1978    only    -       Mar     24       1:00   1:00    S
+Rule   Algeria 1978    only    -       Sep     22       3:00   0       -
+Rule   Algeria 1980    only    -       Apr     25       0:00   1:00    S
+Rule   Algeria 1980    only    -       Oct     31       2:00   0       -
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
+# more precise 0:09:21.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Algiers  0:12:12 -       LMT     1891 Mar 15 0:01
+                       0:09:21 -       PMT     1911 Mar 11    # Paris Mean Time
+                       0:00    Algeria WE%sT   1940 Feb 25 2:00
+                       1:00    Algeria CE%sT   1946 Oct  7
+                       0:00    -       WET     1956 Jan 29
+                       1:00    -       CET     1963 Apr 14
+                       0:00    Algeria WE%sT   1977 Oct 21
+                       1:00    Algeria CE%sT   1979 Oct 26
+                       0:00    Algeria WE%sT   1981 May
+                       1:00    -       CET
+
+# Angola
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Luanda   0:52:56 -       LMT     1892
+                       0:52:04 -       AOT     1911 May 26 # Angola Time
+                       1:00    -       WAT
+
+# Benin
+# Whitman says they switched to 1:00 in 1946, not 1934;
+# go with Shanks & Pottenger.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Porto-Novo 0:10:28 -       LMT     1912
+                       0:00    -       GMT     1934 Feb 26
+                       1:00    -       WAT
+
+# Botswana
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Gaborone 1:43:40 -       LMT     1885
+                       2:00    -       CAT     1943 Sep 19 2:00
+                       2:00    1:00    CAST    1944 Mar 19 2:00
+                       2:00    -       CAT
+
+# Burkina Faso
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Ouagadougou        -0:06:04 -      LMT     1912
+                        0:00   -       GMT
+
+# Burundi
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Bujumbura  1:57:28 -       LMT     1890
+                       2:00    -       CAT
+
+# Cameroon
+# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Douala   0:38:48 -       LMT     1912
+                       1:00    -       WAT
+
+# Cape Verde
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Atlantic/Cape_Verde -1:34:04 -    LMT     1907                    # Praia
+                       -2:00   -       CVT     1942 Sep
+                       -2:00   1:00    CVST    1945 Oct 15
+                       -2:00   -       CVT     1975 Nov 25 2:00
+                       -1:00   -       CVT
+
+# Central African Republic
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Bangui   1:14:20 -       LMT     1912
+                       1:00    -       WAT
+
+# Chad
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Ndjamena 1:00:12 -       LMT     1912
+                       1:00    -       WAT     1979 Oct 14
+                       1:00    1:00    WAST    1980 Mar  8
+                       1:00    -       WAT
+
+# Comoros
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Indian/Comoro   2:53:04 -       LMT     1911 Jul   # Moroni, Gran Comoro
+                       3:00    -       EAT
+
+# Democratic Republic of Congo
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Kinshasa   1:01:12 -       LMT     1897 Nov 9
+                       1:00    -       WAT
+Zone Africa/Lubumbashi 1:49:52 -       LMT     1897 Nov 9
+                       2:00    -       CAT
+
+# Republic of the Congo
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Brazzaville        1:01:08 -       LMT     1912
+                       1:00    -       WAT
+
+# Cote D'Ivoire
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Abidjan  -0:16:08 -      LMT     1912
+                        0:00   -       GMT
+
+# Djibouti
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Djibouti 2:52:36 -       LMT     1911 Jul
+                       3:00    -       EAT
+
+###############################################################################
+
+# Egypt
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Egypt   1940    only    -       Jul     15      0:00    1:00    S
+Rule   Egypt   1940    only    -       Oct      1      0:00    0       -
+Rule   Egypt   1941    only    -       Apr     15      0:00    1:00    S
+Rule   Egypt   1941    only    -       Sep     16      0:00    0       -
+Rule   Egypt   1942    1944    -       Apr      1      0:00    1:00    S
+Rule   Egypt   1942    only    -       Oct     27      0:00    0       -
+Rule   Egypt   1943    1945    -       Nov      1      0:00    0       -
+Rule   Egypt   1945    only    -       Apr     16      0:00    1:00    S
+Rule   Egypt   1957    only    -       May     10      0:00    1:00    S
+Rule   Egypt   1957    1958    -       Oct      1      0:00    0       -
+Rule   Egypt   1958    only    -       May      1      0:00    1:00    S
+Rule   Egypt   1959    1981    -       May      1      1:00    1:00    S
+Rule   Egypt   1959    1965    -       Sep     30      3:00    0       -
+Rule   Egypt   1966    1994    -       Oct      1      3:00    0       -
+Rule   Egypt   1982    only    -       Jul     25      1:00    1:00    S
+Rule   Egypt   1983    only    -       Jul     12      1:00    1:00    S
+Rule   Egypt   1984    1988    -       May      1      1:00    1:00    S
+Rule   Egypt   1989    only    -       May      6      1:00    1:00    S
+Rule   Egypt   1990    1994    -       May      1      1:00    1:00    S
+# IATA (after 1990) says transitions are at 0:00.
+# Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
+Rule   Egypt   1995    max     -       Apr     lastFri  0:00s  1:00    S
+Rule   Egypt   1995    2005    -       Sep     lastThu 23:00s  0       -
+# From Steffen Thorsen (2006-09-19):
+# The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
+# Egypt will turn back clocks by one hour at the midnight of Thursday
+# after observing the daylight saving time since May.
+# http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf
+Rule   Egypt   2006    only    -       Sep     21      23:00s  0       -
+# From Dirk Losch (2007-08-14):
+# I received a mail from an airline which says that the daylight
+# saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
+# From Jesper Norgaard Welen (2007-08-15): [The following agree:]
+# http://www.nentjes.info/Bill/bill5.htm 
+# http://www.timeanddate.com/worldclock/city.html?n=53
+# From Steffen Thorsen (2007-09-04): The official information...:
+# http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
+Rule   Egypt   2007    only    -       Sep     Thu>=1  23:00s  0       -
+# From Abdelrahman Hassan (2007-09-06):
+# Due to the Hijri (lunar Islamic calendar) year being 11 days shorter
+# than the year of the Gregorian calendar, Ramadan shifts earlier each
+# year. This year it will be observed September 13 (September is quite
+# hot in Egypt), and the idea is to make fasting easier for workers by
+# shifting business hours one hour out of daytime heat. Consequently,
+# unless discontinued, next DST may end Thursday 28 August 2008.
+# From Paul Eggert (2007-08-17):
+# For lack of better info, assume the new rule is last Thursday in August.
+Rule   Egypt   2008    max     -       Aug     lastThu 23:00s  0       -
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Cairo    2:05:00 -       LMT     1900 Oct
+                       2:00    Egypt   EE%sT
+
+# Equatorial Guinea
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Malabo   0:35:08 -       LMT     1912
+                       0:00    -       GMT     1963 Dec 15
+                       1:00    -       WAT
+
+# Eritrea
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Asmara   2:35:32 -       LMT     1870
+                       2:35:32 -       AMT     1890          # Asmara Mean Time
+                       2:35:20 -       ADMT    1936 May 5    # Adis Dera MT
+                       3:00    -       EAT
+
+# Ethiopia
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time zones
+# between 1870 and 1890, and that they merged to 38E50 (2:35:20) in 1890.
+# We'll guess that 38E50 is for Adis Dera.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Addis_Ababa        2:34:48 -       LMT     1870
+                       2:35:20 -       ADMT    1936 May 5    # Adis Dera MT
+                       3:00    -       EAT
+
+# Gabon
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Libreville 0:37:48 -       LMT     1912
+                       1:00    -       WAT
+
+# Gambia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Banjul   -1:06:36 -      LMT     1912
+                       -1:06:36 -      BMT     1935    # Banjul Mean Time
+                       -1:00   -       WAT     1964
+                        0:00   -       GMT
+
+# Ghana
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# Whitman says DST was observed from 1931 to ``the present'';
+# go with Shanks & Pottenger.
+Rule   Ghana   1936    1942    -       Sep      1      0:00    0:20    GHST
+Rule   Ghana   1936    1942    -       Dec     31      0:00    0       GMT
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Accra    -0:00:52 -      LMT     1918
+                        0:00   Ghana   %s
+
+# Guinea
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Conakry  -0:54:52 -      LMT     1912
+                        0:00   -       GMT     1934 Feb 26
+                       -1:00   -       WAT     1960
+                        0:00   -       GMT
+
+# Guinea-Bissau
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Bissau   -1:02:20 -      LMT     1911 May 26
+                       -1:00   -       WAT     1975
+                        0:00   -       GMT
+
+# Kenya
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Nairobi  2:27:16 -       LMT     1928 Jul
+                       3:00    -       EAT     1930
+                       2:30    -       BEAT    1940
+                       2:44:45 -       BEAUT   1960
+                       3:00    -       EAT
+
+# Lesotho
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Maseru   1:50:00 -       LMT     1903 Mar
+                       2:00    -       SAST    1943 Sep 19 2:00
+                       2:00    1:00    SAST    1944 Mar 19 2:00
+                       2:00    -       SAST
+
+# Liberia
+# From Paul Eggert (2006-03-22):
+# In 1972 Liberia was the last country to switch
+# from a UTC offset that was not a multiple of 15 or 20 minutes.
+# Howse reports that it was in honor of their president's birthday.
+# Shank & Pottenger report the date as May 1, whereas Howse reports Jan;
+# go with Shanks & Pottenger.
+# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and
+# Whitman each report -0:44:30; go with the more precise figure.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Monrovia -0:43:08 -      LMT     1882
+                       -0:43:08 -      MMT     1919 Mar # Monrovia Mean Time
+                       -0:44:30 -      LRT     1972 May # Liberia Time
+                        0:00   -       GMT
+
+###############################################################################
+
+# Libya
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Libya   1951    only    -       Oct     14      2:00    1:00    S
+Rule   Libya   1952    only    -       Jan      1      0:00    0       -
+Rule   Libya   1953    only    -       Oct      9      2:00    1:00    S
+Rule   Libya   1954    only    -       Jan      1      0:00    0       -
+Rule   Libya   1955    only    -       Sep     30      0:00    1:00    S
+Rule   Libya   1956    only    -       Jan      1      0:00    0       -
+Rule   Libya   1982    1984    -       Apr      1      0:00    1:00    S
+Rule   Libya   1982    1985    -       Oct      1      0:00    0       -
+Rule   Libya   1985    only    -       Apr      6      0:00    1:00    S
+Rule   Libya   1986    only    -       Apr      4      0:00    1:00    S
+Rule   Libya   1986    only    -       Oct      3      0:00    0       -
+Rule   Libya   1987    1989    -       Apr      1      0:00    1:00    S
+Rule   Libya   1987    1989    -       Oct      1      0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Tripoli  0:52:44 -       LMT     1920
+                       1:00    Libya   CE%sT   1959
+                       2:00    -       EET     1982
+                       1:00    Libya   CE%sT   1990 May  4
+# The following entries are from Shanks & Pottenger;
+# the IATA SSIM data contain some obvious errors.
+                       2:00    -       EET     1996 Sep 30
+                       1:00    -       CET     1997 Apr  4
+                       1:00    1:00    CEST    1997 Oct  4
+                       2:00    -       EET
+
+# Madagascar
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Indian/Antananarivo 3:10:04 -     LMT     1911 Jul
+                       3:00    -       EAT     1954 Feb 27 23:00s
+                       3:00    1:00    EAST    1954 May 29 23:00s
+                       3:00    -       EAT
+
+# Malawi
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Blantyre 2:20:00 -       LMT     1903 Mar
+                       2:00    -       CAT
+
+# Mali
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Bamako   -0:32:00 -      LMT     1912
+                        0:00   -       GMT     1934 Feb 26
+                       -1:00   -       WAT     1960 Jun 20
+                        0:00   -       GMT
+
+# Mauritania
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Nouakchott -1:03:48 -      LMT     1912
+                        0:00   -       GMT     1934 Feb 26
+                       -1:00   -       WAT     1960 Nov 28
+                        0:00   -       GMT
+
+# Mauritius
+
+# From Steffen Thorsen (2008-06-25):
+# Mauritius plans to observe DST from 2008-11-01 to 2009-03-31 on a trial
+# basis....
+# It seems that Mauritius observed daylight saving time from 1982-10-10 to 
+# 1983-03-20 as well, but that was not successful....
+# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
+
+# From Alex Krivenyshev (2008-06-25):
+# http://economicdevelopment.gov.mu/portal/site/Mainhomepage/menuitem.a42b24128104d9845dabddd154508a0c/?content_id=0a7cee8b5d69a110VgnVCM1000000a04a8c0RCRD
+
+# From Arthur David Olson (2008-06-30):
+# The www.timeanddate.com article cited by Steffen Thorsen notes that "A
+# final decision has yet to be made on the times that daylight saving
+# would begin and end on these dates." As a place holder, use midnight.
+
+# From Paul Eggert (2008-06-30):
+# Follow Thorsen on DST in 1982/1983, instead of Shanks & Pottenger.
+
+# From Steffen Thorsen (2008-07-10):
+# According to
+# <a href="http://www.lexpress.mu/display_article.php?news_id=111216">
+# http://www.lexpress.mu/display_article.php?news_id=111216
+# </a>
+# (in French), Mauritius will start and end their DST a few days earlier
+# than previously announced (2008-11-01 to 2009-03-31).  The new start
+# date is 2008-10-26 at 02:00 and the new end date is 2009-03-27 (no time
+# given, but it is probably at either 2 or 3 wall clock time).
+# 
+# A little strange though, since the article says that they moved the date 
+# to align itself with Europe and USA which also change time on that date, 
+# but that means they have not paid attention to what happened in 
+# USA/Canada last year (DST ends first Sunday in November). I also wonder 
+# why that they end on a Friday, instead of aligning with Europe which 
+# changes two days later.
+
+# From Alex Krivenyshev (2008-07-11):
+# Seems that English language article "The revival of daylight saving
+# time:  Energy conservation?"-# No. 16578 (07/11/2008) was originally
+# published on Monday, June 30, 2008...
+#
+# I guess that article in French "Le gouvernement avance l'introduction
+# de l'heure d'ete" stating that DST in Mauritius starting on October 26
+# and ending on March 27, 2009 is the most recent one.
+# ...
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html">
+# http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html
+# </a>
+
+# From Riad M. Hossen Ally (2008-08-03):
+# The Government of Mauritius weblink
+# <a href="http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=3D4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD">
+# http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=3D4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD
+# </a>
+# Cabinet Decision of July 18th, 2008 states as follows:
+#
+# 4. ...Cabinet has agreed to the introduction into the National Assembly
+# of the Time Bill which provides for the introduction of summer time in
+# Mauritius. The summer time period which will be of one hour ahead of
+# the standard time, will be aligned with that in Europe and the United
+# States of America. It will start at two o'clock in the morning on the
+# last Sunday of October and will end at two o'clock in the morning on
+# the last Sunday of March the following year. The summer time for the
+# year 2008 - 2009 will, therefore, be effective as from 26 October 2008
+# and end on 29 March 2009.
+
+# From Ed Maste (2008-10-07):
+# THE TIME BILL (No. XXVII of 2008) Explanatory Memorandum states the
+# beginning / ending of summer time is 2 o'clock standard time in the
+# morning of the last Sunday of October / last Sunday of March.
+# <a href="http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf">
+# http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf
+# </a>
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule Mauritius 1982    only    -       Oct     10      0:00    1:00    S
+Rule Mauritius 1983    only    -       Mar     21      0:00    0       -
+Rule Mauritius 2008    max     -       Oct     lastSun 2:00s   1:00    S
+Rule Mauritius 2009    max     -       Mar     lastSun 2:00s   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Indian/Mauritius  3:50:00 -       LMT     1907            # Port Louis
+                       4:00 Mauritius  MU%sT   # Mauritius Time
+# Agalega Is, Rodriguez
+# no information; probably like Indian/Mauritius
+
+# Mayotte
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Indian/Mayotte  3:00:56 -       LMT     1911 Jul        # Mamoutzou
+                       3:00    -       EAT
+
+# Morocco
+# See the `europe' file for Spanish Morocco (Africa/Ceuta).
+
+# From Alex Krivenyshev (2008-05-09):
+# Here is an article that Morocco plan to introduce Daylight Saving Time between
+# 1 June, 2008 and 27 September, 2008.
+#
+# "... Morocco is to save energy by adjusting its clock during summer so it will
+# be one hour ahead of GMT between 1 June and 27 September, according to
+# Communication Minister and Gov ernment Spokesman, Khalid Naciri...."
+#
+# <a href="http://www.worldtimezone.net/dst_news/dst_news_morocco01.html">
+# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
+# </a>
+# OR
+# <a href="http://en.afrik.com/news11892.html">
+# http://en.afrik.com/news11892.html
+# </a>
+
+# From Alex Krivenyshev (2008-05-09):
+# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse:
+# <a href="http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view">
+# http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view
+# </a>
+#
+# Morocco shifts to daylight time on June 1st through September 27, Govt.
+# spokesman.
+
+# From Patrice Scattolin (2008-05-09):
+# According to this article:
+# <a href="http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html">
+# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
+# </a>
+# (and republished here:
+# <a href="http://www.actu.ma/heure-dete-comment_i127896_0.html">
+# http://www.actu.ma/heure-dete-comment_i127896_0.html
+# </a>
+# )
+# the changes occurs at midnight:
+#
+# saturday night may 31st at midnight (which in french is to be
+# intrepreted as the night between saturday and sunday)
+# sunday night the 28th  at midnight
+#
+# Seeing that the 28th is monday, I am guessing that she intends to say
+# the midnight of the 28th which is the midnight between sunday and
+# monday, which jives with other sources that say that it's inclusive
+# june1st to sept 27th.
+#
+# The decision was taken by decree *2-08-224 *but I can't find the decree
+# published on the web.
+#
+# It's also confirmed here:
+# <a href="http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm">
+# http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm
+# </a>
+# on a government portal as being  between june 1st and sept 27th (not yet
+# posted in english).
+#
+# The following google query will generate many relevant hits:
+# <a href="http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search">
+# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
+# </a>
+
+# From Alex Krivenyshev (2008-05-09):
+# Is Western Sahara (part which administrated by Morocco) going to follow
+# Morocco DST changes?  Any information?  What about other part of
+# Western Sahara - under administration of POLISARIO Front (also named
+# SADR Saharawi Arab Democratic Republic)?
+
+# From Arthur David Olson (2008-05-09):
+# XXX--guess that it is only Morocco for now; guess only 2008 for now.
+
+# From Steffen Thorsen (2008-08-27):
+# Morocco will change the clocks back on the midnight between August 31 
+# and September 1. They originally planned to observe DST to near the end 
+# of September:
+#
+# One article about it (in French):
+# <a href="http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default">
+# http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
+# </a>
+#
+# We have some further details posted here:
+# <a href="http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html">
+# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
+# </a>
+
+# From Steffen Thorsen (2009-03-17):
+# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
+# to many sources, such as
+# <a href="http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html">
+# http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html
+# </a>
+# <a href="http://www.medi1sat.ma/fr/depeche.aspx?idp=2312">
+# http://www.medi1sat.ma/fr/depeche.aspx?idp=2312
+# </a>
+# (French)
+#
+# Our summary:
+# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html">
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
+# </a>
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to official document from Royaume du Maroc Premier Ministre,
+# Ministere de la Modernisation des Secteurs Publics
+#
+# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
+# concerning the amendment of the legal time, the Ministry of Modernization of
+# Public Sectors announced that the official time in the Kingdom will be
+# advanced 60 minutes from Sunday 31 May 2009 at midnight.
+#
+# <a href="http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf">
+# http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf
+# </a>
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_morocco03.html">
+# http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
+# </a>
+
+# RULE NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+
+Rule   Morocco 1939    only    -       Sep     12       0:00   1:00    S
+Rule   Morocco 1939    only    -       Nov     19       0:00   0       -
+Rule   Morocco 1940    only    -       Feb     25       0:00   1:00    S
+Rule   Morocco 1945    only    -       Nov     18       0:00   0       -
+Rule   Morocco 1950    only    -       Jun     11       0:00   1:00    S
+Rule   Morocco 1950    only    -       Oct     29       0:00   0       -
+Rule   Morocco 1967    only    -       Jun      3      12:00   1:00    S
+Rule   Morocco 1967    only    -       Oct      1       0:00   0       -
+Rule   Morocco 1974    only    -       Jun     24       0:00   1:00    S
+Rule   Morocco 1974    only    -       Sep      1       0:00   0       -
+Rule   Morocco 1976    1977    -       May      1       0:00   1:00    S
+Rule   Morocco 1976    only    -       Aug      1       0:00   0       -
+Rule   Morocco 1977    only    -       Sep     28       0:00   0       -
+Rule   Morocco 1978    only    -       Jun      1       0:00   1:00    S
+Rule   Morocco 1978    only    -       Aug      4       0:00   0       -
+Rule   Morocco 2008    only    -       Jun      1       0:00   1:00    S
+Rule   Morocco 2008    only    -       Sep      1       0:00   0       -
+Rule   Morocco 2009    only    -       Jun      1       0:00   1:00    S
+Rule   Morocco 2009    only    -       Aug      21      0:00   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Casablanca -0:30:20 -      LMT     1913 Oct 26
+                        0:00   Morocco WE%sT   1984 Mar 16
+                        1:00   -       CET     1986
+                        0:00   Morocco WE%sT
+# Western Sahara
+Zone Africa/El_Aaiun   -0:52:48 -      LMT     1934 Jan
+                       -1:00   -       WAT     1976 Apr 14
+                        0:00   -       WET
+
+# Mozambique
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Maputo   2:10:20 -       LMT     1903 Mar
+                       2:00    -       CAT
+
+# Namibia
+# The 1994-04-03 transition is from Shanks & Pottenger.
+# Shanks & Pottenger report no DST after 1998-04; go with IATA.
+
+# From Petronella Sibeene (2007-03-30) in
+# <http://allafrica.com/stories/200703300178.html>:
+# While the entire country changes its time, Katima Mulilo and other
+# settlements in Caprivi unofficially will not because the sun there
+# rises and sets earlier compared to other regions.  Chief of
+# Forecasting Riaan van Zyl explained that the far eastern parts of
+# the country are close to 40 minutes earlier in sunrise than the rest
+# of the country.
+# 
+# From Paul Eggert (2007-03-31):
+# Apparently the Caprivi Strip informally observes Botswana time, but
+# we have no details.  In the meantime people there can use Africa/Gaborone.
+
+# RULE NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Namibia 1994    max     -       Sep     Sun>=1  2:00    1:00    S
+Rule   Namibia 1995    max     -       Apr     Sun>=1  2:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Windhoek 1:08:24 -       LMT     1892 Feb 8
+                       1:30    -       SWAT    1903 Mar        # SW Africa Time
+                       2:00    -       SAST    1942 Sep 20 2:00
+                       2:00    1:00    SAST    1943 Mar 21 2:00
+                       2:00    -       SAST    1990 Mar 21 # independence
+                       2:00    -       CAT     1994 Apr  3
+                       1:00    Namibia WA%sT
+
+# Niger
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Niamey    0:08:28 -      LMT     1912
+                       -1:00   -       WAT     1934 Feb 26
+                        0:00   -       GMT     1960
+                        1:00   -       WAT
+
+# Nigeria
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Lagos    0:13:36 -       LMT     1919 Sep
+                       1:00    -       WAT
+
+# Reunion
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Indian/Reunion  3:41:52 -       LMT     1911 Jun        # Saint-Denis
+                       4:00    -       RET     # Reunion Time
+#
+# Scattered Islands (Iles Eparses) administered from Reunion are as follows.
+# The following information about them is taken from
+# Iles Eparses (www.outre-mer.gouv.fr/domtom/ile.htm, 1997-07-22, in French;
+# no longer available as of 1999-08-17).
+# We have no info about their time zone histories.
+#
+# Bassas da India - uninhabited
+# Europa Island - inhabited from 1905 to 1910 by two families
+# Glorioso Is - inhabited until at least 1958
+# Juan de Nova - uninhabited
+# Tromelin - inhabited until at least 1958
+
+# Rwanda
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Kigali   2:00:16 -       LMT     1935 Jun
+                       2:00    -       CAT
+
+# St Helena
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Atlantic/St_Helena        -0:22:48 -      LMT     1890            # Jamestown
+                       -0:22:48 -      JMT     1951    # Jamestown Mean Time
+                        0:00   -       GMT
+# The other parts of the St Helena territory are similar:
+#      Tristan da Cunha: on GMT, say Whitman and the CIA
+#      Ascension: on GMT, says usno1995 and the CIA
+#      Gough (scientific station since 1955; sealers wintered previously):
+#              on GMT, says the CIA
+#      Inaccessible, Nightingale: no information, but probably GMT
+
+# Sao Tome and Principe
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Sao_Tome  0:26:56 -      LMT     1884
+                       -0:36:32 -      LMT     1912    # Lisbon Mean Time
+                        0:00   -       GMT
+
+# Senegal
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Dakar    -1:09:44 -      LMT     1912
+                       -1:00   -       WAT     1941 Jun
+                        0:00   -       GMT
+
+# Seychelles
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Indian/Mahe     3:41:48 -       LMT     1906 Jun        # Victoria
+                       4:00    -       SCT     # Seychelles Time
+# From Paul Eggert (2001-05-30):
+# Aldabra, Farquhar, and Desroches, originally dependencies of the
+# Seychelles, were transferred to the British Indian Ocean Territory
+# in 1965 and returned to Seychelles control in 1976.  We don't know
+# whether this affected their time zone, so omit this for now.
+# Possibly the islands were uninhabited.
+
+# Sierra Leone
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# Whitman gives Mar 31 - Aug 31 for 1931 on; go with Shanks & Pottenger.
+Rule   SL      1935    1942    -       Jun      1      0:00    0:40    SLST
+Rule   SL      1935    1942    -       Oct      1      0:00    0       WAT
+Rule   SL      1957    1962    -       Jun      1      0:00    1:00    SLST
+Rule   SL      1957    1962    -       Sep      1      0:00    0       GMT
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Freetown -0:53:00 -      LMT     1882
+                       -0:53:00 -      FMT     1913 Jun # Freetown Mean Time
+                       -1:00   SL      %s      1957
+                        0:00   SL      %s
+
+# Somalia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Mogadishu  3:01:28 -       LMT     1893 Nov
+                       3:00    -       EAT     1931
+                       2:30    -       BEAT    1957
+                       3:00    -       EAT
+
+# South Africa
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   SA      1942    1943    -       Sep     Sun>=15 2:00    1:00    -
+Rule   SA      1943    1944    -       Mar     Sun>=15 2:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Johannesburg 1:52:00 -     LMT     1892 Feb 8
+                       1:30    -       SAST    1903 Mar
+                       2:00    SA      SAST
+# Marion and Prince Edward Is
+# scientific station since 1947
+# no information
+
+# Sudan
+#
+# From <a href="http://www.sunanews.net/sn13jane.html">
+# Sudan News Agency (2000-01-13)
+# </a>, also reported by Michael De Beukelaer-Dossche via Steffen Thorsen:
+# Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
+# Saturday....  This was announced Thursday by Caretaker State Minister for
+# Manpower Abdul-Rahman Nur-Eddin.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Sudan   1970    only    -       May      1      0:00    1:00    S
+Rule   Sudan   1970    1985    -       Oct     15      0:00    0       -
+Rule   Sudan   1971    only    -       Apr     30      0:00    1:00    S
+Rule   Sudan   1972    1985    -       Apr     lastSun 0:00    1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Khartoum 2:10:08 -       LMT     1931
+                       2:00    Sudan   CA%sT   2000 Jan 15 12:00
+                       3:00    -       EAT
+
+# Swaziland
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Mbabane  2:04:24 -       LMT     1903 Mar
+                       2:00    -       SAST
+
+# Tanzania
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Africa/Dar_es_Salaam 2:37:08 -    LMT     1931
+                       3:00    -       EAT     1948
+                       2:44:45 -       BEAUT   1961
+                       3:00    -       EAT
+
+# Togo
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Lome     0:04:52 -       LMT     1893
+                       0:00    -       GMT
+
+# Tunisia
+
+# From Gwillim Law (2005-04-30):
+# My correspondent, Risto Nykanen, has alerted me to another adoption of DST,
+# this time in Tunisia.  According to Yahoo France News
+# <http://fr.news.yahoo.com/050426/5/4dumk.html>, in a story attributed to AP
+# and dated 2005-04-26, "Tunisia has decided to advance its official time by
+# one hour, starting on Sunday, May 1.  Henceforth, Tunisian time will be
+# UTC+2 instead of UTC+1.  The change will take place at 23:00 UTC next
+# Saturday."  (My translation)
+#
+# From Oscar van Vlijmen (2005-05-02):
+# LaPresse, the first national daily newspaper ...
+# <http://www.lapresse.tn/archives/archives280405/actualites/lheure.html>
+# ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30,
+# 1h standard time.
+#
+# From Atef Loukil (2006-03-28):
+# The daylight saving time will be the same each year:
+# Beginning      : the last Sunday of March at 02:00
+# Ending         : the last Sunday of October at 03:00 ...
+# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=1188&Itemid=50
+
+# From Steffen Thorsen (2009-03-16):
+# According to several news sources, Tunisia will not observe DST this year.
+# (Arabic)
+# <a href="http://www.elbashayer.com/?page=viewn&nid=42546">
+# http://www.elbashayer.com/?page=viewn&nid=42546
+# </a>
+# <a href="http://www.babnet.net/kiwidetail-15295.asp">
+# http://www.babnet.net/kiwidetail-15295.asp
+# </a>
+#
+# We have also confirmed this with the US embassy in Tunisia.
+# We have a wrap-up about this on the following page:
+# <a href="http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html">
+# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
+# </a>
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to Tunis Afrique Presse News Agency
+#
+# Standard time to be kept the whole year long (tap.info.tn):
+#
+# (in English)
+# <a href="http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157">
+# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157
+# </a>
+#
+# (in Arabic)
+# <a href="http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1">
+# http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1
+# </a>
+
+# From Arthur David Olson (2009--3-18):
+# The Tunis Afrique Presse News Agency notice contains this: "This measure is due to the fact
+# that the fasting month of ramadan coincides with the period concerned by summer time.
+# Therefore, the standard time will be kept unchanged the whole year long."
+# So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Tunisia 1939    only    -       Apr     15      23:00s  1:00    S
+Rule   Tunisia 1939    only    -       Nov     18      23:00s  0       -
+Rule   Tunisia 1940    only    -       Feb     25      23:00s  1:00    S
+Rule   Tunisia 1941    only    -       Oct      6       0:00   0       -
+Rule   Tunisia 1942    only    -       Mar      9       0:00   1:00    S
+Rule   Tunisia 1942    only    -       Nov      2       3:00   0       -
+Rule   Tunisia 1943    only    -       Mar     29       2:00   1:00    S
+Rule   Tunisia 1943    only    -       Apr     17       2:00   0       -
+Rule   Tunisia 1943    only    -       Apr     25       2:00   1:00    S
+Rule   Tunisia 1943    only    -       Oct      4       2:00   0       -
+Rule   Tunisia 1944    1945    -       Apr     Mon>=1   2:00   1:00    S
+Rule   Tunisia 1944    only    -       Oct      8       0:00   0       -
+Rule   Tunisia 1945    only    -       Sep     16       0:00   0       -
+Rule   Tunisia 1977    only    -       Apr     30       0:00s  1:00    S
+Rule   Tunisia 1977    only    -       Sep     24       0:00s  0       -
+Rule   Tunisia 1978    only    -       May      1       0:00s  1:00    S
+Rule   Tunisia 1978    only    -       Oct      1       0:00s  0       -
+Rule   Tunisia 1988    only    -       Jun      1       0:00s  1:00    S
+Rule   Tunisia 1988    1990    -       Sep     lastSun  0:00s  0       -
+Rule   Tunisia 1989    only    -       Mar     26       0:00s  1:00    S
+Rule   Tunisia 1990    only    -       May      1       0:00s  1:00    S
+Rule   Tunisia 2005    only    -       May      1       0:00s  1:00    S
+Rule   Tunisia 2005    only    -       Sep     30       1:00s  0       -
+Rule   Tunisia 2006    2008    -       Mar     lastSun  2:00s  1:00    S
+Rule   Tunisia 2006    2008    -       Oct     lastSun  2:00s  0       -
+Rule   Tunisia 2010    max     -       Mar     lastSun  2:00s  1:00    S
+Rule   Tunisia 2010    max     -       Oct     lastSun  2:00s  0       -
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
+# more precise 0:09:21.
+# Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Tunis    0:40:44 -       LMT     1881 May 12
+                       0:09:21 -       PMT     1911 Mar 11    # Paris Mean Time
+                       1:00    Tunisia CE%sT
+
+# Uganda
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Kampala  2:09:40 -       LMT     1928 Jul
+                       3:00    -       EAT     1930
+                       2:30    -       BEAT    1948
+                       2:44:45 -       BEAUT   1957
+                       3:00    -       EAT
+
+# Zambia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Lusaka   1:53:08 -       LMT     1903 Mar
+                       2:00    -       CAT
+
+# Zimbabwe
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Africa/Harare   2:04:12 -       LMT     1903 Mar
+                       2:00    -       CAT
diff --git a/extra/zoneinfo/antarctica b/extra/zoneinfo/antarctica
new file mode 100644 (file)
index 0000000..ef279cb
--- /dev/null
@@ -0,0 +1,327 @@
+# @(#)antarctica       8.4
+# <pre>
+
+# From Paul Eggert (1999-11-15):
+# To keep things manageable, we list only locations occupied year-round; see
+# <a href="http://www.comnap.aq/comnap/comnap.nsf/P/Stations/">
+# COMNAP - Stations and Bases
+# </a>
+# and
+# <a href="http://www.spri.cam.ac.uk/bob/periant.htm">
+# Summary of the Peri-Antarctic Islands (1998-07-23)
+# </a>
+# for information.
+# Unless otherwise specified, we have no time zone information.
+#
+# Except for the French entries,
+# I made up all time zone abbreviations mentioned here; corrections welcome!
+# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
+
+# These rules are stolen from the `europe' file.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   RussAQ  1981    1984    -       Apr      1       0:00   1:00    S
+Rule   RussAQ  1981    1983    -       Oct      1       0:00   0       -
+Rule   RussAQ  1984    1991    -       Sep     lastSun  2:00s  0       -
+Rule   RussAQ  1985    1991    -       Mar     lastSun  2:00s  1:00    S
+Rule   RussAQ  1992    only    -       Mar     lastSat  23:00  1:00    S
+Rule   RussAQ  1992    only    -       Sep     lastSat  23:00  0       -
+Rule   RussAQ  1993    max     -       Mar     lastSun  2:00s  1:00    S
+Rule   RussAQ  1993    1995    -       Sep     lastSun  2:00s  0       -
+Rule   RussAQ  1996    max     -       Oct     lastSun  2:00s  0       -
+
+# These rules are stolen from the `southamerica' file.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   ArgAQ   1964    1966    -       Mar      1      0:00    0       -
+Rule   ArgAQ   1964    1966    -       Oct     15      0:00    1:00    S
+Rule   ArgAQ   1967    only    -       Apr      2      0:00    0       -
+Rule   ArgAQ   1967    1968    -       Oct     Sun>=1  0:00    1:00    S
+Rule   ArgAQ   1968    1969    -       Apr     Sun>=1  0:00    0       -
+Rule   ArgAQ   1974    only    -       Jan     23      0:00    1:00    S
+Rule   ArgAQ   1974    only    -       May      1      0:00    0       -
+Rule   ChileAQ 1972    1986    -       Mar     Sun>=9  3:00u   0       -
+Rule   ChileAQ 1974    1987    -       Oct     Sun>=9  4:00u   1:00    S
+Rule   ChileAQ 1987    only    -       Apr     12      3:00u   0       -
+Rule   ChileAQ 1988    1989    -       Mar     Sun>=9  3:00u   0       -
+Rule   ChileAQ 1988    only    -       Oct     Sun>=1  4:00u   1:00    S
+Rule   ChileAQ 1989    only    -       Oct     Sun>=9  4:00u   1:00    S
+Rule   ChileAQ 1990    only    -       Mar     18      3:00u   0       -
+Rule   ChileAQ 1990    only    -       Sep     16      4:00u   1:00    S
+Rule   ChileAQ 1991    1996    -       Mar     Sun>=9  3:00u   0       -
+Rule   ChileAQ 1991    1997    -       Oct     Sun>=9  4:00u   1:00    S
+Rule   ChileAQ 1997    only    -       Mar     30      3:00u   0       -
+Rule   ChileAQ 1998    only    -       Mar     Sun>=9  3:00u   0       -
+Rule   ChileAQ 1998    only    -       Sep     27      4:00u   1:00    S
+Rule   ChileAQ 1999    only    -       Apr      4      3:00u   0       -
+Rule   ChileAQ 1999    max     -       Oct     Sun>=9  4:00u   1:00    S
+Rule   ChileAQ 2000    max     -       Mar     Sun>=9  3:00u   0       -
+
+
+# Argentina - year-round bases
+# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
+# Esperanza, San Martin Land, -6323-05659, since 1952-12-17
+# Jubany, Potter Peninsula, King George Island, -6414-0602320, since 1982-01
+# Marambio, Seymour I, -6414-05637, since 1969-10-29
+# Orcadas, Laurie I, -6016-04444, since 1904-02-22
+# San Martin, Debenham I, -6807-06708, since 1951-03-21
+#      (except 1960-03 / 1976-03-21)
+
+# Australia - territories
+# Heard Island, McDonald Islands (uninhabited)
+#      previously sealers and scientific personnel wintered
+#      <a href="http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html">
+#      Margaret Turner reports
+#      </a> (1999-09-30) that they're UTC+5, with no DST;
+#      presumably this is when they have visitors.
+#
+# year-round bases
+# Casey, Bailey Peninsula, -6617+11032, since 1969
+# Davis, Vestfold Hills, -6835+07759, since 1957-01-13
+#      (except 1964-11 - 1969-02)
+# Mawson, Holme Bay, -6736+06253, since 1954-02-13
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Casey  0       -       zzz     1969
+                       8:00    -       WST     # Western (Aus) Standard Time
+Zone Antarctica/Davis  0       -       zzz     1957 Jan 13
+                       7:00    -       DAVT    1964 Nov # Davis Time
+                       0       -       zzz     1969 Feb
+                       7:00    -       DAVT
+Zone Antarctica/Mawson 0       -       zzz     1954 Feb 13
+                       6:00    -       MAWT    # Mawson Time
+# References:
+# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
+# Casey Weather (1998-02-26)
+# </a>
+# <a href="http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html">
+# Davis Station, Antarctica (1998-02-26)
+# </a>
+# <a href="http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html">
+# Mawson Station, Antarctica (1998-02-25)
+# </a>
+
+# Brazil - year-round base
+# Comandante Ferraz, King George Island, -6205+05824, since 1983/4
+
+# Chile - year-round bases and towns
+# Escudero, South Shetland Is, -621157-0585735, since 1994
+# Presidente Eduadro Frei, King George Island, -6214-05848, since 1969-03-07
+# General Bernardo O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
+# Capitan Arturo Prat, -6230-05941
+# Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
+# These locations have always used Santiago time; use TZ='America/Santiago'.
+
+# China - year-round bases
+# Great Wall, King George Island, -6213-05858, since 1985-02-20
+# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
+
+# France - year-round bases
+#
+# From Antoine Leca (1997-01-20):
+# Time data are from Nicole Pailleau at the IFRTP
+# (French Institute for Polar Research and Technology).
+# She confirms that French Southern Territories and Terre Adelie bases
+# don't observe daylight saving time, even if Terre Adelie supplies came
+# from Tasmania.
+#
+# French Southern Territories with year-round inhabitants
+#
+# Martin-de-Vivies Base, Amsterdam Island, -374105+0773155, since 1950
+# Alfred-Faure Base, Crozet Islands, -462551+0515152, since 1964
+# Port-aux-Francais, Kerguelen Islands, -492110+0701303, since 1951;
+#      whaling & sealing station operated 1908/1914, 1920/1929, and 1951/1956
+#
+# St Paul Island - near Amsterdam, uninhabited
+#      fishing stations operated variously 1819/1931
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Indian/Kerguelen  0       -       zzz     1950    # Port-aux-Francais
+                       5:00    -       TFT     # ISO code TF Time
+#
+# year-round base in the main continent
+# Dumont-d'Urville, Ile des Petrels, -6640+14001, since 1956-11
+#
+# Another base at Port-Martin, 50km east, began operation in 1947.
+# It was destroyed by fire on 1952-01-14.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/DumontDUrville 0 -     zzz     1947
+                       10:00   -       PMT     1952 Jan 14 # Port-Martin Time
+                       0       -       zzz     1956 Nov
+                       10:00   -       DDUT    # Dumont-d'Urville Time
+# Reference:
+# <a href="http://en.wikipedia.org/wiki/Dumont_d'Urville_Station">
+# Dumont d'Urville Station (2005-12-05)
+# </a>
+
+# Germany - year-round base
+# Georg von Neumayer, -7039-00815
+
+# India - year-round base
+# Dakshin Gangotri, -7005+01200
+
+# Japan - year-round bases
+# Dome Fuji, -7719+03942
+# Syowa, -690022+0393524
+#
+# From Hideyuki Suzuki (1999-02-06):
+# In all Japanese stations, +0300 is used as the standard time.
+#
+# Syowa station, which is the first antarctic station of Japan,
+# was established on 1957-01-29.  Since Syowa station is still the main
+# station of Japan, it's appropriate for the principal location.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Syowa  0       -       zzz     1957 Jan 29
+                       3:00    -       SYOT    # Syowa Time
+# See:
+# <a href="http://www.nipr.ac.jp/english/ara01.html">
+# NIPR Antarctic Research Activities (1999-08-17)
+# </a>
+
+# S Korea - year-round base
+# King Sejong, King George Island, -6213-05847, since 1988
+
+# New Zealand - claims
+# Balleny Islands (never inhabited)
+# Scott Island (never inhabited)
+#
+# year-round base
+# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo.
+#
+# These rules for New Zealand are stolen from the `australasia' file.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   NZAQ    1974    only    -       Nov      3      2:00s   1:00    D
+Rule   NZAQ    1975    1988    -       Oct     lastSun 2:00s   1:00    D
+Rule   NZAQ    1989    only    -       Oct      8      2:00s   1:00    D
+Rule   NZAQ    1990    2006    -       Oct     Sun>=1  2:00s   1:00    D
+Rule   NZAQ    1975    only    -       Feb     23      2:00s   0       S
+Rule   NZAQ    1976    1989    -       Mar     Sun>=1  2:00s   0       S
+Rule   NZAQ    1990    2007    -       Mar     Sun>=15 2:00s   0       S
+Rule   NZAQ    2007    max     -       Sep     lastSun 2:00s   1:00    D
+Rule   NZAQ    2008    max     -       Apr     Sun>=1  2:00s   0       S
+
+# Norway - territories
+# Bouvet (never inhabited)
+#
+# claims
+# Peter I Island (never inhabited)
+
+# Poland - year-round base
+# Arctowski, King George Island, -620945-0582745, since 1977
+
+# Russia - year-round bases
+# Bellingshausen, King George Island, -621159-0585337, since 1968-02-22
+# Mirny, Davis coast, -6633+09301, since 1956-02
+# Molodezhnaya, Alasheyev Bay, -6740+04551,
+#      year-round from 1962-02 to 1999-07-01
+# Novolazarevskaya, Queen Maud Land, -7046+01150,
+#      year-round from 1960/61 to 1992
+
+# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
+# <a href="http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP">
+# From Craig Mundell (1994-12-15)</a>:
+# Vostok, which is one of the Russian stations, is set on the same
+# time as Moscow, Russia.
+#
+# From Lee Hotz (2001-03-08):
+# I queried the folks at Columbia who spent the summer at Vostok and this is
+# what they had to say about time there:
+# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo)
+# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
+# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
+# of GMT). This is a time zone I think two hours east of Moscow. The
+# natural time zone is in between the two: 8 hours ahead of GMT.''
+#
+# From Paul Eggert (2001-05-04):
+# This seems to be hopelessly confusing, so I asked Lee Hotz about it
+# in person.  He said that some Antartic locations set their local
+# time so that noon is the warmest part of the day, and that this
+# changes during the year and does not necessarily correspond to mean
+# solar noon.  So the Vostok time might have been whatever the clocks
+# happened to be during their visit.  So we still don't really know what time
+# it is at Vostok.  But we'll guess UTC+6.
+#
+Zone Antarctica/Vostok 0       -       zzz     1957 Dec 16
+                       6:00    -       VOST    # Vostok time
+
+# S Africa - year-round bases
+# Marion Island, -4653+03752
+# Sanae, -7141-00250
+
+# UK
+#
+# British Antarctic Territories (BAT) claims
+# South Orkney Islands
+#      scientific station from 1903
+#      whaling station at Signy I 1920/1926
+# South Shetland Islands
+#
+# year-round bases
+# Bird Island, South Georgia, -5400-03803, since 1983
+# Deception Island, -6259-06034, whaling station 1912/1931,
+#      scientific station 1943/1967,
+#      previously sealers and a scientific expedition wintered by accident,
+#      and a garrison was deployed briefly
+# Halley, Coates Land, -7535-02604, since 1956-01-06
+#      Halley is on a moving ice shelf and is periodically relocated
+#      so that it is never more than 10km from its nominal location.
+# Rothera, Adelaide Island, -6734-6808, since 1976-12-01
+#
+# From Paul Eggert (2002-10-22)
+# <http://webexhibits.org/daylightsaving/g.html> says Rothera is -03 all year.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Rothera        0       -       zzz     1976 Dec  1
+                       -3:00   -       ROTT    # Rothera time
+
+# Uruguay - year round base
+# Artigas, King George Island, -621104-0585107
+
+# USA - year-round bases
+#
+# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
+#
+# From Ethan Dicks (1996-10-06):
+# It keeps the same time as Punta Arenas, Chile, because, just like us
+# and the South Pole, that's the other end of their supply line....
+# I verified with someone who was there that since 1980,
+# Palmer has followed Chile.  Prior to that, before the Falklands War,
+# Palmer used to be supplied from Argentina.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Palmer 0       -       zzz     1965
+                       -4:00   ArgAQ   AR%sT   1969 Oct 5
+                       -3:00   ArgAQ   AR%sT   1982 May
+                       -4:00   ChileAQ CL%sT
+#
+#
+# McMurdo, Ross Island, since 1955-12
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/McMurdo        0       -       zzz     1956
+                       12:00   NZAQ    NZ%sT
+#
+# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20
+#
+# From Paul Eggert (1996-09-03):
+# Normally it wouldn't have a separate entry, since it's like the
+# larger Antarctica/McMurdo since 1970, but it's too famous to omit.
+#
+# From Chris Carrier (1996-06-27):
+# Siple, the first commander of the South Pole station,
+# stated that he would have liked to have kept GMT at the station,
+# but that he found it more convenient to keep GMT+12
+# as supplies for the station were coming from McMurdo Sound,
+# which was on GMT+12 because New Zealand was on GMT+12 all year
+# at that time (1957).  (Source: Siple's book 90 degrees SOUTH.)
+#
+# From Susan Smith
+# http://www.cybertours.com/whs/pole10.html
+# (1995-11-13 16:24:56 +1300, no longer available):
+# We use the same time as McMurdo does.
+# And they use the same time as Christchurch, NZ does....
+# One last quirk about South Pole time.
+# All the electric clocks are usually wrong.
+# Something about the generators running at 60.1hertz or something
+# makes all of the clocks run fast.  So every couple of days,
+# we have to go around and set them back 5 minutes or so.
+# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
+#
+Link   Antarctica/McMurdo      Antarctica/South_Pole
diff --git a/extra/zoneinfo/asia b/extra/zoneinfo/asia
new file mode 100644 (file)
index 0000000..2c3dc38
--- /dev/null
@@ -0,0 +1,2152 @@
+# @(#)asia     8.30
+# <pre>
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+#
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Another source occasionally used is Edward W. Whitman, World Time Differences,
+# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
+# I found in the UCLA library.
+#
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#
+# I invented the abbreviations marked `*' in the following table;
+# the rest are from earlier versions of this file, or from other sources.
+# Corrections are welcome!
+#           std  dst
+#           LMT        Local Mean Time
+#      2:00 EET  EEST  Eastern European Time
+#      2:00 IST  IDT   Israel
+#      3:00 AST  ADT   Arabia*
+#      3:30 IRST IRDT  Iran
+#      4:00 GST        Gulf*
+#      5:30 IST        India
+#      7:00 ICT        Indochina*
+#      7:00 WIT        west Indonesia
+#      8:00 CIT        central Indonesia
+#      8:00 CST        China
+#      9:00 CJT        Central Japanese Time (1896/1937)*
+#      9:00 EIT        east Indonesia
+#      9:00 JST  JDT   Japan
+#      9:00 KST  KDT   Korea
+#      9:30 CST        (Australian) Central Standard Time
+#
+# See the `europe' file for Russia and Turkey in Asia.
+
+# From Guy Harris:
+# Incorporates data for Singapore from Robert Elz' asia 1.1, as well as
+# additional information from Tom Yap, Sun Microsystems Intercontinental
+# Technical Support (including a page from the Official Airline Guide -
+# Worldwide Edition).  The names for time zones are guesses.
+
+###############################################################################
+
+# These rules are stolen from the `europe' file.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   EUAsia  1981    max     -       Mar     lastSun  1:00u  1:00    S
+Rule   EUAsia  1979    1995    -       Sep     lastSun  1:00u  0       -
+Rule   EUAsia  1996    max     -       Oct     lastSun  1:00u  0       -
+Rule E-EurAsia 1981    max     -       Mar     lastSun  0:00   1:00    S
+Rule E-EurAsia 1979    1995    -       Sep     lastSun  0:00   0       -
+Rule E-EurAsia 1996    max     -       Oct     lastSun  0:00   0       -
+Rule RussiaAsia        1981    1984    -       Apr     1        0:00   1:00    S
+Rule RussiaAsia        1981    1983    -       Oct     1        0:00   0       -
+Rule RussiaAsia        1984    1991    -       Sep     lastSun  2:00s  0       -
+Rule RussiaAsia        1985    1991    -       Mar     lastSun  2:00s  1:00    S
+Rule RussiaAsia        1992    only    -       Mar     lastSat 23:00   1:00    S
+Rule RussiaAsia        1992    only    -       Sep     lastSat 23:00   0       -
+Rule RussiaAsia        1993    max     -       Mar     lastSun  2:00s  1:00    S
+Rule RussiaAsia        1993    1995    -       Sep     lastSun  2:00s  0       -
+Rule RussiaAsia        1996    max     -       Oct     lastSun  2:00s  0       -
+
+# Afghanistan
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Kabul      4:36:48 -       LMT     1890
+                       4:00    -       AFT     1945
+                       4:30    -       AFT
+
+# Armenia
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger have Yerevan switching to 3:00 (with Russian DST)
+# in spring 1991, then to 4:00 with no DST in fall 1995, then
+# readopting Russian DST in 1997.  Go with Shanks & Pottenger, even
+# when they disagree with others.  Edgar Der-Danieliantz
+# reported (1996-05-04) that Yerevan probably wouldn't use DST
+# in 1996, though it did use DST in 1995.  IATA SSIM (1991/1998) reports that
+# Armenia switched from 3:00 to 4:00 in 1998 and observed DST after 1991,
+# but started switching at 3:00s in 1998.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Yerevan    2:58:00 -       LMT     1924 May  2
+                       3:00    -       YERT    1957 Mar    # Yerevan Time
+                       4:00 RussiaAsia YER%sT  1991 Mar 31 2:00s
+                       3:00    1:00    YERST   1991 Sep 23 # independence
+                       3:00 RussiaAsia AM%sT   1995 Sep 24 2:00s
+                       4:00    -       AMT     1997
+                       4:00 RussiaAsia AM%sT
+
+# Azerbaijan
+# From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23):
+# According to the resolution of Cabinet of Ministers, 1997
+# Resolution available at: http://aif.az/docs/daylight_res.pdf
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Azer    1997    max     -       Mar     lastSun  4:00   1:00    S
+Rule   Azer    1997    max     -       Oct     lastSun  5:00   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Baku       3:19:24 -       LMT     1924 May  2
+                       3:00    -       BAKT    1957 Mar    # Baku Time
+                       4:00 RussiaAsia BAK%sT  1991 Mar 31 2:00s
+                       3:00    1:00    BAKST   1991 Aug 30 # independence
+                       3:00 RussiaAsia AZ%sT   1992 Sep lastSat 23:00
+                       4:00    -       AZT     1996 # Azerbaijan time
+                       4:00    EUAsia  AZ%sT   1997
+                       4:00    Azer    AZ%sT
+
+# Bahrain
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Bahrain    3:22:20 -       LMT     1920            # Al Manamah
+                       4:00    -       GST     1972 Jun
+                       3:00    -       AST
+
+# Bangladesh
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Dhaka      6:01:40 -       LMT     1890
+                       5:53:20 -       HMT     1941 Oct    # Howrah Mean Time?
+                       6:30    -       BURT    1942 May 15 # Burma Time
+                       5:30    -       IST     1942 Sep
+                       6:30    -       BURT    1951 Sep 30
+                       6:00    -       DACT    1971 Mar 26 # Dacca Time
+                       6:00    -       BDT     # Bangladesh Time
+
+# Bhutan
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Thimphu    5:58:36 -       LMT     1947 Aug 15 # or Thimbu
+                       5:30    -       IST     1987 Oct
+                       6:00    -       BTT     # Bhutan Time
+
+# British Indian Ocean Territory
+# Whitman and the 1995 CIA time zone map say 5:00, but the
+# 1997 and later maps say 6:00.  Assume the switch occurred in 1996.
+# We have no information as to when standard time was introduced;
+# assume it occurred in 1907, the same year as Mauritius (which
+# then contained the Chagos Archipelago).
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Indian/Chagos   4:49:40 -       LMT     1907
+                       5:00    -       IOT     1996 # BIOT Time
+                       6:00    -       IOT
+
+# Brunei
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Brunei     7:39:40 -       LMT     1926 Mar   # Bandar Seri Begawan
+                       7:30    -       BNT     1933
+                       8:00    -       BNT
+
+# Burma / Myanmar
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Rangoon    6:24:40 -       LMT     1880            # or Yangon
+                       6:24:36 -       RMT     1920       # Rangoon Mean Time?
+                       6:30    -       BURT    1942 May   # Burma Time
+                       9:00    -       JST     1945 May 3
+                       6:30    -       MMT                # Myanmar Time
+
+# Cambodia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Phnom_Penh 6:59:40 -       LMT     1906 Jun  9
+                       7:06:20 -       SMT     1911 Mar 11 0:01 # Saigon MT?
+                       7:00    -       ICT     1912 May
+                       8:00    -       ICT     1931 May
+                       7:00    -       ICT
+
+# China
+
+# From Guy Harris:
+# People's Republic of China.  Yes, they really have only one time zone.
+
+# From Bob Devine (1988-01-28):
+# No they don't.  See TIME mag, 1986-02-17 p.52.  Even though
+# China is across 4 physical time zones, before Feb 1, 1986 only the
+# Peking (Bejing) time zone was recognized.  Since that date, China
+# has two of 'em -- Peking's and Urumqi (named after the capital of
+# the Xinjiang Uyghur Autonomous Region).  I don't know about DST for it.
+#
+# . . .I just deleted the DST table and this editor makes it too
+# painful to suck in another copy..  So, here is what I have for
+# DST start/end dates for Peking's time zone (info from AP):
+#
+#     1986 May 4 - Sept 14
+#     1987 mid-April - ??
+
+# From U. S. Naval Observatory (1989-01-19):
+# CHINA               8 H  AHEAD OF UTC  ALL OF CHINA, INCL TAIWAN
+# CHINA               9 H  AHEAD OF UTC  APR 17 - SEP 10
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that China (except for Hong Kong and Macau)
+# has had a single time zone since 1980 May 1, observing summer DST
+# from 1986 through 1991; this contradicts Devine's
+# note about Time magazine, though apparently _something_ happened in 1986.
+# Go with Shanks & Pottenger for now.  I made up names for the other
+# pre-1980 time zones.
+
+# From Shanks & Pottenger:
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Shang   1940    only    -       Jun      3      0:00    1:00    D
+Rule   Shang   1940    1941    -       Oct      1      0:00    0       S
+Rule   Shang   1941    only    -       Mar     16      0:00    1:00    D
+Rule   PRC     1986    only    -       May      4      0:00    1:00    D
+Rule   PRC     1986    1991    -       Sep     Sun>=11 0:00    0       S
+Rule   PRC     1987    1991    -       Apr     Sun>=10 0:00    1:00    D
+
+# From Anthony Fok (2001-12-20):
+# BTW, I did some research on-line and found some info regarding these five
+# historic timezones from some Taiwan websites.  And yes, there are official
+# Chinese names for these locales (before 1949).
+#
+# From Jesper Norgaard Welen (2006-07-14):
+# I have investigated the timezones around 1970 on the
+# http://www.astro.com/atlas site [with provinces and county
+# boundaries summarized below]....  A few other exceptions were two
+# counties on the Sichuan side of the Xizang-Sichuan border,
+# counties Dege and Baiyu which lies on the Sichuan side and are
+# therefore supposed to be GMT+7, Xizang region being GMT+6, but Dege
+# county is GMT+8 according to astro.com while Baiyu county is GMT+6
+# (could be true), for the moment I am assuming that those two
+# counties are mistakes in the astro.com data.
+
+# From Paul Eggert (2008-02-11):
+# I just now checked Google News for western news sources that talk
+# about China's single time zone, and couldn't find anything before 1986
+# talking about China being in one time zone.  (That article was: Jim
+# Mann, "A clumsy embrace for another western custom: China on daylight
+# time--sort of", Los Angeles Times, 1986-05-05.  By the way, this
+# article confirms the tz database's data claiming that China began
+# observing daylight saving time in 1986.
+#
+# From Thomas S. Mullaney (2008-02-11):
+# I think you're combining two subjects that need to treated 
+# separately: daylight savings (which, you're correct, wasn't 
+# implemented until the 1980s) and the unified time zone centered near 
+# Beijing (which was implemented in 1949). Briefly, there was also a 
+# "Lhasa Time" in Tibet and "Urumqi Time" in Xinjiang. The first was 
+# ceased, and the second eventually recognized (again, in the 1980s).
+#
+# From Paul Eggert (2008-06-30):
+# There seems to be a good chance China switched to a single time zone in 1949
+# rather than in 1980 as Shanks & Pottenger have it, but we don't have a
+# reliable documentary source saying so yet, so for now we still go with
+# Shanks & Pottenger.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# Changbai Time ("Long-white Time", Long-white = Heilongjiang area)
+# Heilongjiang (except Mohe county), Jilin
+Zone   Asia/Harbin     8:26:44 -       LMT     1928 # or Haerbin
+                       8:30    -       CHAT    1932 Mar # Changbai Time
+                       8:00    -       CST     1940
+                       9:00    -       CHAT    1966 May
+                       8:30    -       CHAT    1980 May
+                       8:00    PRC     C%sT
+# Zhongyuan Time ("Central plain Time")
+# most of China
+Zone   Asia/Shanghai   8:05:52 -       LMT     1928
+                       8:00    Shang   C%sT    1949
+                       8:00    PRC     C%sT
+# Long-shu Time (probably due to Long and Shu being two names of that area)
+# Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
+# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
+# counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
+# Yangchun, Yangjiang, Yu'nan, and Yunfu.
+Zone   Asia/Chongqing  7:06:20 -       LMT     1928 # or Chungking
+                       7:00    -       LONT    1980 May # Long-shu Time
+                       8:00    PRC     C%sT
+# Xin-zang Time ("Xinjiang-Tibet Time")
+# The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
+# the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
+# Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
+# east Tibet, including Lhasa, Chamdo, Shigaise, Jimsar, Shawan and Hutubi;
+# east Xinjiang, including Urumqi, Turpan, Karamay, Korla, Minfeng, Jinghe,
+# Wusu, Qiemo, Xinyan, Wulanwusu, Jinghe, Yumin, Tacheng, Tuoli, Emin,
+# Shihezi, Changji, Yanqi, Heshuo, Tuokexun, Tulufan, Shanshan, Hami,
+# Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
+Zone   Asia/Urumqi     5:50:20 -       LMT     1928 # or Urumchi
+                       6:00    -       URUT    1980 May # Urumqi Time
+                       8:00    PRC     C%sT
+# Kunlun Time
+# West Tibet, including Pulan, Aheqi, Shufu, Shule;
+# West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
+# Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding,
+# and Yarkand.
+Zone   Asia/Kashgar    5:03:56 -       LMT     1928 # or Kashi or Kaxgar
+                       5:30    -       KAST    1940     # Kashgar Time
+                       5:00    -       KAST    1980 May
+                       8:00    PRC     C%sT
+
+# Hong Kong (Xianggang)
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   HK      1946    only    -       Apr     20      3:30    1:00    S
+Rule   HK      1946    only    -       Dec     1       3:30    0       -
+Rule   HK      1947    only    -       Apr     13      3:30    1:00    S
+Rule   HK      1947    only    -       Dec     30      3:30    0       -
+Rule   HK      1948    only    -       May     2       3:30    1:00    S
+Rule   HK      1948    1952    -       Oct     lastSun 3:30    0       -
+Rule   HK      1949    1953    -       Apr     Sun>=1  3:30    1:00    S
+Rule   HK      1953    only    -       Nov     1       3:30    0       -
+Rule   HK      1954    1964    -       Mar     Sun>=18 3:30    1:00    S
+Rule   HK      1954    only    -       Oct     31      3:30    0       -
+Rule   HK      1955    1964    -       Nov     Sun>=1  3:30    0       -
+Rule   HK      1965    1977    -       Apr     Sun>=16 3:30    1:00    S
+Rule   HK      1965    1977    -       Oct     Sun>=16 3:30    0       -
+Rule   HK      1979    1980    -       May     Sun>=8  3:30    1:00    S
+Rule   HK      1979    1980    -       Oct     Sun>=16 3:30    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Hong_Kong  7:36:36 -       LMT     1904 Oct 30
+                       8:00    HK      HK%sT
+
+
+###############################################################################
+
+# Taiwan
+
+# Shanks & Pottenger write that Taiwan observed DST during 1945, when it
+# was still controlled by Japan.  This is hard to believe, but we don't
+# have any other information.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Taiwan  1945    1951    -       May     1       0:00    1:00    D
+Rule   Taiwan  1945    1951    -       Oct     1       0:00    0       S
+Rule   Taiwan  1952    only    -       Mar     1       0:00    1:00    D
+Rule   Taiwan  1952    1954    -       Nov     1       0:00    0       S
+Rule   Taiwan  1953    1959    -       Apr     1       0:00    1:00    D
+Rule   Taiwan  1955    1961    -       Oct     1       0:00    0       S
+Rule   Taiwan  1960    1961    -       Jun     1       0:00    1:00    D
+Rule   Taiwan  1974    1975    -       Apr     1       0:00    1:00    D
+Rule   Taiwan  1974    1975    -       Oct     1       0:00    0       S
+Rule   Taiwan  1980    only    -       Jun     30      0:00    1:00    D
+Rule   Taiwan  1980    only    -       Sep     30      0:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Taipei     8:06:00 -       LMT     1896 # or Taibei or T'ai-pei
+                       8:00    Taiwan  C%sT
+
+# Macau (Macao, Aomen)
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Macau   1961    1962    -       Mar     Sun>=16 3:30    1:00    S
+Rule   Macau   1961    1964    -       Nov     Sun>=1  3:30    0       -
+Rule   Macau   1963    only    -       Mar     Sun>=16 0:00    1:00    S
+Rule   Macau   1964    only    -       Mar     Sun>=16 3:30    1:00    S
+Rule   Macau   1965    only    -       Mar     Sun>=16 0:00    1:00    S
+Rule   Macau   1965    only    -       Oct     31      0:00    0       -
+Rule   Macau   1966    1971    -       Apr     Sun>=16 3:30    1:00    S
+Rule   Macau   1966    1971    -       Oct     Sun>=16 3:30    0       -
+Rule   Macau   1972    1974    -       Apr     Sun>=15 0:00    1:00    S
+Rule   Macau   1972    1973    -       Oct     Sun>=15 0:00    0       -
+Rule   Macau   1974    1977    -       Oct     Sun>=15 3:30    0       -
+Rule   Macau   1975    1977    -       Apr     Sun>=15 3:30    1:00    S
+Rule   Macau   1978    1980    -       Apr     Sun>=15 0:00    1:00    S
+Rule   Macau   1978    1980    -       Oct     Sun>=15 0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Macau      7:34:20 -       LMT     1912
+                       8:00    Macau   MO%sT   1999 Dec 20 # return to China
+                       8:00    PRC     C%sT
+
+
+###############################################################################
+
+# Cyprus
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Cyprus  1975    only    -       Apr     13      0:00    1:00    S
+Rule   Cyprus  1975    only    -       Oct     12      0:00    0       -
+Rule   Cyprus  1976    only    -       May     15      0:00    1:00    S
+Rule   Cyprus  1976    only    -       Oct     11      0:00    0       -
+Rule   Cyprus  1977    1980    -       Apr     Sun>=1  0:00    1:00    S
+Rule   Cyprus  1977    only    -       Sep     25      0:00    0       -
+Rule   Cyprus  1978    only    -       Oct     2       0:00    0       -
+Rule   Cyprus  1979    1997    -       Sep     lastSun 0:00    0       -
+Rule   Cyprus  1981    1998    -       Mar     lastSun 0:00    1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Nicosia    2:13:28 -       LMT     1921 Nov 14
+                       2:00    Cyprus  EE%sT   1998 Sep
+                       2:00    EUAsia  EE%sT
+# IATA SSIM (1998-09) has Cyprus using EU rules for the first time.
+
+# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
+# However, for various reasons many users expect to find it under Europe.
+Link   Asia/Nicosia    Europe/Nicosia
+
+# Georgia
+# From Paul Eggert (1994-11-19):
+# Today's _Economist_ (p 60) reports that Georgia moved its clocks forward
+# an hour recently, due to a law proposed by Zurab Murvanidze,
+# an MP who went on a hunger strike for 11 days to force discussion about it!
+# We have no details, but we'll guess they didn't move the clocks back in fall.
+#
+# From Mathew Englander, quoting AP (1996-10-23 13:05-04):
+# Instead of putting back clocks at the end of October, Georgia
+# will stay on daylight savings time this winter to save energy,
+# President Eduard Shevardnadze decreed Wednesday.
+#
+# From the BBC via Joseph S. Myers (2004-06-27):
+#
+# Georgia moved closer to Western Europe on Sunday...  The former Soviet
+# republic has changed its time zone back to that of Moscow.  As a result it
+# is now just four hours ahead of Greenwich Mean Time, rather than five hours
+# ahead.  The switch was decreed by the pro-Western president of Georgia,
+# Mikhail Saakashvili, who said the change was partly prompted by the process
+# of integration into Europe.
+
+# From Teimuraz Abashidze (2005-11-07):
+# Government of Georgia ... decided to NOT CHANGE daylight savings time on
+# [Oct.] 30, as it was done before during last more than 10 years.
+# Currently, we are in fact GMT +4:00, as before 30 October it was GMT
+# +3:00.... The problem is, there is NO FORMAL LAW or governmental document
+# about it.  As far as I can find, I was told, that there is no document,
+# because we just DIDN'T ISSUE document about switching to winter time....
+# I don't know what can be done, especially knowing that some years ago our
+# DST rules where changed THREE TIMES during one month.
+
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Tbilisi    2:59:16 -       LMT     1880
+                       2:59:16 -       TBMT    1924 May  2 # Tbilisi Mean Time
+                       3:00    -       TBIT    1957 Mar    # Tbilisi Time
+                       4:00 RussiaAsia TBI%sT  1991 Mar 31 2:00s
+                       3:00    1:00    TBIST   1991 Apr  9 # independence
+                       3:00 RussiaAsia GE%sT   1992 # Georgia Time
+                       3:00 E-EurAsia  GE%sT   1994 Sep lastSun
+                       4:00 E-EurAsia  GE%sT   1996 Oct lastSun
+                       4:00    1:00    GEST    1997 Mar lastSun
+                       4:00 E-EurAsia  GE%sT   2004 Jun 27
+                       3:00 RussiaAsia GE%sT   2005 Mar lastSun 2:00
+                       4:00    -       GET
+
+# East Timor
+
+# See Indonesia for the 1945 transition.
+
+# From Joao Carrascalao, brother of the former governor of East Timor, in
+# <a href="http://etan.org/et99c/december/26-31/30ETMAY.htm">
+# East Timor may be late for its millennium
+# </a> (1999-12-26/31):
+# Portugal tried to change the time forward in 1974 because the sun
+# rises too early but the suggestion raised a lot of problems with the
+# Timorese and I still don't think it would work today because it
+# conflicts with their way of life.
+
+# From Paul Eggert (2000-12-04):
+# We don't have any record of the above attempt.
+# Most likely our records are incomplete, but we have no better data.
+
+# <a href="http://www.hri.org/news/world/undh/last/00-08-16.undh.html">
+# From Manoel de Almeida e Silva, Deputy Spokesman for the UN Secretary-General
+# (2000-08-16)</a>:
+# The Cabinet of the East Timor Transition Administration decided
+# today to advance East Timor's time by one hour.  The time change,
+# which will be permanent, with no seasonal adjustment, will happen at
+# midnight on Saturday, September 16.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Dili       8:22:20 -       LMT     1912
+                       8:00    -       TLT     1942 Feb 21 23:00 # E Timor Time
+                       9:00    -       JST     1945 Sep 23
+                       9:00    -       TLT     1976 May  3
+                       8:00    -       CIT     2000 Sep 17 00:00
+                       9:00    -       TLT
+
+# India
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Kolkata    5:53:28 -       LMT     1880    # Kolkata
+                       5:53:20 -       HMT     1941 Oct    # Howrah Mean Time?
+                       6:30    -       BURT    1942 May 15 # Burma Time
+                       5:30    -       IST     1942 Sep
+                       5:30    1:00    IST     1945 Oct 15
+                       5:30    -       IST
+# The following are like Asia/Kolkata:
+#      Andaman Is
+#      Lakshadweep (Laccadive, Minicoy and Amindivi Is)
+#      Nicobar Is
+
+# Indonesia
+#
+# From Gwillim Law (2001-05-28), overriding Shanks & Pottenger:
+# <http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime>
+# says that Indonesia's time zones changed on 1988-01-01.  Looking at some
+# time zone maps, I think that must refer to Western Borneo (Kalimantan Barat
+# and Kalimantan Tengah) switching from UTC+8 to UTC+7.
+#
+# From Paul Eggert (2007-03-10):
+# Here is another correction to Shanks & Pottenger.
+# JohnTWB writes that Japanese forces did not surrender control in
+# Indonesia until 1945-09-01 00:00 at the earliest (in Jakarta) and
+# other formal surrender ceremonies were September 9, 11, and 13, plus
+# September 12 for the regional surrender to Mountbatten in Singapore.
+# These would be the earliest possible times for a change.
+# Regimes horaires pour le monde entier, by Henri Le Corre, (Editions
+# Traditionnelles, 1987, Paris) says that Java and Madura switched
+# from JST to UTC+07:30 on 1945-09-23, and gives 1944-09-01 for Jayapura
+# (Hollandia).  For now, assume all Indonesian locations other than Jayapura
+# switched on 1945-09-23.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Asia/Jakarta      7:07:12 -       LMT     1867 Aug 10
+# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
+# but this must be a typo.
+                       7:07:12 -       JMT     1923 Dec 31 23:47:12 # Jakarta
+                       7:20    -       JAVT    1932 Nov         # Java Time
+                       7:30    -       WIT     1942 Mar 23
+                       9:00    -       JST     1945 Sep 23
+                       7:30    -       WIT     1948 May
+                       8:00    -       WIT     1950 May
+                       7:30    -       WIT     1964
+                       7:00    -       WIT
+Zone Asia/Pontianak    7:17:20 -       LMT     1908 May
+                       7:17:20 -       PMT     1932 Nov    # Pontianak MT
+                       7:30    -       WIT     1942 Jan 29
+                       9:00    -       JST     1945 Sep 23
+                       7:30    -       WIT     1948 May
+                       8:00    -       WIT     1950 May
+                       7:30    -       WIT     1964
+                       8:00    -       CIT     1988 Jan  1
+                       7:00    -       WIT
+Zone Asia/Makassar     7:57:36 -       LMT     1920
+                       7:57:36 -       MMT     1932 Nov    # Macassar MT
+                       8:00    -       CIT     1942 Feb  9
+                       9:00    -       JST     1945 Sep 23
+                       8:00    -       CIT
+Zone Asia/Jayapura     9:22:48 -       LMT     1932 Nov
+                       9:00    -       EIT     1944 Sep  1
+                       9:30    -       CST     1964
+                       9:00    -       EIT
+
+# Iran
+
+# From Roozbeh Pournader (2003-03-15):
+# This is an English translation of what I just found (originally in Persian).
+# The Gregorian dates in brackets are mine:
+#
+#      Official Newspaper No. 13548-1370/6/25 [1991-09-16]
+#      No. 16760/T233 H                                1370/6/10 [1991-09-01]
+#
+#      The Rule About Change of the Official Time of the Country
+#
+#      The Board of Ministers, in the meeting dated 1370/5/23 [1991-08-14],
+#      based on the suggestion number 2221/D dated 1370/4/22 [1991-07-13]
+#      of the Country's Organization for Official and Employment Affairs,
+#      and referring to the law for equating the working hours of workers
+#      and officers in the whole country dated 1359/4/23 [1980-07-14], and
+#      for synchronizing the official times of the country, agreed that:
+#
+#      The official time of the country will should move forward one hour
+#      at the 24[:00] hours of the first day of Farvardin and should return
+#      to its previous state at the 24[:00] hours of the 30th day of
+#      Shahrivar.
+#
+#      First Deputy to the President - Hassan Habibi
+#
+# From personal experience, that agrees with what has been followed
+# for at least the last 5 years.  Before that, for a few years, the
+# date used was the first Thursday night of Farvardin and the last
+# Thursday night of Shahrivar, but I can't give exact dates....
+# I have also changed the abbreviations to what is considered correct
+# here in Iran, IRST for regular time and IRDT for daylight saving time.
+#
+# From Roozbeh Pournader (2005-04-05):
+# The text of the Iranian law, in effect since 1925, clearly mentions
+# that the true solar year is the measure, and there is no arithmetic
+# leap year calculation involved.  There has never been any serious
+# plan to change that law....
+#
+# From Paul Eggert (2006-03-22):
+# Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter.
+# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates,
+# stopping after 2037 when 32-bit time_t's overflow.
+# That cal-persia used Birashk's approximation, which disagrees with the solar
+# calendar predictions for the year 2025, so I corrected those dates by hand.
+#
+# From Oscar van Vlijmen (2005-03-30), writing about future
+# discrepancies between cal-persia and the Iranian calendar:
+# For 2091 solar-longitude-after yields 2091-03-20 08:40:07.7 UT for
+# the vernal equinox and that gets so close to 12:00 some local
+# Iranian time that the definition of the correct location needs to be
+# known exactly, amongst other factors.  2157 is even closer:
+# 2157-03-20 08:37:15.5 UT.  But the Gregorian year 2025 should give
+# no interpretation problem whatsoever.  By the way, another instant
+# in the near future where there will be a discrepancy between
+# arithmetical and astronomical Iranian calendars will be in 2058:
+# vernal equinox on 2058-03-20 09:03:05.9 UT.  The Java version of
+# Reingold's/Dershowitz' calculator gives correctly the Gregorian date
+# 2058-03-21 for 1 Farvardin 1437 (astronomical).
+#
+# From Steffen Thorsen (2006-03-22):
+# Several of my users have reported that Iran will not observe DST anymore:
+# http://www.irna.ir/en/news/view/line-17/0603193812164948.htm
+#
+# From Reuters (2007-09-16), with a heads-up from Jesper Norgaard Welen:
+# ... the Guardian Council ... approved a law on Sunday to re-introduce
+# daylight saving time ...
+# http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
+#
+# From Roozbeh Pournader (2007-11-05):
+# This is quoted from Official Gazette of the Islamic Republic of
+# Iran, Volume 63, Number 18242, dated Tuesday 1386/6/24
+# [2007-10-16]. I am doing the best translation I can:...
+# The official time of the country will be moved forward for one hour
+# on the 24 hours of the first day of the month of Farvardin and will
+# be changed back to its previous state on the 24 hours of the
+# thirtieth day of Shahrivar.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Iran    1978    1980    -       Mar     21      0:00    1:00    D
+Rule   Iran    1978    only    -       Oct     21      0:00    0       S
+Rule   Iran    1979    only    -       Sep     19      0:00    0       S
+Rule   Iran    1980    only    -       Sep     23      0:00    0       S
+Rule   Iran    1991    only    -       May      3      0:00    1:00    D
+Rule   Iran    1992    1995    -       Mar     22      0:00    1:00    D
+Rule   Iran    1991    1995    -       Sep     22      0:00    0       S
+Rule   Iran    1996    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    1996    only    -       Sep     21      0:00    0       S
+Rule   Iran    1997    1999    -       Mar     22      0:00    1:00    D
+Rule   Iran    1997    1999    -       Sep     22      0:00    0       S
+Rule   Iran    2000    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    2000    only    -       Sep     21      0:00    0       S
+Rule   Iran    2001    2003    -       Mar     22      0:00    1:00    D
+Rule   Iran    2001    2003    -       Sep     22      0:00    0       S
+Rule   Iran    2004    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    2004    only    -       Sep     21      0:00    0       S
+Rule   Iran    2005    only    -       Mar     22      0:00    1:00    D
+Rule   Iran    2005    only    -       Sep     22      0:00    0       S
+Rule   Iran    2008    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    2008    only    -       Sep     21      0:00    0       S
+Rule   Iran    2009    2011    -       Mar     22      0:00    1:00    D
+Rule   Iran    2009    2011    -       Sep     22      0:00    0       S
+Rule   Iran    2012    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    2012    only    -       Sep     21      0:00    0       S
+Rule   Iran    2013    2015    -       Mar     22      0:00    1:00    D
+Rule   Iran    2013    2015    -       Sep     22      0:00    0       S
+Rule   Iran    2016    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    2016    only    -       Sep     21      0:00    0       S
+Rule   Iran    2017    2019    -       Mar     22      0:00    1:00    D
+Rule   Iran    2017    2019    -       Sep     22      0:00    0       S
+Rule   Iran    2020    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    2020    only    -       Sep     21      0:00    0       S
+Rule   Iran    2021    2023    -       Mar     22      0:00    1:00    D
+Rule   Iran    2021    2023    -       Sep     22      0:00    0       S
+Rule   Iran    2024    only    -       Mar     21      0:00    1:00    D
+Rule   Iran    2024    only    -       Sep     21      0:00    0       S
+Rule   Iran    2025    2027    -       Mar     22      0:00    1:00    D
+Rule   Iran    2025    2027    -       Sep     22      0:00    0       S
+Rule   Iran    2028    2029    -       Mar     21      0:00    1:00    D
+Rule   Iran    2028    2029    -       Sep     21      0:00    0       S
+Rule   Iran    2030    2031    -       Mar     22      0:00    1:00    D
+Rule   Iran    2030    2031    -       Sep     22      0:00    0       S
+Rule   Iran    2032    2033    -       Mar     21      0:00    1:00    D
+Rule   Iran    2032    2033    -       Sep     21      0:00    0       S
+Rule   Iran    2034    2035    -       Mar     22      0:00    1:00    D
+Rule   Iran    2034    2035    -       Sep     22      0:00    0       S
+Rule   Iran    2036    2037    -       Mar     21      0:00    1:00    D
+Rule   Iran    2036    2037    -       Sep     21      0:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Tehran     3:25:44 -       LMT     1916
+                       3:25:44 -       TMT     1946    # Tehran Mean Time
+                       3:30    -       IRST    1977 Nov
+                       4:00    Iran    IR%sT   1979
+                       3:30    Iran    IR%sT
+
+
+# Iraq
+#
+# From Jonathan Lennox (2000-06-12):
+# An article in this week's Economist ("Inside the Saddam-free zone", p. 50 in
+# the U.S. edition) on the Iraqi Kurds contains a paragraph:
+# "The three northern provinces ... switched their clocks this spring and
+# are an hour ahead of Baghdad."
+#
+# But Rives McDow (2000-06-18) quotes a contact in Iraqi-Kurdistan as follows:
+# In the past, some Kurdish nationalists, as a protest to the Iraqi
+# Government, did not adhere to daylight saving time.  They referred
+# to daylight saving as Saddam time.  But, as of today, the time zone
+# in Iraqi-Kurdistan is on standard time with Baghdad, Iraq.
+#
+# So we'll ignore the Economist's claim.
+
+# From Steffen Thorsen (2008-03-10):
+# The cabinet in Iraq abolished DST last week, according to the following
+# news sources (in Arabic):
+# <a href="http://www.aljeeran.net/wesima_articles/news-20080305-98602.html">
+# http://www.aljeeran.net/wesima_articles/news-20080305-98602.html
+# </a>
+# <a href="http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10">
+# http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10
+# </a>
+#
+# We have published a short article in English about the change:
+# <a href="http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html">
+# http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
+# </a>
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Iraq    1982    only    -       May     1       0:00    1:00    D
+Rule   Iraq    1982    1984    -       Oct     1       0:00    0       S
+Rule   Iraq    1983    only    -       Mar     31      0:00    1:00    D
+Rule   Iraq    1984    1985    -       Apr     1       0:00    1:00    D
+Rule   Iraq    1985    1990    -       Sep     lastSun 1:00s   0       S
+Rule   Iraq    1986    1990    -       Mar     lastSun 1:00s   1:00    D
+# IATA SSIM (1991/1996) says Apr 1 12:01am UTC; guess the `:01' is a typo.
+# Shanks & Pottenger say Iraq did not observe DST 1992/1997; ignore this.
+#
+Rule   Iraq    1991    2007    -       Apr      1      3:00s   1:00    D
+Rule   Iraq    1991    2007    -       Oct      1      3:00s   0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Baghdad    2:57:40 -       LMT     1890
+                       2:57:36 -       BMT     1918        # Baghdad Mean Time?
+                       3:00    -       AST     1982 May
+                       3:00    Iraq    A%sT
+
+
+###############################################################################
+
+# Israel
+
+# From Ephraim Silverberg (2001-01-11):
+#
+# I coined "IST/IDT" circa 1988.  Until then there were three
+# different abbreviations in use:
+#
+# JST  Jerusalem Standard Time [Danny Braniss, Hebrew University]
+# IZT  Israel Zonal (sic) Time [Prof. Haim Papo, Technion]
+# EEST Eastern Europe Standard Time [used by almost everyone else]
+#
+# Since timezones should be called by country and not capital cities,
+# I ruled out JST.  As Israel is in Asia Minor and not Eastern Europe,
+# EEST was equally unacceptable.  Since "zonal" was not compatible with
+# any other timezone abbreviation, I felt that 'IST' was the way to go
+# and, indeed, it has received almost universal acceptance in timezone
+# settings in Israeli computers.
+#
+# In any case, I am happy to share timezone abbreviations with India,
+# high on my favorite-country list (and not only because my wife's
+# family is from India).
+
+# From Shanks & Pottenger:
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Zion    1940    only    -       Jun      1      0:00    1:00    D
+Rule   Zion    1942    1944    -       Nov      1      0:00    0       S
+Rule   Zion    1943    only    -       Apr      1      2:00    1:00    D
+Rule   Zion    1944    only    -       Apr      1      0:00    1:00    D
+Rule   Zion    1945    only    -       Apr     16      0:00    1:00    D
+Rule   Zion    1945    only    -       Nov      1      2:00    0       S
+Rule   Zion    1946    only    -       Apr     16      2:00    1:00    D
+Rule   Zion    1946    only    -       Nov      1      0:00    0       S
+Rule   Zion    1948    only    -       May     23      0:00    2:00    DD
+Rule   Zion    1948    only    -       Sep      1      0:00    1:00    D
+Rule   Zion    1948    1949    -       Nov      1      2:00    0       S
+Rule   Zion    1949    only    -       May      1      0:00    1:00    D
+Rule   Zion    1950    only    -       Apr     16      0:00    1:00    D
+Rule   Zion    1950    only    -       Sep     15      3:00    0       S
+Rule   Zion    1951    only    -       Apr      1      0:00    1:00    D
+Rule   Zion    1951    only    -       Nov     11      3:00    0       S
+Rule   Zion    1952    only    -       Apr     20      2:00    1:00    D
+Rule   Zion    1952    only    -       Oct     19      3:00    0       S
+Rule   Zion    1953    only    -       Apr     12      2:00    1:00    D
+Rule   Zion    1953    only    -       Sep     13      3:00    0       S
+Rule   Zion    1954    only    -       Jun     13      0:00    1:00    D
+Rule   Zion    1954    only    -       Sep     12      0:00    0       S
+Rule   Zion    1955    only    -       Jun     11      2:00    1:00    D
+Rule   Zion    1955    only    -       Sep     11      0:00    0       S
+Rule   Zion    1956    only    -       Jun      3      0:00    1:00    D
+Rule   Zion    1956    only    -       Sep     30      3:00    0       S
+Rule   Zion    1957    only    -       Apr     29      2:00    1:00    D
+Rule   Zion    1957    only    -       Sep     22      0:00    0       S
+Rule   Zion    1974    only    -       Jul      7      0:00    1:00    D
+Rule   Zion    1974    only    -       Oct     13      0:00    0       S
+Rule   Zion    1975    only    -       Apr     20      0:00    1:00    D
+Rule   Zion    1975    only    -       Aug     31      0:00    0       S
+Rule   Zion    1985    only    -       Apr     14      0:00    1:00    D
+Rule   Zion    1985    only    -       Sep     15      0:00    0       S
+Rule   Zion    1986    only    -       May     18      0:00    1:00    D
+Rule   Zion    1986    only    -       Sep      7      0:00    0       S
+Rule   Zion    1987    only    -       Apr     15      0:00    1:00    D
+Rule   Zion    1987    only    -       Sep     13      0:00    0       S
+Rule   Zion    1988    only    -       Apr      9      0:00    1:00    D
+Rule   Zion    1988    only    -       Sep      3      0:00    0       S
+
+# From Ephraim Silverberg
+# (1997-03-04, 1998-03-16, 1998-12-28, 2000-01-17, 2000-07-25, 2004-12-22,
+# and 2005-02-17):
+
+# According to the Office of the Secretary General of the Ministry of
+# Interior, there is NO set rule for Daylight-Savings/Standard time changes.
+# One thing is entrenched in law, however: that there must be at least 150
+# days of daylight savings time annually.  From 1993-1998, the change to
+# daylight savings time was on a Friday morning from midnight IST to
+# 1 a.m IDT; up until 1998, the change back to standard time was on a
+# Saturday night from midnight daylight savings time to 11 p.m. standard
+# time.  1996 is an exception to this rule where the change back to standard
+# time took place on Sunday night instead of Saturday night to avoid
+# conflicts with the Jewish New Year.  In 1999, the change to
+# daylight savings time was still on a Friday morning but from
+# 2 a.m. IST to 3 a.m. IDT; furthermore, the change back to standard time
+# was also on a Friday morning from 2 a.m. IDT to 1 a.m. IST for
+# 1999 only.  In the year 2000, the change to daylight savings time was
+# similar to 1999, but although the change back will be on a Friday, it
+# will take place from 1 a.m. IDT to midnight IST.  Starting in 2001, all
+# changes to/from will take place at 1 a.m. old time, but now there is no
+# rule as to what day of the week it will take place in as the start date
+# (except in 2003) is the night after the Passover Seder (i.e. the eve
+# of the 16th of Nisan in the lunar Hebrew calendar) and the end date
+# (except in 2002) is three nights before Yom Kippur [Day of Atonement]
+# (the eve of the 7th of Tishrei in the lunar Hebrew calendar).
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Zion    1989    only    -       Apr     30      0:00    1:00    D
+Rule   Zion    1989    only    -       Sep      3      0:00    0       S
+Rule   Zion    1990    only    -       Mar     25      0:00    1:00    D
+Rule   Zion    1990    only    -       Aug     26      0:00    0       S
+Rule   Zion    1991    only    -       Mar     24      0:00    1:00    D
+Rule   Zion    1991    only    -       Sep      1      0:00    0       S
+Rule   Zion    1992    only    -       Mar     29      0:00    1:00    D
+Rule   Zion    1992    only    -       Sep      6      0:00    0       S
+Rule   Zion    1993    only    -       Apr      2      0:00    1:00    D
+Rule   Zion    1993    only    -       Sep      5      0:00    0       S
+
+# The dates for 1994-1995 were obtained from Office of the Spokeswoman for the
+# Ministry of Interior, Jerusalem, Israel.  The spokeswoman can be reached by
+# calling the office directly at 972-2-6701447 or 972-2-6701448.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Zion    1994    only    -       Apr      1      0:00    1:00    D
+Rule   Zion    1994    only    -       Aug     28      0:00    0       S
+Rule   Zion    1995    only    -       Mar     31      0:00    1:00    D
+Rule   Zion    1995    only    -       Sep      3      0:00    0       S
+
+# The dates for 1996 were determined by the Minister of Interior of the
+# time, Haim Ramon.  The official announcement regarding 1996-1998
+# (with the dates for 1997-1998 no longer being relevant) can be viewed at:
+#
+#   ftp://ftp.cs.huji.ac.il/pub/tz/announcements/1996-1998.ramon.ps.gz
+#
+# The dates for 1997-1998 were altered by his successor, Rabbi Eli Suissa.
+#
+# The official announcements for the years 1997-1999 can be viewed at:
+#
+#   ftp://ftp.cs.huji.ac.il/pub/tz/announcements/YYYY.ps.gz
+#
+#       where YYYY is the relevant year.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Zion    1996    only    -       Mar     15      0:00    1:00    D
+Rule   Zion    1996    only    -       Sep     16      0:00    0       S
+Rule   Zion    1997    only    -       Mar     21      0:00    1:00    D
+Rule   Zion    1997    only    -       Sep     14      0:00    0       S
+Rule   Zion    1998    only    -       Mar     20      0:00    1:00    D
+Rule   Zion    1998    only    -       Sep      6      0:00    0       S
+Rule   Zion    1999    only    -       Apr      2      2:00    1:00    D
+Rule   Zion    1999    only    -       Sep      3      2:00    0       S
+
+# The Knesset Interior Committee has changed the dates for 2000 for
+# the third time in just over a year and have set new dates for the
+# years 2001-2004 as well.
+#
+# The official announcement for the start date of 2000 can be viewed at:
+#
+#      ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-start.ps.gz
+#
+# The official announcement for the end date of 2000 and the dates
+# for the years 2001-2004 can be viewed at:
+#
+#      ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-2004.ps.gz
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Zion    2000    only    -       Apr     14      2:00    1:00    D
+Rule   Zion    2000    only    -       Oct      6      1:00    0       S
+Rule   Zion    2001    only    -       Apr      9      1:00    1:00    D
+Rule   Zion    2001    only    -       Sep     24      1:00    0       S
+Rule   Zion    2002    only    -       Mar     29      1:00    1:00    D
+Rule   Zion    2002    only    -       Oct      7      1:00    0       S
+Rule   Zion    2003    only    -       Mar     28      1:00    1:00    D
+Rule   Zion    2003    only    -       Oct      3      1:00    0       S
+Rule   Zion    2004    only    -       Apr      7      1:00    1:00    D
+Rule   Zion    2004    only    -       Sep     22      1:00    0       S
+
+# The proposed law agreed upon by the Knesset Interior Committee on
+# 2005-02-14 is that, for 2005 and beyond, DST starts at 02:00 the
+# last Friday before April 2nd (i.e. the last Friday in March or April
+# 1st itself if it falls on a Friday) and ends at 02:00 on the Saturday
+# night _before_ the fast of Yom Kippur.
+#
+# Those who can read Hebrew can view the announcement at:
+#
+#      ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps
+
+# From Paul Eggert (2005-02-22):
+# I used Ephraim Silverberg's dst-israel.el program
+# <ftp://ftp.cs.huji.ac.il/pub/tz/software/dst-israel.el> (2005-02-20)
+# along with Ed Reingold's cal-hebrew in GNU Emacs 21.4,
+# to generate the transitions in this list.
+# (I replaced "lastFri" with "Fri>=26" by hand.)
+# The spring transitions below all correspond to the following Rule:
+#
+# Rule Zion    2005    max     -       Mar     Fri>=26 2:00    1:00    D
+#
+# but older zic implementations (e.g., Solaris 8) do not support
+# "Fri>=26" to mean April 1 in years like 2005, so for now we list the
+# springtime transitions explicitly.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Zion    2005    only    -       Apr      1      2:00    1:00    D
+Rule   Zion    2005    only    -       Oct      9      2:00    0       S
+Rule   Zion    2006    2010    -       Mar     Fri>=26 2:00    1:00    D
+Rule   Zion    2006    only    -       Oct      1      2:00    0       S
+Rule   Zion    2007    only    -       Sep     16      2:00    0       S
+Rule   Zion    2008    only    -       Oct      5      2:00    0       S
+Rule   Zion    2009    only    -       Sep     27      2:00    0       S
+Rule   Zion    2010    only    -       Sep     12      2:00    0       S
+Rule   Zion    2011    only    -       Apr      1      2:00    1:00    D
+Rule   Zion    2011    only    -       Oct      2      2:00    0       S
+Rule   Zion    2012    2015    -       Mar     Fri>=26 2:00    1:00    D
+Rule   Zion    2012    only    -       Sep     23      2:00    0       S
+Rule   Zion    2013    only    -       Sep      8      2:00    0       S
+Rule   Zion    2014    only    -       Sep     28      2:00    0       S
+Rule   Zion    2015    only    -       Sep     20      2:00    0       S
+Rule   Zion    2016    only    -       Apr      1      2:00    1:00    D
+Rule   Zion    2016    only    -       Oct      9      2:00    0       S
+Rule   Zion    2017    2021    -       Mar     Fri>=26 2:00    1:00    D
+Rule   Zion    2017    only    -       Sep     24      2:00    0       S
+Rule   Zion    2018    only    -       Sep     16      2:00    0       S
+Rule   Zion    2019    only    -       Oct      6      2:00    0       S
+Rule   Zion    2020    only    -       Sep     27      2:00    0       S
+Rule   Zion    2021    only    -       Sep     12      2:00    0       S
+Rule   Zion    2022    only    -       Apr      1      2:00    1:00    D
+Rule   Zion    2022    only    -       Oct      2      2:00    0       S
+Rule   Zion    2023    2032    -       Mar     Fri>=26 2:00    1:00    D
+Rule   Zion    2023    only    -       Sep     24      2:00    0       S
+Rule   Zion    2024    only    -       Oct      6      2:00    0       S
+Rule   Zion    2025    only    -       Sep     28      2:00    0       S
+Rule   Zion    2026    only    -       Sep     20      2:00    0       S
+Rule   Zion    2027    only    -       Oct     10      2:00    0       S
+Rule   Zion    2028    only    -       Sep     24      2:00    0       S
+Rule   Zion    2029    only    -       Sep     16      2:00    0       S
+Rule   Zion    2030    only    -       Oct      6      2:00    0       S
+Rule   Zion    2031    only    -       Sep     21      2:00    0       S
+Rule   Zion    2032    only    -       Sep     12      2:00    0       S
+Rule   Zion    2033    only    -       Apr      1      2:00    1:00    D
+Rule   Zion    2033    only    -       Oct      2      2:00    0       S
+Rule   Zion    2034    2037    -       Mar     Fri>=26 2:00    1:00    D
+Rule   Zion    2034    only    -       Sep     17      2:00    0       S
+Rule   Zion    2035    only    -       Oct      7      2:00    0       S
+Rule   Zion    2036    only    -       Sep     28      2:00    0       S
+Rule   Zion    2037    only    -       Sep     13      2:00    0       S
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Jerusalem  2:20:56 -       LMT     1880
+                       2:20:40 -       JMT     1918    # Jerusalem Mean Time?
+                       2:00    Zion    I%sT
+
+
+
+###############################################################################
+
+# Japan
+
+# `9:00' and `JST' is from Guy Harris.
+
+# From Paul Eggert (1995-03-06):
+# Today's _Asahi Evening News_ (page 4) reports that Japan had
+# daylight saving between 1948 and 1951, but ``the system was discontinued
+# because the public believed it would lead to longer working hours.''
+
+# From Mayumi Negishi in the 2005-08-10 Japan Times
+# <http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm>:
+# Occupation authorities imposed daylight-saving time on Japan on
+# [1948-05-01]....  But lack of prior debate and the execution of
+# daylight-saving time just three days after the bill was passed generated
+# deep hatred of the concept....  The Diet unceremoniously passed a bill to
+# dump the unpopular system in October 1951, less than a month after the San
+# Francisco Peace Treaty was signed.  (A government poll in 1951 showed 53%
+# of the Japanese wanted to scrap daylight-saving time, as opposed to 30% who
+# wanted to keep it.)
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that DST in Japan during those years was as follows:
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Japan   1948    only    -       May     Sun>=1  2:00    1:00    D
+Rule   Japan   1948    1951    -       Sep     Sat>=8  2:00    0       S
+Rule   Japan   1949    only    -       Apr     Sun>=1  2:00    1:00    D
+Rule   Japan   1950    1951    -       May     Sun>=1  2:00    1:00    D
+# but the only locations using it (for birth certificates, presumably, since
+# their audience is astrologers) were US military bases.  For now, assume
+# that for most purposes daylight-saving time was observed; otherwise, what
+# would have been the point of the 1951 poll?
+
+# From Hideyuki Suzuki (1998-11-09):
+# 'Tokyo' usually stands for the former location of Tokyo Astronomical
+# Observatory: E 139 44' 40".90 (9h 18m 58s.727), N 35 39' 16".0.
+# This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996'
+# edited by National Astronomical Observatory of Japan....
+# JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST).
+# The law is enacted on 1886-07-07.
+
+# From Hideyuki Suzuki (1998-11-16):
+# The ordinance No. 51 (1886) established "standard time" in Japan,
+# which stands for the time on E 135 degree.
+# In the ordinance No. 167 (1895), "standard time" was renamed to "central
+# standard time".  And the same ordinance also established "western standard
+# time", which stands for the time on E 120 degree....  But "western standard
+# time" was abolished in the ordinance No. 529 (1937).  In the ordinance No.
+# 167, there is no mention regarding for what place western standard time is
+# standard....
+#
+# I wrote "ordinance" above, but I don't know how to translate.
+# In Japanese it's "chokurei", which means ordinance from emperor.
+
+# Shanks & Pottenger claim JST in use since 1896, and that a few
+# places (e.g. Ishigaki) use +0800; go with Suzuki.  Guess that all
+# ordinances took effect on Jan 1.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Tokyo      9:18:59 -       LMT     1887 Dec 31 15:00u
+                       9:00    -       JST     1896
+                       9:00    -       CJT     1938
+                       9:00    Japan   J%sT
+# Since 1938, all Japanese possessions have been like Asia/Tokyo.
+
+# Jordan
+#
+# From <a href="http://star.arabia.com/990701/JO9.html">
+# Jordan Week (1999-07-01) </a> via Steffen Thorsen (1999-09-09):
+# Clocks in Jordan were forwarded one hour on Wednesday at midnight,
+# in accordance with the government's decision to implement summer time
+# all year round.
+#
+# From <a href="http://star.arabia.com/990930/JO9.html">
+# Jordan Week (1999-09-30) </a> via Steffen Thorsen (1999-11-09):
+# Winter time starts today Thursday, 30 September. Clocks will be turned back
+# by one hour.  This is the latest government decision and it's final!
+# The decision was taken because of the increase in working hours in
+# government's departments from six to seven hours.
+#
+# From Paul Eggert (2005-11-22):
+# Starting 2003 transitions are from Steffen Thorsen's web site timeanddate.com.
+#
+# From Steffen Thorsen (2005-11-23):
+# For Jordan I have received multiple independent user reports every year
+# about DST end dates, as the end-rule is different every year.
+#
+# From Steffen Thorsen (2006-10-01), after a heads-up from Hilal Malawi:
+# http://www.petranews.gov.jo/nepras/2006/Sep/05/4000.htm
+# "Jordan will switch to winter time on Friday, October 27".
+#
+
+# From Phil Pizzey (2009-04-02):
+# ...I think I may have spotted an error in the timezone data for
+# Jordan.
+# The current (2009d) asia file shows Jordan going to daylight
+# saving
+# time on the last Thursday in March.
+#
+# Rule  Jordan      2000  max  -  Mar   lastThu     0:00s 1:00  S
+#
+# However timeanddate.com, which I usually find reliable, shows Jordan
+# going to daylight saving time on the last Friday in March since 2002.
+# Please see
+# <a href="http://www.timeanddate.com/worldclock/timezone.html?n=11">
+# http://www.timeanddate.com/worldclock/timezone.html?n=11
+# </a>
+
+# From Steffen Thorsen (2009-04-02):
+# This single one might be good enough, (2009-03-24, Arabic):
+# <a href="http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279">
+# http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279
+# </a>
+#
+# Google's translation:
+#
+# > The Council of Ministers decided in 2002 to adopt the principle of timely
+# > submission of the summer at 60 minutes as of midnight on the last Thursday
+# > of the month of March of each year.
+#
+# So - this means the midnight between Thursday and Friday since 2002.
+
+# From Arthur David Olson (2009-04-06):
+# We still have Jordan switching to DST on Thursdays in 2000 and 2001.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Jordan  1973    only    -       Jun     6       0:00    1:00    S
+Rule   Jordan  1973    1975    -       Oct     1       0:00    0       -
+Rule   Jordan  1974    1977    -       May     1       0:00    1:00    S
+Rule   Jordan  1976    only    -       Nov     1       0:00    0       -
+Rule   Jordan  1977    only    -       Oct     1       0:00    0       -
+Rule   Jordan  1978    only    -       Apr     30      0:00    1:00    S
+Rule   Jordan  1978    only    -       Sep     30      0:00    0       -
+Rule   Jordan  1985    only    -       Apr     1       0:00    1:00    S
+Rule   Jordan  1985    only    -       Oct     1       0:00    0       -
+Rule   Jordan  1986    1988    -       Apr     Fri>=1  0:00    1:00    S
+Rule   Jordan  1986    1990    -       Oct     Fri>=1  0:00    0       -
+Rule   Jordan  1989    only    -       May     8       0:00    1:00    S
+Rule   Jordan  1990    only    -       Apr     27      0:00    1:00    S
+Rule   Jordan  1991    only    -       Apr     17      0:00    1:00    S
+Rule   Jordan  1991    only    -       Sep     27      0:00    0       -
+Rule   Jordan  1992    only    -       Apr     10      0:00    1:00    S
+Rule   Jordan  1992    1993    -       Oct     Fri>=1  0:00    0       -
+Rule   Jordan  1993    1998    -       Apr     Fri>=1  0:00    1:00    S
+Rule   Jordan  1994    only    -       Sep     Fri>=15 0:00    0       -
+Rule   Jordan  1995    1998    -       Sep     Fri>=15 0:00s   0       -
+Rule   Jordan  1999    only    -       Jul      1      0:00s   1:00    S
+Rule   Jordan  1999    2002    -       Sep     lastFri 0:00s   0       -
+Rule   Jordan  2000    2001    -       Mar     lastThu 0:00s   1:00    S
+Rule   Jordan  2002    max     -       Mar     lastFri 0:00s   1:00    S
+Rule   Jordan  2003    only    -       Oct     24      0:00s   0       -
+Rule   Jordan  2004    only    -       Oct     15      0:00s   0       -
+Rule   Jordan  2005    only    -       Sep     lastFri 0:00s   0       -
+Rule   Jordan  2006    max     -       Oct     lastFri 0:00s   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Amman      2:23:44 -       LMT     1931
+                       2:00    Jordan  EE%sT
+
+
+# Kazakhstan
+
+# From Paul Eggert (1996-11-22):
+# Andrew Evtichov (1996-04-13) writes that Kazakhstan
+# stayed in sync with Moscow after 1990, and that Aqtobe (formerly Aktyubinsk)
+# and Aqtau (formerly Shevchenko) are the largest cities in their zones.
+# Guess that Aqtau and Aqtobe diverged in 1995, since that's the first time
+# IATA SSIM mentions a third time zone in Kazakhstan.
+
+# From Paul Eggert (2006-03-22):
+# German Iofis, ELSI, Almaty (2001-10-09) reports that Kazakhstan uses
+# RussiaAsia rules, instead of switching at 00:00 as the IATA has it.
+# Go with Shanks & Pottenger, who have them always using RussiaAsia rules.
+# Also go with the following claims of Shanks & Pottenger:
+#
+# - Kazakhstan did not observe DST in 1991.
+# - Qyzylorda switched from +5:00 to +6:00 on 1992-01-19 02:00.
+# - Oral switched from +5:00 to +4:00 in spring 1989.
+
+# <a href="http://www.kazsociety.org.uk/news/2005/03/30.htm">
+# From Kazakhstan Embassy's News Bulletin #11 (2005-03-21):
+# </a>
+# The Government of Kazakhstan passed a resolution March 15 abolishing
+# daylight saving time citing lack of economic benefits and health
+# complications coupled with a decrease in productivity.
+#
+# From Branislav Kojic (in Astana) via Gwillim Law (2005-06-28):
+# ... what happened was that the former Kazakhstan Eastern time zone
+# was "blended" with the Central zone.  Therefore, Kazakhstan now has
+# two time zones, and difference between them is one hour.  The zone
+# closer to UTC is the former Western zone (probably still called the
+# same), encompassing four provinces in the west: Aqtobe, Atyrau,
+# Mangghystau, and West Kazakhstan.  The other zone encompasses
+# everything else....  I guess that would make Kazakhstan time zones
+# de jure UTC+5 and UTC+6 respectively.
+
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+#
+# Almaty (formerly Alma-Ata), representing most locations in Kazakhstan
+Zone   Asia/Almaty     5:07:48 -       LMT     1924 May  2 # or Alma-Ata
+                       5:00    -       ALMT    1930 Jun 21 # Alma-Ata Time
+                       6:00 RussiaAsia ALM%sT  1991
+                       6:00    -       ALMT    1992
+                       6:00 RussiaAsia ALM%sT  2005 Mar 15
+                       6:00    -       ALMT
+# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.)
+Zone   Asia/Qyzylorda  4:21:52 -       LMT     1924 May  2
+                       4:00    -       KIZT    1930 Jun 21 # Kizilorda Time
+                       5:00    -       KIZT    1981 Apr  1
+                       5:00    1:00    KIZST   1981 Oct  1
+                       6:00    -       KIZT    1982 Apr  1
+                       5:00 RussiaAsia KIZ%sT  1991
+                       5:00    -       KIZT    1991 Dec 16 # independence
+                       5:00    -       QYZT    1992 Jan 19 2:00
+                       6:00 RussiaAsia QYZ%sT  2005 Mar 15
+                       6:00    -       QYZT
+# Aqtobe (aka Aktobe, formerly Akt'ubinsk)
+Zone   Asia/Aqtobe     3:48:40 -       LMT     1924 May  2
+                       4:00    -       AKTT    1930 Jun 21 # Aktyubinsk Time
+                       5:00    -       AKTT    1981 Apr  1
+                       5:00    1:00    AKTST   1981 Oct  1
+                       6:00    -       AKTT    1982 Apr  1
+                       5:00 RussiaAsia AKT%sT  1991
+                       5:00    -       AKTT    1991 Dec 16 # independence
+                       5:00 RussiaAsia AQT%sT  2005 Mar 15 # Aqtobe Time
+                       5:00    -       AQTT
+# Mangghystau
+# Aqtau was not founded until 1963, but it represents an inhabited region,
+# so include time stamps before 1963.
+Zone   Asia/Aqtau      3:21:04 -       LMT     1924 May  2
+                       4:00    -       FORT    1930 Jun 21 # Fort Shevchenko T
+                       5:00    -       FORT    1963
+                       5:00    -       SHET    1981 Oct  1 # Shevchenko Time
+                       6:00    -       SHET    1982 Apr  1
+                       5:00 RussiaAsia SHE%sT  1991
+                       5:00    -       SHET    1991 Dec 16 # independence
+                       5:00 RussiaAsia AQT%sT  1995 Mar lastSun 2:00 # Aqtau Time
+                       4:00 RussiaAsia AQT%sT  2005 Mar 15
+                       5:00    -       AQTT
+# West Kazakhstan
+Zone   Asia/Oral       3:25:24 -       LMT     1924 May  2 # or Ural'sk
+                       4:00    -       URAT    1930 Jun 21 # Ural'sk time
+                       5:00    -       URAT    1981 Apr  1
+                       5:00    1:00    URAST   1981 Oct  1
+                       6:00    -       URAT    1982 Apr  1
+                       5:00 RussiaAsia URA%sT  1989 Mar 26 2:00
+                       4:00 RussiaAsia URA%sT  1991
+                       4:00    -       URAT    1991 Dec 16 # independence
+                       4:00 RussiaAsia ORA%sT  2005 Mar 15 # Oral Time
+                       5:00    -       ORAT
+
+# Kyrgyzstan (Kirgizstan)
+# Transitions through 1991 are from Shanks & Pottenger.
+
+# From Paul Eggert (2005-08-15):
+# According to an article dated today in the Kyrgyzstan Development Gateway
+# <http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml>
+# Kyrgyzstan is canceling the daylight saving time system.  I take the article
+# to mean that they will leave their clocks at 6 hours ahead of UTC.
+# From Malik Abdugaliev (2005-09-21):
+# Our government cancels daylight saving time 6th of August 2005.
+# From 2005-08-12 our GMT-offset is +6, w/o any daylight saving.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Kyrgyz  1992    1996    -       Apr     Sun>=7  0:00s   1:00    S
+Rule   Kyrgyz  1992    1996    -       Sep     lastSun 0:00    0       -
+Rule   Kyrgyz  1997    2005    -       Mar     lastSun 2:30    1:00    S
+Rule   Kyrgyz  1997    2004    -       Oct     lastSun 2:30    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Bishkek    4:58:24 -       LMT     1924 May  2
+                       5:00    -       FRUT    1930 Jun 21 # Frunze Time
+                       6:00 RussiaAsia FRU%sT  1991 Mar 31 2:00s
+                       5:00    1:00    FRUST   1991 Aug 31 2:00 # independence
+                       5:00    Kyrgyz  KG%sT   2005 Aug 12    # Kyrgyzstan Time
+                       6:00    -       KGT
+
+###############################################################################
+
+# Korea (North and South)
+
+# From Annie I. Bang (2006-07-10) in
+# <http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp>:
+# The Ministry of Commerce, Industry and Energy has already
+# commissioned a research project [to reintroduce DST] and has said
+# the system may begin as early as 2008....  Korea ran a daylight
+# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
+
+# From Shanks & Pottenger:
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   ROK     1960    only    -       May     15      0:00    1:00    D
+Rule   ROK     1960    only    -       Sep     13      0:00    0       S
+Rule   ROK     1987    1988    -       May     Sun>=8  0:00    1:00    D
+Rule   ROK     1987    1988    -       Oct     Sun>=8  0:00    0       S
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Seoul      8:27:52 -       LMT     1890
+                       8:30    -       KST     1904 Dec
+                       9:00    -       KST     1928
+                       8:30    -       KST     1932
+                       9:00    -       KST     1954 Mar 21
+                       8:00    ROK     K%sT    1961 Aug 10
+                       8:30    -       KST     1968 Oct
+                       9:00    ROK     K%sT
+Zone   Asia/Pyongyang  8:23:00 -       LMT     1890
+                       8:30    -       KST     1904 Dec
+                       9:00    -       KST     1928
+                       8:30    -       KST     1932
+                       9:00    -       KST     1954 Mar 21
+                       8:00    -       KST     1961 Aug 10
+                       9:00    -       KST
+
+###############################################################################
+
+# Kuwait
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# From the Arab Times (2007-03-14):
+# The Civil Service Commission (CSC) has approved a proposal forwarded
+# by MP Ahmad Baqer on implementing the daylight saving time (DST) in
+# Kuwait starting from April until the end of Sept this year, reports Al-Anba.
+# <http://www.arabtimesonline.com/arabtimes/kuwait/Viewdet.asp?ID=9950>.
+# From Paul Eggert (2007-03-29):
+# We don't know the details, or whether the approval means it'll happen,
+# so for now we assume no DST.
+Zone   Asia/Kuwait     3:11:56 -       LMT     1950
+                       3:00    -       AST
+
+# Laos
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Vientiane  6:50:24 -       LMT     1906 Jun  9 # or Viangchan
+                       7:06:20 -       SMT     1911 Mar 11 0:01 # Saigon MT?
+                       7:00    -       ICT     1912 May
+                       8:00    -       ICT     1931 May
+                       7:00    -       ICT
+
+# Lebanon
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Lebanon 1920    only    -       Mar     28      0:00    1:00    S
+Rule   Lebanon 1920    only    -       Oct     25      0:00    0       -
+Rule   Lebanon 1921    only    -       Apr     3       0:00    1:00    S
+Rule   Lebanon 1921    only    -       Oct     3       0:00    0       -
+Rule   Lebanon 1922    only    -       Mar     26      0:00    1:00    S
+Rule   Lebanon 1922    only    -       Oct     8       0:00    0       -
+Rule   Lebanon 1923    only    -       Apr     22      0:00    1:00    S
+Rule   Lebanon 1923    only    -       Sep     16      0:00    0       -
+Rule   Lebanon 1957    1961    -       May     1       0:00    1:00    S
+Rule   Lebanon 1957    1961    -       Oct     1       0:00    0       -
+Rule   Lebanon 1972    only    -       Jun     22      0:00    1:00    S
+Rule   Lebanon 1972    1977    -       Oct     1       0:00    0       -
+Rule   Lebanon 1973    1977    -       May     1       0:00    1:00    S
+Rule   Lebanon 1978    only    -       Apr     30      0:00    1:00    S
+Rule   Lebanon 1978    only    -       Sep     30      0:00    0       -
+Rule   Lebanon 1984    1987    -       May     1       0:00    1:00    S
+Rule   Lebanon 1984    1991    -       Oct     16      0:00    0       -
+Rule   Lebanon 1988    only    -       Jun     1       0:00    1:00    S
+Rule   Lebanon 1989    only    -       May     10      0:00    1:00    S
+Rule   Lebanon 1990    1992    -       May     1       0:00    1:00    S
+Rule   Lebanon 1992    only    -       Oct     4       0:00    0       -
+Rule   Lebanon 1993    max     -       Mar     lastSun 0:00    1:00    S
+Rule   Lebanon 1993    1998    -       Sep     lastSun 0:00    0       -
+Rule   Lebanon 1999    max     -       Oct     lastSun 0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Beirut     2:22:00 -       LMT     1880
+                       2:00    Lebanon EE%sT
+
+# Malaysia
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   NBorneo 1935    1941    -       Sep     14      0:00    0:20    TS # one-Third Summer
+Rule   NBorneo 1935    1941    -       Dec     14      0:00    0       -
+#
+# peninsular Malaysia
+# The data here are taken from Mok Ly Yng (2003-10-30)
+# <http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html>.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Asia/Kuala_Lumpur 6:46:46 -       LMT     1901 Jan  1
+                       6:55:25 -       SMT     1905 Jun  1 # Singapore M.T.
+                       7:00    -       MALT    1933 Jan  1 # Malaya Time
+                       7:00    0:20    MALST   1936 Jan  1
+                       7:20    -       MALT    1941 Sep  1
+                       7:30    -       MALT    1942 Feb 16
+                       9:00    -       JST     1945 Sep 12
+                       7:30    -       MALT    1982 Jan  1
+                       8:00    -       MYT     # Malaysia Time
+# Sabah & Sarawak
+# From Paul Eggert (2006-03-22):
+# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982
+# transition dates are from Mok Ly Yng.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Asia/Kuching      7:21:20 -       LMT     1926 Mar
+                       7:30    -       BORT    1933    # Borneo Time
+                       8:00    NBorneo BOR%sT  1942 Feb 16
+                       9:00    -       JST     1945 Sep 12
+                       8:00    -       BORT    1982 Jan  1
+                       8:00    -       MYT
+
+# Maldives
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Indian/Maldives 4:54:00 -       LMT     1880    # Male
+                       4:54:00 -       MMT     1960    # Male Mean Time
+                       5:00    -       MVT             # Maldives Time
+
+# Mongolia
+
+# Shanks & Pottenger say that Mongolia has three time zones, but
+# usno1995 and the CIA map Standard Time Zones of the World (2005-03)
+# both say that it has just one.
+
+# From Oscar van Vlijmen (1999-12-11):
+# <a href="http://www.mongoliatourism.gov.mn/general.htm">
+# General Information Mongolia
+# </a> (1999-09)
+# "Time: Mongolia has two time zones. Three westernmost provinces of
+# Bayan-Ulgii, Uvs, and Hovd are one hour earlier than the capital city, and
+# the rest of the country follows the Ulaanbaatar time, which is UTC/GMT plus
+# eight hours."
+
+# From Rives McDow (1999-12-13):
+# Mongolia discontinued the use of daylight savings time in 1999; 1998
+# being the last year it was implemented.  The dates of implementation I am
+# unsure of, but most probably it was similar to Russia, except for the time
+# of implementation may have been different....
+# Some maps in the past have indicated that there was an additional time
+# zone in the eastern part of Mongolia, including the provinces of Dornod,
+# Suhbaatar, and possibly Khentij.
+
+# From Paul Eggert (1999-12-15):
+# Naming and spelling is tricky in Mongolia.
+# We'll use Hovd (also spelled Chovd and Khovd) to represent the west zone;
+# the capital of the Hovd province is sometimes called Hovd, sometimes Dund-Us,
+# and sometimes Jirgalanta (with variant spellings), but the name Hovd
+# is good enough for our purposes.
+
+# From Rives McDow (2001-05-13):
+# In addition to Mongolia starting daylight savings as reported earlier
+# (adopted DST on 2001-04-27 02:00 local time, ending 2001-09-28),
+# there are three time zones.
+#
+# Provinces [at 7:00]: Bayan-ulgii, Uvs, Khovd, Zavkhan, Govi-Altai
+# Provinces [at 8:00]: Khovsgol, Bulgan, Arkhangai, Khentii, Tov,
+#      Bayankhongor, Ovorkhangai, Dundgovi, Dornogovi, Omnogovi
+# Provinces [at 9:00]: Dornod, Sukhbaatar
+#
+# [The province of Selenge is omitted from the above lists.]
+
+# From Ganbold Ts., Ulaanbaatar (2004-04-17):
+# Daylight saving occurs at 02:00 local time last Saturday of March.
+# It will change back to normal at 02:00 local time last Saturday of
+# September.... As I remember this rule was changed in 2001.
+#
+# From Paul Eggert (2004-04-17):
+# For now, assume Rives McDow's informant got confused about Friday vs
+# Saturday, and that his 2001 dates should have 1 added to them.
+
+# From Paul Eggert (2005-07-26):
+# We have wildly conflicting information about Mongolia's time zones.
+# Bill Bonnet (2005-05-19) reports that the US Embassy in Ulaanbaatar says
+# there is only one time zone and that DST is observed, citing Microsoft
+# Windows XP as the source.  Risto Nykanen (2005-05-16) reports that
+# travelmongolia.org says there are two time zones (UTC+7, UTC+8) with no DST.
+# Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in
+# Washington, DC says there are two time zones, with DST observed.
+# He also found
+# <http://ubpost.mongolnews.mn/index.php?subaction=showcomments&id=1111634894&archive=&start_from=&ucat=1&>
+# which also says that there is DST, and which has a comment by "Toddius"
+# (2005-03-31 06:05 +0700) saying "Mongolia actually has 3.5 time zones.
+# The West (OLGII) is +7 GMT, most of the country is ULAT is +8 GMT
+# and some Eastern provinces are +9 GMT but Sukhbaatar Aimag is SUHK +8.5 GMT.
+# The SUKH timezone is new this year, it is one of the few things the
+# parliament passed during the tumultuous winter session."
+# For now, let's ignore this information, until we have more confirmation.
+
+# From Ganbold Ts. (2007-02-26):
+# Parliament of Mongolia has just changed the daylight-saving rule in February.
+# They decided not to adopt daylight-saving time....
+# http://www.mongolnews.mn/index.php?module=unuudur&sec=view&id=15742
+
+# From Deborah Goldsmith (2008-03-30):
+# We received a bug report claiming that the tz database UTC offset for
+# Asia/Choibalsan (GMT+09:00) is incorrect, and that it should be GMT
+# +08:00 instead. Different sources appear to disagree with the tz
+# database on this, e.g.:
+#
+# <a href="http://www.timeanddate.com/worldclock/city.html?n=1026">
+# http://www.timeanddate.com/worldclock/city.html?n=1026
+# </a>
+# <a href="http://www.worldtimeserver.com/current_time_in_MN.aspx">
+# http://www.worldtimeserver.com/current_time_in_MN.aspx
+# </a>
+#
+# both say GMT+08:00.
+
+# From Steffen Thorsen (2008-03-31):
+# eznis airways, which operates several domestic flights, has a flight
+# schedule here:
+# <a href="http://www.eznis.com/Container.jsp?id=112">
+# http://www.eznis.com/Container.jsp?id=112
+# </a>
+# (click the English flag for English)
+#
+# There it appears that flights between Choibalsan and Ulaanbatar arrive
+# about 1:35 - 1:50 hours later in local clock time, no matter the
+# direction, while Ulaanbaatar-Khvod takes 2 hours in the Eastern
+# direction and 3:35 back, which indicates that Ulaanbatar and Khvod are
+# in different time zones (like we know about), while Choibalsan and
+# Ulaanbatar are in the same time zone (correction needed).
+
+# From Arthur David Olson (2008-05-19):
+# Assume that Choibalsan is indeed offset by 8:00.
+# XXX--in the absence of better information, assume that transition
+# was at the start of 2008-03-31 (the day of Steffen Thorsen's report);
+# this is almost surely wrong.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Mongol  1983    1984    -       Apr     1       0:00    1:00    S
+Rule   Mongol  1983    only    -       Oct     1       0:00    0       -
+# Shanks & Pottenger and IATA SSIM say 1990s switches occurred at 00:00,
+# but McDow says the 2001 switches occurred at 02:00.  Also, IATA SSIM
+# (1996-09) says 1996-10-25.  Go with Shanks & Pottenger through 1998.
+#
+# Shanks & Pottenger say that the Sept. 1984 through Sept. 1990 switches
+# in Choibalsan (more precisely, in Dornod and Sukhbaatar) took place
+# at 02:00 standard time, not at 00:00 local time as in the rest of
+# the country.  That would be odd, and possibly is a result of their
+# correction of 02:00 (in the previous edition) not being done correctly
+# in the latest edition; so ignore it for now.
+
+Rule   Mongol  1985    1998    -       Mar     lastSun 0:00    1:00    S
+Rule   Mongol  1984    1998    -       Sep     lastSun 0:00    0       -
+# IATA SSIM (1999-09) says Mongolia no longer observes DST.
+Rule   Mongol  2001    only    -       Apr     lastSat 2:00    1:00    S
+Rule   Mongol  2001    2006    -       Sep     lastSat 2:00    0       -
+Rule   Mongol  2002    2006    -       Mar     lastSat 2:00    1:00    S
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
+Zone   Asia/Hovd       6:06:36 -       LMT     1905 Aug
+                       6:00    -       HOVT    1978    # Hovd Time
+                       7:00    Mongol  HOV%sT
+# Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga
+Zone   Asia/Ulaanbaatar 7:07:32 -      LMT     1905 Aug
+                       7:00    -       ULAT    1978    # Ulaanbaatar Time
+                       8:00    Mongol  ULA%sT
+# Choibalsan, a.k.a. Bajan Tuemen, Bajan Tumen, Chojbalsan,
+# Choybalsan, Sanbejse, Tchoibalsan
+Zone   Asia/Choibalsan 7:38:00 -       LMT     1905 Aug
+                       7:00    -       ULAT    1978
+                       8:00    -       ULAT    1983 Apr
+                       9:00    Mongol  CHO%sT  2008 Mar 31 # Choibalsan Time
+                       8:00    Mongol  CHO%sT
+
+# Nepal
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Kathmandu  5:41:16 -       LMT     1920
+                       5:30    -       IST     1986
+                       5:45    -       NPT     # Nepal Time
+
+# Oman
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Muscat     3:54:20 -       LMT     1920
+                       4:00    -       GST
+
+# Pakistan
+
+# From Rives McDow (2002-03-13):
+# I have been advised that Pakistan has decided to adopt dst on a
+# TRIAL basis for one year, starting 00:01 local time on April 7, 2002
+# and ending at 00:01 local time October 6, 2002.  This is what I was
+# told, but I believe that the actual time of change may be 00:00; the
+# 00:01 was to make it clear which day it was on.
+
+# From Paul Eggert (2002-03-15):
+# Jesper Norgaard found this URL:
+# http://www.pak.gov.pk/public/news/app/app06_dec.htm
+# (dated 2001-12-06) which says that the Cabinet adopted a scheme "to
+# advance the clocks by one hour on the night between the first
+# Saturday and Sunday of April and revert to the original position on
+# 15th October each year".  This agrees with McDow's 04-07 at 00:00,
+# but disagrees about the October transition, and makes it sound like
+# it's not on a trial basis.  Also, the "between the first Saturday
+# and Sunday of April" phrase, if taken literally, means that the
+# transition takes place at 00:00 on the first Sunday on or after 04-02.
+
+# From Paul Eggert (2003-02-09):
+# DAWN <http://www.dawn.com/2002/10/06/top13.htm> reported on 2002-10-05
+# that 2002 DST ended that day at midnight.  Go with McDow for now.
+
+# From Steffen Thorsen (2003-03-14):
+# According to http://www.dawn.com/2003/03/07/top15.htm
+# there will be no DST in Pakistan this year:
+#
+# ISLAMABAD, March 6: Information and Media Development Minister Sheikh
+# Rashid Ahmed on Thursday said the cabinet had reversed a previous
+# decision to advance clocks by one hour in summer and put them back by
+# one hour in winter with the aim of saving light hours and energy.
+#
+# The minister told a news conference that the experiment had rather
+# shown 8 per cent higher consumption of electricity.
+
+# From Alex Krivenyshev (2008-05-15):
+# 
+# Here is an article that Pakistan plan to introduce Daylight Saving Time 
+# on June 1, 2008 for 3 months.
+# 
+# "... The federal cabinet on Wednesday announced a new conservation plan to help 
+# reduce load shedding by approving the closure of commercial centres at 9pm and 
+# moving clocks forward by one hour for the next three months. 
+# ...."
+# 
+# <a href="http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html">
+# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
+# </a>
+# OR
+# <a href="http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4">
+# http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
+# </a>
+
+# From Arthur David Olson (2008-05-19):
+# XXX--midnight transitions is a guess; 2008 only is a guess.
+
+# From Alexander Krivenyshev (2008-08-28):
+# Pakistan government has decided to keep the watches one-hour advanced
+# for another 2 months--plan to return to Standard Time on October 31
+# instead of August 31.
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan02.html">
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan02.html
+# </a>
+# OR
+# <a href="http://dailymailnews.com/200808/28/news/dmbrn03.html">
+# http://dailymailnews.com/200808/28/news/dmbrn03.html
+# </a>
+
+# From Alexander Krivenyshev (2009-04-08):
+# Based on previous media reports that "... proposed plan to
+# advance clocks by one hour from May 1 will cause disturbance
+# to the working schedules rather than bringing discipline in
+# official working."
+# <a href="http://www.thenews.com.pk/daily_detail.asp?id=171280">
+# http://www.thenews.com.pk/daily_detail.asp?id=171280
+# </a>
+#
+# recent news that instead of May 2009 - Pakistan plan to
+# introduce DST from April 15, 2009
+#
+# FYI: Associated Press Of Pakistan
+# April 08, 2009
+# Cabinet okays proposal to advance clocks by one hour from April 15
+# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1">
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1
+# </a>
+#
+# or
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html">
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html
+# </a>
+#
+# ....
+# The Federal Cabinet on Wednesday approved the proposal to
+# advance clocks in the country by one hour from April 15 to
+# conserve energy"
+
+# From Arthur David Olson (2009-04-10):
+# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule Pakistan  2002    only    -       Apr     Sun>=2  0:01    1:00    S
+Rule Pakistan  2002    only    -       Oct     Sun>=2  0:01    0       -
+Rule Pakistan  2008    only    -       Jun     1       0:00    1:00    S
+Rule Pakistan  2008    only    -       Nov     1       0:00    0       -
+Rule Pakistan  2009    only    -       Apr     15      0:00    1:00    S
+Rule Pakistan  2009    only    -       Nov     1       0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Karachi    4:28:12 -       LMT     1907
+                       5:30    -       IST     1942 Sep
+                       5:30    1:00    IST     1945 Oct 15
+                       5:30    -       IST     1951 Sep 30
+                       5:00    -       KART    1971 Mar 26 # Karachi Time
+                       5:00 Pakistan   PK%sT   # Pakistan Time
+
+# Palestine
+
+# From Amos Shapir (1998-02-15):
+#
+# From 1917 until 1948-05-15, all of Palestine, including the parts now
+# known as the Gaza Strip and the West Bank, was under British rule.
+# Therefore the rules given for Israel for that period, apply there too...
+#
+# The Gaza Strip was under Egyptian rule between 1948-05-15 until 1967-06-05
+# (except a short occupation by Israel from 1956-11 till 1957-03, but no
+# time zone was affected then).  It was never formally annexed to Egypt,
+# though.
+#
+# The rest of Palestine was under Jordanian rule at that time, formally
+# annexed in 1950 as the West Bank (and the word "Trans" was dropped from
+# the country's previous name of "the Hashemite Kingdom of the
+# Trans-Jordan").  So the rules for Jordan for that time apply.  Major
+# towns in that area are Nablus (Shchem), El-Halil (Hebron), Ramallah, and
+# East Jerusalem.
+#
+# Both areas were occupied by Israel in June 1967, but not annexed (except
+# for East Jerusalem).  They were on Israel time since then; there might
+# have been a Military Governor's order about time zones, but I'm not aware
+# of any (such orders may have been issued semi-annually whenever summer
+# time was in effect, but maybe the legal aspect of time was just neglected).
+#
+# The Palestinian Authority was established in 1993, and got hold of most
+# towns in the West Bank and Gaza by 1995.  I know that in order to
+# demonstrate...independence, they have been switching to
+# summer time and back on a different schedule than Israel's, but I don't
+# know when this was started, or what algorithm is used (most likely the
+# Jordanian one).
+#
+# To summarize, the table should probably look something like that:
+#
+# Area \ when | 1918-1947 | 1948-1967 | 1967-1995 | 1996-
+# ------------+-----------+-----------+-----------+-----------
+# Israel      | Zion      | Zion      | Zion      | Zion
+# West bank   | Zion      | Jordan    | Zion      | Jordan
+# Gaza        | Zion      | Egypt     | Zion      | Jordan
+#
+# I guess more info may be available from the PA's web page (if/when they
+# have one).
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that Gaza did not observe DST until 1957, but go
+# with Shapir and assume that it observed DST from 1940 through 1947,
+# and that it used Jordanian rules starting in 1996.
+# We don't yet need a separate entry for the West Bank, since
+# the only differences between it and Gaza that we know about
+# occurred before our cutoff date of 1970.
+# However, as we get more information, we may need to add entries
+# for parts of the West Bank as they transitioned from Israel's rules
+# to Palestine's rules.  If you have more info about this, please
+# send it to tz@elsie.nci.nih.gov for incorporation into future editions.
+
+# From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time,
+# forwarded by Ephraim Silverberg:
+#
+# Despite the fact that Israel changed over to daylight savings time
+# last week, the PLO Authority (PA) has decided not to turn its clocks
+# one-hour forward at this time.  As a sign of independence from Israeli rule,
+# the PA has decided to implement DST in April.
+
+# From Paul Eggert (1999-09-20):
+# Daoud Kuttab writes in
+# <a href="http://www.jpost.com/com/Archive/22.Apr.1999/Opinion/Article-2.html">
+# Holiday havoc
+# </a> (Jerusalem Post, 1999-04-22) that
+# the Palestinian National Authority changed to DST on 1999-04-15.
+# I vaguely recall that they switch back in October (sorry, forgot the source).
+# For now, let's assume that the spring switch was at 24:00,
+# and that they switch at 0:00 on the 3rd Fridays of April and October.
+
+# From Paul Eggert (2005-11-22):
+# Starting 2004 transitions are from Steffen Thorsen's web site timeanddate.com.
+
+# From Steffen Thorsen (2005-11-23):
+# A user from Gaza reported that Gaza made the change early because of
+# the Ramadan.  Next year Ramadan will be even earlier, so I think
+# there is a good chance next year's end date will be around two weeks
+# earlier--the same goes for Jordan.
+
+# From Steffen Thorsen (2006-08-17):
+# I was informed by a user in Bethlehem that in Bethlehem it started the
+# same day as Israel, and after checking with other users in the area, I
+# was informed that they started DST one day after Israel.  I was not
+# able to find any authoritative sources at the time, nor details if
+# Gaza changed as well, but presumed Gaza to follow the same rules as
+# the West Bank.
+
+# From Steffen Thorsen (2006-09-26):
+# according to the Palestine News Network (2006-09-19):
+# http://english.pnn.ps/index.php?option=com_content&task=view&id=596&Itemid=5
+# > The Council of Ministers announced that this year its winter schedule
+# > will begin early, as of midnight Thursday.  It is also time to turn
+# > back the clocks for winter.  Friday will begin an hour late this week.
+# I guess it is likely that next year's date will be moved as well,
+# because of the Ramadan.
+
+# From Jesper Norgaard Welen (2007-09-18):
+# According to Steffen Thorsen's web site the Gaza Strip and the rest of the
+# Palestinian territories left DST early on 13.th. of September at 2:00.
+
+# From Paul Eggert (2007-09-20):
+# My understanding is that Gaza and the West Bank disagree even over when
+# the weekend is (Thursday+Friday versus Friday+Saturday), so I'd be a bit
+# surprised if they agreed about DST.  But for now, assume they agree.
+# For lack of better information, predict that future changes will be
+# the 2nd Thursday of September at 02:00.
+
+# From Alexander Krivenyshev (2008-08-28):
+# Here is an article, that Mideast running on different clocks at Ramadan.
+#
+# Gaza Strip (as Egypt) ended DST at midnight Thursday (Aug 28, 2008), while
+# the West Bank will end Daylight Saving Time at midnight Sunday (Aug 31, 2008).
+#
+# <a href="http://www.guardian.co.uk/world/feedarticle/7759001">
+# http://www.guardian.co.uk/world/feedarticle/7759001
+# </a>
+# <a href="http://www.abcnews.go.com/International/wireStory?id=5676087">
+# http://www.abcnews.go.com/International/wireStory?id=5676087
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html">
+# http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html
+# </a>
+
+# From Alexander Krivenyshev (2009-03-26):
+# According to the Palestine News Network (arabic.pnn.ps), Palestinian
+# government decided to start Daylight Time on Thursday night March
+# 26 and continue until the night of 27 September 2009.
+#
+# (in Arabic)
+# <a href="http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850">
+# http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850
+# </a>
+#
+# or
+# (English translation)
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_westbank01.html">
+# http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
+# </a>
+
+# The rules for Egypt are stolen from the `africa' file.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule EgyptAsia 1957    only    -       May     10      0:00    1:00    S
+Rule EgyptAsia 1957    1958    -       Oct      1      0:00    0       -
+Rule EgyptAsia 1958    only    -       May      1      0:00    1:00    S
+Rule EgyptAsia 1959    1967    -       May      1      1:00    1:00    S
+Rule EgyptAsia 1959    1965    -       Sep     30      3:00    0       -
+Rule EgyptAsia 1966    only    -       Oct      1      3:00    0       -
+
+Rule Palestine 1999    2005    -       Apr     Fri>=15 0:00    1:00    S
+Rule Palestine 1999    2003    -       Oct     Fri>=15 0:00    0       -
+Rule Palestine 2004    only    -       Oct      1      1:00    0       -
+Rule Palestine 2005    only    -       Oct      4      2:00    0       -
+Rule Palestine 2006    2008    -       Apr      1      0:00    1:00    S
+Rule Palestine 2006    only    -       Sep     22      0:00    0       -
+Rule Palestine 2007    only    -       Sep     Thu>=8  2:00    0       -
+Rule Palestine 2008    only    -       Aug     lastFri 2:00    0       -
+Rule Palestine 2009    max     -       Mar     lastFri 0:00    1:00    S
+Rule Palestine 2009    max     -       Sep     lastMon 2:00    0       -
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Gaza       2:17:52 -       LMT     1900 Oct
+                       2:00    Zion    EET     1948 May 15
+                       2:00 EgyptAsia  EE%sT   1967 Jun  5
+                       2:00    Zion    I%sT    1996
+                       2:00    Jordan  EE%sT   1999
+                       2:00 Palestine  EE%sT
+
+# Paracel Is
+# no information
+
+# Philippines
+# On 1844-08-16, Narciso Claveria, governor-general of the
+# Philippines, issued a proclamation announcing that 1844-12-30 was to
+# be immediately followed by 1845-01-01.  Robert H. van Gent has a
+# transcript of the decree in <http://www.phys.uu.nl/~vgent/idl/idl.htm>.
+# The rest of the data are from Shanks & Pottenger.
+
+# From Paul Eggert (2006-04-25):
+# Tomorrow's Manila Standard reports that the Philippines Department of
+# Trade and Industry is considering adopting DST this June when the
+# rainy season begins.  See
+# <http://www.manilastandardtoday.com/?page=politics02_april26_2006>.
+# For now, we'll ignore this, since it's not definite and we lack details.
+#
+# From Jesper Norgaard Welen (2006-04-26):
+# ... claims that Philippines had DST last time in 1990:
+# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/
+# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires,
+# but no details]
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Phil    1936    only    -       Nov     1       0:00    1:00    S
+Rule   Phil    1937    only    -       Feb     1       0:00    0       -
+Rule   Phil    1954    only    -       Apr     12      0:00    1:00    S
+Rule   Phil    1954    only    -       Jul     1       0:00    0       -
+Rule   Phil    1978    only    -       Mar     22      0:00    1:00    S
+Rule   Phil    1978    only    -       Sep     21      0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Manila     -15:56:00 -     LMT     1844 Dec 31
+                       8:04:00 -       LMT     1899 May 11
+                       8:00    Phil    PH%sT   1942 May
+                       9:00    -       JST     1944 Nov
+                       8:00    Phil    PH%sT
+
+# Qatar
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Qatar      3:26:08 -       LMT     1920    # Al Dawhah / Doha
+                       4:00    -       GST     1972 Jun
+                       3:00    -       AST
+
+# Saudi Arabia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Riyadh     3:06:52 -       LMT     1950
+                       3:00    -       AST
+
+# Singapore
+# The data here are taken from Mok Ly Yng (2003-10-30)
+# <http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html>.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Singapore  6:55:25 -       LMT     1901 Jan  1
+                       6:55:25 -       SMT     1905 Jun  1 # Singapore M.T.
+                       7:00    -       MALT    1933 Jan  1 # Malaya Time
+                       7:00    0:20    MALST   1936 Jan  1
+                       7:20    -       MALT    1941 Sep  1
+                       7:30    -       MALT    1942 Feb 16
+                       9:00    -       JST     1945 Sep 12
+                       7:30    -       MALT    1965 Aug  9 # independence
+                       7:30    -       SGT     1982 Jan  1 # Singapore Time
+                       8:00    -       SGT
+
+# Spratly Is
+# no information
+
+# Sri Lanka
+# From Paul Eggert (1996-09-03):
+# "Sri Lanka advances clock by an hour to avoid blackout"
+# (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24,
+# no longer available as of 1999-08-17)
+# reported ``the country's standard time will be put forward by one hour at
+# midnight Friday (1830 GMT) `in the light of the present power crisis'.''
+#
+# From Dharmasiri Senanayake, Sri Lanka Media Minister (1996-10-24), as quoted
+# by Shamindra in
+# <a href="news:54rka5$m5h@mtinsc01-mgt.ops.worldnet.att.net">
+# Daily News - Hot News Section (1996-10-26)
+# </a>:
+# With effect from 12.30 a.m. on 26th October 1996
+# Sri Lanka will be six (06) hours ahead of GMT.
+
+# From Jesper Norgaard Welen (2006-04-14), quoting Sri Lanka News Online
+# <http://news.sinhalaya.com/wmview.php?ArtID=11002> (2006-04-13):
+# 0030 hrs on April 15, 2006 (midnight of April 14, 2006 +30 minutes)
+# at present, become 2400 hours of April 14, 2006 (midnight of April 14, 2006).
+
+# From Peter Apps and Ranga Sirila of Reuters (2006-04-12) in:
+# <http://today.reuters.co.uk/news/newsArticle.aspx?type=scienceNews&storyID=2006-04-12T172228Z_01_COL295762_RTRIDST_0_SCIENCE-SRILANKA-TIME-DC.XML>
+# [The Tamil Tigers] never accepted the original 1996 time change and simply
+# kept their clocks set five and a half hours ahead of Greenwich Mean
+# Time (GMT), in line with neighbor India.
+# From Paul Eggert (2006-04-18):
+# People who live in regions under Tamil control can use [TZ='Asia/Kolkata'],
+# as that zone has agreed with the Tamil areas since our cutoff date of 1970.
+
+# From K Sethu (2006-04-25):
+# I think the abbreviation LKT originated from the world of computers at
+# the time of or subsequent to the time zone changes by SL Government
+# twice in 1996 and probably SL Government or its standardization
+# agencies never declared an abbreviation as a national standard.
+#
+# I recollect before the recent change the government annoucemments
+# mentioning it as simply changing Sri Lanka Standard Time or Sri Lanka
+# Time and no mention was made about the abbreviation.
+#
+# If we look at Sri Lanka Department of Government's "Official News
+# Website of Sri Lanka" ... http://www.news.lk/ we can see that they
+# use SLT as abbreviation in time stamp at the beginning of each news
+# item....
+#
+# Within Sri Lanka I think LKT is well known among computer users and
+# adminsitrators.  In my opinion SLT may not be a good choice because the
+# nation's largest telcom / internet operator Sri Lanka Telcom is well
+# known by that abbreviation - simply as SLT (there IP domains are
+# slt.lk and sltnet.lk).
+#
+# But if indeed our government has adopted SLT as standard abbreviation
+# (that we have not known so far) then  it is better that it be used for
+# all computers.
+
+# From Paul Eggert (2006-04-25):
+# One possibility is that we wait for a bit for the dust to settle down
+# and then see what people actually say in practice.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Colombo    5:19:24 -       LMT     1880
+                       5:19:32 -       MMT     1906    # Moratuwa Mean Time
+                       5:30    -       IST     1942 Jan  5
+                       5:30    0:30    IHST    1942 Sep
+                       5:30    1:00    IST     1945 Oct 16 2:00
+                       5:30    -       IST     1996 May 25 0:00
+                       6:30    -       LKT     1996 Oct 26 0:30
+                       6:00    -       LKT     2006 Apr 15 0:30
+                       5:30    -       IST
+
+# Syria
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Syria   1920    1923    -       Apr     Sun>=15 2:00    1:00    S
+Rule   Syria   1920    1923    -       Oct     Sun>=1  2:00    0       -
+Rule   Syria   1962    only    -       Apr     29      2:00    1:00    S
+Rule   Syria   1962    only    -       Oct     1       2:00    0       -
+Rule   Syria   1963    1965    -       May     1       2:00    1:00    S
+Rule   Syria   1963    only    -       Sep     30      2:00    0       -
+Rule   Syria   1964    only    -       Oct     1       2:00    0       -
+Rule   Syria   1965    only    -       Sep     30      2:00    0       -
+Rule   Syria   1966    only    -       Apr     24      2:00    1:00    S
+Rule   Syria   1966    1976    -       Oct     1       2:00    0       -
+Rule   Syria   1967    1978    -       May     1       2:00    1:00    S
+Rule   Syria   1977    1978    -       Sep     1       2:00    0       -
+Rule   Syria   1983    1984    -       Apr     9       2:00    1:00    S
+Rule   Syria   1983    1984    -       Oct     1       2:00    0       -
+Rule   Syria   1986    only    -       Feb     16      2:00    1:00    S
+Rule   Syria   1986    only    -       Oct     9       2:00    0       -
+Rule   Syria   1987    only    -       Mar     1       2:00    1:00    S
+Rule   Syria   1987    1988    -       Oct     31      2:00    0       -
+Rule   Syria   1988    only    -       Mar     15      2:00    1:00    S
+Rule   Syria   1989    only    -       Mar     31      2:00    1:00    S
+Rule   Syria   1989    only    -       Oct     1       2:00    0       -
+Rule   Syria   1990    only    -       Apr     1       2:00    1:00    S
+Rule   Syria   1990    only    -       Sep     30      2:00    0       -
+Rule   Syria   1991    only    -       Apr      1      0:00    1:00    S
+Rule   Syria   1991    1992    -       Oct      1      0:00    0       -
+Rule   Syria   1992    only    -       Apr      8      0:00    1:00    S
+Rule   Syria   1993    only    -       Mar     26      0:00    1:00    S
+Rule   Syria   1993    only    -       Sep     25      0:00    0       -
+# IATA SSIM (1998-02) says 1998-04-02;
+# (1998-09) says 1999-03-29 and 1999-09-29; (1999-02) says 1999-04-02,
+# 2000-04-02, and 2001-04-02; (1999-09) says 2000-03-31 and 2001-03-31;
+# (2006) says 2006-03-31 and 2006-09-22;
+# for now ignore all these claims and go with Shanks & Pottenger,
+# except for the 2006-09-22 claim (which seems right for Ramadan).
+Rule   Syria   1994    1996    -       Apr      1      0:00    1:00    S
+Rule   Syria   1994    2005    -       Oct      1      0:00    0       -
+Rule   Syria   1997    1998    -       Mar     lastMon 0:00    1:00    S
+Rule   Syria   1999    2006    -       Apr      1      0:00    1:00    S
+# From Stephen Colebourne (2006-09-18):
+# According to IATA data, Syria will change DST on 21st September [21:00 UTC]
+# this year [only]....  This is probably related to Ramadan, like Egypt.
+Rule   Syria   2006    only    -       Sep     22      0:00    0       -
+# From Paul Eggert (2007-03-29):
+# Today the AP reported "Syria will switch to summertime at midnight Thursday."
+# http://www.iht.com/articles/ap/2007/03/29/africa/ME-GEN-Syria-Time-Change.php
+Rule   Syria   2007    only    -       Mar     lastFri 0:00    1:00    S
+# From Jesper Norgard (2007-10-27):
+# The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
+# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sence than
+# having it between Wednesday and Thursday (two workdays in Syria) since the
+# weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
+# it is implemented at midnight of the last workday before weekend...
+# 
+# From Steffen Thorsen (2007-10-27):
+# Jesper Norgaard Welen wrote:
+# 
+# > "Winter local time in Syria will be observed at midnight of Thursday 1
+# > November 2007, and the clock will be put back 1 hour."
+# 
+# I found confirmation on this in this gov.sy-article (Arabic):
+# http://wehda.alwehda.gov.sy/_print_veiw.asp?FileName=12521710520070926111247
+# 
+# which using Google's translate tools says:
+# Council of Ministers also approved the commencement of work on 
+# identifying the winter time as of Friday, 2/11/2007 where the 60th 
+# minute delay at midnight Thursday 1/11/2007.
+Rule   Syria   2007    only    -       Nov      Fri>=1 0:00    0       -
+
+# From Stephen Colebourne (2008-03-17):
+# For everyone's info, I saw an IATA time zone change for [Syria] for
+# this month (March 2008) in the last day or so...This is the data IATA
+# are now using:
+# Country     Time Standard   --- DST Start ---   --- DST End ---  DST
+# Name        Zone Variation   Time    Date        Time    Date
+# Variation
+# Syrian Arab
+# Republic    SY    +0200      2200  03APR08       2100  30SEP08   +0300
+#                              2200  02APR09       2100  30SEP09   +0300
+#                              2200  01APR10       2100  30SEP10   +0300
+
+# From Arthur David Olson (2008-03-17):
+# Here's a link to English-language coverage by the Syrian Arab News
+# Agency (SANA)...
+# <a href="http://www.sana.sy/eng/21/2008/03/11/165173.htm">
+# http://www.sana.sy/eng/21/2008/03/11/165173.htm
+# </a>...which reads (in part) "The Cabinet approved the suggestion of the
+# Ministry of Electricity to begin daylight savings time on Friday April
+# 4th, advancing clocks one hour ahead on midnight of Thursday April 3rd."
+# Since Syria is two hours east of UTC, the 2200 and 2100 transition times
+# shown above match up with midnight in Syria.
+
+# From Arthur David Olson (2008-03-18):
+# My buest guess at a Syrian rule is "the Friday nearest April 1";
+# coding that involves either using a "Mar Fri>=29" construct that old time zone
+# compilers can't handle  or having multiple Rules (a la Israel).
+# For now, use "Apr Fri>=1", and go with IATA on a uniform Sep 30 end.
+
+# From Steffen Thorsen (2008-10-07):
+# Syria has now officially decided to end DST on 2008-11-01 this year,
+# according to the following article in the Syrian Arab News Agency (SANA).
+#
+# The article is in Arabic, and seems to tell that they will go back to
+# winter time on 2008-11-01 at 00:00 local daylight time (delaying/setting
+# clocks back 60 minutes).
+#
+# <a href="http://sana.sy/ara/2/2008/10/07/195459.htm">
+# http://sana.sy/ara/2/2008/10/07/195459.htm
+# </a>
+
+# From Steffen Thorsen (2009-03-19):
+# Syria will start DST on 2009-03-27 00:00 this year according to many sources,
+# two examples:
+#
+# <a href="http://www.sana.sy/eng/21/2009/03/17/217563.htm">
+# http://www.sana.sy/eng/21/2009/03/17/217563.htm
+# </a>
+# (English, Syrian Arab News # Agency)
+# <a href="http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209">
+# http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209
+# </a>
+# (Arabic, gov-site)
+#
+# We have not found any sources saying anything about when DST ends this year.
+#
+# Our summary
+# <a href="http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html">
+# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
+# </a>
+
+Rule   Syria   2008    only    -       Apr     Fri>=1  0:00    1:00    S
+Rule   Syria   2008    max     -       Nov     1       0:00    0       -
+Rule   Syria   2009    max     -       Mar     lastFri 0:00    1:00    S
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Damascus   2:25:12 -       LMT     1920    # Dimashq
+                       2:00    Syria   EE%sT
+
+# Tajikistan
+# From Shanks & Pottenger.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Dushanbe   4:35:12 -       LMT     1924 May  2
+                       5:00    -       DUST    1930 Jun 21 # Dushanbe Time
+                       6:00 RussiaAsia DUS%sT  1991 Mar 31 2:00s
+                       5:00    1:00    DUSST   1991 Sep  9 2:00s
+                       5:00    -       TJT                 # Tajikistan Time
+
+# Thailand
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Bangkok    6:42:04 -       LMT     1880
+                       6:42:04 -       BMT     1920 Apr # Bangkok Mean Time
+                       7:00    -       ICT
+
+# Turkmenistan
+# From Shanks & Pottenger.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Ashgabat   3:53:32 -       LMT     1924 May  2 # or Ashkhabad
+                       4:00    -       ASHT    1930 Jun 21 # Ashkhabad Time
+                       5:00 RussiaAsia ASH%sT  1991 Mar 31 2:00
+                       4:00 RussiaAsia ASH%sT  1991 Oct 27 # independence
+                       4:00 RussiaAsia TM%sT   1992 Jan 19 2:00
+                       5:00    -       TMT
+
+# United Arab Emirates
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Dubai      3:41:12 -       LMT     1920
+                       4:00    -       GST
+
+# Uzbekistan
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Samarkand  4:27:12 -       LMT     1924 May  2
+                       4:00    -       SAMT    1930 Jun 21 # Samarkand Time
+                       5:00    -       SAMT    1981 Apr  1
+                       5:00    1:00    SAMST   1981 Oct  1
+                       6:00    -       TAST    1982 Apr  1 # Tashkent Time
+                       5:00 RussiaAsia SAM%sT  1991 Sep  1 # independence
+                       5:00 RussiaAsia UZ%sT   1992
+                       5:00    -       UZT
+Zone   Asia/Tashkent   4:37:12 -       LMT     1924 May  2
+                       5:00    -       TAST    1930 Jun 21 # Tashkent Time
+                       6:00 RussiaAsia TAS%sT  1991 Mar 31 2:00
+                       5:00 RussiaAsia TAS%sT  1991 Sep  1 # independence
+                       5:00 RussiaAsia UZ%sT   1992
+                       5:00    -       UZT
+
+# Vietnam
+
+# From Arthur David Olson (2008-03-18):
+# The English-language name of Vietnam's most populous city is "Ho Chi Min City";
+# we use Ho_Chi_Minh below to avoid a name of more than 14 characters.
+
+# From Shanks & Pottenger:
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Ho_Chi_Minh        7:06:40 -       LMT     1906 Jun  9
+                       7:06:20 -       SMT     1911 Mar 11 0:01 # Saigon MT?
+                       7:00    -       ICT     1912 May
+                       8:00    -       ICT     1931 May
+                       7:00    -       ICT
+
+# Yemen
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Asia/Aden       3:00:48 -       LMT     1950
+                       3:00    -       AST
diff --git a/extra/zoneinfo/australasia b/extra/zoneinfo/australasia
new file mode 100644 (file)
index 0000000..41608cd
--- /dev/null
@@ -0,0 +1,1454 @@
+# @(#)australasia      8.9
+# <pre>
+
+# This file also includes Pacific islands.
+
+# Notes are at the end of this file
+
+###############################################################################
+
+# Australia
+
+# Please see the notes below for the controversy about "EST" versus "AEST" etc.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Aus     1917    only    -       Jan      1      0:01    1:00    -
+Rule   Aus     1917    only    -       Mar     25      2:00    0       -
+Rule   Aus     1942    only    -       Jan      1      2:00    1:00    -
+Rule   Aus     1942    only    -       Mar     29      2:00    0       -
+Rule   Aus     1942    only    -       Sep     27      2:00    1:00    -
+Rule   Aus     1943    1944    -       Mar     lastSun 2:00    0       -
+Rule   Aus     1943    only    -       Oct      3      2:00    1:00    -
+# Go with Whitman and the Australian National Standards Commission, which
+# says W Australia didn't use DST in 1943/1944.  Ignore Whitman's claim that
+# 1944/1945 was just like 1943/1944.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# Northern Territory
+Zone Australia/Darwin   8:43:20 -      LMT     1895 Feb
+                        9:00   -       CST     1899 May
+                        9:30   Aus     CST
+# Western Australia
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   AW      1974    only    -       Oct     lastSun 2:00s   1:00    -
+Rule   AW      1975    only    -       Mar     Sun>=1  2:00s   0       -
+Rule   AW      1983    only    -       Oct     lastSun 2:00s   1:00    -
+Rule   AW      1984    only    -       Mar     Sun>=1  2:00s   0       -
+Rule   AW      1991    only    -       Nov     17      2:00s   1:00    -
+Rule   AW      1992    only    -       Mar     Sun>=1  2:00s   0       -
+Rule   AW      2006    only    -       Dec      3      2:00s   1:00    -
+Rule   AW      2007    2009    -       Mar     lastSun 2:00s   0       -
+Rule   AW      2007    2008    -       Oct     lastSun 2:00s   1:00    -
+Zone Australia/Perth    7:43:24 -      LMT     1895 Dec
+                        8:00   Aus     WST     1943 Jul
+                        8:00   AW      WST
+Zone Australia/Eucla    8:35:28 -      LMT     1895 Dec
+                        8:45   Aus     CWST    1943 Jul
+                        8:45   AW      CWST
+
+# Queensland
+#
+# From Alex Livingston (1996-11-01):
+# I have heard or read more than once that some resort islands off the coast
+# of Queensland chose to keep observing daylight-saving time even after
+# Queensland ceased to.
+#
+# From Paul Eggert (1996-11-22):
+# IATA SSIM (1993-02/1994-09) say that the Holiday Islands (Hayman, Lindeman,
+# Hamilton) observed DST for two years after the rest of Queensland stopped.
+# Hamilton is the largest, but there is also a Hamilton in Victoria,
+# so use Lindeman.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   AQ      1971    only    -       Oct     lastSun 2:00s   1:00    -
+Rule   AQ      1972    only    -       Feb     lastSun 2:00s   0       -
+Rule   AQ      1989    1991    -       Oct     lastSun 2:00s   1:00    -
+Rule   AQ      1990    1992    -       Mar     Sun>=1  2:00s   0       -
+Rule   Holiday 1992    1993    -       Oct     lastSun 2:00s   1:00    -
+Rule   Holiday 1993    1994    -       Mar     Sun>=1  2:00s   0       -
+Zone Australia/Brisbane        10:12:08 -      LMT     1895
+                       10:00   Aus     EST     1971
+                       10:00   AQ      EST
+Zone Australia/Lindeman  9:55:56 -     LMT     1895
+                       10:00   Aus     EST     1971
+                       10:00   AQ      EST     1992 Jul
+                       10:00   Holiday EST
+
+# South Australia
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   AS      1971    1985    -       Oct     lastSun 2:00s   1:00    -
+Rule   AS      1986    only    -       Oct     19      2:00s   1:00    -
+Rule   AS      1987    2007    -       Oct     lastSun 2:00s   1:00    -
+Rule   AS      1972    only    -       Feb     27      2:00s   0       -
+Rule   AS      1973    1985    -       Mar     Sun>=1  2:00s   0       -
+Rule   AS      1986    1989    -       Mar     Sun>=15 2:00s   0       -
+Rule   AS      1990    only    -       Mar     Sun>=18 2:00s   0       -
+Rule   AS      1991    only    -       Mar     Sun>=1  2:00s   0       -
+Rule   AS      1992    only    -       Mar     Sun>=18 2:00s   0       -
+Rule   AS      1993    only    -       Mar     Sun>=1  2:00s   0       -
+Rule   AS      1994    only    -       Mar     Sun>=18 2:00s   0       -
+Rule   AS      1995    2005    -       Mar     lastSun 2:00s   0       -
+Rule   AS      2006    only    -       Apr     Sun>=1  2:00s   0       -
+Rule   AS      2007    only    -       Mar     lastSun 2:00s   0       -
+Rule   AS      2008    max     -       Apr     Sun>=1  2:00s   0       -
+Rule   AS      2008    max     -       Oct     Sun>=1  2:00s   1:00    -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Australia/Adelaide        9:14:20 -       LMT     1895 Feb
+                       9:00    -       CST     1899 May
+                       9:30    Aus     CST     1971
+                       9:30    AS      CST
+
+# Tasmania
+#
+# From Paul Eggert (2005-08-16):
+# <http://www.bom.gov.au/climate/averages/tables/dst_times.shtml>
+# says King Island didn't observe DST from WWII until late 1971.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   AT      1967    only    -       Oct     Sun>=1  2:00s   1:00    -
+Rule   AT      1968    only    -       Mar     lastSun 2:00s   0       -
+Rule   AT      1968    1985    -       Oct     lastSun 2:00s   1:00    -
+Rule   AT      1969    1971    -       Mar     Sun>=8  2:00s   0       -
+Rule   AT      1972    only    -       Feb     lastSun 2:00s   0       -
+Rule   AT      1973    1981    -       Mar     Sun>=1  2:00s   0       -
+Rule   AT      1982    1983    -       Mar     lastSun 2:00s   0       -
+Rule   AT      1984    1986    -       Mar     Sun>=1  2:00s   0       -
+Rule   AT      1986    only    -       Oct     Sun>=15 2:00s   1:00    -
+Rule   AT      1987    1990    -       Mar     Sun>=15 2:00s   0       -
+Rule   AT      1987    only    -       Oct     Sun>=22 2:00s   1:00    -
+Rule   AT      1988    1990    -       Oct     lastSun 2:00s   1:00    -
+Rule   AT      1991    1999    -       Oct     Sun>=1  2:00s   1:00    -
+Rule   AT      1991    2005    -       Mar     lastSun 2:00s   0       -
+Rule   AT      2000    only    -       Aug     lastSun 2:00s   1:00    -
+Rule   AT      2001    max     -       Oct     Sun>=1  2:00s   1:00    -
+Rule   AT      2006    only    -       Apr     Sun>=1  2:00s   0       -
+Rule   AT      2007    only    -       Mar     lastSun 2:00s   0       -
+Rule   AT      2008    max     -       Apr     Sun>=1  2:00s   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Australia/Hobart  9:49:16 -       LMT     1895 Sep
+                       10:00   -       EST     1916 Oct 1 2:00
+                       10:00   1:00    EST     1917 Feb
+                       10:00   Aus     EST     1967
+                       10:00   AT      EST
+Zone Australia/Currie  9:35:28 -       LMT     1895 Sep
+                       10:00   -       EST     1916 Oct 1 2:00
+                       10:00   1:00    EST     1917 Feb
+                       10:00   Aus     EST     1971 Jul
+                       10:00   AT      EST
+
+# Victoria
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   AV      1971    1985    -       Oct     lastSun 2:00s   1:00    -
+Rule   AV      1972    only    -       Feb     lastSun 2:00s   0       -
+Rule   AV      1973    1985    -       Mar     Sun>=1  2:00s   0       -
+Rule   AV      1986    1990    -       Mar     Sun>=15 2:00s   0       -
+Rule   AV      1986    1987    -       Oct     Sun>=15 2:00s   1:00    -
+Rule   AV      1988    1999    -       Oct     lastSun 2:00s   1:00    -
+Rule   AV      1991    1994    -       Mar     Sun>=1  2:00s   0       -
+Rule   AV      1995    2005    -       Mar     lastSun 2:00s   0       -
+Rule   AV      2000    only    -       Aug     lastSun 2:00s   1:00    -
+Rule   AV      2001    2007    -       Oct     lastSun 2:00s   1:00    -
+Rule   AV      2006    only    -       Apr     Sun>=1  2:00s   0       -
+Rule   AV      2007    only    -       Mar     lastSun 2:00s   0       -
+Rule   AV      2008    max     -       Apr     Sun>=1  2:00s   0       -
+Rule   AV      2008    max     -       Oct     Sun>=1  2:00s   1:00    -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Australia/Melbourne 9:39:52 -     LMT     1895 Feb
+                       10:00   Aus     EST     1971
+                       10:00   AV      EST
+
+# New South Wales
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   AN      1971    1985    -       Oct     lastSun 2:00s   1:00    -
+Rule   AN      1972    only    -       Feb     27      2:00s   0       -
+Rule   AN      1973    1981    -       Mar     Sun>=1  2:00s   0       -
+Rule   AN      1982    only    -       Apr     Sun>=1  2:00s   0       -
+Rule   AN      1983    1985    -       Mar     Sun>=1  2:00s   0       -
+Rule   AN      1986    1989    -       Mar     Sun>=15 2:00s   0       -
+Rule   AN      1986    only    -       Oct     19      2:00s   1:00    -
+Rule   AN      1987    1999    -       Oct     lastSun 2:00s   1:00    -
+Rule   AN      1990    1995    -       Mar     Sun>=1  2:00s   0       -
+Rule   AN      1996    2005    -       Mar     lastSun 2:00s   0       -
+Rule   AN      2000    only    -       Aug     lastSun 2:00s   1:00    -
+Rule   AN      2001    2007    -       Oct     lastSun 2:00s   1:00    -
+Rule   AN      2006    only    -       Apr     Sun>=1  2:00s   0       -
+Rule   AN      2007    only    -       Mar     lastSun 2:00s   0       -
+Rule   AN      2008    max     -       Apr     Sun>=1  2:00s   0       -
+Rule   AN      2008    max     -       Oct     Sun>=1  2:00s   1:00    -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Australia/Sydney  10:04:52 -      LMT     1895 Feb
+                       10:00   Aus     EST     1971
+                       10:00   AN      EST
+Zone Australia/Broken_Hill 9:25:48 -   LMT     1895 Feb
+                       10:00   -       EST     1896 Aug 23
+                       9:00    -       CST     1899 May
+                       9:30    Aus     CST     1971
+                       9:30    AN      CST     2000
+                       9:30    AS      CST
+
+# Lord Howe Island
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   LH      1981    1984    -       Oct     lastSun 2:00    1:00    -
+Rule   LH      1982    1985    -       Mar     Sun>=1  2:00    0       -
+Rule   LH      1985    only    -       Oct     lastSun 2:00    0:30    -
+Rule   LH      1986    1989    -       Mar     Sun>=15 2:00    0       -
+Rule   LH      1986    only    -       Oct     19      2:00    0:30    -
+Rule   LH      1987    1999    -       Oct     lastSun 2:00    0:30    -
+Rule   LH      1990    1995    -       Mar     Sun>=1  2:00    0       -
+Rule   LH      1996    2005    -       Mar     lastSun 2:00    0       -
+Rule   LH      2000    only    -       Aug     lastSun 2:00    0:30    -
+Rule   LH      2001    2007    -       Oct     lastSun 2:00    0:30    -
+Rule   LH      2006    only    -       Apr     Sun>=1  2:00    0       -
+Rule   LH      2007    only    -       Mar     lastSun 2:00    0       -
+Rule   LH      2008    max     -       Apr     Sun>=1  2:00    0       -
+Rule   LH      2008    max     -       Oct     Sun>=1  2:00    0:30    -
+Zone Australia/Lord_Howe 10:36:20 -    LMT     1895 Feb
+                       10:00   -       EST     1981 Mar
+                       10:30   LH      LHST
+
+# Australian miscellany
+#
+# Ashmore Is, Cartier
+# no indigenous inhabitants; only seasonal caretakers
+# no times are set
+#
+# Coral Sea Is
+# no indigenous inhabitants; only meteorologists
+# no times are set
+#
+# Macquarie
+# permanent occupation (scientific station) since 1948;
+# sealing and penguin oil station operated 1888/1917
+# like Australia/Hobart
+
+# Christmas
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Indian/Christmas  7:02:52 -       LMT     1895 Feb
+                       7:00    -       CXT     # Christmas Island Time
+
+# Cook Is
+# From Shanks & Pottenger:
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Cook    1978    only    -       Nov     12      0:00    0:30    HS
+Rule   Cook    1979    1991    -       Mar     Sun>=1  0:00    0       -
+Rule   Cook    1979    1990    -       Oct     lastSun 0:00    0:30    HS
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Rarotonga -10:39:04 -     LMT     1901            # Avarua
+                       -10:30  -       CKT     1978 Nov 12     # Cook Is Time
+                       -10:00  Cook    CK%sT
+
+# Cocos
+# These islands were ruled by the Ross family from about 1830 to 1978.
+# We don't know when standard time was introduced; for now, we guess 1900.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Indian/Cocos    6:27:40 -       LMT     1900
+                       6:30    -       CCT     # Cocos Islands Time
+
+# Fiji
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Fiji    1998    1999    -       Nov     Sun>=1  2:00    1:00    S
+Rule   Fiji    1999    2000    -       Feb     lastSun 3:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Fiji    11:53:40 -      LMT     1915 Oct 26     # Suva
+                       12:00   Fiji    FJ%sT   # Fiji Time
+
+# French Polynesia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Gambier  -8:59:48 -     LMT     1912 Oct        # Rikitea
+                        -9:00  -       GAMT    # Gambier Time
+Zone   Pacific/Marquesas -9:18:00 -    LMT     1912 Oct
+                        -9:30  -       MART    # Marquesas Time
+Zone   Pacific/Tahiti   -9:58:16 -     LMT     1912 Oct        # Papeete
+                       -10:00  -       TAHT    # Tahiti Time
+# Clipperton (near North America) is administered from French Polynesia;
+# it is uninhabited.
+
+# Guam
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Guam    -14:21:00 -     LMT     1844 Dec 31
+                        9:39:00 -      LMT     1901            # Agana
+                       10:00   -       GST     2000 Dec 23     # Guam
+                       10:00   -       ChST    # Chamorro Standard Time
+
+# Kiribati
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Tarawa     11:32:04 -     LMT     1901            # Bairiki
+                        12:00  -       GILT             # Gilbert Is Time
+Zone Pacific/Enderbury -11:24:20 -     LMT     1901
+                       -12:00  -       PHOT    1979 Oct # Phoenix Is Time
+                       -11:00  -       PHOT    1995
+                        13:00  -       PHOT
+Zone Pacific/Kiritimati        -10:29:20 -     LMT     1901
+                       -10:40  -       LINT    1979 Oct # Line Is Time
+                       -10:00  -       LINT    1995
+                        14:00  -       LINT
+
+# N Mariana Is
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Saipan    -14:17:00 -     LMT     1844 Dec 31
+                        9:43:00 -      LMT     1901
+                        9:00   -       MPT     1969 Oct # N Mariana Is Time
+                       10:00   -       MPT     2000 Dec 23
+                       10:00   -       ChST    # Chamorro Standard Time
+
+# Marshall Is
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Majuro    11:24:48 -      LMT     1901
+                       11:00   -       MHT     1969 Oct # Marshall Islands Time
+                       12:00   -       MHT
+Zone Pacific/Kwajalein 11:09:20 -      LMT     1901
+                       11:00   -       MHT     1969 Oct
+                       -12:00  -       KWAT    1993 Aug 20     # Kwajalein Time
+                       12:00   -       MHT
+
+# Micronesia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Truk      10:07:08 -      LMT     1901
+                       10:00   -       TRUT                    # Truk Time
+Zone Pacific/Ponape    10:32:52 -      LMT     1901            # Kolonia
+                       11:00   -       PONT                    # Ponape Time
+Zone Pacific/Kosrae    10:51:56 -      LMT     1901
+                       11:00   -       KOST    1969 Oct        # Kosrae Time
+                       12:00   -       KOST    1999
+                       11:00   -       KOST
+
+# Nauru
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Nauru   11:07:40 -      LMT     1921 Jan 15     # Uaobe
+                       11:30   -       NRT     1942 Mar 15     # Nauru Time
+                       9:00    -       JST     1944 Aug 15
+                       11:30   -       NRT     1979 May
+                       12:00   -       NRT
+
+# New Caledonia
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   NC      1977    1978    -       Dec     Sun>=1  0:00    1:00    S
+Rule   NC      1978    1979    -       Feb     27      0:00    0       -
+Rule   NC      1996    only    -       Dec      1      2:00s   1:00    S
+# Shanks & Pottenger say the following was at 2:00; go with IATA.
+Rule   NC      1997    only    -       Mar      2      2:00s   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Noumea  11:05:48 -      LMT     1912 Jan 13
+                       11:00   NC      NC%sT
+
+
+###############################################################################
+
+# New Zealand
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   NZ      1927    only    -       Nov      6      2:00    1:00    S
+Rule   NZ      1928    only    -       Mar      4      2:00    0       M
+Rule   NZ      1928    1933    -       Oct     Sun>=8  2:00    0:30    S
+Rule   NZ      1929    1933    -       Mar     Sun>=15 2:00    0       M
+Rule   NZ      1934    1940    -       Apr     lastSun 2:00    0       M
+Rule   NZ      1934    1940    -       Sep     lastSun 2:00    0:30    S
+Rule   NZ      1946    only    -       Jan      1      0:00    0       S
+# Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no
+# convenient notation for this so we must duplicate the Rule lines.
+Rule   NZ      1974    only    -       Nov     Sun>=1  2:00s   1:00    D
+Rule   Chatham 1974    only    -       Nov     Sun>=1  2:45s   1:00    D
+Rule   NZ      1975    only    -       Feb     lastSun 2:00s   0       S
+Rule   Chatham 1975    only    -       Feb     lastSun 2:45s   0       S
+Rule   NZ      1975    1988    -       Oct     lastSun 2:00s   1:00    D
+Rule   Chatham 1975    1988    -       Oct     lastSun 2:45s   1:00    D
+Rule   NZ      1976    1989    -       Mar     Sun>=1  2:00s   0       S
+Rule   Chatham 1976    1989    -       Mar     Sun>=1  2:45s   0       S
+Rule   NZ      1989    only    -       Oct     Sun>=8  2:00s   1:00    D
+Rule   Chatham 1989    only    -       Oct     Sun>=8  2:45s   1:00    D
+Rule   NZ      1990    2006    -       Oct     Sun>=1  2:00s   1:00    D
+Rule   Chatham 1990    2006    -       Oct     Sun>=1  2:45s   1:00    D
+Rule   NZ      1990    2007    -       Mar     Sun>=15 2:00s   0       S
+Rule   Chatham 1990    2007    -       Mar     Sun>=15 2:45s   0       S
+Rule   NZ      2007    max     -       Sep     lastSun 2:00s   1:00    D
+Rule   Chatham 2007    max     -       Sep     lastSun 2:45s   1:00    D
+Rule   NZ      2008    max     -       Apr     Sun>=1  2:00s   0       S
+Rule   Chatham 2008    max     -       Apr     Sun>=1  2:45s   0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Auckland  11:39:04 -      LMT     1868 Nov  2
+                       11:30   NZ      NZ%sT   1946 Jan  1
+                       12:00   NZ      NZ%sT
+Zone Pacific/Chatham   12:13:48 -      LMT     1957 Jan  1
+                       12:45   Chatham CHA%sT
+
+
+# Auckland Is
+# uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers,
+# and scientific personnel have wintered
+
+# Campbell I
+# minor whaling stations operated 1909/1914
+# scientific station operated 1941/1995;
+# previously whalers, sealers, pastoralists, and scientific personnel wintered
+# was probably like Pacific/Auckland
+
+###############################################################################
+
+
+# Niue
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Niue    -11:19:40 -     LMT     1901            # Alofi
+                       -11:20  -       NUT     1951    # Niue Time
+                       -11:30  -       NUT     1978 Oct 1
+                       -11:00  -       NUT
+
+# Norfolk
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Norfolk 11:11:52 -      LMT     1901            # Kingston
+                       11:12   -       NMT     1951    # Norfolk Mean Time
+                       11:30   -       NFT             # Norfolk Time
+
+# Palau (Belau)
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Palau     8:57:56 -       LMT     1901            # Koror
+                       9:00    -       PWT     # Palau Time
+
+# Papua New Guinea
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Port_Moresby 9:48:40 -    LMT     1880
+                       9:48:32 -       PMMT    1895    # Port Moresby Mean Time
+                       10:00   -       PGT             # Papua New Guinea Time
+
+# Pitcairn
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Pitcairn  -8:40:20 -      LMT     1901            # Adamstown
+                       -8:30   -       PNT     1998 Apr 27 00:00
+                       -8:00   -       PST     # Pitcairn Standard Time
+
+# American Samoa
+Zone Pacific/Pago_Pago  12:37:12 -     LMT     1879 Jul  5
+                       -11:22:48 -     LMT     1911
+                       -11:30  -       SAMT    1950            # Samoa Time
+                       -11:00  -       NST     1967 Apr        # N=Nome
+                       -11:00  -       BST     1983 Nov 30     # B=Bering
+                       -11:00  -       SST                     # S=Samoa
+
+# Samoa
+Zone Pacific/Apia       12:33:04 -     LMT     1879 Jul  5
+                       -11:26:56 -     LMT     1911
+                       -11:30  -       SAMT    1950            # Samoa Time
+                       -11:00  -       WST                     # Samoa Time
+
+# Solomon Is
+# excludes Bougainville, for which see Papua New Guinea
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Guadalcanal 10:39:48 -    LMT     1912 Oct        # Honiara
+                       11:00   -       SBT     # Solomon Is Time
+
+# Tokelau Is
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Fakaofo -11:24:56 -     LMT     1901
+                       -10:00  -       TKT     # Tokelau Time
+
+# Tonga
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Tonga   1999    only    -       Oct      7      2:00s   1:00    S
+Rule   Tonga   2000    only    -       Mar     19      2:00s   0       -
+Rule   Tonga   2000    2001    -       Nov     Sun>=1  2:00    1:00    S
+Rule   Tonga   2001    2002    -       Jan     lastSun 2:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Tongatapu 12:19:20 -      LMT     1901
+                       12:20   -       TOT     1941 # Tonga Time
+                       13:00   -       TOT     1999
+                       13:00   Tonga   TO%sT
+
+# Tuvalu
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Funafuti  11:56:52 -      LMT     1901
+                       12:00   -       TVT     # Tuvalu Time
+
+
+# US minor outlying islands
+
+# Howland, Baker
+# Howland was mined for guano by American companies 1857-1878 and British
+# 1886-1891; Baker was similar but exact dates are not known.
+# Inhabited by civilians 1935-1942; U.S. military bases 1943-1944;
+# uninhabited thereafter.
+# Howland observed Hawaii Standard Time (UTC-10:30) in 1937;
+# see page 206 of Elgen M. Long and Marie K. Long,
+# Amelia Earhart: the Mystery Solved, Simon & Schuster (2000).
+# So most likely Howland and Baker observed Hawaii Time from 1935
+# until they were abandoned after the war.
+
+# Jarvis
+# Mined for guano by American companies 1857-1879 and British 1883?-1891?.
+# Inhabited by civilians 1935-1942; IGY scientific base 1957-1958;
+# uninhabited thereafter.
+# no information; was probably like Pacific/Kiritimati
+
+# Johnston
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Pacific/Johnston  -10:00  -       HST
+
+# Kingman
+# uninhabited
+
+# Midway
+#
+# From Mark Brader (2005-01-23):
+# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies,
+# published 1994 by Paladwr Press, McLean, VA, USA; ISBN 0-9626483-5-3]
+# reproduced a Pan American Airways timeables from 1936, for their weekly
+# "Orient Express" flights between San Francisco and Manila, and connecting
+# flights to Chicago and the US East Coast.  As it uses some time zone
+# designations that I've never seen before:....
+# Fri. 6:30A Lv. HONOLOLU (Pearl Harbor), H.I.   H.L.T. Ar. 5:30P Sun.
+#  "   3:00P Ar. MIDWAY ISLAND . . . . . . . . . M.L.T. Lv. 6:00A  "
+#
+Zone Pacific/Midway    -11:49:28 -     LMT     1901
+                       -11:00  -       NST     1956 Jun  3
+                       -11:00  1:00    NDT     1956 Sep  2
+                       -11:00  -       NST     1967 Apr        # N=Nome
+                       -11:00  -       BST     1983 Nov 30     # B=Bering
+                       -11:00  -       SST                     # S=Samoa
+
+# Palmyra
+# uninhabited since World War II; was probably like Pacific/Kiritimati
+
+# Wake
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Wake    11:06:28 -      LMT     1901
+                       12:00   -       WAKT    # Wake Time
+
+
+# Vanuatu
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Vanuatu 1983    only    -       Sep     25      0:00    1:00    S
+Rule   Vanuatu 1984    1991    -       Mar     Sun>=23 0:00    0       -
+Rule   Vanuatu 1984    only    -       Oct     23      0:00    1:00    S
+Rule   Vanuatu 1985    1991    -       Sep     Sun>=23 0:00    1:00    S
+Rule   Vanuatu 1992    1993    -       Jan     Sun>=23 0:00    0       -
+Rule   Vanuatu 1992    only    -       Oct     Sun>=23 0:00    1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Efate   11:13:16 -      LMT     1912 Jan 13             # Vila
+                       11:00   Vanuatu VU%sT   # Vanuatu Time
+
+# Wallis and Futuna
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Pacific/Wallis  12:15:20 -      LMT     1901
+                       12:00   -       WFT     # Wallis & Futuna Time
+
+###############################################################################
+
+# NOTES
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Another source occasionally used is Edward W. Whitman, World Time Differences,
+# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
+# I found in the UCLA library.
+#
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#
+# I invented the abbreviations marked `*' in the following table;
+# the rest are from earlier versions of this file, or from other sources.
+# Corrections are welcome!
+#              std dst
+#              LMT     Local Mean Time
+#        8:00  WST WST Western Australia
+#        8:45  CWST CWST Central Western Australia*
+#        9:00  JST     Japan
+#        9:30  CST CST Central Australia
+#       10:00  EST EST Eastern Australia
+#       10:00  ChST    Chamorro
+#       10:30  LHST LHST Lord Howe*
+#       11:30  NZMT NZST New Zealand through 1945
+#       12:00  NZST NZDT New Zealand 1946-present
+#       12:45  CHAST CHADT Chatham*
+#      -11:00  SST     Samoa
+#      -10:00  HST     Hawaii
+#      - 8:00  PST     Pitcairn*
+#
+# See the `northamerica' file for Hawaii.
+# See the `southamerica' file for Easter I and the Galapagos Is.
+
+###############################################################################
+
+# Australia
+
+# From Paul Eggert (2005-12-08):
+# <a href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">
+# Implementation Dates of Daylight Saving Time within Australia
+# </a> summarizes daylight saving issues in Australia.
+
+# From Arthur David Olson (2005-12-12):
+# <a href="http://www.lawlink.nsw.gov.au/lawlink/Corporate/ll_agdinfo.nsf/pages/community_relations_daylight_saving">
+# Lawlink NSW:Daylight Saving in New South Wales
+# </a> covers New South Wales in particular.
+
+# From John Mackin (1991-03-06):
+# We in Australia have _never_ referred to DST as `daylight' time.
+# It is called `summer' time.  Now by a happy coincidence, `summer'
+# and `standard' happen to start with the same letter; hence, the
+# abbreviation does _not_ change...
+# The legislation does not actually define abbreviations, at least
+# in this State, but the abbreviation is just commonly taken to be the
+# initials of the phrase, and the legislation here uniformly uses
+# the phrase `summer time' and does not use the phrase `daylight
+# time'.
+# Announcers on the Commonwealth radio network, the ABC (for Australian
+# Broadcasting Commission), use the phrases `Eastern Standard Time'
+# or `Eastern Summer Time'.  (Note, though, that as I say in the
+# current australasia file, there is really no such thing.)  Announcers
+# on its overseas service, Radio Australia, use the same phrases
+# prefixed by the word `Australian' when referring to local times;
+# time announcements on that service, naturally enough, are made in UTC.
+
+# From Arthur David Olson (1992-03-08):
+# Given the above, what's chosen for year-round use is:
+#      CST     for any place operating at a GMTOFF of 9:30
+#      WST     for any place operating at a GMTOFF of 8:00
+#      EST     for any place operating at a GMTOFF of 10:00
+
+# From Chuck Soper (2006-06-01):
+# I recently found this Australian government web page on time zones:
+# <http://www.australia.gov.au/about-australia-13time>
+# And this government web page lists time zone names and abbreviations:
+# <http://www.bom.gov.au/climate/averages/tables/daysavtm.shtml>
+
+# From Paul Eggert (2001-04-05), summarizing a long discussion about "EST"
+# versus "AEST" etc.:
+#
+# I see the following points of dispute:
+#
+# * How important are unique time zone abbreviations?
+#
+#   Here I tend to agree with the point (most recently made by Chris
+#   Newman) that unique abbreviations should not be essential for proper
+#   operation of software.  We have other instances of ambiguity
+#   (e.g. "IST" denoting both "Israel Standard Time" and "Indian
+#   Standard Time"), and they are not likely to go away any time soon.
+#   In the old days, some software mistakenly relied on unique
+#   abbreviations, but this is becoming less true with time, and I don't
+#   think it's that important to cater to such software these days.
+#
+#   On the other hand, there is another motivation for unambiguous
+#   abbreviations: it cuts down on human confusion.  This is
+#   particularly true for Australia, where "EST" can mean one thing for
+#   time T and a different thing for time T plus 1 second.
+#
+# * Does the relevant legislation indicate which abbreviations should be used?
+#
+#   Here I tend to think that things are a mess, just as they are in
+#   many other countries.  We Americans are currently disagreeing about
+#   which abbreviation to use for the newly legislated Chamorro Standard
+#   Time, for example.
+#
+#   Personally, I would prefer to use common practice; I would like to
+#   refer to legislation only for examples of common practice, or as a
+#   tiebreaker.
+#
+# * Do Australians more often use "Eastern Daylight Time" or "Eastern
+#   Summer Time"?  Do they typically prefix the time zone names with
+#   the word "Australian"?
+#
+#   My own impression is that both "Daylight Time" and "Summer Time" are
+#   common and are widely understood, but that "Summer Time" is more
+#   popular; and that the leading "A" is also common but is omitted more
+#   often than not.  I just used AltaVista advanced search and got the
+#   following count of page hits:
+#
+#     1,103 "Eastern Summer Time" AND domain:au
+#       971 "Australian Eastern Summer Time" AND domain:au
+#       613 "Eastern Daylight Time" AND domain:au
+#       127 "Australian Eastern Daylight Time" AND domain:au
+#
+#   Here "Summer" seems quite a bit more popular than "Daylight",
+#   particularly when we know the time zone is Australian and not US,
+#   say.  The "Australian" prefix seems to be popular for Eastern Summer
+#   Time, but unpopular for Eastern Daylight Time.
+#
+#   For abbreviations, tools like AltaVista are less useful because of
+#   ambiguity.  Many hits are not really time zones, unfortunately, and
+#   many hits denote US time zones and not Australian ones.  But here
+#   are the hit counts anyway:
+#
+#     161,304 "EST" and domain:au
+#      25,156 "EDT" and domain:au
+#      18,263 "AEST" and domain:au
+#      10,416 "AEDT" and domain:au
+#
+#      14,538 "CST" and domain:au
+#       5,728 "CDT" and domain:au
+#         176 "ACST" and domain:au
+#          29 "ACDT" and domain:au
+#
+#       7,539 "WST" and domain:au
+#          68 "AWST" and domain:au
+#
+#   This data suggest that Australians tend to omit the "A" prefix in
+#   practice.  The situation for "ST" versus "DT" is less clear, given
+#   the ambiguities involved.
+#
+# * How do Australians feel about the abbreviations in the tz database?
+#
+#   If you just count Australians on this list, I count 2 in favor and 3
+#   against.  One of the "against" votes (David Keegel) counseled delay,
+#   saying that both AEST/AEDT and EST/EST are widely used and
+#   understood in Australia.
+
+# From Paul Eggert (1995-12-19):
+# Shanks & Pottenger report 2:00 for all autumn changes in Australia and NZ.
+# Mark Prior writes that his newspaper
+# reports that NSW's fall 1995 change will occur at 2:00,
+# but Robert Elz says it's been 3:00 in Victoria since 1970
+# and perhaps the newspaper's `2:00' is referring to standard time.
+# For now we'll continue to assume 2:00s for changes since 1960.
+
+# From Eric Ulevik (1998-01-05):
+#
+# Here are some URLs to Australian time legislation. These URLs are stable,
+# and should probably be included in the data file. There are probably more
+# relevant entries in this database.
+#
+# NSW (including LHI and Broken Hill):
+# <a href="http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html">
+# Standard Time Act 1987 (updated 1995-04-04)
+# </a>
+# ACT
+# <a href="http://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html">
+# Standard Time and Summer Time Act 1972
+# </a>
+# SA
+# <a href="http://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html">
+# Standard Time Act, 1898
+# </a>
+
+# From David Grosz (2005-06-13):
+# It was announced last week that Daylight Saving would be extended by
+# one week next year to allow for the 2006 Commonwealth Games.
+# Daylight Saving is now to end for next year only on the first Sunday
+# in April instead of the last Sunday in March.
+#
+# From Gwillim Law (2005-06-14):
+# I did some Googling and found that all of those states (and territory) plan
+# to extend DST together in 2006.
+# ACT: http://www.cmd.act.gov.au/mediareleases/fileread.cfm?file=86.txt
+# New South Wales: http://www.thecouriermail.news.com.au/common/story_page/0,5936,15538869%255E1702,00.html
+# South Australia: http://www.news.com.au/story/0,10117,15555031-1246,00.html
+# Tasmania: http://www.media.tas.gov.au/release.php?id=14772
+# Victoria: I wasn't able to find anything separate, but the other articles
+# allude to it.
+# But not Queensland
+# http://www.news.com.au/story/0,10117,15564030-1248,00.html.
+
+# Northern Territory
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# # The NORTHERN TERRITORY..  [ Courtesy N.T. Dept of the Chief Minister ]
+# #                                    [ Nov 1990 ]
+# #    N.T. have never utilised any DST due to sub-tropical/tropical location.
+# ...
+# Zone        Australia/North         9:30    -       CST
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# the Northern Territory do[es] not have daylight saving.
+
+# Western Australia
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# #  The state of WESTERN AUSTRALIA..  [ Courtesy W.A. dept Premier+Cabinet ]
+# #                                            [ Nov 1990 ]
+# #    W.A. suffers from a great deal of public and political opposition to
+# #    DST in principle. A bill is brought before parliament in most years, but
+# #    usually defeated either in the upper house, or in party caucus
+# #    before reaching parliament.
+# ...
+# Zone Australia/West          8:00    AW      %sST
+# ...
+# Rule AW      1974    only    -       Oct     lastSun 2:00    1:00    D
+# Rule AW      1975    only    -       Mar     Sun>=1  3:00    0       W
+# Rule AW      1983    only    -       Oct     lastSun 2:00    1:00    D
+# Rule AW      1984    only    -       Mar     Sun>=1  3:00    0       W
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# Western Australia...do[es] not have daylight saving.
+
+# From John D. Newman via Bradley White (1991-11-02):
+# Western Australia is still on "winter time". Some DH in Sydney
+# rang me at home a few days ago at 6.00am. (He had just arrived at
+# work at 9.00am.)
+# W.A. is switching to Summer Time on Nov 17th just to confuse
+# everybody again.
+
+# From Arthur David Olson (1992-03-08):
+# The 1992 ending date used in the rules is a best guess;
+# it matches what was used in the past.
+
+# <a href="http://www.bom.gov.au/faq/faqgen.htm">
+# The Australian Bureau of Meteorology FAQ
+# </a> (1999-09-27) writes that Giles Meteorological Station uses
+# South Australian time even though it's located in Western Australia.
+
+# Queensland
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# #   The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ]
+# #                                            [ Dec 1990 ]
+# ...
+# Zone Australia/Queensland    10:00   AQ      %sST
+# ...
+# Rule AQ      1971    only    -       Oct     lastSun 2:00    1:00    D
+# Rule AQ      1972    only    -       Feb     lastSun 3:00    0       E
+# Rule AQ      1989    max     -       Oct     lastSun 2:00    1:00    D
+# Rule AQ      1990    max     -       Mar     Sun>=1  3:00    0       E
+
+# From Bradley White (1989-12-24):
+# "Australia/Queensland" now observes daylight time (i.e. from
+# October 1989).
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# ...Queensland...[has] agreed to end daylight saving
+# at 3am tomorrow (March 3)...
+
+# From John Mackin (1991-03-06):
+# I can certainly confirm for my part that Daylight Saving in NSW did in fact
+# end on Sunday, 3 March.  I don't know at what hour, though.  (It surprised
+# me.)
+
+# From Bradley White (1992-03-08):
+# ...there was recently a referendum in Queensland which resulted
+# in the experimental daylight saving system being abandoned. So, ...
+# ...
+# Rule QLD     1989    1991    -       Oct     lastSun 2:00    1:00    D
+# Rule QLD     1990    1992    -       Mar     Sun>=1  3:00    0       S
+# ...
+
+# From Arthur David Olson (1992-03-08):
+# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes.
+
+# From Christopher Hunt (2006-11-21), after an advance warning
+# from Jesper Norgaard Welen (2006-11-01):
+# WA are trialing DST for three years.
+# <http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf>
+
+# From Rives McDow (2002-04-09):
+# The most interesting region I have found consists of three towns on the
+# southern coast....  South Australia observes daylight saving time; Western
+# Australia does not.  The two states are one and a half hours apart.  The
+# residents decided to forget about this nonsense of changing the clock so
+# much and set the local time 20 hours and 45 minutes from the
+# international date line, or right in the middle of the time of South
+# Australia and Western Australia....
+#
+# From Paul Eggert (2002-04-09):
+# This is confirmed by the section entitled
+# "What's the deal with time zones???" in
+# <http://www.earthsci.unimelb.edu.au/~awatkins/null.html>.
+#
+# From Alex Livingston (2006-12-07):
+# ... it was just on four years ago that I drove along the Eyre Highway,
+# which passes through eastern Western Australia close to the southern
+# coast of the continent.
+#
+# I paid particular attention to the time kept there. There can be no
+# dispute that UTC+08:45 was considered "the time" from the border
+# village just inside the border with South Australia to as far west
+# as just east of Caiguna. There can also be no dispute that Eucla is
+# the largest population centre in this zone....
+#
+# Now that Western Australia is observing daylight saving, the
+# question arose whether this part of the state would follow suit. I
+# just called the border village and confirmed that indeed they have,
+# meaning that they are now observing UTC+09:45.
+#
+# (2006-12-09):
+# I personally doubt that either experimentation with daylight saving
+# in WA or its introduction in SA had anything to do with the genesis
+# of this time zone.  My hunch is that it's been around since well
+# before 1975.  I remember seeing it noted on road maps decades ago.
+
+# From Paul Eggert (2006-12-15):
+# For lack of better info, assume the tradition dates back to the
+# introduction of standard time in 1895.
+
+
+# southeast Australia
+#
+# From Paul Eggert (2007-07-23):
+# Starting autumn 2008 Victoria, NSW, South Australia, Tasmania and the ACT
+# end DST the first Sunday in April and start DST the first Sunday in October.
+# http://www.theage.com.au/news/national/daylight-savings-to-span-six-months/2007/06/27/1182623966703.html
+
+
+# South Australia
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# ...South Australia...[has] agreed to end daylight saving
+# at 3am tomorrow (March 3)...
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# #   The state of SOUTH AUSTRALIA....[ Courtesy of S.A. Dept of Labour ]
+# #                                            [ Nov 1990 ]
+# ...
+# Zone Australia/South         9:30    AS      %sST
+# ...
+# Rule  AS     1971    max     -       Oct     lastSun 2:00    1:00    D
+# Rule  AS     1972    1985    -       Mar     Sun>=1  3:00    0       C
+# Rule  AS     1986    1990    -       Mar     Sun>=15 3:00    0       C
+# Rule  AS     1991    max     -       Mar     Sun>=1  3:00    0       C
+
+# From Bradley White (1992-03-11):
+# Recent correspondence with a friend in Adelaide
+# contained the following exchange:  "Due to the Adelaide Festival,
+# South Australia delays setting back our clocks for a few weeks."
+
+# From Robert Elz (1992-03-13):
+# I heard that apparently (or at least, it appears that)
+# South Aus will have an extra 3 weeks daylight saving every even
+# numbered year (from 1990).  That's when the Adelaide Festival
+# is on...
+
+# From Robert Elz (1992-03-16, 00:57:07 +1000):
+# DST didn't end in Adelaide today (yesterday)....
+# But whether it's "4th Sunday" or "2nd last Sunday" I have no idea whatever...
+# (it's just as likely to be "the Sunday we pick for this year"...).
+
+# From Bradley White (1994-04-11):
+# If Sun, 15 March, 1992 was at +1030 as kre asserts, but yet Sun, 20 March,
+# 1994 was at +0930 as John Connolly's customer seems to assert, then I can
+# only conclude that the actual rule is more complicated....
+
+# From John Warburton (1994-10-07):
+# The new Daylight Savings dates for South Australia ...
+# was gazetted in the Government Hansard on Sep 26 1994....
+# start on last Sunday in October and end in last sunday in March.
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# Tasmania
+
+# The rules for 1967 through 1991 were reported by George Shepherd
+# via Simon Woodhead via Robert Elz (1991-03-06):
+# #  The state of TASMANIA.. [Courtesy Tasmanian Dept of Premier + Cabinet ]
+# #                                    [ Nov 1990 ]
+
+# From Bill Hart via Guy Harris (1991-10-10):
+# Oh yes, the new daylight savings rules are uniquely tasmanian, we have
+# 6 weeks a year now when we are out of sync with the rest of Australia
+# (but nothing new about that).
+
+# From Alex Livingston (1999-10-04):
+# I heard on the ABC (Australian Broadcasting Corporation) radio news on the
+# (long) weekend that Tasmania, which usually goes its own way in this regard,
+# has decided to join with most of NSW, the ACT, and most of Victoria
+# (Australia) and start daylight saving on the last Sunday in August in 2000
+# instead of the first Sunday in October.
+
+# Sim Alam (2000-07-03) reported a legal citation for the 2000/2001 rules:
+# http://www.thelaw.tas.gov.au/fragview/42++1968+GS3A@EN+2000070300
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# Victoria
+
+# The rules for 1971 through 1991 were reported by George Shepherd
+# via Simon Woodhead via Robert Elz (1991-03-06):
+# #   The state of VICTORIA.. [ Courtesy of Vic. Dept of Premier + Cabinet ]
+# #                                            [ Nov 1990 ]
+
+# From Scott Harrington (2001-08-29):
+# On KQED's "City Arts and Lectures" program last night I heard an
+# interesting story about daylight savings time.  Dr. John Heilbron was
+# discussing his book "The Sun in the Church: Cathedrals as Solar
+# Observatories"[1], and in particular the Shrine of Remembrance[2] located
+# in Melbourne, Australia.
+#
+# Apparently the shrine's main purpose is a beam of sunlight which
+# illuminates a special spot on the floor at the 11th hour of the 11th day
+# of the 11th month (Remembrance Day) every year in memory of Australia's
+# fallen WWI soldiers.  And if you go there on Nov. 11, at 11am local time,
+# you will indeed see the sunbeam illuminate the special spot at the
+# expected time.
+#
+# However, that is only because of some special mirror contraption that had
+# to be employed, since due to daylight savings time, the true solar time of
+# the remembrance moment occurs one hour later (or earlier?).  Perhaps
+# someone with more information on this jury-rig can tell us more.
+#
+# [1] http://www.hup.harvard.edu/catalog/HEISUN.html
+# [2] http://www.shrine.org.au
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# New South Wales
+
+# From Arthur David Olson:
+# New South Wales and subjurisdictions have their own ideas of a fun time.
+# Based on law library research by John Mackin,
+# who notes:
+#      In Australia, time is not legislated federally, but rather by the
+#      individual states.  Thus, while such terms as ``Eastern Standard Time''
+#      [I mean, of course, Australian EST, not any other kind] are in common
+#      use, _they have NO REAL MEANING_, as they are not defined in the
+#      legislation.  This is very important to understand.
+#      I have researched New South Wales time only...
+
+# From Eric Ulevik (1999-05-26):
+# DST will start in NSW on the last Sunday of August, rather than the usual
+# October in 2000.  [See: Matthew Moore,
+# <a href="http://www.smh.com.au/news/9905/26/pageone/pageone4.html">
+# Two months more daylight saving
+# </a>
+# Sydney Morning Herald (1999-05-26).]
+
+# From Paul Eggert (1999-09-27):
+# See the following official NSW source:
+# <a href="http://dir.gis.nsw.gov.au/cgi-bin/genobject/document/other/daylightsaving/tigGmZ">
+# Daylight Saving in New South Wales.
+# </a>
+#
+# Narrabri Shire (NSW) council has announced it will ignore the extension of
+# daylight saving next year.  See:
+# <a href="http://abc.net.au/news/regionals/neweng/monthly/regeng-22jul1999-1.htm">
+# Narrabri Council to ignore daylight saving
+# </a> (1999-07-22).  For now, we'll wait to see if this really happens.
+#
+# Victoria will following NSW.  See:
+# <a href="http://abc.net.au/local/news/olympics/1999/07/item19990728112314_1.htm">
+# Vic to extend daylight saving
+# </a> (1999-07-28).
+#
+# However, South Australia rejected the DST request.  See:
+# <a href="http://abc.net.au/news/olympics/1999/07/item19990719151754_1.htm">
+# South Australia rejects Olympics daylight savings request
+# </a> (1999-07-19).
+#
+# Queensland also will not observe DST for the Olympics.  See:
+# <a href="http://abc.net.au/news/olympics/1999/06/item19990601114608_1.htm">
+# Qld says no to daylight savings for Olympics
+# </a> (1999-06-01), which quotes Queensland Premier Peter Beattie as saying
+# ``Look you've got to remember in my family when this came up last time
+# I voted for it, my wife voted against it and she said to me it's all very
+# well for you, you don't have to worry about getting the children out of
+# bed, getting them to school, getting them to sleep at night.
+# I've been through all this argument domestically...my wife rules.''
+#
+# Broken Hill will stick with South Australian time in 2000.  See:
+# <a href="http://abc.net.au/news/regionals/brokenh/monthly/regbrok-21jul1999-6.htm">
+# Broken Hill to be behind the times
+# </a> (1999-07-21).
+
+# IATA SSIM (1998-09) says that the spring 2000 change for Australian
+# Capital Territory, New South Wales except Lord Howe Island and Broken
+# Hill, and Victoria will be August 27, presumably due to the Sydney Olympics.
+
+# From Eric Ulevik, referring to Sydney's Sun Herald (2000-08-13), page 29:
+# The Queensland Premier Peter Beattie is encouraging northern NSW
+# towns to use Queensland time.
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# Yancowinna
+
+# From John Mackin (1989-01-04):
+# `Broken Hill' means the County of Yancowinna.
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# # YANCOWINNA..  [ Confirmation courtesy of Broken Hill Postmaster ]
+# #                                    [ Dec 1990 ]
+# ...
+# # Yancowinna uses Central Standard Time, despite [its] location on the
+# # New South Wales side of the S.A. border. Most business and social dealings
+# # are with CST zones, therefore CST is legislated by local government
+# # although the switch to Summer Time occurs in line with N.S.W. There have
+# # been years when this did not apply, but the historical data is not
+# # presently available.
+# Zone Australia/Yancowinna    9:30     AY     %sST
+# ...
+# Rule  AY     1971    1985    -       Oct     lastSun 2:00    1:00    D
+# Rule  AY     1972    only    -       Feb     lastSun 3:00    0       C
+# [followed by other Rules]
+
+# Lord Howe Island
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# LHI...               [ Courtesy of Pauline Van Winsen ]
+#                                      [ Dec 1990 ]
+# Lord Howe Island is located off the New South Wales coast, and is half an
+# hour ahead of NSW time.
+
+# From James Lonergan, Secretary, Lord Howe Island Board (2000-01-27):
+# Lord Howe Island summer time in 2000/2001 will commence on the same
+# date as the rest of NSW (i.e. 2000-08-27).  For your information the
+# Lord Howe Island Board (controlling authority for the Island) is
+# seeking the community's views on various options for summer time
+# arrangements on the Island, e.g. advance clocks by 1 full hour
+# instead of only 30 minutes.  Dependant on the wishes of residents
+# the Board may approach the NSW government to change the existing
+# arrangements.  The starting date for summer time on the Island will
+# however always coincide with the rest of NSW.
+
+# From James Lonergan, Secretary, Lord Howe Island Board (2000-10-25):
+# Lord Howe Island advances clocks by 30 minutes during DST in NSW and retards
+# clocks by 30 minutes when DST finishes. Since DST was most recently
+# introduced in NSW, the "changeover" time on the Island has been 02:00 as
+# shown on clocks on LHI. I guess this means that for 30 minutes at the start
+# of DST, LHI is actually 1 hour ahead of the rest of NSW.
+
+# From Paul Eggert (2006-03-22):
+# For Lord Howe dates we use Shanks & Pottenger through 1989, and
+# Lonergan thereafter.  For times we use Lonergan.
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+###############################################################################
+
+# New Zealand
+
+# From Mark Davies (1990-10-03):
+# the 1989/90 year was a trial of an extended "daylight saving" period.
+# This trial was deemed successful and the extended period adopted for
+# subsequent years (with the addition of a further week at the start).
+# source -- phone call to Ministry of Internal Affairs Head Office.
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# # The Country of New Zealand   (Australia's east island -) Gee they hate that!
+# #                               or is Australia the west island of N.Z.
+# #    [ courtesy of Geoff Tribble.. Auckland N.Z. ]
+# #                            [ Nov 1990 ]
+# ...
+# Rule NZ      1974    1988    -       Oct     lastSun 2:00    1:00    D
+# Rule NZ      1989    max     -       Oct     Sun>=1  2:00    1:00    D
+# Rule NZ      1975    1989    -       Mar     Sun>=1  3:00    0       S
+# Rule NZ      1990    max     -       Mar     lastSun 3:00    0       S
+# ...
+# Zone NZ                      12:00   NZ              NZ%sT   # New Zealand
+# Zone NZ-CHAT                 12:45   -               NZ-CHAT # Chatham Island
+
+# From Arthur David Olson (1992-03-08):
+# The chosen rules use the Davies October 8 values for the start of DST in 1989
+# rather than the October 1 value.
+
+# From Paul Eggert (1995-12-19);
+# Shank & Pottenger report 2:00 for all autumn changes in Australia and NZ.
+# Robert Uzgalis writes that the New Zealand Daylight
+# Savings Time Order in Council dated 1990-06-18 specifies 2:00 standard
+# time on both the first Sunday in October and the third Sunday in March.
+# As with Australia, we'll assume the tradition is 2:00s, not 2:00.
+#
+# From Paul Eggert (2006-03-22):
+# The Department of Internal Affairs (DIA) maintains a brief history,
+# as does Carol Squires; see tz-link.htm for the full references.
+# Use these sources in preference to Shanks & Pottenger.
+#
+# For Chatham, IATA SSIM (1991/1999) gives the NZ rules but with
+# transitions at 2:45 local standard time; this confirms that Chatham
+# is always exactly 45 minutes ahead of Auckland.
+
+# From Colin Sharples (2007-04-30):
+# DST will now start on the last Sunday in September, and end on the
+# first Sunday in April.  The changes take effect this year, meaning
+# that DST will begin on 2007-09-30 2008-04-06.
+# http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Services-Daylight-Saving-Daylight-saving-to-be-extended
+
+###############################################################################
+
+
+# Fiji
+
+# Howse writes (p 153) that in 1879 the British governor of Fiji
+# enacted an ordinance standardizing the islands on Antipodean Time
+# instead of the American system (which was one day behind).
+
+# From Rives McDow (1998-10-08):
+# Fiji will introduce DST effective 0200 local time, 1998-11-01
+# until 0300 local time 1999-02-28.  Each year the DST period will
+# be from the first Sunday in November until the last Sunday in February.
+
+# From Paul Eggert (2000-01-08):
+# IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
+
+# From the BBC World Service (1998-10-31 11:32 UTC):
+# The Fijiian government says the main reasons for the time change is to
+# improve productivity and reduce road accidents.  But correspondents say it
+# also hopes the move will boost Fiji's ability to compete with other pacific
+# islands in the effort to attract tourists to witness the dawning of the new
+# millenium.
+
+# http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
+# reports that Fiji has discontinued DST.
+
+# Johnston
+
+# Johnston data is from usno1995.
+
+
+# Kiribati
+
+# From Paul Eggert (1996-01-22):
+# Today's _Wall Street Journal_ (page 1) reports that Kiribati
+# ``declared it the same day throught the country as of Jan. 1, 1995''
+# as part of the competition to be first into the 21st century.
+
+
+# Kwajalein
+
+# In comp.risks 14.87 (26 August 1993), Peter Neumann writes:
+# I wonder what happened in Kwajalein, where there was NO Friday,
+# 1993-08-20.  Thursday night at midnight Kwajalein switched sides with
+# respect to the International Date Line, to rejoin its fellow islands,
+# going from 11:59 p.m. Thursday to 12:00 m. Saturday in a blink.
+
+
+# N Mariana Is, Guam
+
+# Howse writes (p 153) ``The Spaniards, on the other hand, reached the
+# Philippines and the Ladrones from America,'' and implies that the Ladrones
+# (now called the Marianas) kept American date for quite some time.
+# For now, we assume the Ladrones switched at the same time as the Philippines;
+# see Asia/Manila.
+
+# US Public Law 106-564 (2000-12-23) made UTC+10 the official standard time,
+# under the name "Chamorro Standard Time".  There is no official abbreviation,
+# but Congressman Robert A. Underwood, author of the bill that became law,
+# wrote in a press release (2000-12-27) that he will seek the use of "ChST".
+
+
+# Micronesia
+
+# Alan Eugene Davis writes (1996-03-16),
+# ``I am certain, having lived there for the past decade, that "Truk"
+# (now properly known as Chuuk) ... is in the time zone GMT+10.''
+#
+# Shanks & Pottenger write that Truk switched from UTC+10 to UTC+11
+# on 1978-10-01; ignore this for now.
+
+# From Paul Eggert (1999-10-29):
+# The Federated States of Micronesia Visitors Board writes in
+# <a href="http://www.fsmgov.org/info/clocks.html">
+# The Federated States of Micronesia - Visitor Information
+# </a> (1999-01-26)
+# that Truk and Yap are UTC+10, and Ponape and Kosrae are UTC+11.
+# We don't know when Kosrae switched from UTC+12; assume January 1 for now.
+
+
+# Midway
+
+# From Charles T O'Connor, KMTH DJ (1956),
+# quoted in the KTMH section of the Radio Heritage Collection
+# <http://radiodx.com/spdxr/KMTH.htm> (2002-12-31):
+# For the past two months we've been on what is known as Daylight
+# Saving Time.  This time has put us on air at 5am in the morning,
+# your time down there in New Zealand.  Starting September 2, 1956
+# we'll again go back to Standard Time.  This'll mean that we'll go to
+# air at 6am your time.
+#
+# From Paul Eggert (2003-03-23):
+# We don't know the date of that quote, but we'll guess they
+# started DST on June 3.  Possibly DST was observed other years
+# in Midway, but we have no record of it.
+
+
+# Pitcairn
+
+# From Rives McDow (1999-11-08):
+# A Proclamation was signed by the Governor of Pitcairn on the 27th March 1998
+# with regard to Pitcairn Standard Time.  The Proclamation is as follows.
+#
+#      The local time for general purposes in the Islands shall be
+#      Co-ordinated Universal time minus 8 hours and shall be known
+#      as Pitcairn Standard Time.
+#
+# ... I have also seen Pitcairn listed as UTC minus 9 hours in several
+# references, and can only assume that this was an error in interpretation
+# somehow in light of this proclamation.
+
+# From Rives McDow (1999-11-09):
+# The Proclamation regarding Pitcairn time came into effect on 27 April 1998
+# ... at midnight.
+
+# From Howie Phelps (1999-11-10), who talked to a Pitcairner via shortwave:
+# Betty Christian told me yesterday that their local time is the same as
+# Pacific Standard Time. They used to be 1/2 hour different from us here in
+# Sacramento but it was changed a couple of years ago.
+
+
+# Samoa
+
+# Howse writes (p 153, citing p 10 of the 1883-11-18 New York Herald)
+# that in 1879 the King of Samoa decided to change
+# ``the date in his kingdom from the Antipodean to the American system,
+# ordaining -- by a masterpiece of diplomatic flattery -- that
+# the Fourth of July should be celebrated twice in that year.''
+
+
+# Tonga
+
+# From Paul Eggert (1996-01-22):
+# Today's _Wall Street Journal_ (p 1) reports that ``Tonga has been plotting
+# to sneak ahead of [New Zealanders] by introducing daylight-saving time.''
+# Since Kiribati has moved the Date Line it's not clear what Tonga will do.
+
+# Don Mundell writes in the 1997-02-20 Tonga Chronicle
+# <a href="http://www.tongatapu.net.to/tonga/homeland/timebegins.htm">
+# How Tonga became `The Land where Time Begins'
+# </a>:
+
+# Until 1941 Tonga maintained a standard time 50 minutes ahead of NZST
+# 12 hours and 20 minutes ahead of GMT.  When New Zealand adjusted its
+# standard time in 1940s, Tonga had the choice of subtracting from its
+# local time to come on the same standard time as New Zealand or of
+# advancing its time to maintain the differential of 13 degrees
+# (approximately 50 minutes ahead of New Zealand time).
+#
+# Because His Majesty King Taufa'ahau Tupou IV, then Crown Prince
+# Tungi, preferred to ensure Tonga's title as the land where time
+# begins, the Legislative Assembly approved the latter change.
+#
+# But some of the older, more conservative members from the outer
+# islands objected. "If at midnight on Dec. 31, we move ahead 40
+# minutes, as your Royal Highness wishes, what becomes of the 40
+# minutes we have lost?"
+#
+# The Crown Prince, presented an unanswerable argument: "Remember that
+# on the World Day of Prayer, you would be the first people on Earth
+# to say your prayers in the morning."
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
+
+# From Eric Ulevik (1999-05-03):
+# Tonga's director of tourism, who is also secretary of the National Millenium
+# Committee, has a plan to get Tonga back in front.
+# He has proposed a one-off move to tropical daylight saving for Tonga from
+# October to March, which has won approval in principle from the Tongan
+# Government.
+
+# From Steffen Thorsen (1999-09-09):
+# * Tonga will introduce DST in November
+#
+# I was given this link by John Letts:
+# <a href="http://news.bbc.co.uk/hi/english/world/asia-pacific/newsid_424000/424764.stm">
+# http://news.bbc.co.uk/hi/english/world/asia-pacific/newsid_424000/424764.stm
+# </a>
+#
+# I have not been able to find exact dates for the transition in November
+# yet. By reading this article it seems like Fiji will be 14 hours ahead
+# of UTC as well, but as far as I know Fiji will only be 13 hours ahead
+# (12 + 1 hour DST).
+
+# From Arthur David Olson (1999-09-20):
+# According to <a href="http://www.tongaonline.com/news/sept1799.html">
+# http://www.tongaonline.com/news/sept1799.html
+# </a>:
+# "Daylight Savings Time will take effect on Oct. 2 through April 15, 2000
+# and annually thereafter from the first Saturday in October through the
+# third Saturday of April.  Under the system approved by Privy Council on
+# Sept. 10, clocks must be turned ahead one hour on the opening day and
+# set back an hour on the closing date."
+# Alas, no indication of the time of day.
+
+# From Rives McDow (1999-10-06):
+# Tonga started its Daylight Saving on Saturday morning October 2nd at 0200am.
+# Daylight Saving ends on April 16 at 0300am which is Sunday morning.
+
+# From Steffen Thorsen (2000-10-31):
+# Back in March I found a notice on the website http://www.tongaonline.com
+# that Tonga changed back to standard time one month early, on March 19
+# instead of the original reported date April 16. Unfortunately, the article
+# is no longer available on the site, and I did not make a copy of the
+# text, and I have forgotten to report it here.
+# (Original URL was: http://www.tongaonline.com/news/march162000.htm )
+
+# From Rives McDow (2000-12-01):
+# Tonga is observing DST as of 2000-11-04 and will stop on 2001-01-27.
+
+# From Sione Moala-Mafi (2001-09-20) via Rives McDow:
+# At 2:00am on the first Sunday of November, the standard time in the Kingdom
+# shall be moved forward by one hour to 3:00am.  At 2:00am on the last Sunday
+# of January the standard time in the Kingdom shall be moved backward by one
+# hour to 1:00am.
+
+# From Pulu 'Anau (2002-11-05):
+# The law was for 3 years, supposedly to get renewed.  It wasn't.
+
+
+# Wake
+
+# From Vernice Anderson, Personal Secretary to Philip Jessup,
+# US Ambassador At Large (oral history interview, 1971-02-02):
+#
+# Saturday, the 14th [of October, 1950] -- ...  The time was all the
+# more confusing at that point, because we had crossed the
+# International Date Line, thus getting two Sundays.  Furthermore, we
+# discovered that Wake Island had two hours of daylight saving time
+# making calculation of time in Washington difficult if not almost
+# impossible.
+#
+# http://www.trumanlibrary.org/wake/meeting.htm
+
+# From Paul Eggert (2003-03-23):
+# We have no other report of DST in Wake Island, so omit this info for now.
+
+###############################################################################
+
+# The International Date Line
+
+# From Gwillim Law (2000-01-03):
+#
+# The International Date Line is not defined by any international standard,
+# convention, or treaty.  Mapmakers are free to draw it as they please.
+# Reputable mapmakers will simply ensure that every point of land appears on
+# the correct side of the IDL, according to the date legally observed there.
+#
+# When Kiribati adopted a uniform date in 1995, thereby moving the Phoenix and
+# Line Islands to the west side of the IDL (or, if you prefer, moving the IDL
+# to the east side of the Phoenix and Line Islands), I suppose that most
+# mapmakers redrew the IDL following the boundary of Kiribati.  Even that line
+# has a rather arbitrary nature.  The straight-line boundaries between Pacific
+# island nations that are shown on many maps are based on an international
+# convention, but are not legally binding national borders.... The date is
+# governed by the IDL; therefore, even on the high seas, there may be some
+# places as late as fourteen hours later than UTC.  And, since the IDL is not
+# an international standard, there are some places on the high seas where the
+# correct date is ambiguous.
+
+# From Wikipedia <http://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
+# Before 1920, all ships kept local apparent time on the high seas by setting
+# their clocks at night or at the morning sight so that, given the ship's
+# speed and direction, it would be 12 o'clock when the Sun crossed the ship's
+# meridian (12 o'clock = local apparent noon).  During 1917, at the
+# Anglo-French Conference on Time-keeping at Sea, it was recommended that all
+# ships, both military and civilian, should adopt hourly standard time zones
+# on the high seas.  Whenever a ship was within the territorial waters of any
+# nation it would use that nation's standard time.  The captain was permitted
+# to change his ship's clocks at a time of his choice following his ship's
+# entry into another zone time--he often chose midnight.  These zones were
+# adopted by all major fleets between 1920 and 1925 but not by many
+# independent merchant ships until World War II.
+
+# From Paul Eggert, using references suggested by Oscar van Vlijmen
+# (2005-03-20):
+#
+# The American Practical Navigator (2002)
+# <http://pollux.nss.nima.mil/pubs/pubs_j_apn_sections.html?rid=187>
+# talks only about the 180-degree meridian with respect to ships in
+# international waters; it ignores the international date line.
diff --git a/extra/zoneinfo/authors.txt b/extra/zoneinfo/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/extra/zoneinfo/europe b/extra/zoneinfo/europe
new file mode 100644 (file)
index 0000000..09f3e1e
--- /dev/null
@@ -0,0 +1,2647 @@
+# @(#)europe   8.20
+# <pre>
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1991, and IATA SSIM is the source for entries afterwards.
+#
+# Other sources occasionally used include:
+#
+#      Edward W. Whitman, World Time Differences,
+#      Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
+#      which I found in the UCLA library.
+#
+#      <a href="http://www.pettswoodvillage.co.uk/Daylight_Savings_William_Willett.pdf">
+#      William Willett, The Waste of Daylight, 19th edition
+#      </a> (1914-03)
+#
+#      Brazil's Departamento Servico da Hora (DSH),
+#      <a href="http://pcdsh01.on.br/HISTHV.htm">
+#      History of Summer Time
+#      </a> (1998-09-21, in Portuguese)
+
+#
+# I invented the abbreviations marked `*' in the following table;
+# the rest are from earlier versions of this file, or from other sources.
+# Corrections are welcome!
+#                   std dst  2dst
+#                   LMT           Local Mean Time
+#       -4:00       AST ADT       Atlantic
+#       -3:00       WGT WGST      Western Greenland*
+#       -1:00       EGT EGST      Eastern Greenland*
+#        0:00       GMT BST  BDST Greenwich, British Summer
+#        0:00       GMT IST       Greenwich, Irish Summer
+#        0:00       WET WEST WEMT Western Europe
+#        0:19:32.13 AMT NST       Amsterdam, Netherlands Summer (1835-1937)*
+#        0:20       NET NEST      Netherlands (1937-1940)*
+#        1:00       CET CEST CEMT Central Europe
+#        1:00:14    SET           Swedish (1879-1899)*
+#        2:00       EET EEST      Eastern Europe
+#        3:00       MSK MSD       Moscow
+#
+# A reliable and entertaining source about time zones, especially in Britain,
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+
+# From Peter Ilieve (1994-12-04),
+# The original six [EU members]: Belgium, France, (West) Germany, Italy,
+# Luxembourg, the Netherlands.
+# Plus, from 1 Jan 73: Denmark, Ireland, United Kingdom.
+# Plus, from 1 Jan 81: Greece.
+# Plus, from 1 Jan 86: Spain, Portugal.
+# Plus, from 1 Jan 95: Austria, Finland, Sweden. (Norway negotiated terms for
+# entry but in a referendum on 28 Nov 94 the people voted No by 52.2% to 47.8%
+# on a turnout of 88.6%. This was almost the same result as Norway's previous
+# referendum in 1972, they are the only country to have said No twice.
+# Referendums in the other three countries voted Yes.)
+# ...
+# Estonia ... uses EU dates but not at 01:00 GMT, they use midnight GMT.
+# I don't think they know yet what they will do from 1996 onwards.
+# ...
+# There shouldn't be any [current members who are not using EU rules].
+# A Directive has the force of law, member states are obliged to enact
+# national law to implement it. The only contentious issue was the
+# different end date for the UK and Ireland, and this was always allowed
+# in the Directive.
+
+
+###############################################################################
+
+# Britain (United Kingdom) and Ireland (Eire)
+
+# From Peter Ilieve (1994-07-06):
+#
+# On 17 Jan 1994 the Independent, a UK quality newspaper, had a piece about
+# historical vistas along the Thames in west London. There was a photo
+# and a sketch map showing some of the sightlines involved. One paragraph
+# of the text said:
+#
+# `An old stone obelisk marking a forgotten terrestrial meridian stands
+# beside the river at Kew. In the 18th century, before time and longitude
+# was standardised by the Royal Observatory in Greenwich, scholars observed
+# this stone and the movement of stars from Kew Observatory nearby. They
+# made their calculations and set the time for the Horse Guards and Parliament,
+# but now the stone is obscured by scrubwood and can only be seen by walking
+# along the towpath within a few yards of it.'
+#
+# I have a one inch to one mile map of London and my estimate of the stone's
+# position is 51 deg. 28' 30" N, 0 deg. 18' 45" W. The longitude should
+# be within about +-2". The Ordnance Survey grid reference is TQ172761.
+#
+# [This yields GMTOFF = -0:01:15 for London LMT in the 18th century.]
+
+# From Paul Eggert (1993-11-18):
+#
+# Howse writes that Britain was the first country to use standard time.
+# The railways cared most about the inconsistencies of local mean time,
+# and it was they who forced a uniform time on the country.
+# The original idea was credited to Dr. William Hyde Wollaston (1766-1828)
+# and was popularized by Abraham Follett Osler (1808-1903).
+# The first railway to adopt London time was the Great Western Railway
+# in November 1840; other railways followed suit, and by 1847 most
+# (though not all) railways used London time.  On 1847-09-22 the
+# Railway Clearing House, an industry standards body, recommended that GMT be
+# adopted at all stations as soon as the General Post Office permitted it.
+# The transition occurred on 12-01 for the L&NW, the Caledonian,
+# and presumably other railways; the January 1848 Bradshaw's lists many
+# railways as using GMT.  By 1855 the vast majority of public
+# clocks in Britain were set to GMT (though some, like the great clock
+# on Tom Tower at Christ Church, Oxford, were fitted with two minute hands,
+# one for local time and one for GMT).  The last major holdout was the legal
+# system, which stubbornly stuck to local time for many years, leading
+# to oddities like polls opening at 08:13 and closing at 16:13.
+# The legal system finally switched to GMT when the Statutes (Definition
+# of Time) Act took effect; it received the Royal Assent on 1880-08-02.
+#
+# In the tables below, we condense this complicated story into a single
+# transition date for London, namely 1847-12-01.  We don't know as much
+# about Dublin, so we use 1880-08-02, the legal transition time.
+
+# From Paul Eggert (2003-09-27):
+# Summer Time was first seriously proposed by William Willett (1857-1915),
+# a London builder and member of the Royal Astronomical Society
+# who circulated a pamphlet ``The Waste of Daylight'' (1907)
+# that proposed advancing clocks 20 minutes on each of four Sundays in April,
+# and retarding them by the same amount on four Sundays in September.
+# A bill was drafted in 1909 and introduced in Parliament several times,
+# but it met with ridicule and opposition, especially from farming interests.
+# Later editions of the pamphlet proposed one-hour summer time, and
+# it was eventually adopted as a wartime measure in 1916.
+# See: Summer Time Arrives Early, The Times (2000-05-18).
+# A monument to Willett was unveiled on 1927-05-21, in an open space in
+# a 45-acre wood near Chislehurst, Kent that was purchased by popular
+# subscription and open to the public.  On the south face of the monolith,
+# designed by G. W. Miller, is the the William Willett Memorial Sundial,
+# which is permanently set to Summer Time.
+
+# From Winston Churchill (1934-04-28):
+# It is one of the paradoxes of history that we should owe the boon of
+# summer time, which gives every year to the people of this country
+# between 160 and 170 hours more daylight leisure, to a war which
+# plunged Europe into darkness for four years, and shook the
+# foundations of civilization throughout the world.
+#      -- <a href="http://www.winstonchurchill.org/fh114willett.htm">
+#      "A Silent Toast to William Willett", Pictorial Weekly
+#      </a>
+
+# From Paul Eggert (1996-09-03):
+# The OED Supplement says that the English originally said ``Daylight Saving''
+# when they were debating the adoption of DST in 1908; but by 1916 this
+# term appears only in quotes taken from DST's opponents, whereas the
+# proponents (who eventually won the argument) are quoted as using ``Summer''.
+
+# From Arthur David Olson (1989-01-19):
+#
+# A source at the British Information Office in New York avers that it's
+# known as "British" Summer Time in all parts of the United Kingdom.
+
+# Date: 4 Jan 89 08:57:25 GMT (Wed)
+# From: Jonathan Leffler
+# [British Summer Time] is fixed annually by Act of Parliament.
+# If you can predict what Parliament will do, you should be in
+# politics making a fortune, not computing.
+
+# From Chris Carrier (1996-06-14):
+# I remember reading in various wartime issues of the London Times the
+# acronym BDST for British Double Summer Time.  Look for the published
+# time of sunrise and sunset in The Times, when BDST was in effect, and
+# if you find a zone reference it will say, "All times B.D.S.T."
+
+# From Joseph S. Myers (1999-09-02):
+# ... some military cables (WO 219/4100 - this is a copy from the
+# main SHAEF archives held in the US National Archives, SHAEF/5252/8/516)
+# agree that the usage is BDST (this appears in a message dated 17 Feb 1945).
+
+# From Joseph S. Myers (2000-10-03):
+# On 18th April 1941, Sir Stephen Tallents of the BBC wrote to Sir
+# Alexander Maxwell of the Home Office asking whether there was any
+# official designation; the reply of the 21st was that there wasn't
+# but he couldn't think of anything better than the "Double British
+# Summer Time" that the BBC had been using informally.
+# http://student.cusu.cam.ac.uk/~jsm28/british-time/bbc-19410418.png
+# http://student.cusu.cam.ac.uk/~jsm28/british-time/ho-19410421.png
+
+# From Sir Alexander Maxwell in the above-mentioned letter (1941-04-21):
+# [N]o official designation has as far as I know been adopted for the time
+# which is to be introduced in May....
+# I cannot think of anything better than "Double British Summer Time"
+# which could not be said to run counter to any official description.
+
+# From Paul Eggert (2000-10-02):
+# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common
+# and follows the more usual convention of putting the location name first,
+# so we use `BDST'.
+
+# Peter Ilieve (1998-04-19) described at length
+# the history of summer time legislation in the United Kingdom.
+# Since 1998 Joseph S. Myers has been updating
+# and extending this list, which can be found in
+# <a href="http://student.cusu.cam.ac.uk/~jsm28/british-time/">
+# History of legal time in Britain
+# </a>
+
+# From Joseph S. Myers (1998-01-06):
+#
+# The legal time in the UK outside of summer time is definitely GMT, not UTC;
+# see Lord Tanlaw's speech
+# <a href="http://www.parliament.the-stationery-office.co.uk/pa/ld199697/ldhansrd/pdvn/lds97/text/70611-20.htm#70611-20_head0">
+# (Lords Hansard 11 June 1997 columns 964 to 976)
+# </a>.
+
+# From Paul Eggert (2006-03-22):
+#
+# For lack of other data, follow Shanks & Pottenger for Eire in 1940-1948.
+#
+# Given Ilieve and Myers's data, the following claims by Shanks & Pottenger
+# are incorrect:
+#     * Wales did not switch from GMT to daylight saving time until
+#      1921 Apr 3, when they began to conform with the rest of Great Britain.
+# Actually, Wales was identical after 1880.
+#     * Eire had two transitions on 1916 Oct 1.
+# It actually just had one transition.
+#     * Northern Ireland used single daylight saving time throughout WW II.
+# Actually, it conformed to Britain.
+#     * GB-Eire changed standard time to 1 hour ahead of GMT on 1968-02-18.
+# Actually, that date saw the usual switch to summer time.
+# Standard time was not changed until 1968-10-27 (the clocks didn't change).
+#
+# Here is another incorrect claim by Shanks & Pottenger:
+#     * Jersey, Guernsey, and the Isle of Man did not switch from GMT
+#      to daylight saving time until 1921 Apr 3, when they began to
+#      conform with Great Britain.
+# S.R.&O. 1916, No. 382 and HO 45/10811/312364 (quoted above) say otherwise.
+#
+# The following claim by Shanks & Pottenger is possible though doubtful;
+# we'll ignore it for now.
+#     * Dublin's 1971-10-31 switch was at 02:00, even though London's was 03:00.
+#
+#
+# Whitman says Dublin Mean Time was -0:25:21, which is more precise than
+# Shanks & Pottenger.
+# Perhaps this was Dunsink Observatory Time, as Dunsink Observatory
+# (8 km NW of Dublin's center) seemingly was to Dublin as Greenwich was
+# to London.  For example:
+#
+#   "Timeball on the ballast office is down.  Dunsink time."
+#   -- James Joyce, Ulysses
+
+# From Joseph S. Myers (2005-01-26):
+# Irish laws are available online at www.irishstatutebook.ie.  These include
+# various relating to legal time, for example:
+#
+# ZZA13Y1923.html ZZA12Y1924.html ZZA8Y1925.html ZZSIV20PG1267.html
+#
+# ZZSI71Y1947.html ZZSI128Y1948.html ZZSI23Y1949.html ZZSI41Y1950.html
+# ZZSI27Y1951.html ZZSI73Y1952.html
+#
+# ZZSI11Y1961.html ZZSI232Y1961.html ZZSI182Y1962.html
+# ZZSI167Y1963.html ZZSI257Y1964.html ZZSI198Y1967.html
+# ZZA23Y1968.html ZZA17Y1971.html
+#
+# ZZSI67Y1981.html ZZSI212Y1982.html ZZSI45Y1986.html
+# ZZSI264Y1988.html ZZSI52Y1990.html ZZSI371Y1992.html
+# ZZSI395Y1994.html ZZSI484Y1997.html ZZSI506Y2001.html
+#
+# [These are all relative to the root, e.g., the first is
+# <http://www.irishstatutebook.ie/ZZA13Y1923.html>.]
+#
+# (These are those I found, but there could be more.  In any case these
+# should allow various updates to the comments in the europe file to cover
+# the laws applicable in Ireland.)
+#
+# (Note that the time in the Republic of Ireland since 1968 has been defined
+# in terms of standard time being GMT+1 with a period of winter time when it
+# is GMT, rather than standard time being GMT with a period of summer time
+# being GMT+1.)
+
+# From Paul Eggert (1999-03-28):
+# Clive Feather (<news:859845706.26043.0@office.demon.net>, 1997-03-31)
+# reports that Folkestone (Cheriton) Shuttle Terminal uses Concession Time
+# (CT), equivalent to French civil time.
+# Julian Hill (<news:36118128.5A14@virgin.net>, 1998-09-30) reports that
+# trains between Dollands Moor (the freight facility next door)
+# and Frethun run in CT.
+# My admittedly uninformed guess is that the terminal has two authorities,
+# the French concession operators and the British civil authorities,
+# and that the time depends on who you're talking to.
+# If, say, the British police were called to the station for some reason,
+# I would expect the official police report to use GMT/BST and not CET/CEST.
+# This is a borderline case, but for now let's stick to GMT/BST.
+
+# From an anonymous contributor (1996-06-02):
+# The law governing time in Ireland is under Statutory Instrument SI 395/94,
+# which gives force to European Union 7th Council Directive # 94/21/EC.
+# Under this directive, the Minister for Justice in Ireland makes appropriate
+# regulations. I spoke this morning with the Secretary of the Department of
+# Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
+# "Irish Summer Time", abbreviated to "IST".
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# Summer Time Act, 1916
+Rule   GB-Eire 1916    only    -       May     21      2:00s   1:00    BST
+Rule   GB-Eire 1916    only    -       Oct      1      2:00s   0       GMT
+# S.R.&O. 1917, No. 358
+Rule   GB-Eire 1917    only    -       Apr      8      2:00s   1:00    BST
+Rule   GB-Eire 1917    only    -       Sep     17      2:00s   0       GMT
+# S.R.&O. 1918, No. 274
+Rule   GB-Eire 1918    only    -       Mar     24      2:00s   1:00    BST
+Rule   GB-Eire 1918    only    -       Sep     30      2:00s   0       GMT
+# S.R.&O. 1919, No. 297
+Rule   GB-Eire 1919    only    -       Mar     30      2:00s   1:00    BST
+Rule   GB-Eire 1919    only    -       Sep     29      2:00s   0       GMT
+# S.R.&O. 1920, No. 458
+Rule   GB-Eire 1920    only    -       Mar     28      2:00s   1:00    BST
+# S.R.&O. 1920, No. 1844
+Rule   GB-Eire 1920    only    -       Oct     25      2:00s   0       GMT
+# S.R.&O. 1921, No. 363
+Rule   GB-Eire 1921    only    -       Apr      3      2:00s   1:00    BST
+Rule   GB-Eire 1921    only    -       Oct      3      2:00s   0       GMT
+# S.R.&O. 1922, No. 264
+Rule   GB-Eire 1922    only    -       Mar     26      2:00s   1:00    BST
+Rule   GB-Eire 1922    only    -       Oct      8      2:00s   0       GMT
+# The Summer Time Act, 1922
+Rule   GB-Eire 1923    only    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1923    1924    -       Sep     Sun>=16 2:00s   0       GMT
+Rule   GB-Eire 1924    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1925    1926    -       Apr     Sun>=16 2:00s   1:00    BST
+# The Summer Time Act, 1925
+Rule   GB-Eire 1925    1938    -       Oct     Sun>=2  2:00s   0       GMT
+Rule   GB-Eire 1927    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1928    1929    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1930    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1931    1932    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1933    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1934    only    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1935    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1936    1937    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1938    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1939    only    -       Apr     Sun>=16 2:00s   1:00    BST
+# S.R.&O. 1939, No. 1379
+Rule   GB-Eire 1939    only    -       Nov     Sun>=16 2:00s   0       GMT
+# S.R.&O. 1940, No. 172 and No. 1883
+Rule   GB-Eire 1940    only    -       Feb     Sun>=23 2:00s   1:00    BST
+# S.R.&O. 1941, No. 476
+Rule   GB-Eire 1941    only    -       May     Sun>=2  1:00s   2:00    BDST
+Rule   GB-Eire 1941    1943    -       Aug     Sun>=9  1:00s   1:00    BST
+# S.R.&O. 1942, No. 506
+Rule   GB-Eire 1942    1944    -       Apr     Sun>=2  1:00s   2:00    BDST
+# S.R.&O. 1944, No. 932
+Rule   GB-Eire 1944    only    -       Sep     Sun>=16 1:00s   1:00    BST
+# S.R.&O. 1945, No. 312
+Rule   GB-Eire 1945    only    -       Apr     Mon>=2  1:00s   2:00    BDST
+Rule   GB-Eire 1945    only    -       Jul     Sun>=9  1:00s   1:00    BST
+# S.R.&O. 1945, No. 1208
+Rule   GB-Eire 1945    1946    -       Oct     Sun>=2  2:00s   0       GMT
+Rule   GB-Eire 1946    only    -       Apr     Sun>=9  2:00s   1:00    BST
+# The Summer Time Act, 1947
+Rule   GB-Eire 1947    only    -       Mar     16      2:00s   1:00    BST
+Rule   GB-Eire 1947    only    -       Apr     13      1:00s   2:00    BDST
+Rule   GB-Eire 1947    only    -       Aug     10      1:00s   1:00    BST
+Rule   GB-Eire 1947    only    -       Nov      2      2:00s   0       GMT
+# Summer Time Order, 1948 (S.I. 1948/495)
+Rule   GB-Eire 1948    only    -       Mar     14      2:00s   1:00    BST
+Rule   GB-Eire 1948    only    -       Oct     31      2:00s   0       GMT
+# Summer Time Order, 1949 (S.I. 1949/373)
+Rule   GB-Eire 1949    only    -       Apr      3      2:00s   1:00    BST
+Rule   GB-Eire 1949    only    -       Oct     30      2:00s   0       GMT
+# Summer Time Order, 1950 (S.I. 1950/518)
+# Summer Time Order, 1951 (S.I. 1951/430)
+# Summer Time Order, 1952 (S.I. 1952/451)
+Rule   GB-Eire 1950    1952    -       Apr     Sun>=14 2:00s   1:00    BST
+Rule   GB-Eire 1950    1952    -       Oct     Sun>=21 2:00s   0       GMT
+# revert to the rules of the Summer Time Act, 1925
+Rule   GB-Eire 1953    only    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1953    1960    -       Oct     Sun>=2  2:00s   0       GMT
+Rule   GB-Eire 1954    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1955    1956    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1957    only    -       Apr     Sun>=9  2:00s   1:00    BST
+Rule   GB-Eire 1958    1959    -       Apr     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1960    only    -       Apr     Sun>=9  2:00s   1:00    BST
+# Summer Time Order, 1961 (S.I. 1961/71)
+# Summer Time (1962) Order, 1961 (S.I. 1961/2465)
+# Summer Time Order, 1963 (S.I. 1963/81)
+Rule   GB-Eire 1961    1963    -       Mar     lastSun 2:00s   1:00    BST
+Rule   GB-Eire 1961    1968    -       Oct     Sun>=23 2:00s   0       GMT
+# Summer Time (1964) Order, 1963 (S.I. 1963/2101)
+# Summer Time Order, 1964 (S.I. 1964/1201)
+# Summer Time Order, 1967 (S.I. 1967/1148)
+Rule   GB-Eire 1964    1967    -       Mar     Sun>=19 2:00s   1:00    BST
+# Summer Time Order, 1968 (S.I. 1968/117)
+Rule   GB-Eire 1968    only    -       Feb     18      2:00s   1:00    BST
+# The British Standard Time Act, 1968
+#      (no summer time)
+# The Summer Time Act, 1972
+Rule   GB-Eire 1972    1980    -       Mar     Sun>=16 2:00s   1:00    BST
+Rule   GB-Eire 1972    1980    -       Oct     Sun>=23 2:00s   0       GMT
+# Summer Time Order, 1980 (S.I. 1980/1089)
+# Summer Time Order, 1982 (S.I. 1982/1673)
+# Summer Time Order, 1986 (S.I. 1986/223)
+# Summer Time Order, 1988 (S.I. 1988/931)
+Rule   GB-Eire 1981    1995    -       Mar     lastSun 1:00u   1:00    BST
+Rule   GB-Eire 1981    1989    -       Oct     Sun>=23 1:00u   0       GMT
+# Summer Time Order, 1989 (S.I. 1989/985)
+# Summer Time Order, 1992 (S.I. 1992/1729)
+# Summer Time Order 1994 (S.I. 1994/2798)
+Rule   GB-Eire 1990    1995    -       Oct     Sun>=22 1:00u   0       GMT
+# Summer Time Order 1997 (S.I. 1997/2982)
+# See EU for rules starting in 1996.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/London   -0:01:15 -      LMT     1847 Dec  1 0:00s
+                        0:00   GB-Eire %s      1968 Oct 27
+                        1:00   -       BST     1971 Oct 31 2:00u
+                        0:00   GB-Eire %s      1996
+                        0:00   EU      GMT/BST
+Link   Europe/London   Europe/Jersey
+Link   Europe/London   Europe/Guernsey
+Link   Europe/London   Europe/Isle_of_Man
+Zone   Europe/Dublin   -0:25:00 -      LMT     1880 Aug  2
+                       -0:25:21 -      DMT     1916 May 21 2:00
+                       -0:25:21 1:00   IST     1916 Oct  1 2:00s
+                        0:00   GB-Eire %s      1921 Dec  6 # independence
+                        0:00   GB-Eire GMT/IST 1940 Feb 25 2:00
+                        0:00   1:00    IST     1946 Oct  6 2:00
+                        0:00   -       GMT     1947 Mar 16 2:00
+                        0:00   1:00    IST     1947 Nov  2 2:00
+                        0:00   -       GMT     1948 Apr 18 2:00
+                        0:00   GB-Eire GMT/IST 1968 Oct 27
+                        1:00   -       IST     1971 Oct 31 2:00u
+                        0:00   GB-Eire GMT/IST 1996
+                        0:00   EU      GMT/IST
+
+###############################################################################
+
+# Europe
+
+# EU rules are for the European Union, previously known as the EC, EEC,
+# Common Market, etc.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   EU      1977    1980    -       Apr     Sun>=1   1:00u  1:00    S
+Rule   EU      1977    only    -       Sep     lastSun  1:00u  0       -
+Rule   EU      1978    only    -       Oct      1       1:00u  0       -
+Rule   EU      1979    1995    -       Sep     lastSun  1:00u  0       -
+Rule   EU      1981    max     -       Mar     lastSun  1:00u  1:00    S
+Rule   EU      1996    max     -       Oct     lastSun  1:00u  0       -
+# The most recent directive covers the years starting in 2002.  See:
+# <a href="http://europa.eu.int/eur-lex/en/lif/dat/2000/en_300L0084.html">
+# Directive 2000/84/EC of the European Parliament and of the Council
+# of 19 January 2001 on summer-time arrangements.
+# </a>
+
+# W-Eur differs from EU only in that W-Eur uses standard time.
+Rule   W-Eur   1977    1980    -       Apr     Sun>=1   1:00s  1:00    S
+Rule   W-Eur   1977    only    -       Sep     lastSun  1:00s  0       -
+Rule   W-Eur   1978    only    -       Oct      1       1:00s  0       -
+Rule   W-Eur   1979    1995    -       Sep     lastSun  1:00s  0       -
+Rule   W-Eur   1981    max     -       Mar     lastSun  1:00s  1:00    S
+Rule   W-Eur   1996    max     -       Oct     lastSun  1:00s  0       -
+
+# Older C-Eur rules are for convenience in the tables.
+# From 1977 on, C-Eur differs from EU only in that C-Eur uses standard time.
+Rule   C-Eur   1916    only    -       Apr     30      23:00   1:00    S
+Rule   C-Eur   1916    only    -       Oct      1       1:00   0       -
+Rule   C-Eur   1917    1918    -       Apr     Mon>=15  2:00s  1:00    S
+Rule   C-Eur   1917    1918    -       Sep     Mon>=15  2:00s  0       -
+Rule   C-Eur   1940    only    -       Apr      1       2:00s  1:00    S
+Rule   C-Eur   1942    only    -       Nov      2       2:00s  0       -
+Rule   C-Eur   1943    only    -       Mar     29       2:00s  1:00    S
+Rule   C-Eur   1943    only    -       Oct      4       2:00s  0       -
+Rule   C-Eur   1944    1945    -       Apr     Mon>=1   2:00s  1:00    S
+# Whitman gives 1944 Oct 7; go with Shanks & Pottenger.
+Rule   C-Eur   1944    only    -       Oct      2       2:00s  0       -
+# From Jesper Norgaard Welen (2008-07-13):
+#
+# I found what is probably a typo of 2:00 which should perhaps be 2:00s
+# in the C-Eur rule from tz database version 2008d (this part was
+# corrected in version 2008d). The circumstancial evidence is simply the
+# tz database itself, as seen below:
+#
+# Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15  0:01
+#    0:00 France WE%sT 1945 Sep 16  3:00
+#
+# Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
+#    0:00 France WE%sT 1945 Sep 16 3:00
+#
+# Zone Europe/Belgrade 1:22:00 - LMT 1884
+#    1:00 1:00 CEST 1945 Sep 16  2:00s
+#
+# Rule France 1945 only - Sep 16  3:00 0 -
+# Rule Belgium 1945 only - Sep 16  2:00s 0 -
+# Rule Neth 1945 only - Sep 16 2:00s 0 -
+#
+# The rule line to be changed is:
+#
+# Rule C-Eur 1945 only - Sep 16  2:00 0 -
+#
+# It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
+# 2:00 standard time, e.g. 3:00 local time.  However there are no
+# countries that use C-Eur rules in September 1945, so the only items
+# affected are apparently these ficticious zones that translates acronyms
+# CET and MET:
+#
+# Zone CET  1:00 C-Eur CE%sT
+# Zone MET  1:00 C-Eur ME%sT
+#
+# It this is right then the corrected version would look like:
+#
+# Rule C-Eur 1945 only - Sep 16  2:00s 0 -
+#
+# A small step for mankind though 8-)
+Rule   C-Eur   1945    only    -       Sep     16       2:00s  0       -
+Rule   C-Eur   1977    1980    -       Apr     Sun>=1   2:00s  1:00    S
+Rule   C-Eur   1977    only    -       Sep     lastSun  2:00s  0       -
+Rule   C-Eur   1978    only    -       Oct      1       2:00s  0       -
+Rule   C-Eur   1979    1995    -       Sep     lastSun  2:00s  0       -
+Rule   C-Eur   1981    max     -       Mar     lastSun  2:00s  1:00    S
+Rule   C-Eur   1996    max     -       Oct     lastSun  2:00s  0       -
+
+# E-Eur differs from EU only in that E-Eur switches at midnight local time.
+Rule   E-Eur   1977    1980    -       Apr     Sun>=1   0:00   1:00    S
+Rule   E-Eur   1977    only    -       Sep     lastSun  0:00   0       -
+Rule   E-Eur   1978    only    -       Oct      1       0:00   0       -
+Rule   E-Eur   1979    1995    -       Sep     lastSun  0:00   0       -
+Rule   E-Eur   1981    max     -       Mar     lastSun  0:00   1:00    S
+Rule   E-Eur   1996    max     -       Oct     lastSun  0:00   0       -
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Russia  1917    only    -       Jul      1      23:00   1:00    MST     # Moscow Summer Time
+Rule   Russia  1917    only    -       Dec     28       0:00   0       MMT     # Moscow Mean Time
+Rule   Russia  1918    only    -       May     31      22:00   2:00    MDST    # Moscow Double Summer Time
+Rule   Russia  1918    only    -       Sep     16       1:00   1:00    MST
+Rule   Russia  1919    only    -       May     31      23:00   2:00    MDST
+Rule   Russia  1919    only    -       Jul      1       2:00   1:00    S
+Rule   Russia  1919    only    -       Aug     16       0:00   0       -
+Rule   Russia  1921    only    -       Feb     14      23:00   1:00    S
+Rule   Russia  1921    only    -       Mar     20      23:00   2:00    M # Midsummer
+Rule   Russia  1921    only    -       Sep      1       0:00   1:00    S
+Rule   Russia  1921    only    -       Oct      1       0:00   0       -
+# Act No.925 of the Council of Ministers of the USSR (1980-10-24):
+Rule   Russia  1981    1984    -       Apr      1       0:00   1:00    S
+Rule   Russia  1981    1983    -       Oct      1       0:00   0       -
+# Act No.967 of the Council of Ministers of the USSR (1984-09-13), repeated in
+# Act No.227 of the Council of Ministers of the USSR (1989-03-14):
+Rule   Russia  1984    1991    -       Sep     lastSun  2:00s  0       -
+Rule   Russia  1985    1991    -       Mar     lastSun  2:00s  1:00    S
+#
+Rule   Russia  1992    only    -       Mar     lastSat  23:00  1:00    S
+Rule   Russia  1992    only    -       Sep     lastSat  23:00  0       -
+Rule   Russia  1993    max     -       Mar     lastSun  2:00s  1:00    S
+Rule   Russia  1993    1995    -       Sep     lastSun  2:00s  0       -
+Rule   Russia  1996    max     -       Oct     lastSun  2:00s  0       -
+
+# These are for backward compatibility with older versions.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   WET             0:00    EU      WE%sT
+Zone   CET             1:00    C-Eur   CE%sT
+Zone   MET             1:00    C-Eur   ME%sT
+Zone   EET             2:00    EU      EE%sT
+
+# Previous editions of this database used abbreviations like MET DST
+# for Central European Summer Time, but this didn't agree with common usage.
+
+# From Markus Kuhn (1996-07-12):
+# The official German names ... are
+#
+#      Mitteleuropaeische Zeit (MEZ)         = UTC+01:00
+#      Mitteleuropaeische Sommerzeit (MESZ)  = UTC+02:00
+#
+# as defined in the German Time Act (Gesetz ueber die Zeitbestimmung (ZeitG),
+# 1978-07-25, Bundesgesetzblatt, Jahrgang 1978, Teil I, S. 1110-1111)....
+# I wrote ... to the German Federal Physical-Technical Institution
+#
+#      Physikalisch-Technische Bundesanstalt (PTB)
+#      Laboratorium 4.41 "Zeiteinheit"
+#      Postfach 3345
+#      D-38023 Braunschweig
+#      phone: +49 531 592-0
+#
+# ... I received today an answer letter from Dr. Peter Hetzel, head of the PTB
+# department for time and frequency transmission.  He explained that the
+# PTB translates MEZ and MESZ into English as
+#
+#      Central European Time (CET)         = UTC+01:00
+#      Central European Summer Time (CEST) = UTC+02:00
+
+
+# Albania
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Albania 1940    only    -       Jun     16      0:00    1:00    S
+Rule   Albania 1942    only    -       Nov      2      3:00    0       -
+Rule   Albania 1943    only    -       Mar     29      2:00    1:00    S
+Rule   Albania 1943    only    -       Apr     10      3:00    0       -
+Rule   Albania 1974    only    -       May      4      0:00    1:00    S
+Rule   Albania 1974    only    -       Oct      2      0:00    0       -
+Rule   Albania 1975    only    -       May      1      0:00    1:00    S
+Rule   Albania 1975    only    -       Oct      2      0:00    0       -
+Rule   Albania 1976    only    -       May      2      0:00    1:00    S
+Rule   Albania 1976    only    -       Oct      3      0:00    0       -
+Rule   Albania 1977    only    -       May      8      0:00    1:00    S
+Rule   Albania 1977    only    -       Oct      2      0:00    0       -
+Rule   Albania 1978    only    -       May      6      0:00    1:00    S
+Rule   Albania 1978    only    -       Oct      1      0:00    0       -
+Rule   Albania 1979    only    -       May      5      0:00    1:00    S
+Rule   Albania 1979    only    -       Sep     30      0:00    0       -
+Rule   Albania 1980    only    -       May      3      0:00    1:00    S
+Rule   Albania 1980    only    -       Oct      4      0:00    0       -
+Rule   Albania 1981    only    -       Apr     26      0:00    1:00    S
+Rule   Albania 1981    only    -       Sep     27      0:00    0       -
+Rule   Albania 1982    only    -       May      2      0:00    1:00    S
+Rule   Albania 1982    only    -       Oct      3      0:00    0       -
+Rule   Albania 1983    only    -       Apr     18      0:00    1:00    S
+Rule   Albania 1983    only    -       Oct      1      0:00    0       -
+Rule   Albania 1984    only    -       Apr      1      0:00    1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Tirane   1:19:20 -       LMT     1914
+                       1:00    -       CET     1940 Jun 16
+                       1:00    Albania CE%sT   1984 Jul
+                       1:00    EU      CE%sT
+
+# Andorra
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Andorra  0:06:04 -       LMT     1901
+                       0:00    -       WET     1946 Sep 30
+                       1:00    -       CET     1985 Mar 31 2:00
+                       1:00    EU      CE%sT
+
+# Austria
+
+# From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and
+# 1945-11-18, but the Austrian Federal Office of Metrology and
+# Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged"
+# date of 1945-04-12 with no time.  For the 1980-04-06 transition
+# Shanks & Pottenger give 02:00, the BEV 00:00.  Go with the BEV,
+# and guess 02:00 for 1945-04-12.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Austria 1920    only    -       Apr      5      2:00s   1:00    S
+Rule   Austria 1920    only    -       Sep     13      2:00s   0       -
+Rule   Austria 1946    only    -       Apr     14      2:00s   1:00    S
+Rule   Austria 1946    1948    -       Oct     Sun>=1  2:00s   0       -
+Rule   Austria 1947    only    -       Apr      6      2:00s   1:00    S
+Rule   Austria 1948    only    -       Apr     18      2:00s   1:00    S
+Rule   Austria 1980    only    -       Apr      6      0:00    1:00    S
+Rule   Austria 1980    only    -       Sep     28      0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Vienna   1:05:20 -       LMT     1893 Apr
+                       1:00    C-Eur   CE%sT   1920
+                       1:00    Austria CE%sT   1940 Apr  1 2:00s
+                       1:00    C-Eur   CE%sT   1945 Apr  2 2:00s
+                       1:00    1:00    CEST    1945 Apr 12 2:00s
+                       1:00    -       CET     1946
+                       1:00    Austria CE%sT   1981
+                       1:00    EU      CE%sT
+
+# Belarus
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Minsk    1:50:16 -       LMT     1880
+                       1:50    -       MMT     1924 May 2 # Minsk Mean Time
+                       2:00    -       EET     1930 Jun 21
+                       3:00    -       MSK     1941 Jun 28
+                       1:00    C-Eur   CE%sT   1944 Jul  3
+                       3:00    Russia  MSK/MSD 1990
+                       3:00    -       MSK     1991 Mar 31 2:00s
+                       2:00    1:00    EEST    1991 Sep 29 2:00s
+                       2:00    -       EET     1992 Mar 29 0:00s
+                       2:00    1:00    EEST    1992 Sep 27 0:00s
+                       2:00    Russia  EE%sT
+
+# Belgium
+#
+# From Paul Eggert (1997-07-02):
+# Entries from 1918 through 1991 are taken from:
+#      Annuaire de L'Observatoire Royal de Belgique,
+#      Avenue Circulaire, 3, B-1180 BRUXELLES, CLVIIe annee, 1991
+#      (Imprimerie HAYEZ, s.p.r.l., Rue Fin, 4, 1080 BRUXELLES, MCMXC),
+#      pp 8-9.
+# LMT before 1892 was 0:17:30, according to the official journal of Belgium:
+#      Moniteur Belge, Samedi 30 Avril 1892, N.121.
+# Thanks to Pascal Delmoitie for these references.
+# The 1918 rules are listed for completeness; they apply to unoccupied Belgium.
+# Assume Brussels switched to WET in 1918 when the armistice took effect.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Belgium 1918    only    -       Mar      9       0:00s  1:00    S
+Rule   Belgium 1918    1919    -       Oct     Sat>=1  23:00s  0       -
+Rule   Belgium 1919    only    -       Mar      1      23:00s  1:00    S
+Rule   Belgium 1920    only    -       Feb     14      23:00s  1:00    S
+Rule   Belgium 1920    only    -       Oct     23      23:00s  0       -
+Rule   Belgium 1921    only    -       Mar     14      23:00s  1:00    S
+Rule   Belgium 1921    only    -       Oct     25      23:00s  0       -
+Rule   Belgium 1922    only    -       Mar     25      23:00s  1:00    S
+Rule   Belgium 1922    1927    -       Oct     Sat>=1  23:00s  0       -
+Rule   Belgium 1923    only    -       Apr     21      23:00s  1:00    S
+Rule   Belgium 1924    only    -       Mar     29      23:00s  1:00    S
+Rule   Belgium 1925    only    -       Apr      4      23:00s  1:00    S
+# DSH writes that a royal decree of 1926-02-22 specified the Sun following 3rd
+# Sat in Apr (except if it's Easter, in which case it's one Sunday earlier),
+# to Sun following 1st Sat in Oct, and that a royal decree of 1928-09-15
+# changed the transition times to 02:00 GMT.
+Rule   Belgium 1926    only    -       Apr     17      23:00s  1:00    S
+Rule   Belgium 1927    only    -       Apr      9      23:00s  1:00    S
+Rule   Belgium 1928    only    -       Apr     14      23:00s  1:00    S
+Rule   Belgium 1928    1938    -       Oct     Sun>=2   2:00s  0       -
+Rule   Belgium 1929    only    -       Apr     21       2:00s  1:00    S
+Rule   Belgium 1930    only    -       Apr     13       2:00s  1:00    S
+Rule   Belgium 1931    only    -       Apr     19       2:00s  1:00    S
+Rule   Belgium 1932    only    -       Apr      3       2:00s  1:00    S
+Rule   Belgium 1933    only    -       Mar     26       2:00s  1:00    S
+Rule   Belgium 1934    only    -       Apr      8       2:00s  1:00    S
+Rule   Belgium 1935    only    -       Mar     31       2:00s  1:00    S
+Rule   Belgium 1936    only    -       Apr     19       2:00s  1:00    S
+Rule   Belgium 1937    only    -       Apr      4       2:00s  1:00    S
+Rule   Belgium 1938    only    -       Mar     27       2:00s  1:00    S
+Rule   Belgium 1939    only    -       Apr     16       2:00s  1:00    S
+Rule   Belgium 1939    only    -       Nov     19       2:00s  0       -
+Rule   Belgium 1940    only    -       Feb     25       2:00s  1:00    S
+Rule   Belgium 1944    only    -       Sep     17       2:00s  0       -
+Rule   Belgium 1945    only    -       Apr      2       2:00s  1:00    S
+Rule   Belgium 1945    only    -       Sep     16       2:00s  0       -
+Rule   Belgium 1946    only    -       May     19       2:00s  1:00    S
+Rule   Belgium 1946    only    -       Oct      7       2:00s  0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Brussels 0:17:30 -       LMT     1880
+                       0:17:30 -       BMT     1892 May  1 12:00 # Brussels MT
+                       0:00    -       WET     1914 Nov  8
+                       1:00    -       CET     1916 May  1  0:00
+                       1:00    C-Eur   CE%sT   1918 Nov 11 11:00u
+                       0:00    Belgium WE%sT   1940 May 20  2:00s
+                       1:00    C-Eur   CE%sT   1944 Sep  3
+                       1:00    Belgium CE%sT   1977
+                       1:00    EU      CE%sT
+
+# Bosnia and Herzegovina
+# see Serbia
+
+# Bulgaria
+#
+# From Plamen Simenov via Steffen Thorsen (1999-09-09):
+# A document of Government of Bulgaria (No.94/1997) says:
+# EET --> EETDST is in 03:00 Local time in last Sunday of March ...
+# EETDST --> EET is in 04:00 Local time in last Sunday of October
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Bulg    1979    only    -       Mar     31      23:00   1:00    S
+Rule   Bulg    1979    only    -       Oct      1       1:00   0       -
+Rule   Bulg    1980    1982    -       Apr     Sat>=1  23:00   1:00    S
+Rule   Bulg    1980    only    -       Sep     29       1:00   0       -
+Rule   Bulg    1981    only    -       Sep     27       2:00   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Sofia    1:33:16 -       LMT     1880
+                       1:56:56 -       IMT     1894 Nov 30 # Istanbul MT?
+                       2:00    -       EET     1942 Nov  2  3:00
+                       1:00    C-Eur   CE%sT   1945
+                       1:00    -       CET     1945 Apr 2 3:00
+                       2:00    -       EET     1979 Mar 31 23:00
+                       2:00    Bulg    EE%sT   1982 Sep 26  2:00
+                       2:00    C-Eur   EE%sT   1991
+                       2:00    E-Eur   EE%sT   1997
+                       2:00    EU      EE%sT
+
+# Croatia
+# see Serbia
+
+# Cyprus
+# Please see the `asia' file for Asia/Nicosia.
+
+# Czech Republic
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Czech   1945    only    -       Apr      8      2:00s   1:00    S
+Rule   Czech   1945    only    -       Nov     18      2:00s   0       -
+Rule   Czech   1946    only    -       May      6      2:00s   1:00    S
+Rule   Czech   1946    1949    -       Oct     Sun>=1  2:00s   0       -
+Rule   Czech   1947    only    -       Apr     20      2:00s   1:00    S
+Rule   Czech   1948    only    -       Apr     18      2:00s   1:00    S
+Rule   Czech   1949    only    -       Apr      9      2:00s   1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Prague   0:57:44 -       LMT     1850
+                       0:57:44 -       PMT     1891 Oct     # Prague Mean Time
+                       1:00    C-Eur   CE%sT   1944 Sep 17 2:00s
+                       1:00    Czech   CE%sT   1979
+                       1:00    EU      CE%sT
+
+# Denmark, Faroe Islands, and Greenland
+
+# From Jesper Norgaard Welen (2005-04-26):
+# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law
+# [introducing standard time] was in effect from 1894-01-01....
+# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL
+# confirms this, and states that the law was put forth 1893-03-29.
+#
+# The EU treaty with effect from 1973:
+# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL
+#
+# This provoked a new law from 1974 to make possible summer time changes
+# in subsequenet decrees with the law
+# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL
+#
+# It seems however that no decree was set forward until 1980.  I have
+# not found any decree, but in another related law, the effecting DST
+# changes are stated explicitly to be from 1980-04-06 at 02:00 to
+# 1980-09-28 at 02:00.  If this is true, this differs slightly from
+# the EU rule in that DST runs to 02:00, not 03:00.  We don't know
+# when Denmark began using the EU rule correctly, but we have only
+# confirmation of the 1980-time, so I presume it was correct in 1981:
+# The law is about the management of the extra hour, concerning
+# working hours reported and effect on obligatory-rest rules (which
+# was suspended on that night):
+# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL
+
+# From Jesper Norgaard Welen (2005-06-11):
+# The Herning Folkeblad (1980-09-26) reported that the night between
+# Saturday and Sunday the clock is set back from three to two.
+
+# From Paul Eggert (2005-06-11):
+# Hence the "02:00" of the 1980 law refers to standard time, not
+# wall-clock time, and so the EU rules were in effect in 1980.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Denmark 1916    only    -       May     14      23:00   1:00    S
+Rule   Denmark 1916    only    -       Sep     30      23:00   0       -
+Rule   Denmark 1940    only    -       May     15       0:00   1:00    S
+Rule   Denmark 1945    only    -       Apr      2       2:00s  1:00    S
+Rule   Denmark 1945    only    -       Aug     15       2:00s  0       -
+Rule   Denmark 1946    only    -       May      1       2:00s  1:00    S
+Rule   Denmark 1946    only    -       Sep      1       2:00s  0       -
+Rule   Denmark 1947    only    -       May      4       2:00s  1:00    S
+Rule   Denmark 1947    only    -       Aug     10       2:00s  0       -
+Rule   Denmark 1948    only    -       May      9       2:00s  1:00    S
+Rule   Denmark 1948    only    -       Aug      8       2:00s  0       -
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Europe/Copenhagen  0:50:20 -      LMT     1890
+                        0:50:20 -      CMT     1894 Jan  1 # Copenhagen MT
+                        1:00   Denmark CE%sT   1942 Nov  2 2:00s
+                        1:00   C-Eur   CE%sT   1945 Apr  2 2:00
+                        1:00   Denmark CE%sT   1980
+                        1:00   EU      CE%sT
+Zone Atlantic/Faroe    -0:27:04 -      LMT     1908 Jan 11     # Torshavn
+                        0:00   -       WET     1981
+                        0:00   EU      WE%sT
+#
+# From Paul Eggert (2004-10-31):
+# During World War II, Germany maintained secret manned weather stations in
+# East Greenland and Franz Josef Land, but we don't know their time zones.
+# My source for this is Wilhelm Dege's book mentioned under Svalbard.
+#
+# From Paul Eggert (2006-03-22):
+# Greenland joined the EU as part of Denmark, obtained home rule on 1979-05-01,
+# and left the EU on 1985-02-01.  It therefore should have been using EU
+# rules at least through 1984.  Shanks & Pottenger say Scoresbysund and Godthab
+# used C-Eur rules after 1980, but IATA SSIM (1991/1996) says they use EU
+# rules since at least 1991.  Assume EU rules since 1980.
+
+# From Gwillin Law (2001-06-06), citing
+# <http://www.statkart.no/efs/efshefter/2001/efs5-2001.pdf> (2001-03-15),
+# and with translations corrected by Steffen Thorsen:
+#
+# Greenland has four local times, and the relation to UTC
+# is according to the following time line:
+#
+# The military zone near Thule UTC-4
+# Standard Greenland time      UTC-3
+# Scoresbysund                 UTC-1
+# Danmarkshavn                 UTC
+#
+# In the military area near Thule and in Danmarkshavn DST will not be
+# introduced.
+
+# From Rives McDow (2001-11-01):
+#
+# I correspond regularly with the Dansk Polarcenter, and wrote them at
+# the time to clarify the situation in Thule.  Unfortunately, I have
+# not heard back from them regarding my recent letter.  [But I have
+# info from earlier correspondence.]
+#
+# According to the center, a very small local time zone around Thule
+# Air Base keeps the time according to UTC-4, implementing daylight
+# savings using North America rules, changing the time at 02:00 local time....
+#
+# The east coast of Greenland north of the community of Scoresbysund
+# uses UTC in the same way as in Iceland, year round, with no dst.
+# There are just a few stations on this coast, including the
+# Danmarkshavn ICAO weather station mentioned in your September 29th
+# email.  The other stations are two sledge patrol stations in
+# Mestersvig and Daneborg, the air force base at Station Nord, and the
+# DPC research station at Zackenberg.
+#
+# Scoresbysund and two small villages nearby keep time UTC-1 and use
+# the same daylight savings time period as in West Greenland (Godthab).
+#
+# The rest of Greenland, including Godthab (this area, although it
+# includes central Greenland, is known as west Greenland), keeps time
+# UTC-3, with daylight savings methods according to European rules.
+#
+# It is common procedure to use UTC 0 in the wilderness of East and
+# North Greenland, because it is mainly Icelandic aircraft operators
+# maintaining traffic in these areas.  However, the official status of
+# this area is that it sticks with Godthab time.  This area might be
+# considered a dual time zone in some respects because of this.
+
+# From Rives McDow (2001-11-19):
+# I heard back from someone stationed at Thule; the time change took place
+# there at 2:00 AM.
+
+# From Paul Eggert (2006-03-22):
+# From 1997 on the CIA map shows Danmarkshavn on GMT;
+# the 1995 map as like Godthab.
+# For lack of better info, assume they were like Godthab before 1996.
+# startkart.no says Thule does not observe DST, but this is clearly an error,
+# so go with Shanks & Pottenger for Thule transitions until this year.
+# For 2007 on assume Thule will stay in sync with US DST rules.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Thule   1991    1992    -       Mar     lastSun 2:00    1:00    D
+Rule   Thule   1991    1992    -       Sep     lastSun 2:00    0       S
+Rule   Thule   1993    2006    -       Apr     Sun>=1  2:00    1:00    D
+Rule   Thule   1993    2006    -       Oct     lastSun 2:00    0       S
+Rule   Thule   2007    max     -       Mar     Sun>=8  2:00    1:00    D
+Rule   Thule   2007    max     -       Nov     Sun>=1  2:00    0       S
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Danmarkshavn -1:14:40 -   LMT     1916 Jul 28
+                       -3:00   -       WGT     1980 Apr  6 2:00
+                       -3:00   EU      WG%sT   1996
+                       0:00    -       GMT
+Zone America/Scoresbysund -1:27:52 -   LMT     1916 Jul 28 # Ittoqqortoormiit
+                       -2:00   -       CGT     1980 Apr  6 2:00
+                       -2:00   C-Eur   CG%sT   1981 Mar 29
+                       -1:00   EU      EG%sT
+Zone America/Godthab   -3:26:56 -      LMT     1916 Jul 28 # Nuuk
+                       -3:00   -       WGT     1980 Apr  6 2:00
+                       -3:00   EU      WG%sT
+Zone America/Thule     -4:35:08 -      LMT     1916 Jul 28 # Pituffik air base
+                       -4:00   Thule   A%sT
+
+# Estonia
+# From Peter Ilieve (1994-10-15):
+# A relative in Tallinn confirms the accuracy of the data for 1989 onwards
+# [through 1994] and gives the legal authority for it,
+# a regulation of the Government of Estonia, No. 111 of 1989....
+#
+# From Peter Ilieve (1996-10-28):
+# [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s,
+# but a relative confirms that Estonia still switches at 02:00s, writing:]
+# ``I do not [know] exactly but there are some little different
+# (confusing) rules for International Air and Railway Transport Schedules
+# conversion in Sunday connected with end of summer time in Estonia....
+# A discussion is running about the summer time efficiency and effect on
+# human physiology.  It seems that Estonia maybe will not change to
+# summer time next spring.''
+
+# From Peter Ilieve (1998-11-04), heavily edited:
+# <a href="http://trip.rk.ee/cgi-bin/thw?${BASE}=akt&${OOHTML}=rtd&TA=1998&TO=1&AN=1390">
+# The 1998-09-22 Estonian time law
+# </a>
+# refers to the Eighth Directive and cites the association agreement between
+# the EU and Estonia, ratified by the Estonian law (RT II 1995, 22--27, 120).
+#
+# I also asked [my relative] whether they use any standard abbreviation
+# for their standard and summer times. He says no, they use "suveaeg"
+# (summer time) and "talveaeg" (winter time).
+
+# From <a href="http://www.baltictimes.com/">The Baltic Times</a> (1999-09-09)
+# via Steffen Thorsen:
+# This year will mark the last time Estonia shifts to summer time,
+# a council of the ruling coalition announced Sept. 6....
+# But what this could mean for Estonia's chances of joining the European
+# Union are still unclear.  In 1994, the EU declared summer time compulsory
+# for all member states until 2001.  Brussels has yet to decide what to do
+# after that.
+
+# From Mart Oruaas (2000-01-29):
+# Regulation no. 301 (1999-10-12) obsoletes previous regulation
+# no. 206 (1998-09-22) and thus sticks Estonia to +02:00 GMT for all
+# the year round.  The regulation is effective 1999-11-01.
+
+# From Toomas Soome (2002-02-21):
+# The Estonian government has changed once again timezone politics.
+# Now we are using again EU rules.
+#
+# From Urmet Jaanes (2002-03-28):
+# The legislative reference is Government decree No. 84 on 2002-02-21.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Tallinn  1:39:00 -       LMT     1880
+                       1:39:00 -       TMT     1918 Feb # Tallinn Mean Time
+                       1:00    C-Eur   CE%sT   1919 Jul
+                       1:39:00 -       TMT     1921 May
+                       2:00    -       EET     1940 Aug  6
+                       3:00    -       MSK     1941 Sep 15
+                       1:00    C-Eur   CE%sT   1944 Sep 22
+                       3:00    Russia  MSK/MSD 1989 Mar 26 2:00s
+                       2:00    1:00    EEST    1989 Sep 24 2:00s
+                       2:00    C-Eur   EE%sT   1998 Sep 22
+                       2:00    EU      EE%sT   1999 Nov  1
+                       2:00    -       EET     2002 Feb 21
+                       2:00    EU      EE%sT
+
+# Finland
+#
+# From Hannu Strang (1994-09-25 06:03:37 UTC):
+# Well, here in Helsinki we're just changing from summer time to regular one,
+# and it's supposed to change at 4am...
+#
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say Finland has switched at 02:00 standard time
+# since 1981.  Go with Strang instead.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Finland 1942    only    -       Apr     3       0:00    1:00    S
+Rule   Finland 1942    only    -       Oct     3       0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Helsinki 1:39:52 -       LMT     1878 May 31
+                       1:39:52 -       HMT     1921 May    # Helsinki Mean Time
+                       2:00    Finland EE%sT   1981 Mar 29 2:00
+                       2:00    EU      EE%sT
+
+# Aaland Is
+Link   Europe/Helsinki Europe/Mariehamn
+
+
+# France
+
+# From Ciro Discepolo (2000-12-20):
+#
+# Henri Le Corre, Regimes Horaires pour le monde entier, Editions
+# Traditionnelles - Paris 2 books, 1993
+#
+# Gabriel, Traite de l'heure dans le monde, Guy Tredaniel editeur,
+# Paris, 1991
+#
+# Francoise Gauquelin, Problemes de l'heure resolus en astrologie,
+# Guy tredaniel, Paris 1987
+
+
+#
+# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   France  1916    only    -       Jun     14      23:00s  1:00    S
+Rule   France  1916    1919    -       Oct     Sun>=1  23:00s  0       -
+Rule   France  1917    only    -       Mar     24      23:00s  1:00    S
+Rule   France  1918    only    -       Mar      9      23:00s  1:00    S
+Rule   France  1919    only    -       Mar      1      23:00s  1:00    S
+Rule   France  1920    only    -       Feb     14      23:00s  1:00    S
+Rule   France  1920    only    -       Oct     23      23:00s  0       -
+Rule   France  1921    only    -       Mar     14      23:00s  1:00    S
+Rule   France  1921    only    -       Oct     25      23:00s  0       -
+Rule   France  1922    only    -       Mar     25      23:00s  1:00    S
+# DSH writes that a law of 1923-05-24 specified 3rd Sat in Apr at 23:00 to 1st
+# Sat in Oct at 24:00; and that in 1930, because of Easter, the transitions
+# were Apr 12 and Oct 5.  Go with Shanks & Pottenger.
+Rule   France  1922    1938    -       Oct     Sat>=1  23:00s  0       -
+Rule   France  1923    only    -       May     26      23:00s  1:00    S
+Rule   France  1924    only    -       Mar     29      23:00s  1:00    S
+Rule   France  1925    only    -       Apr      4      23:00s  1:00    S
+Rule   France  1926    only    -       Apr     17      23:00s  1:00    S
+Rule   France  1927    only    -       Apr      9      23:00s  1:00    S
+Rule   France  1928    only    -       Apr     14      23:00s  1:00    S
+Rule   France  1929    only    -       Apr     20      23:00s  1:00    S
+Rule   France  1930    only    -       Apr     12      23:00s  1:00    S
+Rule   France  1931    only    -       Apr     18      23:00s  1:00    S
+Rule   France  1932    only    -       Apr      2      23:00s  1:00    S
+Rule   France  1933    only    -       Mar     25      23:00s  1:00    S
+Rule   France  1934    only    -       Apr      7      23:00s  1:00    S
+Rule   France  1935    only    -       Mar     30      23:00s  1:00    S
+Rule   France  1936    only    -       Apr     18      23:00s  1:00    S
+Rule   France  1937    only    -       Apr      3      23:00s  1:00    S
+Rule   France  1938    only    -       Mar     26      23:00s  1:00    S
+Rule   France  1939    only    -       Apr     15      23:00s  1:00    S
+Rule   France  1939    only    -       Nov     18      23:00s  0       -
+Rule   France  1940    only    -       Feb     25       2:00   1:00    S
+# The French rules for 1941-1944 were not used in Paris, but Shanks & Pottenger
+# write that they were used in Monaco and in many French locations.
+# Le Corre writes that the upper limit of the free zone was Arneguy, Orthez,
+# Mont-de-Marsan, Bazas, Langon, Lamotte-Montravel, Marouil, La
+# Rochefoucault, Champagne-Mouton, La Roche-Posay, La Haye-Decartes,
+# Loches, Montrichard, Vierzon, Bourges, Moulins, Digoin,
+# Paray-le-Monial, Montceau-les-Mines, Chalons-sur-Saone, Arbois,
+# Dole, Morez, St-Claude, and Collognes (Haute-Savioe).
+Rule   France  1941    only    -       May      5       0:00   2:00    M # Midsummer
+# Shanks & Pottenger say this transition occurred at Oct 6 1:00,
+# but go with Denis Excoffier (1997-12-12),
+# who quotes the Ephemerides Astronomiques for 1998 from Bureau des Longitudes
+# as saying 5/10/41 22hUT.
+Rule   France  1941    only    -       Oct      6       0:00   1:00    S
+Rule   France  1942    only    -       Mar      9       0:00   2:00    M
+Rule   France  1942    only    -       Nov      2       3:00   1:00    S
+Rule   France  1943    only    -       Mar     29       2:00   2:00    M
+Rule   France  1943    only    -       Oct      4       3:00   1:00    S
+Rule   France  1944    only    -       Apr      3       2:00   2:00    M
+Rule   France  1944    only    -       Oct      8       1:00   1:00    S
+Rule   France  1945    only    -       Apr      2       2:00   2:00    M
+Rule   France  1945    only    -       Sep     16       3:00   0       -
+# Shanks & Pottenger give Mar 28 2:00 and Sep 26 3:00;
+# go with Excoffier's 28/3/76 0hUT and 25/9/76 23hUT.
+Rule   France  1976    only    -       Mar     28       1:00   1:00    S
+Rule   France  1976    only    -       Sep     26       1:00   0       -
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time, and Whitman 0:09:05,
+# but Howse quotes the actual French legislation as saying 0:09:21.
+# Go with Howse.  Howse writes that the time in France was officially based
+# on PMT-0:09:21 until 1978-08-09, when the time base finally switched to UTC.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Paris    0:09:21 -       LMT     1891 Mar 15  0:01
+                       0:09:21 -       PMT     1911 Mar 11  0:01  # Paris MT
+# Shanks & Pottenger give 1940 Jun 14 0:00; go with Excoffier and Le Corre.
+                       0:00    France  WE%sT   1940 Jun 14 23:00
+# Le Corre says Paris stuck with occupied-France time after the liberation;
+# go with Shanks & Pottenger.
+                       1:00    C-Eur   CE%sT   1944 Aug 25
+                       0:00    France  WE%sT   1945 Sep 16  3:00
+                       1:00    France  CE%sT   1977
+                       1:00    EU      CE%sT
+
+# Germany
+
+# From Markus Kuhn (1998-09-29):
+# The German time zone web site by the Physikalisch-Technische
+# Bundesanstalt contains DST information back to 1916.
+# [See tz-link.htm for the URL.]
+
+# From Joerg Schilling (2002-10-23):
+# In 1945, Berlin was switched to Moscow Summer time (GMT+4) by
+# <a href="http://www.dhm.de/lemo/html/biografien/BersarinNikolai/">
+# General [Nikolai] Bersarin</a>.
+
+# From Paul Eggert (2003-03-08):
+# <a href="http://www.parlament-berlin.de/pds-fraktion.nsf/727459127c8b66ee8525662300459099/defc77cb784f180ac1256c2b0030274b/$FILE/bersarint.pdf">
+# http://www.parlament-berlin.de/pds-fraktion.nsf/727459127c8b66ee8525662300459099/defc77cb784f180ac1256c2b0030274b/$FILE/bersarint.pdf
+# </a>
+# says that Bersarin issued an order to use Moscow time on May 20.
+# However, Moscow did not observe daylight saving in 1945, so
+# this was equivalent to CEMT (GMT+3), not GMT+4.
+
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Germany 1946    only    -       Apr     14      2:00s   1:00    S
+Rule   Germany 1946    only    -       Oct      7      2:00s   0       -
+Rule   Germany 1947    1949    -       Oct     Sun>=1  2:00s   0       -
+# http://www.ptb.de/de/org/4/44/441/salt.htm says the following transition
+# occurred at 3:00 MEZ, not the 2:00 MEZ given in Shanks & Pottenger.
+# Go with the PTB.
+Rule   Germany 1947    only    -       Apr      6      3:00s   1:00    S
+Rule   Germany 1947    only    -       May     11      2:00s   2:00    M
+Rule   Germany 1947    only    -       Jun     29      3:00    1:00    S
+Rule   Germany 1948    only    -       Apr     18      2:00s   1:00    S
+Rule   Germany 1949    only    -       Apr     10      2:00s   1:00    S
+
+Rule SovietZone        1945    only    -       May     24      2:00    2:00    M # Midsummer
+Rule SovietZone        1945    only    -       Sep     24      3:00    1:00    S
+Rule SovietZone        1945    only    -       Nov     18      2:00s   0       -
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Berlin   0:53:28 -       LMT     1893 Apr
+                       1:00    C-Eur   CE%sT   1945 May 24 2:00
+                       1:00 SovietZone CE%sT   1946
+                       1:00    Germany CE%sT   1980
+                       1:00    EU      CE%sT
+
+# Georgia
+# Please see the "asia" file for Asia/Tbilisi.
+# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
+# is in Europe.  Our reference location Tbilisi is in the Asian part.
+
+# Gibraltar
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Europe/Gibraltar  -0:21:24 -      LMT     1880 Aug  2 0:00s
+                       0:00    GB-Eire %s      1957 Apr 14 2:00
+                       1:00    -       CET     1982
+                       1:00    EU      CE%sT
+
+# Greece
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# Whitman gives 1932 Jul 5 - Nov 1; go with Shanks & Pottenger.
+Rule   Greece  1932    only    -       Jul      7      0:00    1:00    S
+Rule   Greece  1932    only    -       Sep      1      0:00    0       -
+# Whitman gives 1941 Apr 25 - ?; go with Shanks & Pottenger.
+Rule   Greece  1941    only    -       Apr      7      0:00    1:00    S
+# Whitman gives 1942 Feb 2 - ?; go with Shanks & Pottenger.
+Rule   Greece  1942    only    -       Nov      2      3:00    0       -
+Rule   Greece  1943    only    -       Mar     30      0:00    1:00    S
+Rule   Greece  1943    only    -       Oct      4      0:00    0       -
+# Whitman gives 1944 Oct 3 - Oct 31; go with Shanks & Pottenger.
+Rule   Greece  1952    only    -       Jul      1      0:00    1:00    S
+Rule   Greece  1952    only    -       Nov      2      0:00    0       -
+Rule   Greece  1975    only    -       Apr     12      0:00s   1:00    S
+Rule   Greece  1975    only    -       Nov     26      0:00s   0       -
+Rule   Greece  1976    only    -       Apr     11      2:00s   1:00    S
+Rule   Greece  1976    only    -       Oct     10      2:00s   0       -
+Rule   Greece  1977    1978    -       Apr     Sun>=1  2:00s   1:00    S
+Rule   Greece  1977    only    -       Sep     26      2:00s   0       -
+Rule   Greece  1978    only    -       Sep     24      4:00    0       -
+Rule   Greece  1979    only    -       Apr      1      9:00    1:00    S
+Rule   Greece  1979    only    -       Sep     29      2:00    0       -
+Rule   Greece  1980    only    -       Apr      1      0:00    1:00    S
+Rule   Greece  1980    only    -       Sep     28      0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Athens   1:34:52 -       LMT     1895 Sep 14
+                       1:34:52 -       AMT     1916 Jul 28 0:01     # Athens MT
+                       2:00    Greece  EE%sT   1941 Apr 30
+                       1:00    Greece  CE%sT   1944 Apr  4
+                       2:00    Greece  EE%sT   1981
+                       # Shanks & Pottenger say it switched to C-Eur in 1981;
+                       # go with EU instead, since Greece joined it on Jan 1.
+                       2:00    EU      EE%sT
+
+# Hungary
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Hungary 1918    only    -       Apr      1       3:00   1:00    S
+Rule   Hungary 1918    only    -       Sep     29       3:00   0       -
+Rule   Hungary 1919    only    -       Apr     15       3:00   1:00    S
+Rule   Hungary 1919    only    -       Sep     15       3:00   0       -
+Rule   Hungary 1920    only    -       Apr      5       3:00   1:00    S
+Rule   Hungary 1920    only    -       Sep     30       3:00   0       -
+Rule   Hungary 1945    only    -       May      1      23:00   1:00    S
+Rule   Hungary 1945    only    -       Nov      3       0:00   0       -
+Rule   Hungary 1946    only    -       Mar     31       2:00s  1:00    S
+Rule   Hungary 1946    1949    -       Oct     Sun>=1   2:00s  0       -
+Rule   Hungary 1947    1949    -       Apr     Sun>=4   2:00s  1:00    S
+Rule   Hungary 1950    only    -       Apr     17       2:00s  1:00    S
+Rule   Hungary 1950    only    -       Oct     23       2:00s  0       -
+Rule   Hungary 1954    1955    -       May     23       0:00   1:00    S
+Rule   Hungary 1954    1955    -       Oct      3       0:00   0       -
+Rule   Hungary 1956    only    -       Jun     Sun>=1   0:00   1:00    S
+Rule   Hungary 1956    only    -       Sep     lastSun  0:00   0       -
+Rule   Hungary 1957    only    -       Jun     Sun>=1   1:00   1:00    S
+Rule   Hungary 1957    only    -       Sep     lastSun  3:00   0       -
+Rule   Hungary 1980    only    -       Apr      6       1:00   1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Budapest 1:16:20 -       LMT     1890 Oct
+                       1:00    C-Eur   CE%sT   1918
+                       1:00    Hungary CE%sT   1941 Apr  6  2:00
+                       1:00    C-Eur   CE%sT   1945
+                       1:00    Hungary CE%sT   1980 Sep 28  2:00s
+                       1:00    EU      CE%sT
+
+# Iceland
+#
+# From Adam David (1993-11-06):
+# The name of the timezone in Iceland for system / mail / news purposes is GMT.
+#
+# (1993-12-05):
+# This material is paraphrased from the 1988 edition of the University of
+# Iceland Almanak.
+#
+# From January 1st, 1908 the whole of Iceland was standardised at 1 hour
+# behind GMT. Previously, local mean solar time was used in different parts
+# of Iceland, the almanak had been based on Reykjavik mean solar time which
+# was 1 hour and 28 minutes behind GMT.
+#
+# "first day of winter" referred to [below] means the first day of the 26 weeks
+# of winter, according to the old icelandic calendar that dates back to the
+# time the norsemen first settled Iceland.  The first day of winter is always
+# Saturday, but is not dependent on the Julian or Gregorian calendars.
+#
+# (1993-12-10):
+# I have a reference from the Oxford Icelandic-English dictionary for the
+# beginning of winter, which ties it to the ecclesiastical calendar (and thus
+# to the julian/gregorian calendar) over the period in question.
+#      the winter begins on the Saturday next before St. Luke's day
+#      (old style), or on St. Luke's day, if a Saturday.
+# St. Luke's day ought to be traceable from ecclesiastical sources. "old style"
+# might be a reference to the Julian calendar as opposed to Gregorian, or it
+# might mean something else (???).
+#
+# From Paul Eggert (2006-03-22):
+# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points.
+# We go with the Almanak, except for one claim from Shanks & Pottenger, namely
+# that Reykavik was 21W57 from 1837 to 1908, local mean time before that.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Iceland 1917    1918    -       Feb     19      23:00   1:00    S
+Rule   Iceland 1917    only    -       Oct     21       1:00   0       -
+Rule   Iceland 1918    only    -       Nov     16       1:00   0       -
+Rule   Iceland 1939    only    -       Apr     29      23:00   1:00    S
+Rule   Iceland 1939    only    -       Nov     29       2:00   0       -
+Rule   Iceland 1940    only    -       Feb     25       2:00   1:00    S
+Rule   Iceland 1940    only    -       Nov      3       2:00   0       -
+Rule   Iceland 1941    only    -       Mar      2       1:00s  1:00    S
+Rule   Iceland 1941    only    -       Nov      2       1:00s  0       -
+Rule   Iceland 1942    only    -       Mar      8       1:00s  1:00    S
+Rule   Iceland 1942    only    -       Oct     25       1:00s  0       -
+# 1943-1946 - first Sunday in March until first Sunday in winter
+Rule   Iceland 1943    1946    -       Mar     Sun>=1   1:00s  1:00    S
+Rule   Iceland 1943    1948    -       Oct     Sun>=22  1:00s  0       -
+# 1947-1967 - first Sunday in April until first Sunday in winter
+Rule   Iceland 1947    1967    -       Apr     Sun>=1   1:00s  1:00    S
+# 1949 Oct transition delayed by 1 week
+Rule   Iceland 1949    only    -       Oct     30       1:00s  0       -
+Rule   Iceland 1950    1966    -       Oct     Sun>=22  1:00s  0       -
+Rule   Iceland 1967    only    -       Oct     29       1:00s  0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Atlantic/Reykjavik        -1:27:24 -      LMT     1837
+                       -1:27:48 -      RMT     1908 # Reykjavik Mean Time?
+                       -1:00   Iceland IS%sT   1968 Apr 7 1:00s
+                        0:00   -       GMT
+
+# Italy
+#
+# From Paul Eggert (2001-03-06):
+# Sicily and Sardinia each had their own time zones from 1866 to 1893,
+# called Palermo Time (+00:53:28) and Cagliari Time (+00:36:32).
+# During World War II, German-controlled Italy used German time.
+# But these events all occurred before the 1970 cutoff,
+# so record only the time in Rome.
+#
+# From Paul Eggert (2006-03-22):
+# For Italian DST we have three sources: Shanks & Pottenger, Whitman, and
+# F. Pollastri
+# <a href="http://toi.iriti.cnr.it/uk/ienitlt.html">
+# Day-light Saving Time in Italy (2006-02-03)
+# </a>
+# (`FP' below), taken from an Italian National Electrotechnical Institute
+# publication. When the three sources disagree, guess who's right, as follows:
+#
+# year FP      Shanks&P. (S)   Whitman (W)     Go with:
+# 1916 06-03   06-03 24:00     06-03 00:00     FP & W
+#      09-30   09-30 24:00     09-30 01:00     FP; guess 24:00s
+# 1917 04-01   03-31 24:00     03-31 00:00     FP & S
+#      09-30   09-29 24:00     09-30 01:00     FP & W
+# 1918 03-09   03-09 24:00     03-09 00:00     FP & S
+#      10-06   10-05 24:00     10-06 01:00     FP & W
+# 1919 03-01   03-01 24:00     03-01 00:00     FP & S
+#      10-04   10-04 24:00     10-04 01:00     FP; guess 24:00s
+# 1920 03-20   03-20 24:00     03-20 00:00     FP & S
+#      09-18   09-18 24:00     10-01 01:00     FP; guess 24:00s
+# 1944 04-02   04-03 02:00                     S (see C-Eur)
+#      09-16   10-02 03:00                     FP; guess 24:00s
+# 1945 09-14   09-16 24:00                     FP; guess 24:00s
+# 1970 05-21   05-31 00:00                     S
+#      09-20   09-27 00:00                     S
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Italy   1916    only    -       Jun      3      0:00s   1:00    S
+Rule   Italy   1916    only    -       Oct      1      0:00s   0       -
+Rule   Italy   1917    only    -       Apr      1      0:00s   1:00    S
+Rule   Italy   1917    only    -       Sep     30      0:00s   0       -
+Rule   Italy   1918    only    -       Mar     10      0:00s   1:00    S
+Rule   Italy   1918    1919    -       Oct     Sun>=1  0:00s   0       -
+Rule   Italy   1919    only    -       Mar      2      0:00s   1:00    S
+Rule   Italy   1920    only    -       Mar     21      0:00s   1:00    S
+Rule   Italy   1920    only    -       Sep     19      0:00s   0       -
+Rule   Italy   1940    only    -       Jun     15      0:00s   1:00    S
+Rule   Italy   1944    only    -       Sep     17      0:00s   0       -
+Rule   Italy   1945    only    -       Apr      2      2:00    1:00    S
+Rule   Italy   1945    only    -       Sep     15      0:00s   0       -
+Rule   Italy   1946    only    -       Mar     17      2:00s   1:00    S
+Rule   Italy   1946    only    -       Oct      6      2:00s   0       -
+Rule   Italy   1947    only    -       Mar     16      0:00s   1:00    S
+Rule   Italy   1947    only    -       Oct      5      0:00s   0       -
+Rule   Italy   1948    only    -       Feb     29      2:00s   1:00    S
+Rule   Italy   1948    only    -       Oct      3      2:00s   0       -
+Rule   Italy   1966    1968    -       May     Sun>=22 0:00    1:00    S
+Rule   Italy   1966    1969    -       Sep     Sun>=22 0:00    0       -
+Rule   Italy   1969    only    -       Jun      1      0:00    1:00    S
+Rule   Italy   1970    only    -       May     31      0:00    1:00    S
+Rule   Italy   1970    only    -       Sep     lastSun 0:00    0       -
+Rule   Italy   1971    1972    -       May     Sun>=22 0:00    1:00    S
+Rule   Italy   1971    only    -       Sep     lastSun 1:00    0       -
+Rule   Italy   1972    only    -       Oct      1      0:00    0       -
+Rule   Italy   1973    only    -       Jun      3      0:00    1:00    S
+Rule   Italy   1973    1974    -       Sep     lastSun 0:00    0       -
+Rule   Italy   1974    only    -       May     26      0:00    1:00    S
+Rule   Italy   1975    only    -       Jun      1      0:00s   1:00    S
+Rule   Italy   1975    1977    -       Sep     lastSun 0:00s   0       -
+Rule   Italy   1976    only    -       May     30      0:00s   1:00    S
+Rule   Italy   1977    1979    -       May     Sun>=22 0:00s   1:00    S
+Rule   Italy   1978    only    -       Oct      1      0:00s   0       -
+Rule   Italy   1979    only    -       Sep     30      0:00s   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Rome     0:49:56 -       LMT     1866 Sep 22
+                       0:49:56 -       RMT     1893 Nov  1 0:00s # Rome Mean
+                       1:00    Italy   CE%sT   1942 Nov  2 2:00s
+                       1:00    C-Eur   CE%sT   1944 Jul
+                       1:00    Italy   CE%sT   1980
+                       1:00    EU      CE%sT
+
+Link   Europe/Rome     Europe/Vatican
+Link   Europe/Rome     Europe/San_Marino
+
+# Latvia
+
+# From Liene Kanepe (1998-09-17):
+
+# I asked about this matter Scientific Secretary of the Institute of Astronomy
+# of The University of Latvia Dr. paed Mr. Ilgonis Vilks. I also searched the
+# correct data in juridical acts and I found some juridical documents about
+# changes in the counting of time in Latvia from 1981....
+#
+# Act No.35 of the Council of Ministers of Latvian SSR of 1981-01-22 ...
+# according to the Act No.925 of the Council of Ministers of USSR of 1980-10-24
+# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
+# the hands of the clock 1 hour forward on 1 April at 00:00 (GMT 31 March 21:00)
+# and 1 hour backward on the 1 October at 00:00 (GMT 30 September 20:00).
+#
+# Act No.592 of the Council of Ministers of Latvian SSR of 1984-09-24 ...
+# according to the Act No.967 of the Council of Ministers of USSR of 1984-09-13
+# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
+# the hands of the clock 1 hour forward on the last Sunday of March at 02:00
+# (GMT 23:00 on the previous day) and 1 hour backward on the last Sunday of
+# September at 03:00 (GMT 23:00 on the previous day).
+#
+# Act No.81 of the Council of Ministers of Latvian SSR of 1989-03-22 ...
+# according to the Act No.227 of the Council of Ministers of USSR of 1989-03-14
+# ...: since the last Sunday of March 1989 in Lithuanian SSR, Latvian SSR,
+# Estonian SSR and Kaliningrad region of Russian Federation all year round the
+# time of 2nd time zone (Moscow time minus one hour). On the territory of Latvia
+# transition to summer time is performed on the last Sunday of March at 02:00
+# (GMT 00:00), turning the hands of the clock 1 hour forward.  The end of
+# daylight saving time is performed on the last Sunday of September at 03:00
+# (GMT 00:00), turning the hands of the clock 1 hour backward. Exception is
+# 1989-03-26, when we must not turn the hands of the clock....
+#
+# The Regulations of the Cabinet of Ministers of the Republic of Latvia of
+# 1997-01-21 on transition to Summer time ... established the same order of
+# daylight savings time settings as in the States of the European Union.
+
+# From Andrei Ivanov (2000-03-06):
+# This year Latvia will not switch to Daylight Savings Time (as specified in
+# <a href="http://www.lv-laiks.lv/wwwraksti/2000/071072/vd4.htm">
+# The Regulations of the Cabinet of Ministers of the Rep. of Latvia of
+# 29-Feb-2000 (#79)</a>, in Latvian for subscribers only).
+
+# <a href="http://www.rferl.org/newsline/2001/01/3-CEE/cee-030101.html">
+# From RFE/RL Newsline (2001-01-03), noted after a heads-up by Rives McDow:
+# </a>
+# The Latvian government on 2 January decided that the country will
+# institute daylight-saving time this spring, LETA reported.
+# Last February the three Baltic states decided not to turn back their
+# clocks one hour in the spring....
+# Minister of Economy Aigars Kalvitis noted that Latvia had too few
+# daylight hours and thus decided to comply with a draft European
+# Commission directive that provides for instituting daylight-saving
+# time in EU countries between 2002 and 2006. The Latvian government
+# urged Lithuania and Estonia to adopt a similar time policy, but it
+# appears that they will not do so....
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Latvia  1989    1996    -       Mar     lastSun  2:00s  1:00    S
+Rule   Latvia  1989    1996    -       Sep     lastSun  2:00s  0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Riga     1:36:24 -       LMT     1880
+                       1:36:24 -       RMT     1918 Apr 15 2:00 #Riga Mean Time
+                       1:36:24 1:00    LST     1918 Sep 16 3:00 #Latvian Summer
+                       1:36:24 -       RMT     1919 Apr  1 2:00
+                       1:36:24 1:00    LST     1919 May 22 3:00
+                       1:36:24 -       RMT     1926 May 11
+                       2:00    -       EET     1940 Aug  5
+                       3:00    -       MSK     1941 Jul
+                       1:00    C-Eur   CE%sT   1944 Oct 13
+                       3:00    Russia  MSK/MSD 1989 Mar lastSun 2:00s
+                       2:00    1:00    EEST    1989 Sep lastSun 2:00s
+                       2:00    Latvia  EE%sT   1997 Jan 21
+                       2:00    EU      EE%sT   2000 Feb 29
+                       2:00    -       EET     2001 Jan  2
+                       2:00    EU      EE%sT
+
+# Liechtenstein
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Vaduz    0:38:04 -       LMT     1894 Jun
+                       1:00    -       CET     1981
+                       1:00    EU      CE%sT
+
+# Lithuania
+
+# From Paul Eggert (1996-11-22):
+# IATA SSIM (1992/1996) says Lithuania uses W-Eur rules, but since it is
+# known to be wrong about Estonia and Latvia, assume it's wrong here too.
+
+# From Marius Gedminas (1998-08-07):
+# I would like to inform that in this year Lithuanian time zone
+# (Europe/Vilnius) was changed.
+
+# From <a href="http://www.elta.lt/">ELTA</a> No. 972 (2582) (1999-09-29),
+# via Steffen Thorsen:
+# Lithuania has shifted back to the second time zone (GMT plus two hours)
+# to be valid here starting from October 31,
+# as decided by the national government on Wednesday....
+# The Lithuanian government also announced plans to consider a
+# motion to give up shifting to summer time in spring, as it was
+# already done by Estonia.
+
+# From the <a href="http://www.tourism.lt/informa/ff.htm">
+# Fact File, Lithuanian State Department of Tourism
+# </a> (2000-03-27): Local time is GMT+2 hours ..., no daylight saving.
+
+# From a user via Klaus Marten (2003-02-07):
+# As a candidate for membership of the European Union, Lithuania will
+# observe Summer Time in 2003, changing its clocks at the times laid
+# down in EU Directive 2000/84 of 19.I.01 (i.e. at the same times as its
+# neighbour Latvia). The text of the Lithuanian government Order of
+# 7.XI.02 to this effect can be found at
+# http://www.lrvk.lt/nut/11/n1749.htm
+
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Vilnius  1:41:16 -       LMT     1880
+                       1:24:00 -       WMT     1917        # Warsaw Mean Time
+                       1:35:36 -       KMT     1919 Oct 10 # Kaunas Mean Time
+                       1:00    -       CET     1920 Jul 12
+                       2:00    -       EET     1920 Oct  9
+                       1:00    -       CET     1940 Aug  3
+                       3:00    -       MSK     1941 Jun 24
+                       1:00    C-Eur   CE%sT   1944 Aug
+                       3:00    Russia  MSK/MSD 1991 Mar 31 2:00s
+                       2:00    1:00    EEST    1991 Sep 29 2:00s
+                       2:00    C-Eur   EE%sT   1998
+                       2:00    -       EET     1998 Mar 29 1:00u
+                       1:00    EU      CE%sT   1999 Oct 31 1:00u
+                       2:00    -       EET     2003 Jan  1
+                       2:00    EU      EE%sT
+
+# Luxembourg
+# Whitman disagrees with most of these dates in minor ways;
+# go with Shanks & Pottenger.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Lux     1916    only    -       May     14      23:00   1:00    S
+Rule   Lux     1916    only    -       Oct      1       1:00   0       -
+Rule   Lux     1917    only    -       Apr     28      23:00   1:00    S
+Rule   Lux     1917    only    -       Sep     17       1:00   0       -
+Rule   Lux     1918    only    -       Apr     Mon>=15  2:00s  1:00    S
+Rule   Lux     1918    only    -       Sep     Mon>=15  2:00s  0       -
+Rule   Lux     1919    only    -       Mar      1      23:00   1:00    S
+Rule   Lux     1919    only    -       Oct      5       3:00   0       -
+Rule   Lux     1920    only    -       Feb     14      23:00   1:00    S
+Rule   Lux     1920    only    -       Oct     24       2:00   0       -
+Rule   Lux     1921    only    -       Mar     14      23:00   1:00    S
+Rule   Lux     1921    only    -       Oct     26       2:00   0       -
+Rule   Lux     1922    only    -       Mar     25      23:00   1:00    S
+Rule   Lux     1922    only    -       Oct     Sun>=2   1:00   0       -
+Rule   Lux     1923    only    -       Apr     21      23:00   1:00    S
+Rule   Lux     1923    only    -       Oct     Sun>=2   2:00   0       -
+Rule   Lux     1924    only    -       Mar     29      23:00   1:00    S
+Rule   Lux     1924    1928    -       Oct     Sun>=2   1:00   0       -
+Rule   Lux     1925    only    -       Apr      5      23:00   1:00    S
+Rule   Lux     1926    only    -       Apr     17      23:00   1:00    S
+Rule   Lux     1927    only    -       Apr      9      23:00   1:00    S
+Rule   Lux     1928    only    -       Apr     14      23:00   1:00    S
+Rule   Lux     1929    only    -       Apr     20      23:00   1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Europe/Luxembourg 0:24:36 -       LMT     1904 Jun
+                       1:00    Lux     CE%sT   1918 Nov 25
+                       0:00    Lux     WE%sT   1929 Oct  6 2:00s
+                       0:00    Belgium WE%sT   1940 May 14 3:00
+                       1:00    C-Eur   WE%sT   1944 Sep 18 3:00
+                       1:00    Belgium CE%sT   1977
+                       1:00    EU      CE%sT
+
+# Macedonia
+# see Serbia
+
+# Malta
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Malta   1973    only    -       Mar     31      0:00s   1:00    S
+Rule   Malta   1973    only    -       Sep     29      0:00s   0       -
+Rule   Malta   1974    only    -       Apr     21      0:00s   1:00    S
+Rule   Malta   1974    only    -       Sep     16      0:00s   0       -
+Rule   Malta   1975    1979    -       Apr     Sun>=15 2:00    1:00    S
+Rule   Malta   1975    1980    -       Sep     Sun>=15 2:00    0       -
+Rule   Malta   1980    only    -       Mar     31      2:00    1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Malta    0:58:04 -       LMT     1893 Nov  2 0:00s # Valletta
+                       1:00    Italy   CE%sT   1942 Nov  2 2:00s
+                       1:00    C-Eur   CE%sT   1945 Apr  2 2:00s
+                       1:00    Italy   CE%sT   1973 Mar 31
+                       1:00    Malta   CE%sT   1981
+                       1:00    EU      CE%sT
+
+# Moldova
+
+# From Paul Eggert (2006-03-22):
+# A previous version of this database followed Shanks & Pottenger, who write
+# that Tiraspol switched to Moscow time on 1992-01-19 at 02:00.
+# However, this is most likely an error, as Moldova declared independence
+# on 1991-08-27 (the 1992-01-19 date is that of a Russian decree).
+# In early 1992 there was large-scale interethnic violence in the area
+# and it's possible that some Russophones continued to observe Moscow time.
+# But [two people] separately reported via
+# Jesper Norgaard that as of 2001-01-24 Tiraspol was like Chisinau.
+# The Tiraspol entry has therefore been removed for now.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Chisinau 1:55:20 -       LMT     1880
+                       1:55    -       CMT     1918 Feb 15 # Chisinau MT
+                       1:44:24 -       BMT     1931 Jul 24 # Bucharest MT
+                       2:00    Romania EE%sT   1940 Aug 15
+                       2:00    1:00    EEST    1941 Jul 17
+                       1:00    C-Eur   CE%sT   1944 Aug 24
+                       3:00    Russia  MSK/MSD 1990
+                       3:00    -       MSK     1990 May 6
+                       2:00    -       EET     1991
+                       2:00    Russia  EE%sT   1992
+                       2:00    E-Eur   EE%sT   1997
+# See Romania commentary for the guessed 1997 transition to EU rules.
+                       2:00    EU      EE%sT
+
+# Monaco
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
+# more precise 0:09:21.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Monaco   0:29:32 -       LMT     1891 Mar 15
+                       0:09:21 -       PMT     1911 Mar 11    # Paris Mean Time
+                       0:00    France  WE%sT   1945 Sep 16 3:00
+                       1:00    France  CE%sT   1977
+                       1:00    EU      CE%sT
+
+# Montenegro
+# see Serbia
+
+# Netherlands
+
+# Howse writes that the Netherlands' railways used GMT between 1892 and 1940,
+# but for other purposes the Netherlands used Amsterdam mean time.
+
+# However, Robert H. van Gent writes (2001-04-01):
+# Howse's statement is only correct up to 1909. From 1909-05-01 (00:00:00
+# Amsterdam mean time) onwards, the whole of the Netherlands (including
+# the Dutch railways) was required by law to observe Amsterdam mean time
+# (19 minutes 32.13 seconds ahead of GMT). This had already been the
+# common practice (except for the railways) for many decades but it was
+# not until 1909 when the Dutch government finally defined this by law.
+# On 1937-07-01 this was changed to 20 minutes (exactly) ahead of GMT and
+# was generally known as Dutch Time ("Nederlandse Tijd").
+#
+# (2001-04-08):
+# 1892-05-01 was the date when the Dutch railways were by law required to
+# observe GMT while the remainder of the Netherlands adhered to the common
+# practice of following Amsterdam mean time.
+#
+# (2001-04-09):
+# In 1835 the authorities of the province of North Holland requested the
+# municipal authorities of the towns and cities in the province to observe
+# Amsterdam mean time but I do not know in how many cases this request was
+# actually followed.
+#
+# From 1852 onwards the Dutch telegraph offices were by law required to
+# observe Amsterdam mean time. As the time signals from the observatory of
+# Leiden were also distributed by the telegraph system, I assume that most
+# places linked up with the telegraph (and railway) system automatically
+# adopted Amsterdam mean time.
+#
+# Although the early Dutch railway companies initially observed a variety
+# of times, most of them had adopted Amsterdam mean time by 1858 but it
+# was not until 1866 when they were all required by law to observe
+# Amsterdam mean time.
+
+# The data before 1945 are taken from
+# <http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm>.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Neth    1916    only    -       May      1      0:00    1:00    NST     # Netherlands Summer Time
+Rule   Neth    1916    only    -       Oct      1      0:00    0       AMT     # Amsterdam Mean Time
+Rule   Neth    1917    only    -       Apr     16      2:00s   1:00    NST
+Rule   Neth    1917    only    -       Sep     17      2:00s   0       AMT
+Rule   Neth    1918    1921    -       Apr     Mon>=1  2:00s   1:00    NST
+Rule   Neth    1918    1921    -       Sep     lastMon 2:00s   0       AMT
+Rule   Neth    1922    only    -       Mar     lastSun 2:00s   1:00    NST
+Rule   Neth    1922    1936    -       Oct     Sun>=2  2:00s   0       AMT
+Rule   Neth    1923    only    -       Jun     Fri>=1  2:00s   1:00    NST
+Rule   Neth    1924    only    -       Mar     lastSun 2:00s   1:00    NST
+Rule   Neth    1925    only    -       Jun     Fri>=1  2:00s   1:00    NST
+# From 1926 through 1939 DST began 05-15, except that it was delayed by a week
+# in years when 05-15 fell in the Pentecost weekend.
+Rule   Neth    1926    1931    -       May     15      2:00s   1:00    NST
+Rule   Neth    1932    only    -       May     22      2:00s   1:00    NST
+Rule   Neth    1933    1936    -       May     15      2:00s   1:00    NST
+Rule   Neth    1937    only    -       May     22      2:00s   1:00    NST
+Rule   Neth    1937    only    -       Jul      1      0:00    1:00    S
+Rule   Neth    1937    1939    -       Oct     Sun>=2  2:00s   0       -
+Rule   Neth    1938    1939    -       May     15      2:00s   1:00    S
+Rule   Neth    1945    only    -       Apr      2      2:00s   1:00    S
+Rule   Neth    1945    only    -       Sep     16      2:00s   0       -
+#
+# Amsterdam Mean Time was +00:19:32.13 exactly, but the .13 is omitted
+# below because the current format requires GMTOFF to be an integer.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Europe/Amsterdam  0:19:32 -       LMT     1835
+                       0:19:32 Neth    %s      1937 Jul  1
+                       0:20    Neth    NE%sT   1940 May 16 0:00 # Dutch Time
+                       1:00    C-Eur   CE%sT   1945 Apr  2 2:00
+                       1:00    Neth    CE%sT   1977
+                       1:00    EU      CE%sT
+
+# Norway
+# http://met.no/met/met_lex/q_u/sommertid.html (2004-01) agrees with Shanks &
+# Pottenger.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Norway  1916    only    -       May     22      1:00    1:00    S
+Rule   Norway  1916    only    -       Sep     30      0:00    0       -
+Rule   Norway  1945    only    -       Apr      2      2:00s   1:00    S
+Rule   Norway  1945    only    -       Oct      1      2:00s   0       -
+Rule   Norway  1959    1964    -       Mar     Sun>=15 2:00s   1:00    S
+Rule   Norway  1959    1965    -       Sep     Sun>=15 2:00s   0       -
+Rule   Norway  1965    only    -       Apr     25      2:00s   1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Oslo     0:43:00 -       LMT     1895 Jan  1
+                       1:00    Norway  CE%sT   1940 Aug 10 23:00
+                       1:00    C-Eur   CE%sT   1945 Apr  2  2:00
+                       1:00    Norway  CE%sT   1980
+                       1:00    EU      CE%sT
+
+# Svalbard & Jan Mayen
+
+# From Steffen Thorsen (2001-05-01):
+# Although I could not find it explicitly, it seems that Jan Mayen and
+# Svalbard have been using the same time as Norway at least since the
+# time they were declared as parts of Norway.  Svalbard was declared
+# as a part of Norway by law of 1925-07-17 no 11, section 4 and Jan
+# Mayen by law of 1930-02-27 no 2, section 2. (From
+# http://www.lovdata.no/all/nl-19250717-011.html and
+# http://www.lovdata.no/all/nl-19300227-002.html).  The law/regulation
+# for normal/standard time in Norway is from 1894-06-29 no 1 (came
+# into operation on 1895-01-01) and Svalbard/Jan Mayen seem to be a
+# part of this law since 1925/1930. (From
+# http://www.lovdata.no/all/nl-18940629-001.html ) I have not been
+# able to find if Jan Mayen used a different time zone (e.g. -0100)
+# before 1930. Jan Mayen has only been "inhabitated" since 1921 by
+# Norwegian meteorologists and maybe used the same time as Norway ever
+# since 1921.  Svalbard (Arctic/Longyearbyen) has been inhabited since
+# before 1895, and therefore probably changed the local time somewhere
+# between 1895 and 1925 (inclusive).
+
+# From Paul Eggert (2001-05-01):
+#
+# Actually, Jan Mayen was never occupied by Germany during World War II,
+# so it must have diverged from Oslo time during the war, as Oslo was
+# keeping Berlin time.
+#
+# <http://home.no.net/janmayen/history.htm> says that the meteorologists
+# burned down their station in 1940 and left the island, but returned in
+# 1941 with a small Norwegian garrison and continued operations despite
+# frequent air ttacks from Germans.  In 1943 the Americans established a
+# radiolocating station on the island, called "Atlantic City".  Possibly
+# the UTC offset changed during the war, but I think it unlikely that
+# Jan Mayen used German daylight-saving rules.
+#
+# Svalbard is more complicated, as it was raided in August 1941 by an
+# Allied party that evacuated the civilian population to England (says
+# <http://www.bartleby.com/65/sv/Svalbard.html>).  The Svalbard FAQ
+# <http://www.svalbard.com/SvalbardFAQ.html> says that the Germans were
+# expelled on 1942-05-14.  However, small parties of Germans did return,
+# and according to Wilhelm Dege's book "War North of 80" (1954)
+# <http://www.ucalgary.ca/UofC/departments/UP/1-55238/1-55238-110-2.html>
+# the German armed forces at the Svalbard weather station code-named
+# Haudegen did not surrender to the Allies until September 1945.
+#
+# All these events predate our cutoff date of 1970.  Unless we can
+# come up with more definitive info about the timekeeping during the
+# war years it's probably best just do do the following for now:
+Link   Europe/Oslo     Arctic/Longyearbyen
+
+# Poland
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Poland  1918    1919    -       Sep     16      2:00s   0       -
+Rule   Poland  1919    only    -       Apr     15      2:00s   1:00    S
+Rule   Poland  1944    only    -       Apr      3      2:00s   1:00    S
+# Whitman gives 1944 Nov 30; go with Shanks & Pottenger.
+Rule   Poland  1944    only    -       Oct      4      2:00    0       -
+# For 1944-1948 Whitman gives the previous day; go with Shanks & Pottenger.
+Rule   Poland  1945    only    -       Apr     29      0:00    1:00    S
+Rule   Poland  1945    only    -       Nov      1      0:00    0       -
+# For 1946 on the source is Kazimierz Borkowski,
+# Torun Center for Astronomy, Dept. of Radio Astronomy, Nicolaus Copernicus U.,
+# <http://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1>
+# Thanks to Przemyslaw Augustyniak (2005-05-28) for this reference.
+# He also gives these further references:
+# Mon Pol nr 13, poz 162 (1995) <http://www.abc.com.pl/serwis/mp/1995/0162.htm>
+# Druk nr 2180 (2003) <http://www.senat.gov.pl/k5/dok/sejm/053/2180.pdf>
+Rule   Poland  1946    only    -       Apr     14      0:00s   1:00    S
+Rule   Poland  1946    only    -       Oct      7      2:00s   0       -
+Rule   Poland  1947    only    -       May      4      2:00s   1:00    S
+Rule   Poland  1947    1949    -       Oct     Sun>=1  2:00s   0       -
+Rule   Poland  1948    only    -       Apr     18      2:00s   1:00    S
+Rule   Poland  1949    only    -       Apr     10      2:00s   1:00    S
+Rule   Poland  1957    only    -       Jun      2      1:00s   1:00    S
+Rule   Poland  1957    1958    -       Sep     lastSun 1:00s   0       -
+Rule   Poland  1958    only    -       Mar     30      1:00s   1:00    S
+Rule   Poland  1959    only    -       May     31      1:00s   1:00    S
+Rule   Poland  1959    1961    -       Oct     Sun>=1  1:00s   0       -
+Rule   Poland  1960    only    -       Apr      3      1:00s   1:00    S
+Rule   Poland  1961    1964    -       May     lastSun 1:00s   1:00    S
+Rule   Poland  1962    1964    -       Sep     lastSun 1:00s   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Warsaw   1:24:00 -       LMT     1880
+                       1:24:00 -       WMT     1915 Aug  5   # Warsaw Mean Time
+                       1:00    C-Eur   CE%sT   1918 Sep 16 3:00
+                       2:00    Poland  EE%sT   1922 Jun
+                       1:00    Poland  CE%sT   1940 Jun 23 2:00
+                       1:00    C-Eur   CE%sT   1944 Oct
+                       1:00    Poland  CE%sT   1977
+                       1:00    W-Eur   CE%sT   1988
+                       1:00    EU      CE%sT
+
+# Portugal
+#
+# From Rui Pedro Salgueiro (1992-11-12):
+# Portugal has recently (September, 27) changed timezone
+# (from WET to MET or CET) to harmonize with EEC.
+#
+# Martin Bruckmann (1996-02-29) reports via Peter Ilieve
+# that Portugal is reverting to 0:00 by not moving its clocks this spring.
+# The new Prime Minister was fed up with getting up in the dark in the winter.
+#
+# From Paul Eggert (1996-11-12):
+# IATA SSIM (1991-09) reports several 1991-09 and 1992-09 transitions
+# at 02:00u, not 01:00u.  Assume that these are typos.
+# IATA SSIM (1991/1992) reports that the Azores were at -1:00.
+# IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00.
+# Guess that the Azores changed to EU rules in 1992 (since that's when Portugal
+# harmonized with the EU), and that they stayed +0:00 that winter.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# DSH writes that despite Decree 1,469 (1915), the change to the clocks was not
+# done every year, depending on what Spain did, because of railroad schedules.
+# Go with Shanks & Pottenger.
+Rule   Port    1916    only    -       Jun     17      23:00   1:00    S
+# Whitman gives 1916 Oct 31; go with Shanks & Pottenger.
+Rule   Port    1916    only    -       Nov      1       1:00   0       -
+Rule   Port    1917    only    -       Feb     28      23:00s  1:00    S
+Rule   Port    1917    1921    -       Oct     14      23:00s  0       -
+Rule   Port    1918    only    -       Mar      1      23:00s  1:00    S
+Rule   Port    1919    only    -       Feb     28      23:00s  1:00    S
+Rule   Port    1920    only    -       Feb     29      23:00s  1:00    S
+Rule   Port    1921    only    -       Feb     28      23:00s  1:00    S
+Rule   Port    1924    only    -       Apr     16      23:00s  1:00    S
+Rule   Port    1924    only    -       Oct     14      23:00s  0       -
+Rule   Port    1926    only    -       Apr     17      23:00s  1:00    S
+Rule   Port    1926    1929    -       Oct     Sat>=1  23:00s  0       -
+Rule   Port    1927    only    -       Apr      9      23:00s  1:00    S
+Rule   Port    1928    only    -       Apr     14      23:00s  1:00    S
+Rule   Port    1929    only    -       Apr     20      23:00s  1:00    S
+Rule   Port    1931    only    -       Apr     18      23:00s  1:00    S
+# Whitman gives 1931 Oct 8; go with Shanks & Pottenger.
+Rule   Port    1931    1932    -       Oct     Sat>=1  23:00s  0       -
+Rule   Port    1932    only    -       Apr      2      23:00s  1:00    S
+Rule   Port    1934    only    -       Apr      7      23:00s  1:00    S
+# Whitman gives 1934 Oct 5; go with Shanks & Pottenger.
+Rule   Port    1934    1938    -       Oct     Sat>=1  23:00s  0       -
+# Shanks & Pottenger give 1935 Apr 30; go with Whitman.
+Rule   Port    1935    only    -       Mar     30      23:00s  1:00    S
+Rule   Port    1936    only    -       Apr     18      23:00s  1:00    S
+# Whitman gives 1937 Apr 2; go with Shanks & Pottenger.
+Rule   Port    1937    only    -       Apr      3      23:00s  1:00    S
+Rule   Port    1938    only    -       Mar     26      23:00s  1:00    S
+Rule   Port    1939    only    -       Apr     15      23:00s  1:00    S
+# Whitman gives 1939 Oct 7; go with Shanks & Pottenger.
+Rule   Port    1939    only    -       Nov     18      23:00s  0       -
+Rule   Port    1940    only    -       Feb     24      23:00s  1:00    S
+# Shanks & Pottenger give 1940 Oct 7; go with Whitman.
+Rule   Port    1940    1941    -       Oct      5      23:00s  0       -
+Rule   Port    1941    only    -       Apr      5      23:00s  1:00    S
+Rule   Port    1942    1945    -       Mar     Sat>=8  23:00s  1:00    S
+Rule   Port    1942    only    -       Apr     25      22:00s  2:00    M # Midsummer
+Rule   Port    1942    only    -       Aug     15      22:00s  1:00    S
+Rule   Port    1942    1945    -       Oct     Sat>=24 23:00s  0       -
+Rule   Port    1943    only    -       Apr     17      22:00s  2:00    M
+Rule   Port    1943    1945    -       Aug     Sat>=25 22:00s  1:00    S
+Rule   Port    1944    1945    -       Apr     Sat>=21 22:00s  2:00    M
+Rule   Port    1946    only    -       Apr     Sat>=1  23:00s  1:00    S
+Rule   Port    1946    only    -       Oct     Sat>=1  23:00s  0       -
+Rule   Port    1947    1949    -       Apr     Sun>=1   2:00s  1:00    S
+Rule   Port    1947    1949    -       Oct     Sun>=1   2:00s  0       -
+# Shanks & Pottenger say DST was observed in 1950; go with Whitman.
+# Whitman gives Oct lastSun for 1952 on; go with Shanks & Pottenger.
+Rule   Port    1951    1965    -       Apr     Sun>=1   2:00s  1:00    S
+Rule   Port    1951    1965    -       Oct     Sun>=1   2:00s  0       -
+Rule   Port    1977    only    -       Mar     27       0:00s  1:00    S
+Rule   Port    1977    only    -       Sep     25       0:00s  0       -
+Rule   Port    1978    1979    -       Apr     Sun>=1   0:00s  1:00    S
+Rule   Port    1978    only    -       Oct      1       0:00s  0       -
+Rule   Port    1979    1982    -       Sep     lastSun  1:00s  0       -
+Rule   Port    1980    only    -       Mar     lastSun  0:00s  1:00    S
+Rule   Port    1981    1982    -       Mar     lastSun  1:00s  1:00    S
+Rule   Port    1983    only    -       Mar     lastSun  2:00s  1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# Shanks & Pottenger say the transition from LMT to WET occurred 1911-05-24;
+# Willett says 1912-01-01.  Go with Willett.
+Zone   Europe/Lisbon   -0:36:32 -      LMT     1884
+                       -0:36:32 -      LMT     1912 Jan  1  # Lisbon Mean Time
+                        0:00   Port    WE%sT   1966 Apr  3 2:00
+                        1:00   -       CET     1976 Sep 26 1:00
+                        0:00   Port    WE%sT   1983 Sep 25 1:00s
+                        0:00   W-Eur   WE%sT   1992 Sep 27 1:00s
+                        1:00   EU      CE%sT   1996 Mar 31 1:00u
+                        0:00   EU      WE%sT
+Zone Atlantic/Azores   -1:42:40 -      LMT     1884            # Ponta Delgada
+                       -1:54:32 -      HMT     1911 May 24  # Horta Mean Time
+                       -2:00   Port    AZO%sT  1966 Apr  3 2:00 # Azores Time
+                       -1:00   Port    AZO%sT  1983 Sep 25 1:00s
+                       -1:00   W-Eur   AZO%sT  1992 Sep 27 1:00s
+                        0:00   EU      WE%sT   1993 Mar 28 1:00u
+                       -1:00   EU      AZO%sT
+Zone Atlantic/Madeira  -1:07:36 -      LMT     1884            # Funchal
+                       -1:07:36 -      FMT     1911 May 24  # Funchal Mean Time
+                       -1:00   Port    MAD%sT  1966 Apr  3 2:00 # Madeira Time
+                        0:00   Port    WE%sT   1983 Sep 25 1:00s
+                        0:00   EU      WE%sT
+
+# Romania
+#
+# From Paul Eggert (1999-10-07):
+# <a href="http://www.nineoclock.ro/POL/1778pol.html">
+# Nine O'clock</a> (1998-10-23) reports that the switch occurred at
+# 04:00 local time in fall 1998.  For lack of better info,
+# assume that Romania and Moldova switched to EU rules in 1997,
+# the same year as Bulgaria.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Romania 1932    only    -       May     21       0:00s  1:00    S
+Rule   Romania 1932    1939    -       Oct     Sun>=1   0:00s  0       -
+Rule   Romania 1933    1939    -       Apr     Sun>=2   0:00s  1:00    S
+Rule   Romania 1979    only    -       May     27       0:00   1:00    S
+Rule   Romania 1979    only    -       Sep     lastSun  0:00   0       -
+Rule   Romania 1980    only    -       Apr      5      23:00   1:00    S
+Rule   Romania 1980    only    -       Sep     lastSun  1:00   0       -
+Rule   Romania 1991    1993    -       Mar     lastSun  0:00s  1:00    S
+Rule   Romania 1991    1993    -       Sep     lastSun  0:00s  0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Europe/Bucharest  1:44:24 -       LMT     1891 Oct
+                       1:44:24 -       BMT     1931 Jul 24     # Bucharest MT
+                       2:00    Romania EE%sT   1981 Mar 29 2:00s
+                       2:00    C-Eur   EE%sT   1991
+                       2:00    Romania EE%sT   1994
+                       2:00    E-Eur   EE%sT   1997
+                       2:00    EU      EE%sT
+
+# Russia
+
+# From Paul Eggert (2006-03-22):
+# Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
+# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
+# are from Andrey A. Chernov.  The rest is from Shanks & Pottenger,
+# except we follow Chernov's report that 1992 DST transitions were Sat
+# 23:00, not Sun 02:00s.
+#
+# From Stanislaw A. Kuzikowski (1994-06-29):
+# But now it is some months since Novosibirsk is 3 hours ahead of Moscow!
+# I do not know why they have decided to make this change;
+# as far as I remember it was done exactly during winter->summer switching
+# so we (Novosibirsk) simply did not switch.
+#
+# From Andrey A. Chernov (1996-10-04):
+# `MSK' and `MSD' were born and used initially on Moscow computers with
+# UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group)....
+# The next step was the UUCP network, the Relcom predecessor
+# (used mainly for mail), and MSK/MSD was actively used there.
+#
+# From Chris Carrier (1996-10-30):
+# According to a friend of mine who rode the Trans-Siberian Railroad from
+# Moscow to Irkutsk in 1995, public air and rail transport in Russia ...
+# still follows Moscow time, no matter where in Russia it is located.
+#
+# For Grozny, Chechnya, we have the following story from
+# John Daniszewski, "Scavengers in the Rubble", Los Angeles Times (2001-02-07):
+# News--often false--is spread by word of mouth.  A rumor that it was
+# time to move the clocks back put this whole city out of sync with
+# the rest of Russia for two weeks--even soldiers stationed here began
+# enforcing curfew at the wrong time.
+#
+# From Gwillim Law (2001-06-05):
+# There's considerable evidence that Sakhalin Island used to be in
+# UTC+11, and has changed to UTC+10, in this decade.  I start with the
+# SSIM, which listed Yuzhno-Sakhalinsk in zone RU10 along with Magadan
+# until February 1997, and then in RU9 with Khabarovsk and Vladivostok
+# since September 1997....  Although the Kuril Islands are
+# administratively part of Sakhalin oblast', they appear to have
+# remained on UTC+11 along with Magadan.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+#
+# Kaliningradskaya oblast'.
+Zone Europe/Kaliningrad         1:22:00 -      LMT     1893 Apr
+                        1:00   C-Eur   CE%sT   1945
+                        2:00   Poland  CE%sT   1946
+                        3:00   Russia  MSK/MSD 1991 Mar 31 2:00s
+                        2:00   Russia  EE%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Adygeya, Arkhangel'skaya oblast',
+# Belgorodskaya oblast', Bryanskaya oblast', Vladimirskaya oblast',
+# Vologodskaya oblast', Voronezhskaya oblast',
+# Respublika Dagestan, Ivanovskaya oblast', Respublika Ingushetiya,
+# Kabarbino-Balkarskaya Respublika, Respublika Kalmykiya,
+# Kalyzhskaya oblast', Respublika Karachaevo-Cherkessiya,
+# Respublika Kareliya, Respublika Komi,
+# Kostromskaya oblast', Krasnodarskij kraj, Kurskaya oblast',
+# Leningradskaya oblast', Lipetskaya oblast', Respublika Marij El,
+# Respublika Mordoviya, Moskva, Moskovskaya oblast',
+# Murmanskaya oblast', Nenetskij avtonomnyj okrug,
+# Nizhegorodskaya oblast', Novgorodskaya oblast', Orlovskaya oblast',
+# Penzenskaya oblast', Pskovskaya oblast', Rostovskaya oblast',
+# Ryazanskaya oblast', Sankt-Peterburg,
+# Respublika Severnaya Osetiya, Smolenskaya oblast',
+# Stavropol'skij kraj, Tambovskaya oblast', Respublika Tatarstan,
+# Tverskaya oblast', Tyl'skaya oblast', Ul'yanovskaya oblast',
+# Chechenskaya Respublika, Chuvashskaya oblast',
+# Yaroslavskaya oblast'
+Zone Europe/Moscow      2:30:20 -      LMT     1880
+                        2:30   -       MMT     1916 Jul  3 # Moscow Mean Time
+                        2:30:48 Russia %s      1919 Jul  1 2:00
+                        3:00   Russia  MSK/MSD 1922 Oct
+                        2:00   -       EET     1930 Jun 21
+                        3:00   Russia  MSK/MSD 1991 Mar 31 2:00s
+                        2:00   Russia  EE%sT   1992 Jan 19 2:00s
+                        3:00   Russia  MSK/MSD
+#
+# Astrakhanskaya oblast', Kirovskaya oblast', Saratovskaya oblast',
+# Volgogradskaya oblast'.  Shanks & Pottenger say Kirov is still at +0400
+# but Wikipedia (2006-05-09) says +0300.  Perhaps it switched after the
+# others?  But we have no data.
+Zone Europe/Volgograd   2:57:40 -      LMT     1920 Jan  3
+                        3:00   -       TSAT    1925 Apr  6 # Tsaritsyn Time
+                        3:00   -       STAT    1930 Jun 21 # Stalingrad Time
+                        4:00   -       STAT    1961 Nov 11
+                        4:00   Russia  VOL%sT  1989 Mar 26 2:00s # Volgograd T
+                        3:00   Russia  VOL%sT  1991 Mar 31 2:00s
+                        4:00   -       VOLT    1992 Mar 29 2:00s
+                        3:00   Russia  VOL%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Samarskaya oblast', Udmyrtskaya respublika
+Zone Europe/Samara      3:20:36 -      LMT     1919 Jul  1 2:00
+                        3:00   -       SAMT    1930 Jun 21
+                        4:00   -       SAMT    1935 Jan 27
+                        4:00   Russia  KUY%sT  1989 Mar 26 2:00s # Kuybyshev
+                        3:00   Russia  KUY%sT  1991 Mar 31 2:00s
+                        2:00   Russia  KUY%sT  1991 Sep 29 2:00s
+                        3:00   -       KUYT    1991 Oct 20 3:00
+                        4:00   Russia  SAM%sT  # Samara Time
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Bashkortostan, Komi-Permyatskij avtonomnyj okrug,
+# Kurganskaya oblast', Orenburgskaya oblast', Permskaya oblast',
+# Sverdlovskaya oblast', Tyumenskaya oblast',
+# Khanty-Manskijskij avtonomnyj okrug, Chelyabinskaya oblast',
+# Yamalo-Nenetskij avtonomnyj okrug.
+Zone Asia/Yekaterinburg         4:02:24 -      LMT     1919 Jul 15 4:00
+                        4:00   -       SVET    1930 Jun 21 # Sverdlovsk Time
+                        5:00   Russia  SVE%sT  1991 Mar 31 2:00s
+                        4:00   Russia  SVE%sT  1992 Jan 19 2:00s
+                        5:00   Russia  YEK%sT  # Yekaterinburg Time
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Altaj, Altajskij kraj, Omskaya oblast'.
+Zone Asia/Omsk          4:53:36 -      LMT     1919 Nov 14
+                        5:00   -       OMST    1930 Jun 21 # Omsk TIme
+                        6:00   Russia  OMS%sT  1991 Mar 31 2:00s
+                        5:00   Russia  OMS%sT  1992 Jan 19 2:00s
+                        6:00   Russia  OMS%sT
+#
+# From Paul Eggert (2006-08-19): I'm guessing about Tomsk here; it's
+# not clear when it switched from +7 to +6.
+# Novosibirskaya oblast', Tomskaya oblast'.
+Zone Asia/Novosibirsk   5:31:40 -      LMT     1919 Dec 14 6:00
+                        6:00   -       NOVT    1930 Jun 21 # Novosibirsk Time
+                        7:00   Russia  NOV%sT  1991 Mar 31 2:00s
+                        6:00   Russia  NOV%sT  1992 Jan 19 2:00s
+                        7:00   Russia  NOV%sT  1993 May 23 # say Shanks & P.
+                        6:00   Russia  NOV%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Kemerovskaya oblast', Krasnoyarskij kraj,
+# Tajmyrskij (Dolgano-Nenetskij) avtonomnyj okrug,
+# Respublika Tuva, Respublika Khakasiya, Evenkijskij avtonomnyj okrug.
+Zone Asia/Krasnoyarsk   6:11:20 -      LMT     1920 Jan  6
+                        6:00   -       KRAT    1930 Jun 21 # Krasnoyarsk Time
+                        7:00   Russia  KRA%sT  1991 Mar 31 2:00s
+                        6:00   Russia  KRA%sT  1992 Jan 19 2:00s
+                        7:00   Russia  KRA%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Buryatiya, Irkutskaya oblast',
+# Ust'-Ordynskij Buryatskij avtonomnyj okrug.
+Zone Asia/Irkutsk       6:57:20 -      LMT     1880
+                        6:57:20 -      IMT     1920 Jan 25 # Irkutsk Mean Time
+                        7:00   -       IRKT    1930 Jun 21 # Irkutsk Time
+                        8:00   Russia  IRK%sT  1991 Mar 31 2:00s
+                        7:00   Russia  IRK%sT  1992 Jan 19 2:00s
+                        8:00   Russia  IRK%sT
+#
+# From Oscar van Vlijmen (2003-10-18): [This region consists of]
+# Aginskij Buryatskij avtonomnyj okrug, Amurskaya oblast',
+# [parts of] Respublika Sakha (Yakutiya), Chitinskaya oblast'.
+# The Sakha districts are: Aldanskij, Amginskij, Anabarskij,
+# Bulunskij, Verkhnekolymskij, Verkhnevilyujskij, Vilyujskij, Gornyj,
+# Zhiganskij, Kobyajskij, Lenskij, Megino-Kangalasskij, Mirninskij,
+# Namskij, Nyurbinskij, Olenekskij, Olekminskij, Srednekolymskij,
+# Suntarskij, Tattinskij, Ust'-Aldanskij, Khangalasskij,
+# Churapchinskij, Eveno-Bytantajskij.
+Zone Asia/Yakutsk       8:38:40 -      LMT     1919 Dec 15
+                        8:00   -       YAKT    1930 Jun 21 # Yakutsk Time
+                        9:00   Russia  YAK%sT  1991 Mar 31 2:00s
+                        8:00   Russia  YAK%sT  1992 Jan 19 2:00s
+                        9:00   Russia  YAK%sT
+#
+# From Oscar van Vlijmen (2003-10-18): [This region consists of]
+# Evrejskaya avtonomnaya oblast', Khabarovskij kraj, Primorskij kraj,
+# [parts of] Respublika Sakha (Yakutiya).
+# The Sakha districts are: Verkhoyanskij, Tomponskij, Ust'-Majskij,
+# Ust'-Yanskij.
+Zone Asia/Vladivostok   8:47:44 -      LMT     1922 Nov 15
+                        9:00   -       VLAT    1930 Jun 21 # Vladivostok Time
+                       10:00   Russia  VLA%sT  1991 Mar 31 2:00s
+                        9:00   Russia  VLA%sST 1992 Jan 19 2:00s
+                       10:00   Russia  VLA%sT
+#
+# Sakhalinskaya oblast'.
+# The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
+Zone Asia/Sakhalin      9:30:48 -      LMT     1905 Aug 23
+                        9:00   -       CJT     1938
+                        9:00   -       JST     1945 Aug 25
+                       11:00   Russia  SAK%sT  1991 Mar 31 2:00s # Sakhalin T.
+                       10:00   Russia  SAK%sT  1992 Jan 19 2:00s
+                       11:00   Russia  SAK%sT  1997 Mar lastSun 2:00s
+                       10:00   Russia  SAK%sT
+#
+# From Oscar van Vlijmen (2003-10-18): [This region consists of]
+# Magadanskaya oblast', Respublika Sakha (Yakutiya).
+# Probably also: Kuril Islands.
+# The Sakha districts are: Abyjskij, Allaikhovskij, Momskij,
+# Nizhnekolymskij, Ojmyakonskij.
+Zone Asia/Magadan      10:03:12 -      LMT     1924 May  2
+                       10:00   -       MAGT    1930 Jun 21 # Magadan Time
+                       11:00   Russia  MAG%sT  1991 Mar 31 2:00s
+                       10:00   Russia  MAG%sT  1992 Jan 19 2:00s
+                       11:00   Russia  MAG%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
+#
+# The Zone name should be Asia/Petropavlovsk-Kamchatski, but that's too long.
+Zone Asia/Kamchatka    10:34:36 -      LMT     1922 Nov 10
+                       11:00   -       PETT    1930 Jun 21 # P-K Time
+                       12:00   Russia  PET%sT  1991 Mar 31 2:00s
+                       11:00   Russia  PET%sT  1992 Jan 19 2:00s
+                       12:00   Russia  PET%sT
+#
+# Chukotskij avtonomnyj okrug
+Zone Asia/Anadyr       11:49:56 -      LMT     1924 May  2
+                       12:00   -       ANAT    1930 Jun 21 # Anadyr Time
+                       13:00   Russia  ANA%sT  1982 Apr  1 0:00s
+                       12:00   Russia  ANA%sT  1991 Mar 31 2:00s
+                       11:00   Russia  ANA%sT  1992 Jan 19 2:00s
+                       12:00   Russia  ANA%sT
+
+# Serbia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Belgrade 1:22:00 -       LMT     1884
+                       1:00    -       CET     1941 Apr 18 23:00
+                       1:00    C-Eur   CE%sT   1945
+                       1:00    -       CET     1945 May 8 2:00s
+                       1:00    1:00    CEST    1945 Sep 16  2:00s
+# Metod Kozelj reports that the legal date of
+# transition to EU rules was 1982-11-27, for all of Yugoslavia at the time.
+# Shanks & Pottenger don't give as much detail, so go with Kozelj.
+                       1:00    -       CET     1982 Nov 27
+                       1:00    EU      CE%sT
+Link Europe/Belgrade Europe/Ljubljana  # Slovenia
+Link Europe/Belgrade Europe/Podgorica  # Montenegro
+Link Europe/Belgrade Europe/Sarajevo   # Bosnia and Herzegovina
+Link Europe/Belgrade Europe/Skopje     # Macedonia
+Link Europe/Belgrade Europe/Zagreb     # Croatia
+
+# Slovakia
+Link Europe/Prague Europe/Bratislava
+
+# Slovenia
+# see Serbia
+
+# Spain
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# For 1917-1919 Whitman gives Apr Sat>=1 - Oct Sat>=1;
+# go with Shanks & Pottenger.
+Rule   Spain   1917    only    -       May      5      23:00s  1:00    S
+Rule   Spain   1917    1919    -       Oct      6      23:00s  0       -
+Rule   Spain   1918    only    -       Apr     15      23:00s  1:00    S
+Rule   Spain   1919    only    -       Apr      5      23:00s  1:00    S
+# Whitman gives 1921 Feb 28 - Oct 14; go with Shanks & Pottenger.
+Rule   Spain   1924    only    -       Apr     16      23:00s  1:00    S
+# Whitman gives 1924 Oct 14; go with Shanks & Pottenger.
+Rule   Spain   1924    only    -       Oct      4      23:00s  0       -
+Rule   Spain   1926    only    -       Apr     17      23:00s  1:00    S
+# Whitman says no DST in 1929; go with Shanks & Pottenger.
+Rule   Spain   1926    1929    -       Oct     Sat>=1  23:00s  0       -
+Rule   Spain   1927    only    -       Apr      9      23:00s  1:00    S
+Rule   Spain   1928    only    -       Apr     14      23:00s  1:00    S
+Rule   Spain   1929    only    -       Apr     20      23:00s  1:00    S
+# Whitman gives 1937 Jun 16, 1938 Apr 16, 1940 Apr 13;
+# go with Shanks & Pottenger.
+Rule   Spain   1937    only    -       May     22      23:00s  1:00    S
+Rule   Spain   1937    1939    -       Oct     Sat>=1  23:00s  0       -
+Rule   Spain   1938    only    -       Mar     22      23:00s  1:00    S
+Rule   Spain   1939    only    -       Apr     15      23:00s  1:00    S
+Rule   Spain   1940    only    -       Mar     16      23:00s  1:00    S
+# Whitman says no DST 1942-1945; go with Shanks & Pottenger.
+Rule   Spain   1942    only    -       May      2      22:00s  2:00    M # Midsummer
+Rule   Spain   1942    only    -       Sep      1      22:00s  1:00    S
+Rule   Spain   1943    1946    -       Apr     Sat>=13 22:00s  2:00    M
+Rule   Spain   1943    only    -       Oct      3      22:00s  1:00    S
+Rule   Spain   1944    only    -       Oct     10      22:00s  1:00    S
+Rule   Spain   1945    only    -       Sep     30       1:00   1:00    S
+Rule   Spain   1946    only    -       Sep     30       0:00   0       -
+Rule   Spain   1949    only    -       Apr     30      23:00   1:00    S
+Rule   Spain   1949    only    -       Sep     30       1:00   0       -
+Rule   Spain   1974    1975    -       Apr     Sat>=13 23:00   1:00    S
+Rule   Spain   1974    1975    -       Oct     Sun>=1   1:00   0       -
+Rule   Spain   1976    only    -       Mar     27      23:00   1:00    S
+Rule   Spain   1976    1977    -       Sep     lastSun  1:00   0       -
+Rule   Spain   1977    1978    -       Apr      2      23:00   1:00    S
+Rule   Spain   1978    only    -       Oct      1       1:00   0       -
+# The following rules are copied from Morocco from 1967 through 1978.
+Rule SpainAfrica 1967  only    -       Jun      3      12:00   1:00    S
+Rule SpainAfrica 1967  only    -       Oct      1       0:00   0       -
+Rule SpainAfrica 1974  only    -       Jun     24       0:00   1:00    S
+Rule SpainAfrica 1974  only    -       Sep      1       0:00   0       -
+Rule SpainAfrica 1976  1977    -       May      1       0:00   1:00    S
+Rule SpainAfrica 1976  only    -       Aug      1       0:00   0       -
+Rule SpainAfrica 1977  only    -       Sep     28       0:00   0       -
+Rule SpainAfrica 1978  only    -       Jun      1       0:00   1:00    S
+Rule SpainAfrica 1978  only    -       Aug      4       0:00   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Madrid   -0:14:44 -      LMT     1901 Jan  1  0:00s
+                        0:00   Spain   WE%sT   1946 Sep 30
+                        1:00   Spain   CE%sT   1979
+                        1:00   EU      CE%sT
+Zone   Africa/Ceuta    -0:21:16 -      LMT     1901
+                        0:00   -       WET     1918 May  6 23:00
+                        0:00   1:00    WEST    1918 Oct  7 23:00
+                        0:00   -       WET     1924
+                        0:00   Spain   WE%sT   1929
+                        0:00 SpainAfrica WE%sT 1984 Mar 16
+                        1:00   -       CET     1986
+                        1:00   EU      CE%sT
+Zone   Atlantic/Canary -1:01:36 -      LMT     1922 Mar # Las Palmas de Gran C.
+                       -1:00   -       CANT    1946 Sep 30 1:00 # Canaries Time
+                        0:00   -       WET     1980 Apr  6 0:00s
+                        0:00   1:00    WEST    1980 Sep 28 0:00s
+                        0:00   EU      WE%sT
+# IATA SSIM (1996-09) says the Canaries switch at 2:00u, not 1:00u.
+# Ignore this for now, as the Canaries are part of the EU.
+
+# Sweden
+
+# From Ivan Nilsson (2001-04-13), superseding Shanks & Pottenger:
+#
+# The law "Svensk forfattningssamling 1878, no 14" about standard time in 1879:
+# From the beginning of 1879 (that is 01-01 00:00) the time for all
+# places in the country is "the mean solar time for the meridian at
+# three degrees, or twelve minutes of time, to the west of the
+# meridian of the Observatory of Stockholm".  The law is dated 1878-05-31.
+#
+# The observatory at that time had the meridian 18 degrees 03' 30"
+# eastern longitude = 01:12:14 in time.  Less 12 minutes gives the
+# national standard time as 01:00:14 ahead of GMT....
+#
+# About the beginning of CET in Sweden. The lawtext ("Svensk
+# forfattningssamling 1899, no 44") states, that "from the beginning
+# of 1900... ... the same as the mean solar time for the meridian at
+# the distance of one hour of time from the meridian of the English
+# observatory at Greenwich, or at 12 minutes 14 seconds to the west
+# from the meridian of the Observatory of Stockholm". The law is dated
+# 1899-06-16.  In short: At 1900-01-01 00:00:00 the new standard time
+# in Sweden is 01:00:00 ahead of GMT.
+#
+# 1916: The lawtext ("Svensk forfattningssamling 1916, no 124") states
+# that "1916-05-15 is considered to begin one hour earlier". It is
+# pretty obvious that at 05-14 23:00 the clocks are set to 05-15 00:00....
+# Further the law says, that "1916-09-30 is considered to end one hour later".
+#
+# The laws regulating [DST] are available on the site of the Swedish
+# Parliament beginning with 1985 - the laws regulating 1980/1984 are
+# not available on the site (to my knowledge they are only available
+# in Swedish): <http://www.riksdagen.se/english/work/sfst.asp> (type
+# "sommartid" without the quotes in the field "Fritext" and then click
+# the Sok-button).
+#
+# (2001-05-13):
+#
+# I have now found a newspaper stating that at 1916-10-01 01:00
+# summertime the church-clocks etc were set back one hour to show
+# 1916-10-01 00:00 standard time.  The article also reports that some
+# people thought the switch to standard time would take place already
+# at 1916-10-01 00:00 summer time, but they had to wait for another
+# hour before the event took place.
+#
+# Source: The newspaper "Dagens Nyheter", 1916-10-01, page 7 upper left.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Europe/Stockholm  1:12:12 -       LMT     1879 Jan  1
+                       1:00:14 -       SET     1900 Jan  1     # Swedish Time
+                       1:00    -       CET     1916 May 14 23:00
+                       1:00    1:00    CEST    1916 Oct  1 01:00
+                       1:00    -       CET     1980
+                       1:00    EU      CE%sT
+
+# Switzerland
+# From Howse:
+# By the end of the 18th century clocks and watches became commonplace
+# and their performance improved enormously.  Communities began to keep
+# mean time in preference to apparent time -- Geneva from 1780 ....
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# From Whitman (who writes ``Midnight?''):
+# Rule Swiss   1940    only    -       Nov      2      0:00    1:00    S
+# Rule Swiss   1940    only    -       Dec     31      0:00    0       -
+# From Shanks & Pottenger:
+# Rule Swiss   1941    1942    -       May     Sun>=1  2:00    1:00    S
+# Rule Swiss   1941    1942    -       Oct     Sun>=1  0:00    0       -
+
+# From Alois Treindl (2008-12-17):
+# I have researched the DST usage in Switzerland during the 1940ies.
+#
+# As I wrote in an earlier message, I suspected the current tzdata values
+# to be wrong. This is now verified.
+#
+# I have found copies of the original ruling by the Swiss Federal
+# government, in 'Eidgen[o]ssische Gesetzessammlung 1941 and 1942' (Swiss
+# federal law collection)...
+#
+# DST began on Monday 5 May 1941, 1:00 am by shifting the clocks to 2:00 am
+# DST ended on Monday 6 Oct 1941, 2:00 am by shifting the clocks to 1:00 am.
+#
+# DST began on Monday, 4 May 1942 at 01:00 am
+# DST ended on Monday, 5 Oct 1942 at 02:00 am
+#
+# There was no DST in 1940, I have checked the law collection carefully.
+# It is also indicated by the fact that the 1942 entry in the law
+# collection points back to 1941 as a reference, but no reference to any
+# other years are made.
+#
+# Newspaper articles I have read in the archives on 6 May 1941 reported
+# about the introduction of DST (Sommerzeit in German) during the previous
+# night as an absolute novelty, because this was the first time that such
+# a thing had happened in Switzerland.
+#
+# I have also checked 1916, because one book source (Gabriel, Traite de
+# l'heure dans le monde) claims that Switzerland had DST in 1916. This is
+# false, no official document could be found. Probably Gabriel got misled
+# by references to Germany, which introduced DST in 1916 for the first time.
+#
+# The tzdata rules for Switzerland must be changed to:
+# Rule  Swiss   1941    1942    -       May     Mon>=1  1:00    1:00    S
+# Rule  Swiss   1941    1942    -       Oct     Mon>=1  2:00    0       -
+#
+# The 1940 rules must be deleted.
+#
+# One further detail for Switzerland, which is probably out of scope for
+# most users of tzdata:
+# The zone file
+# Zone    Europe/Zurich   0:34:08 -       LMT     1848 Sep 12
+#                          0:29:44 -       BMT     1894 Jun #Bern Mean Time
+#                          1:00    Swiss   CE%sT   1981
+#                          1:00    EU      CE%sT
+# describes all of Switzerland correctly, with the exception of
+# the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not
+# follow Bern Mean Time but kept its own local mean time.
+# To represent this, an extra zone would be needed.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Swiss   1941    1942    -       May     Mon>=1  1:00    1:00    S
+Rule   Swiss   1941    1942    -       Oct     Mon>=1  2:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Zurich   0:34:08 -       LMT     1848 Sep 12
+                       0:29:44 -       BMT     1894 Jun # Bern Mean Time
+                       1:00    Swiss   CE%sT   1981
+                       1:00    EU      CE%sT
+
+# Turkey
+
+# From Amar Devegowda (2007-01-03):
+# The time zone rules for Istanbul, Turkey have not been changed for years now.
+# ... The latest rules are available at -
+# http://www.timeanddate.com/worldclock/timezone.html?n=107
+# From Steffen Thorsen (2007-01-03):
+# I have been able to find press records back to 1996 which all say that
+# DST started 01:00 local time and end at 02:00 local time.  I am not sure
+# what happened before that.  One example for each year from 1996 to 2001:
+# http://newspot.byegm.gov.tr/arsiv/1996/21/N4.htm
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING97/03/97X03X25.TXT
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING98/03/98X03X02.HTM
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING99/10/99X10X26.HTM#%2016
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2000/03/00X03X06.HTM#%2021
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2001/03/23x03x01.HTM#%2027
+# From Paul Eggert (2007-01-03):
+# Prefer the above source to Shanks & Pottenger for time stamps after 1990.
+
+# From Steffen Thorsen (2007-03-09):
+# Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
+# start/end time, according to the following page (2007-03-07):
+# http://www.ntvmsnbc.com/news/402029.asp
+# The official document is located here - it is in Turkish...:
+# http://rega.basbakanlik.gov.tr/eskiler/2007/03/20070307-7.htm
+# I was able to locate the following seemingly official document
+# (on a non-government server though) describing dates between 2002 and 2006:
+# http://www.alomaliye.com/bkk_2002_3769.htm
+
+# From Sue Williams (2008-08-11):
+# I spotted this news article about a potential change in Turkey.
+#
+# <a href="http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1">
+# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
+# </a>
+
+# From Sue Williams (2008-08-20):
+# This article says that around the end of March 2011, Turkey wants to
+# adjust the clocks forward by 1/2 hour and stay that way permanently.
+# The article indicates that this is a change in timezone offset in addition
+# to stopping observance of DST.
+# This proposal has not yet been approved.
+#
+# Read more here...
+#
+# Turkey to abandon daylight saving time in 2011
+# <a href="http://www.turkishdailynews.com.tr/article.php?enewsid=112989">
+# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
+# </a>
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Turkey  1916    only    -       May      1      0:00    1:00    S
+Rule   Turkey  1916    only    -       Oct      1      0:00    0       -
+Rule   Turkey  1920    only    -       Mar     28      0:00    1:00    S
+Rule   Turkey  1920    only    -       Oct     25      0:00    0       -
+Rule   Turkey  1921    only    -       Apr      3      0:00    1:00    S
+Rule   Turkey  1921    only    -       Oct      3      0:00    0       -
+Rule   Turkey  1922    only    -       Mar     26      0:00    1:00    S
+Rule   Turkey  1922    only    -       Oct      8      0:00    0       -
+# Whitman gives 1923 Apr 28 - Sep 16 and no DST in 1924-1925;
+# go with Shanks & Pottenger.
+Rule   Turkey  1924    only    -       May     13      0:00    1:00    S
+Rule   Turkey  1924    1925    -       Oct      1      0:00    0       -
+Rule   Turkey  1925    only    -       May      1      0:00    1:00    S
+Rule   Turkey  1940    only    -       Jun     30      0:00    1:00    S
+Rule   Turkey  1940    only    -       Oct      5      0:00    0       -
+Rule   Turkey  1940    only    -       Dec      1      0:00    1:00    S
+Rule   Turkey  1941    only    -       Sep     21      0:00    0       -
+Rule   Turkey  1942    only    -       Apr      1      0:00    1:00    S
+# Whitman omits the next two transition and gives 1945 Oct 1;
+# go with Shanks & Pottenger.
+Rule   Turkey  1942    only    -       Nov      1      0:00    0       -
+Rule   Turkey  1945    only    -       Apr      2      0:00    1:00    S
+Rule   Turkey  1945    only    -       Oct      8      0:00    0       -
+Rule   Turkey  1946    only    -       Jun      1      0:00    1:00    S
+Rule   Turkey  1946    only    -       Oct      1      0:00    0       -
+Rule   Turkey  1947    1948    -       Apr     Sun>=16 0:00    1:00    S
+Rule   Turkey  1947    1950    -       Oct     Sun>=2  0:00    0       -
+Rule   Turkey  1949    only    -       Apr     10      0:00    1:00    S
+Rule   Turkey  1950    only    -       Apr     19      0:00    1:00    S
+Rule   Turkey  1951    only    -       Apr     22      0:00    1:00    S
+Rule   Turkey  1951    only    -       Oct      8      0:00    0       -
+Rule   Turkey  1962    only    -       Jul     15      0:00    1:00    S
+Rule   Turkey  1962    only    -       Oct      8      0:00    0       -
+Rule   Turkey  1964    only    -       May     15      0:00    1:00    S
+Rule   Turkey  1964    only    -       Oct      1      0:00    0       -
+Rule   Turkey  1970    1972    -       May     Sun>=2  0:00    1:00    S
+Rule   Turkey  1970    1972    -       Oct     Sun>=2  0:00    0       -
+Rule   Turkey  1973    only    -       Jun      3      1:00    1:00    S
+Rule   Turkey  1973    only    -       Nov      4      3:00    0       -
+Rule   Turkey  1974    only    -       Mar     31      2:00    1:00    S
+Rule   Turkey  1974    only    -       Nov      3      5:00    0       -
+Rule   Turkey  1975    only    -       Mar     30      0:00    1:00    S
+Rule   Turkey  1975    1976    -       Oct     lastSun 0:00    0       -
+Rule   Turkey  1976    only    -       Jun      1      0:00    1:00    S
+Rule   Turkey  1977    1978    -       Apr     Sun>=1  0:00    1:00    S
+Rule   Turkey  1977    only    -       Oct     16      0:00    0       -
+Rule   Turkey  1979    1980    -       Apr     Sun>=1  3:00    1:00    S
+Rule   Turkey  1979    1982    -       Oct     Mon>=11 0:00    0       -
+Rule   Turkey  1981    1982    -       Mar     lastSun 3:00    1:00    S
+Rule   Turkey  1983    only    -       Jul     31      0:00    1:00    S
+Rule   Turkey  1983    only    -       Oct      2      0:00    0       -
+Rule   Turkey  1985    only    -       Apr     20      0:00    1:00    S
+Rule   Turkey  1985    only    -       Sep     28      0:00    0       -
+Rule   Turkey  1986    1990    -       Mar     lastSun 2:00s   1:00    S
+Rule   Turkey  1986    1990    -       Sep     lastSun 2:00s   0       -
+Rule   Turkey  1991    2006    -       Mar     lastSun 1:00s   1:00    S
+Rule   Turkey  1991    1995    -       Sep     lastSun 1:00s   0       -
+Rule   Turkey  1996    2006    -       Oct     lastSun 1:00s   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   Europe/Istanbul 1:55:52 -       LMT     1880
+                       1:56:56 -       IMT     1910 Oct # Istanbul Mean Time?
+                       2:00    Turkey  EE%sT   1978 Oct 15
+                       3:00    Turkey  TR%sT   1985 Apr 20 # Turkey Time
+                       2:00    Turkey  EE%sT   2007
+                       2:00    EU      EE%sT
+Link   Europe/Istanbul Asia/Istanbul   # Istanbul is in both continents.
+
+# Ukraine
+#
+# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# via Garrett Wollman (2003-01-27):
+# BTW, I've found the official document on this matter. It's goverment
+# regulations number 509, May 13, 1996. In my poor translation it says:
+# "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
+# of March at 3am the time is changing to 4am and each last Sunday of
+# October the time at 4am is changing to 3am"
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# Most of Ukraine since 1970 has been like Kiev.
+# "Kyiv" is the transliteration of the Ukrainian name, but
+# "Kiev" is more common in English.
+Zone Europe/Kiev       2:02:04 -       LMT     1880
+                       2:02:04 -       KMT     1924 May  2 # Kiev Mean Time
+                       2:00    -       EET     1930 Jun 21
+                       3:00    -       MSK     1941 Sep 20
+                       1:00    C-Eur   CE%sT   1943 Nov  6
+                       3:00    Russia  MSK/MSD 1990
+                       3:00    -       MSK     1990 Jul  1 2:00
+                       2:00    -       EET     1992
+                       2:00    E-Eur   EE%sT   1995
+                       2:00    EU      EE%sT
+# Ruthenia used CET 1990/1991.
+# "Uzhhorod" is the transliteration of the Ukrainian name, but
+# "Uzhgorod" is more common in English.
+Zone Europe/Uzhgorod   1:29:12 -       LMT     1890 Oct
+                       1:00    -       CET     1940
+                       1:00    C-Eur   CE%sT   1944 Oct
+                       1:00    1:00    CEST    1944 Oct 26
+                       1:00    -       CET     1945 Jun 29
+                       3:00    Russia  MSK/MSD 1990
+                       3:00    -       MSK     1990 Jul  1 2:00
+                       1:00    -       CET     1991 Mar 31 3:00
+                       2:00    -       EET     1992
+                       2:00    E-Eur   EE%sT   1995
+                       2:00    EU      EE%sT
+# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991.
+# "Zaporizhia" is the transliteration of the Ukrainian name, but
+# "Zaporozh'ye" is more common in English.  Use the common English
+# spelling, except omit the apostrophe as it is not allowed in
+# portable Posix file names.
+Zone Europe/Zaporozhye 2:20:40 -       LMT     1880
+                       2:20    -       CUT     1924 May  2 # Central Ukraine T
+                       2:00    -       EET     1930 Jun 21
+                       3:00    -       MSK     1941 Aug 25
+                       1:00    C-Eur   CE%sT   1943 Oct 25
+                       3:00    Russia  MSK/MSD 1991 Mar 31 2:00
+                       2:00    E-Eur   EE%sT   1995
+                       2:00    EU      EE%sT
+# Central Crimea used Moscow time 1994/1997.
+Zone Europe/Simferopol 2:16:24 -       LMT     1880
+                       2:16    -       SMT     1924 May  2 # Simferopol Mean T
+                       2:00    -       EET     1930 Jun 21
+                       3:00    -       MSK     1941 Nov
+                       1:00    C-Eur   CE%sT   1944 Apr 13
+                       3:00    Russia  MSK/MSD 1990
+                       3:00    -       MSK     1990 Jul  1 2:00
+                       2:00    -       EET     1992
+# From Paul Eggert (2006-03-22):
+# The _Economist_ (1994-05-28, p 45) reports that central Crimea switched
+# from Kiev to Moscow time sometime after the January 1994 elections.
+# Shanks (1999) says ``date of change uncertain'', but implies that it happened
+# sometime between the 1994 DST switches.  Shanks & Pottenger simply say
+# 1994-09-25 03:00, but that can't be right.  For now, guess it
+# changed in May.
+                       2:00    E-Eur   EE%sT   1994 May
+# From IATA SSIM (1994/1997), which also says that Kerch is still like Kiev.
+                       3:00    E-Eur   MSK/MSD 1996 Mar 31 3:00s
+                       3:00    1:00    MSD     1996 Oct 27 3:00s
+# IATA SSIM (1997-09) says Crimea switched to EET/EEST.
+# Assume it happened in March by not changing the clocks.
+                       3:00    Russia  MSK/MSD 1997
+                       3:00    -       MSK     1997 Mar lastSun 1:00u
+                       2:00    EU      EE%sT
+
+###############################################################################
+
+# One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from
+# the last Sunday in March to the last Sunday in September in 1986.
+# The source shows Romania changing a day later than everybody else.
+#
+# According to Bernard Sieloff's source, Poland is in the MET time zone but
+# uses the WE DST rules.  The Western USSR uses EET+1 and ME DST rules.
+# Bernard Sieloff's source claims Romania switches on the same day, but at
+# 00:00 standard time (i.e., 01:00 DST).  It also claims that Turkey
+# switches on the same day, but switches on at 01:00 standard time
+# and off at 00:00 standard time (i.e., 01:00 DST)
+
+# ...
+# Date: Wed, 28 Jan 87 16:56:27 -0100
+# From: Tom Hofmann
+# ...
+#
+# ...the European time rules are...standardized since 1981, when
+# most European coun[tr]ies started DST.  Before that year, only
+# a few countries (UK, France, Italy) had DST, each according
+# to own national rules.  In 1981, however, DST started on
+# 'Apr firstSun', and not on 'Mar lastSun' as in the following
+# years...
+# But also since 1981 there are some more national exceptions
+# than listed in 'europe': Switzerland, for example, joined DST
+# one year later, Denmark ended DST on 'Oct 1' instead of 'Sep
+# lastSun' in 1981---I don't know how they handle now.
+#
+# Finally, DST ist always from 'Apr 1' to 'Oct 1' in the
+# Soviet Union (as far as I know).
+#
+# Tom Hofmann, Scientific Computer Center, CIBA-GEIGY AG,
+# 4002 Basle, Switzerland
+# ...
+
+# ...
+# Date: Wed, 4 Feb 87 22:35:22 +0100
+# From: Dik T. Winter
+# ...
+#
+# The information from Tom Hofmann is (as far as I know) not entirely correct.
+# After a request from chongo at amdahl I tried to retrieve all information
+# about DST in Europe.  I was able to find all from about 1969.
+#
+# ...standardization on DST in Europe started in about 1977 with switches on
+# first Sunday in April and last Sunday in September...
+# In 1981 UK joined Europe insofar that
+# the starting day for both shifted to last Sunday in March.  And from 1982
+# the whole of Europe used DST, with switch dates April 1 and October 1 in
+# the Sov[i]et Union.  In 1985 the SU reverted to standard Europe[a]n switch
+# dates...
+#
+# It should also be remembered that time-zones are not constants; e.g.
+# Portugal switched in 1976 from MET (or CET) to WET with DST...
+# Note also that though there were rules for switch dates not
+# all countries abided to these dates, and many individual deviations
+# occurred, though not since 1982 I believe.  Another note: it is always
+# assumed that DST is 1 hour ahead of normal time, this need not be the
+# case; at least in the Netherlands there have been times when DST was 2 hours
+# in advance of normal time.
+#
+# ...
+# dik t. winter, cwi, amsterdam, nederland
+# ...
+
+# From Bob Devine (1988-01-28):
+# ...
+# Greece: Last Sunday in April to last Sunday in September (iffy on dates).
+# Since 1978.  Change at midnight.
+# ...
+# Monaco: has same DST as France.
+# ...
diff --git a/extra/zoneinfo/leapseconds b/extra/zoneinfo/leapseconds
new file mode 100644 (file)
index 0000000..aa8cceb
--- /dev/null
@@ -0,0 +1,84 @@
+# @(#)leapseconds      8.7
+
+# Allowance for leapseconds added to each timezone file.
+
+# The International Earth Rotation Service periodically uses leap seconds
+# to keep UTC to within 0.9 s of UT1
+# (which measures the true angular orientation of the earth in space); see
+# Terry J Quinn, The BIPM and the accurate measure of time,
+# Proc IEEE 79, 7 (July 1991), 894-905.
+# There were no leap seconds before 1972, because the official mechanism
+# accounting for the discrepancy between atomic time and the earth's rotation
+# did not exist until the early 1970s.
+
+# The correction (+ or -) is made at the given time, so lines
+# will typically look like:
+#      Leap    YEAR    MON     DAY     23:59:60        +       R/S
+# or
+#      Leap    YEAR    MON     DAY     23:59:59        -       R/S
+
+# If the leapsecond is Rolling (R) the given time is local time
+# If the leapsecond is Stationary (S) the given time is UTC
+
+# Leap YEAR    MONTH   DAY     HH:MM:SS        CORR    R/S
+Leap   1972    Jun     30      23:59:60        +       S
+Leap   1972    Dec     31      23:59:60        +       S
+Leap   1973    Dec     31      23:59:60        +       S
+Leap   1974    Dec     31      23:59:60        +       S
+Leap   1975    Dec     31      23:59:60        +       S
+Leap   1976    Dec     31      23:59:60        +       S
+Leap   1977    Dec     31      23:59:60        +       S
+Leap   1978    Dec     31      23:59:60        +       S
+Leap   1979    Dec     31      23:59:60        +       S
+Leap   1981    Jun     30      23:59:60        +       S
+Leap   1982    Jun     30      23:59:60        +       S
+Leap   1983    Jun     30      23:59:60        +       S
+Leap   1985    Jun     30      23:59:60        +       S
+Leap   1987    Dec     31      23:59:60        +       S
+Leap   1989    Dec     31      23:59:60        +       S
+Leap   1990    Dec     31      23:59:60        +       S
+Leap   1992    Jun     30      23:59:60        +       S
+Leap   1993    Jun     30      23:59:60        +       S
+Leap   1994    Jun     30      23:59:60        +       S
+Leap   1995    Dec     31      23:59:60        +       S
+Leap   1997    Jun     30      23:59:60        +       S
+Leap   1998    Dec     31      23:59:60        +       S
+Leap   2005    Dec     31      23:59:60        +       S
+Leap   2008    Dec     31      23:59:60        +       S
+
+# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
+#
+# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
+#
+# SERVICE DE LA ROTATION TERRESTRE
+# OBSERVATOIRE DE PARIS
+# 61, Av. de l'Observatoire 75014 PARIS (France)
+# Tel.      : 33 (0) 1 40 51 22 29
+# FAX       : 33 (0) 1 40 51 22 91
+# Internet  : services.iers@obspm.fr
+#
+# Paris, 15 January 2009
+#
+# Bulletin C 37
+#
+# To authorities responsible
+# for the measurement and
+# distribution of time
+#
+# INFORMATION ON UTC - TAI
+#
+# NO positive leap second will be introduced at the end of June 2009.
+# The difference between Coordinated Universal Time UTC and the
+# International Atomic Time TAI is :           
+#
+# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
+#
+# Leap seconds can be introduced in UTC at the end of the months of December
+# or June,  depending on the evolution of UT1-TAI. Bulletin C is mailed every
+# six months, either to announce a time step in UTC, or to confirm that there
+# will be no time step at the next possible date.
+#
+# Daniel GAMBIS
+# Head                 
+# Earth Orientation Center of the IERS
+# Observatoire de Paris, France
diff --git a/extra/zoneinfo/northamerica b/extra/zoneinfo/northamerica
new file mode 100644 (file)
index 0000000..7fd6ea6
--- /dev/null
@@ -0,0 +1,2678 @@
+# @(#)northamerica     8.27
+# <pre>
+
+# also includes Central America and the Caribbean
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (1999-03-22):
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+
+###############################################################################
+
+# United States
+
+# From Paul Eggert (1999-03-31):
+# Howse writes (pp 121-125) that time zones were invented by
+# Professor Charles Ferdinand Dowd (1825-1904),
+# Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
+# His pamphlet ``A System of National Time for Railroads'' (1870)
+# was the result of his proposals at the Convention of Railroad Trunk Lines
+# in New York City (1869-10).  His 1870 proposal was based on Washington, DC,
+# but in 1872-05 he moved the proposed origin to Greenwich.
+# His proposal was adopted by the railroads on 1883-11-18 at 12:00,
+# and the most of the country soon followed suit.
+
+# From Paul Eggert (2005-04-16):
+# That 1883 transition occurred at 12:00 new time, not at 12:00 old time.
+# See p 46 of David Prerau, Seize the daylight, Thunder's Mouth Press (2005).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data in the US is
+# Thomas G. Shanks, The American Atlas (5th edition),
+# San Diego: ACS Publications, Inc. (1991).
+# Make sure you have the errata sheet; the book is somewhat useless without it.
+# It is the source for most of the pre-1991 US entries below.
+
+# From Paul Eggert (2001-03-06):
+# Daylight Saving Time was first suggested as a joke by Benjamin Franklin
+# in his whimsical essay ``An Economical Project for Diminishing the Cost
+# of Light'' published in the Journal de Paris (1784-04-26).
+# Not everyone is happy with the results:
+#
+#      I don't really care how time is reckoned so long as there is some
+#      agreement about it, but I object to being told that I am saving
+#      daylight when my reason tells me that I am doing nothing of the kind.
+#      I even object to the implication that I am wasting something
+#      valuable if I stay in bed after the sun has risen.  As an admirer
+#      of moonlight I resent the bossy insistence of those who want to
+#      reduce my time for enjoying it.  At the back of the Daylight Saving
+#      scheme I detect the bony, blue-fingered hand of Puritanism, eager
+#      to push people into bed earlier, and get them up earlier, to make
+#      them healthy, wealthy and wise in spite of themselves.
+#
+#      -- Robertson Davies, The diary of Samuel Marchbanks,
+#         Clarke, Irwin (1947), XIX, Sunday
+#
+# For more about the first ten years of DST in the United States, see
+# Robert Garland's <a href="http://www.clpgh.org/exhibit/dst.html">
+# Ten years of daylight saving from the Pittsburgh standpoint
+# (Carnegie Library of Pittsburgh, 1927)</a>.
+#
+# Shanks says that DST was called "War Time" in the US in 1918 and 1919.
+# However, DST was imposed by the Standard Time Act of 1918, which
+# was the first nationwide legal time standard, and apparently
+# time was just called "Standard Time" or "Daylight Saving Time".
+
+# From Arthur David Olson:
+# US Daylight Saving Time ended on the last Sunday of *October* in 1974.
+# See, for example, the front page of the Saturday, 1974-10-26
+# and Sunday, 1974-10-27 editions of the Washington Post.
+
+# From Arthur David Olson:
+# Before the Uniform Time Act of 1966 took effect in 1967, observance of
+# Daylight Saving Time in the US was by local option, except during wartime.
+
+# From Arthur David Olson (2000-09-25):
+# Last night I heard part of a rebroadcast of a 1945 Arch Oboler radio drama.
+# In the introduction, Oboler spoke of "Eastern Peace Time."
+# An AltaVista search turned up
+# <a href="http://rowayton.org/rhs/hstaug45.html">:
+# "When the time is announced over the radio now, it is 'Eastern Peace
+# Time' instead of the old familiar 'Eastern War Time.'  Peace is wonderful."
+# </a> (August 1945) by way of confirmation.
+
+# From Joseph Gallant citing
+# George H. Douglas, _The Early Days of Radio Broadcasting_ (1987):
+# At 7 P.M. (Eastern War Time) [on 1945-08-14], the networks were set
+# to switch to London for Attlee's address, but the American people
+# never got to hear his speech live. According to one press account,
+# CBS' Bob Trout was first to announce the word of Japan's surrender,
+# but a few seconds later, NBC, ABC and Mutual also flashed the word
+# of surrender, all of whom interrupting the bells of Big Ben in
+# London which were to precede Mr. Attlee's speech.
+
+# From Paul Eggert (2003-02-09): It was Robert St John, not Bob Trout.  From
+# Myrna Oliver's obituary of St John on page B16 of today's Los Angeles Times:
+#
+# ... a war-weary U.S. clung to radios, awaiting word of Japan's surrender.
+# Any announcement from Asia would reach St. John's New York newsroom on a
+# wire service teletype machine, which had prescribed signals for major news.
+# Associated Press, for example, would ring five bells before spewing out
+# typed copy of an important story, and 10 bells for news "of transcendental
+# importance."
+#
+# On Aug. 14, stalling while talking steadily into the NBC networks' open
+# microphone, St. John heard five bells and waited only to hear a sixth bell,
+# before announcing confidently: "Ladies and gentlemen, World War II is over.
+# The Japanese have agreed to our surrender terms."
+#
+# He had scored a 20-second scoop on other broadcasters.
+
+# From Arthur David Olson (2005-08-22):
+# Paul has been careful to use the "US" rules only in those locations
+# that are part of the United States; this reflects the real scope of
+# U.S. government action.  So even though the "US" rules have changed
+# in the latest release, other countries won't be affected.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   US      1918    1919    -       Mar     lastSun 2:00    1:00    D
+Rule   US      1918    1919    -       Oct     lastSun 2:00    0       S
+Rule   US      1942    only    -       Feb     9       2:00    1:00    W # War
+Rule   US      1945    only    -       Aug     14      23:00u  1:00    P # Peace
+Rule   US      1945    only    -       Sep     30      2:00    0       S
+Rule   US      1967    2006    -       Oct     lastSun 2:00    0       S
+Rule   US      1967    1973    -       Apr     lastSun 2:00    1:00    D
+Rule   US      1974    only    -       Jan     6       2:00    1:00    D
+Rule   US      1975    only    -       Feb     23      2:00    1:00    D
+Rule   US      1976    1986    -       Apr     lastSun 2:00    1:00    D
+Rule   US      1987    2006    -       Apr     Sun>=1  2:00    1:00    D
+Rule   US      2007    max     -       Mar     Sun>=8  2:00    1:00    D
+Rule   US      2007    max     -       Nov     Sun>=1  2:00    0       S
+
+# From Arthur David Olson, 2005-12-19
+# We generate the files specified below to guard against old files with
+# obsolete information being left in the time zone binary directory.
+# We limit the list to names that have appeared in previous versions of
+# this time zone package.
+# We do these as separate Zones rather than as Links to avoid problems if
+# a particular place changes whether it observes DST.
+# We put these specifications here in the northamerica file both to
+# increase the chances that they'll actually get compiled and to
+# avoid the need to duplicate the US rules in another file.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   EST              -5:00  -       EST
+Zone   MST              -7:00  -       MST
+Zone   HST             -10:00  -       HST
+Zone   EST5EDT          -5:00  US      E%sT
+Zone   CST6CDT          -6:00  US      C%sT
+Zone   MST7MDT          -7:00  US      M%sT
+Zone   PST8PDT          -8:00  US      P%sT
+
+# From Bob Devine (1988-01-28):
+# ...Alaska (and Hawaii) had the timezone names changed in 1967.
+#    old                        new
+#    Pacific Standard Time(PST)  -same-
+#    Yukon Standard Time(YST)    -same-
+#    Central Alaska S.T. (CAT)   Alaska-Hawaii St[an]dard Time (AHST)
+#    Nome Standard Time (NT)     Bering Standard Time (BST)
+#
+# ...Alaska's timezone lines were redrawn in 1983 to give only 2 tz.
+#    The YST zone now covers nearly all of the state, AHST just part
+#    of the Aleutian islands.   No DST.
+
+# From Paul Eggert (1995-12-19):
+# The tables below use `NST', not `NT', for Nome Standard Time.
+# I invented `CAWT' for Central Alaska War Time.
+
+# From U. S. Naval Observatory (1989-01-19):
+# USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
+# USA  EASTERN       4 H  BEHIND UTC    APR 3 - OCT 30
+# USA  CENTRAL       6 H  BEHIND UTC    CHICAGO, HOUSTON
+# USA  CENTRAL       5 H  BEHIND UTC    APR 3 - OCT 30
+# USA  MOUNTAIN      7 H  BEHIND UTC    DENVER
+# USA  MOUNTAIN      6 H  BEHIND UTC    APR 3 - OCT 30
+# USA  PACIFIC       8 H  BEHIND UTC    L.A., SAN FRANCISCO
+# USA  PACIFIC       7 H  BEHIND UTC    APR 3 - OCT 30
+# USA  ALASKA STD    9 H  BEHIND UTC    MOST OF ALASKA     (AKST)
+# USA  ALASKA STD    8 H  BEHIND UTC    APR 3 - OCT 30 (AKDT)
+# USA  ALEUTIAN     10 H  BEHIND UTC    ISLANDS WEST OF 170W
+# USA  - " -         9 H  BEHIND UTC    APR 3 - OCT 30
+# USA  HAWAII       10 H  BEHIND UTC
+# USA  BERING       11 H  BEHIND UTC    SAMOA, MIDWAY
+
+# From Arthur David Olson (1989-01-21):
+# The above dates are for 1988.
+# Note the "AKST" and "AKDT" abbreviations, the claim that there's
+# no DST in Samoa, and the claim that there is DST in Alaska and the
+# Aleutians.
+
+# From Arthur David Olson (1988-02-13):
+# Legal standard time zone names, from United States Code (1982 Edition and
+# Supplement III), Title 15, Chapter 6, Section 260 and forward.  First, names
+# up to 1967-04-01 (when most provisions of the Uniform Time Act of 1966
+# took effect), as explained in sections 263 and 261:
+#      (none)
+#      United States standard eastern time
+#      United States standard mountain time
+#      United States standard central time
+#      United States standard Pacific time
+#      (none)
+#      United States standard Alaska time
+#      (none)
+# Next, names from 1967-04-01 until 1983-11-30 (the date for
+# public law 98-181):
+#      Atlantic standard time
+#      eastern standard time
+#      central standard time
+#      mountain standard time
+#      Pacific standard time
+#      Yukon standard time
+#      Alaska-Hawaii standard time
+#      Bering standard time
+# And after 1983-11-30:
+#      Atlantic standard time
+#      eastern standard time
+#      central standard time
+#      mountain standard time
+#      Pacific standard time
+#      Alaska standard time
+#      Hawaii-Aleutian standard time
+#      Samoa standard time
+# The law doesn't give abbreviations.
+#
+# From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
+# Public law 106-564 (2000-12-23) introduced the abbreviation
+# "Chamorro Standard Time" for time in Guam and the Northern Marianas.
+# See the file "australasia".
+
+# From Arthur David Olson, 2005-08-09
+# The following was signed into law on 2005-08-08.
+#
+# H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
+#   (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
+#   U.S.C. 260a(a)) is amended--
+#     (1) by striking `first Sunday of April' and inserting `second
+#     Sunday of March'; and
+#     (2) by striking `last Sunday of October' and inserting `first
+#     Sunday of November'.
+#   (b) Effective Date- Subsection (a) shall take effect 1 year after the
+#   date of enactment of this Act or March 1, 2007, whichever is later.
+#   (c) Report to Congress- Not later than 9 months after the effective
+#   date stated in subsection (b), the Secretary shall report to Congress
+#   on the impact of this section on energy consumption in the United
+#   States.
+#   (d) Right to Revert- Congress retains the right to revert the
+#   Daylight Saving Time back to the 2005 time schedules once the
+#   Department study is complete.
+
+# US eastern time, represented by New York
+
+# Connecticut, Delaware, District of Columbia, most of Florida,
+# Georgia, southeast Indiana (Dearborn and Ohio counties), eastern Kentucky
+# (except America/Kentucky/Louisville below), Maine, Maryland, Massachusetts,
+# New Hampshire, New Jersey, New York, North Carolina, Ohio,
+# Pennsylvania, Rhode Island, South Carolina, eastern Tennessee,
+# Vermont, Virginia, West Virginia
+
+# From Dave Cantor (2004-11-02):
+# Early this summer I had the occasion to visit the Mount Washington
+# Observatory weather station atop (of course!) Mount Washington [, NH]....
+# One of the staff members said that the station was on Eastern Standard Time
+# and didn't change their clocks for Daylight Saving ... so that their
+# reports will always have times which are 5 hours behind UTC.
+
+# From Paul Eggert (2005-08-26):
+# According to today's Huntsville Times
+# <http://www.al.com/news/huntsvilletimes/index.ssf?/base/news/1125047783228320.xml&coll=1>
+# a few towns on Alabama's "eastern border with Georgia, such as Phenix City
+# in Russell County, Lanett in Chambers County and some towns in Lee County,
+# set their watches and clocks on Eastern time."  It quotes H.H. "Bubba"
+# Roberts, city administrator in Phenix City. as saying "We are in the Central
+# time zone, but we do go by the Eastern time zone because so many people work
+# in Columbus."
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   NYC     1920    only    -       Mar     lastSun 2:00    1:00    D
+Rule   NYC     1920    only    -       Oct     lastSun 2:00    0       S
+Rule   NYC     1921    1966    -       Apr     lastSun 2:00    1:00    D
+Rule   NYC     1921    1954    -       Sep     lastSun 2:00    0       S
+Rule   NYC     1955    1966    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/New_York  -4:56:02 -      LMT     1883 Nov 18 12:03:58
+                       -5:00   US      E%sT    1920
+                       -5:00   NYC     E%sT    1942
+                       -5:00   US      E%sT    1946
+                       -5:00   NYC     E%sT    1967
+                       -5:00   US      E%sT
+
+# US central time, represented by Chicago
+
+# Alabama, Arkansas, Florida panhandle (Bay, Calhoun, Escambia,
+# Gulf, Holmes, Jackson, Okaloosa, Santa Rosa, Walton, and
+# Washington counties), Illinois, western Indiana
+# (Gibson, Jasper, Lake, LaPorte, Newton, Porter, Posey, Spencer,
+# Vanderburgh, and Warrick counties), Iowa, most of Kansas, western
+# Kentucky, Louisiana, Minnesota, Mississippi, Missouri, eastern
+# Nebraska, eastern North Dakota, Oklahoma, eastern South Dakota,
+# western Tennessee, most of Texas, Wisconsin
+
+# From Larry M. Smith (2006-04-26) re Wisconsin:
+# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
+# is currently enforced at the 01:00 time of change.  Because the local
+# "bar time" in the state corresponds to 02:00, a number of citations
+# are issued for the "sale of class 'B' alcohol after prohibited
+# hours" within the deviated hour of this change every year....
+#
+# From Douglas R. Bomberg (2007-03-12):
+# Wisconsin has enacted (nearly eleventh-hour) legislation to get WI
+# Statue 175 closer in synch with the US Congress' intent....
+# http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   Chicago 1920    only    -       Jun     13      2:00    1:00    D
+Rule   Chicago 1920    1921    -       Oct     lastSun 2:00    0       S
+Rule   Chicago 1921    only    -       Mar     lastSun 2:00    1:00    D
+Rule   Chicago 1922    1966    -       Apr     lastSun 2:00    1:00    D
+Rule   Chicago 1922    1954    -       Sep     lastSun 2:00    0       S
+Rule   Chicago 1955    1966    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Chicago   -5:50:36 -      LMT     1883 Nov 18 12:09:24
+                       -6:00   US      C%sT    1920
+                       -6:00   Chicago C%sT    1936 Mar  1 2:00
+                       -5:00   -       EST     1936 Nov 15 2:00
+                       -6:00   Chicago C%sT    1942
+                       -6:00   US      C%sT    1946
+                       -6:00   Chicago C%sT    1967
+                       -6:00   US      C%sT
+# Oliver County, ND switched from mountain to central time on 1992-10-25.
+Zone America/North_Dakota/Center -6:45:12 - LMT        1883 Nov 18 12:14:48
+                       -7:00   US      M%sT    1992 Oct 25 02:00
+                       -6:00   US      C%sT
+# Morton County, ND, switched from mountain to central time on
+# 2003-10-26, except for the area around Mandan which was already central time.
+# See <http://dmses.dot.gov/docimages/p63/135818.pdf>.
+# Officially this switch also included part of Sioux County, and
+# Jones, Mellette, and Todd Counties in South Dakota;
+# but in practice these other counties were already observing central time.
+# See <http://www.epa.gov/fedrgstr/EPA-IMPACT/2003/October/Day-28/i27056.htm>.
+Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
+                       -7:00   US      M%sT    2003 Oct 26 02:00
+                       -6:00   US      C%sT
+
+# US mountain time, represented by Denver
+#
+# Colorado, far western Kansas, Montana, western
+# Nebraska, Nevada border (Jackpot, Owyhee, and Mountain City),
+# New Mexico, southwestern North Dakota,
+# western South Dakota, far western Texas (El Paso County, Hudspeth County,
+# and Pine Springs and Nickel Creek in Culberson County), Utah, Wyoming
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   Denver  1920    1921    -       Mar     lastSun 2:00    1:00    D
+Rule   Denver  1920    only    -       Oct     lastSun 2:00    0       S
+Rule   Denver  1921    only    -       May     22      2:00    0       S
+Rule   Denver  1965    1966    -       Apr     lastSun 2:00    1:00    D
+Rule   Denver  1965    1966    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Denver    -6:59:56 -      LMT     1883 Nov 18 12:00:04
+                       -7:00   US      M%sT    1920
+                       -7:00   Denver  M%sT    1942
+                       -7:00   US      M%sT    1946
+                       -7:00   Denver  M%sT    1967
+                       -7:00   US      M%sT
+
+# US Pacific time, represented by Los Angeles
+#
+# California, northern Idaho (Benewah, Bonner, Boundary, Clearwater,
+# Idaho, Kootenai, Latah, Lewis, Nez Perce, and Shoshone counties,
+# and the northern three-quarters of Idaho county),
+# most of Nevada, most of Oregon, and Washington
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   CA      1948    only    -       Mar     14      2:00    1:00    D
+Rule   CA      1949    only    -       Jan      1      2:00    0       S
+Rule   CA      1950    1966    -       Apr     lastSun 2:00    1:00    D
+Rule   CA      1950    1961    -       Sep     lastSun 2:00    0       S
+Rule   CA      1962    1966    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Los_Angeles -7:52:58 -    LMT     1883 Nov 18 12:07:02
+                       -8:00   US      P%sT    1946
+                       -8:00   CA      P%sT    1967
+                       -8:00   US      P%sT
+
+# Alaska
+# AK%sT is the modern abbreviation for -9:00 per USNO.
+#
+# From Paul Eggert (2001-05-30):
+# Howse writes that Alaska switched from the Julian to the Gregorian calendar,
+# and from east-of-GMT to west-of-GMT days, when the US bought it from Russia.
+# This was on 1867-10-18, a Friday; the previous day was 1867-10-06 Julian,
+# also a Friday.  Include only the time zone part of this transition,
+# ignoring the switch from Julian to Gregorian, since we can't represent
+# the Julian calendar.
+#
+# As far as we know, none of the exact locations mentioned below were
+# permanently inhabited in 1867 by anyone using either calendar.
+# (Yakutat was colonized by the Russians in 1799, but the settlement
+# was destroyed in 1805 by a Yakutat-kon war party.)  However, there
+# were nearby inhabitants in some cases and for our purposes perhaps
+# it's best to simply use the official transition.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Juneau     15:02:19 -     LMT     1867 Oct 18
+                        -8:57:41 -     LMT     1900 Aug 20 12:00
+                        -8:00  -       PST     1942
+                        -8:00  US      P%sT    1946
+                        -8:00  -       PST     1969
+                        -8:00  US      P%sT    1983 Oct 30 2:00
+                        -9:00  US      Y%sT    1983 Nov 30
+                        -9:00  US      AK%sT
+Zone America/Yakutat    14:41:05 -     LMT     1867 Oct 18
+                        -9:18:55 -     LMT     1900 Aug 20 12:00
+                        -9:00  -       YST     1942
+                        -9:00  US      Y%sT    1946
+                        -9:00  -       YST     1969
+                        -9:00  US      Y%sT    1983 Nov 30
+                        -9:00  US      AK%sT
+Zone America/Anchorage  14:00:24 -     LMT     1867 Oct 18
+                        -9:59:36 -     LMT     1900 Aug 20 12:00
+                       -10:00  -       CAT     1942
+                       -10:00  US      CAT/CAWT 1945 Aug 14 23:00u
+                       -10:00  US      CAT/CAPT 1946 # Peace
+                       -10:00  -       CAT     1967 Apr
+                       -10:00  -       AHST    1969
+                       -10:00  US      AH%sT   1983 Oct 30 2:00
+                        -9:00  US      Y%sT    1983 Nov 30
+                        -9:00  US      AK%sT
+Zone America/Nome       12:58:21 -     LMT     1867 Oct 18
+                       -11:01:38 -     LMT     1900 Aug 20 12:00
+                       -11:00  -       NST     1942
+                       -11:00  US      N%sT    1946
+                       -11:00  -       NST     1967 Apr
+                       -11:00  -       BST     1969
+                       -11:00  US      B%sT    1983 Oct 30 2:00
+                        -9:00  US      Y%sT    1983 Nov 30
+                        -9:00  US      AK%sT
+Zone America/Adak       12:13:21 -     LMT     1867 Oct 18
+                       -11:46:38 -     LMT     1900 Aug 20 12:00
+                       -11:00  -       NST     1942
+                       -11:00  US      N%sT    1946
+                       -11:00  -       NST     1967 Apr
+                       -11:00  -       BST     1969
+                       -11:00  US      B%sT    1983 Oct 30 2:00
+                       -10:00  US      AH%sT   1983 Nov 30
+                       -10:00  US      HA%sT
+# The following switches don't quite make our 1970 cutoff.
+#
+# Shanks writes that part of southwest Alaska (e.g. Aniak)
+# switched from -11:00 to -10:00 on 1968-09-22 at 02:00,
+# and another part (e.g. Akiak) made the same switch five weeks later.
+#
+# From David Flater (2004-11-09):
+# In e-mail, 2004-11-02, Ray Hudson, historian/liaison to the Unalaska
+# Historic Preservation Commission, provided this information, which
+# suggests that Unalaska deviated from statutory time from early 1967
+# possibly until 1983:
+#
+#  Minutes of the Unalaska City Council Meeting, January 10, 1967:
+#  "Except for St. Paul and Akutan, Unalaska is the only important
+#  location not on Alaska Standard Time.  The following resolution was
+#  made by William Robinson and seconded by Henry Swanson:  Be it
+#  resolved that the City of Unalaska hereby goes to Alaska Standard
+#  Time as of midnight Friday, January 13, 1967 (1 A.M. Saturday,
+#  January 14, Alaska Standard Time.)  This resolution was passed with
+#  three votes for and one against."
+
+# Hawaii
+#
+# From Arthur David Olson:
+# And then there's Hawaii.
+# DST was observed for one day in 1933;
+# standard time was changed by half an hour in 1947;
+# it's always standard as of 1986.
+#
+# From Paul Eggert:
+# Shanks says the 1933 experiment lasted for three weeks.  Go with Shanks.
+#
+Zone Pacific/Honolulu  -10:31:26 -     LMT     1900 Jan  1 12:00
+                       -10:30  -       HST     1933 Apr 30 2:00
+                       -10:30  1:00    HDT     1933 May 21 2:00
+                       -10:30  US      H%sT    1947 Jun  8 2:00
+                       -10:00  -       HST
+
+# Now we turn to US areas that have diverged from the consensus since 1970.
+
+# Arizona mostly uses MST.
+
+# From Paul Eggert (2002-10-20):
+#
+# The information in the rest of this paragraph is derived from the
+# <a href="http://www.dlapr.lib.az.us/links/daylight.htm">
+# Daylight Saving Time web page (2002-01-23)</a> maintained by the
+# Arizona State Library, Archives and Public Records.
+# Between 1944-01-01 and 1944-04-01 the State of Arizona used standard
+# time, but by federal law railroads, airlines, bus lines, military
+# personnel, and some engaged in interstate commerce continued to
+# observe war (i.e., daylight saving) time.  The 1944-03-17 Phoenix
+# Gazette says that was the date the law changed, and that 04-01 was
+# the date the state's clocks would change.  In 1945 the State of
+# Arizona used standard time all year, again with exceptions only as
+# mandated by federal law.  Arizona observed DST in 1967, but Arizona
+# Laws 1968, ch. 183 (effective 1968-03-21) repealed DST.
+#
+# Shanks says the 1944 experiment came to an end on 1944-03-17.
+# Go with the Arizona State Library instead.
+
+Zone America/Phoenix   -7:28:18 -      LMT     1883 Nov 18 11:31:42
+                       -7:00   US      M%sT    1944 Jan  1 00:01
+                       -7:00   -       MST     1944 Apr  1 00:01
+                       -7:00   US      M%sT    1944 Oct  1 00:01
+                       -7:00   -       MST     1967
+                       -7:00   US      M%sT    1968 Mar 21
+                       -7:00   -       MST
+# From Arthur David Olson (1988-02-13):
+# A writer from the Inter Tribal Council of Arizona, Inc.,
+# notes in private correspondence dated 1987-12-28 that "Presently, only the
+# Navajo Nation participates in the Daylight Saving Time policy, due to its
+# large size and location in three states."  (The "only" means that other
+# tribal nations don't use DST.)
+
+Link America/Denver America/Shiprock
+
+# Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
+# Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
+# Custer, Elmore, Franklin, Fremont, Gem, Gooding, Jefferson, Jerome,
+# Lemhi, Lincoln, Madison, Minidoka, Oneida, Owyhee, Payette, Power,
+# Teton, Twin Falls, Valley, Washington counties, and the southern
+# quarter of Idaho county) and eastern Oregon (most of Malheur County)
+# switched four weeks late in 1974.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Boise     -7:44:49 -      LMT     1883 Nov 18 12:15:11
+                       -8:00   US      P%sT    1923 May 13 2:00
+                       -7:00   US      M%sT    1974
+                       -7:00   -       MST     1974 Feb  3 2:00
+                       -7:00   US      M%sT
+
+# Indiana
+#
+# For a map of Indiana's time zone regions, see:
+# <a href="http://www.mccsc.edu/time.html">
+# What time is it in Indiana?
+# </a> (2006-03-01)
+#
+# From Paul Eggert (2007-08-17):
+# Since 1970, most of Indiana has been like America/Indiana/Indianapolis,
+# with the following exceptions:
+#
+# - Gibson, Jasper, Lake, LaPorte, Newton, Porter, Posey, Spencer,
+#   Vandenburgh, and Warrick counties have been like America/Chicago.
+#
+# - Dearborn and Ohio counties have been like America/New_York.
+#
+# - Clark, Floyd, and Harrison counties have been like
+#   America/Kentucky/Louisville.
+#
+# - Crawford, Daviess, Dubois, Knox, Martin, Perry, Pike, Pulaski, Starke,
+#   and Switzerland counties have their own time zone histories as noted below.
+#
+# Shanks partitioned Indiana into 345 regions, each with its own time history,
+# and wrote ``Even newspaper reports present contradictory information.''
+# Those Hoosiers!  Such a flighty and changeable people!
+# Fortunately, most of the complexity occurred before our cutoff date of 1970.
+#
+# Other than Indianapolis, the Indiana place names are so nondescript
+# that they would be ambiguous if we left them at the `America' level.
+# So we reluctantly put them all in a subdirectory `America/Indiana'.
+
+# From Paul Eggert (2005-08-16):
+# http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
+
+# From Nathan Stratton Treadway (2006-03-30):
+# http://www.dot.gov/affairs/dot0406.htm [3705 B]
+# From Deborah Goldsmith (2006-01-18):
+# http://dmses.dot.gov/docimages/pdf95/382329_web.pdf [2.9 MB]
+# From Paul Eggert (2006-01-20):
+# It says "DOT is relocating the time zone boundary in Indiana to move Starke,
+# Pulaski, Knox, Daviess, Martin, Pike, Dubois, and Perry Counties from the
+# Eastern Time Zone to the Central Time Zone.... The effective date of
+# this rule is 2:OO a.m. EST Sunday, April 2, 2006, which is the
+# changeover date from standard time to Daylight Saving Time."
+# Strictly speaking, this means the affected counties will change their
+# clocks twice that night, but this obviously is in error.  The intent
+# is that 01:59:59 EST be followed by 02:00:00 CDT.
+
+# From Gwillim Law (2007-02-10):
+# The Associated Press has been reporting that Pulaski County, Indiana is
+# going to switch from Central to Eastern Time on March 11, 2007....
+# http://www.indystar.com/apps/pbcs.dll/article?AID=/20070207/LOCAL190108/702070524/0/LOCAL
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule Indianapolis 1941 only    -       Jun     22      2:00    1:00    D
+Rule Indianapolis 1941 1954    -       Sep     lastSun 2:00    0       S
+Rule Indianapolis 1946 1954    -       Apr     lastSun 2:00    1:00    D
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Indianapolis -5:44:38 - LMT 1883 Nov 18 12:15:22
+                       -6:00   US      C%sT    1920
+                       -6:00 Indianapolis C%sT 1942
+                       -6:00   US      C%sT    1946
+                       -6:00 Indianapolis C%sT 1955 Apr 24 2:00
+                       -5:00   -       EST     1957 Sep 29 2:00
+                       -6:00   -       CST     1958 Apr 27 2:00
+                       -5:00   -       EST     1969
+                       -5:00   US      E%sT    1971
+                       -5:00   -       EST     2006
+                       -5:00   US      E%sT
+#
+# Eastern Crawford County, Indiana, left its clocks alone in 1974,
+# as well as from 1976 through 2005.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   Marengo 1951    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Marengo 1951    only    -       Sep     lastSun 2:00    0       S
+Rule   Marengo 1954    1960    -       Apr     lastSun 2:00    1:00    D
+Rule   Marengo 1954    1960    -       Sep     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Marengo -5:45:23 -        LMT     1883 Nov 18 12:14:37
+                       -6:00   US      C%sT    1951
+                       -6:00   Marengo C%sT    1961 Apr 30 2:00
+                       -5:00   -       EST     1969
+                       -5:00   US      E%sT    1974 Jan  6 2:00
+                       -6:00   1:00    CDT     1974 Oct 27 2:00
+                       -5:00   US      E%sT    1976
+                       -5:00   -       EST     2006
+                       -5:00   US      E%sT
+#
+# Daviess, Dubois, Knox, and Martin Counties, Indiana,
+# switched from eastern to central time in April 2006, then switched back
+# in November 2007.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule Vincennes 1946    only    -       Apr     lastSun 2:00    1:00    D
+Rule Vincennes 1946    only    -       Sep     lastSun 2:00    0       S
+Rule Vincennes 1953    1954    -       Apr     lastSun 2:00    1:00    D
+Rule Vincennes 1953    1959    -       Sep     lastSun 2:00    0       S
+Rule Vincennes 1955    only    -       May      1      0:00    1:00    D
+Rule Vincennes 1956    1963    -       Apr     lastSun 2:00    1:00    D
+Rule Vincennes 1960    only    -       Oct     lastSun 2:00    0       S
+Rule Vincennes 1961    only    -       Sep     lastSun 2:00    0       S
+Rule Vincennes 1962    1963    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Vincennes -5:50:07 - LMT  1883 Nov 18 12:09:53
+                       -6:00   US      C%sT    1946
+                       -6:00 Vincennes C%sT    1964 Apr 26 2:00
+                       -5:00   -       EST     1969
+                       -5:00   US      E%sT    1971
+                       -5:00   -       EST     2006 Apr  2 2:00
+                       -6:00   US      C%sT    2007 Nov  4 2:00
+                       -5:00   US      E%sT
+#
+# Perry County, Indiana, switched from eastern to central time in April 2006.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule Perry     1946    only    -       Apr     lastSun 2:00    1:00    D
+Rule Perry     1946    only    -       Sep     lastSun 2:00    0       S
+Rule Perry     1953    1954    -       Apr     lastSun 2:00    1:00    D
+Rule Perry     1953    1959    -       Sep     lastSun 2:00    0       S
+Rule Perry     1955    only    -       May      1      0:00    1:00    D
+Rule Perry     1956    1963    -       Apr     lastSun 2:00    1:00    D
+Rule Perry     1960    only    -       Oct     lastSun 2:00    0       S
+Rule Perry     1961    only    -       Sep     lastSun 2:00    0       S
+Rule Perry     1962    1963    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Tell_City -5:47:03 - LMT  1883 Nov 18 12:12:57
+                       -6:00   US      C%sT    1946
+                       -6:00 Perry     C%sT    1964 Apr 26 2:00
+                       -5:00   -       EST     1969
+                       -5:00   US      E%sT    1971
+                       -5:00   -       EST     2006 Apr  2 2:00
+                       -6:00   US      C%sT
+#
+# Pike County, Indiana moved from central to eastern time in 1977,
+# then switched back in 2006, then switched back again in 2007.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   Pike    1955    only    -       May      1      0:00    1:00    D
+Rule   Pike    1955    1960    -       Sep     lastSun 2:00    0       S
+Rule   Pike    1956    1964    -       Apr     lastSun 2:00    1:00    D
+Rule   Pike    1961    1964    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Petersburg -5:49:07 - LMT 1883 Nov 18 12:10:53
+                       -6:00   US      C%sT    1955
+                       -6:00   Pike    C%sT    1965 Apr 25 2:00
+                       -5:00   -       EST     1966 Oct 30 2:00
+                       -6:00   US      C%sT    1977 Oct 30 2:00
+                       -5:00   -       EST     2006 Apr  2 2:00
+                       -6:00   US      C%sT    2007 Nov  4 2:00
+                       -5:00   US      E%sT
+#
+# Starke County, Indiana moved from central to eastern time in 1991,
+# then switched back in 2006.
+# From Arthur David Olson (1991-10-28):
+# An article on page A3 of the Sunday, 1991-10-27 Washington Post
+# notes that Starke County switched from Central time to Eastern time as of
+# 1991-10-27.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   Starke  1947    1961    -       Apr     lastSun 2:00    1:00    D
+Rule   Starke  1947    1954    -       Sep     lastSun 2:00    0       S
+Rule   Starke  1955    1956    -       Oct     lastSun 2:00    0       S
+Rule   Starke  1957    1958    -       Sep     lastSun 2:00    0       S
+Rule   Starke  1959    1961    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Knox -5:46:30 -   LMT     1883 Nov 18 12:13:30
+                       -6:00   US      C%sT    1947
+                       -6:00   Starke  C%sT    1962 Apr 29 2:00
+                       -5:00   -       EST     1963 Oct 27 2:00
+                       -6:00   US      C%sT    1991 Oct 27 2:00
+                       -5:00   -       EST     2006 Apr  2 2:00
+                       -6:00   US      C%sT
+#
+# Pulaski County, Indiana, switched from eastern to central time in
+# April 2006 and then switched back in March 2007.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   Pulaski 1946    1960    -       Apr     lastSun 2:00    1:00    D
+Rule   Pulaski 1946    1954    -       Sep     lastSun 2:00    0       S
+Rule   Pulaski 1955    1956    -       Oct     lastSun 2:00    0       S
+Rule   Pulaski 1957    1960    -       Sep     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Winamac -5:46:25 - LMT    1883 Nov 18 12:13:35
+                       -6:00   US      C%sT    1946
+                       -6:00   Pulaski C%sT    1961 Apr 30 2:00
+                       -5:00   -       EST     1969
+                       -5:00   US      E%sT    1971
+                       -5:00   -       EST     2006 Apr  2 2:00
+                       -6:00   US      C%sT    2007 Mar 11 2:00
+                       -5:00   US      E%sT
+#
+# Switzerland County, Indiana, did not observe DST from 1973 through 2005.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Indiana/Vevay -5:40:16 -  LMT     1883 Nov 18 12:19:44
+                       -6:00   US      C%sT    1954 Apr 25 2:00
+                       -5:00   -       EST     1969
+                       -5:00   US      E%sT    1973
+                       -5:00   -       EST     2006
+                       -5:00   US      E%sT
+
+# Part of Kentucky left its clocks alone in 1974.
+# This also includes Clark, Floyd, and Harrison counties in Indiana.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule Louisville        1921    only    -       May     1       2:00    1:00    D
+Rule Louisville        1921    only    -       Sep     1       2:00    0       S
+Rule Louisville        1941    1961    -       Apr     lastSun 2:00    1:00    D
+Rule Louisville        1941    only    -       Sep     lastSun 2:00    0       S
+Rule Louisville        1946    only    -       Jun     2       2:00    0       S
+Rule Louisville        1950    1955    -       Sep     lastSun 2:00    0       S
+Rule Louisville        1956    1960    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Kentucky/Louisville -5:43:02 -    LMT     1883 Nov 18 12:16:58
+                       -6:00   US      C%sT    1921
+                       -6:00 Louisville C%sT   1942
+                       -6:00   US      C%sT    1946
+                       -6:00 Louisville C%sT   1961 Jul 23 2:00
+                       -5:00   -       EST     1968
+                       -5:00   US      E%sT    1974 Jan  6 2:00
+                       -6:00   1:00    CDT     1974 Oct 27 2:00
+                       -5:00   US      E%sT
+#
+# Wayne County, Kentucky
+#
+# From
+# <a href="http://www.lake-cumberland.com/life/archive/news990129time.shtml">
+# Lake Cumberland LIFE
+# </a> (1999-01-29) via WKYM-101.7:
+# Clinton County has joined Wayne County in asking the DoT to change from
+# the Central to the Eastern time zone....  The Wayne County government made
+# the same request in December.  And while Russell County officials have not
+# taken action, the majority of respondents to a poll conducted there in
+# August indicated they would like to change to "fast time" also.
+# The three Lake Cumberland counties are the farthest east of any U.S.
+# location in the Central time zone.
+#
+# From Rich Wales (2000-08-29):
+# After prolonged debate, and despite continuing deep differences of opinion,
+# Wayne County (central Kentucky) is switching from Central (-0600) to Eastern
+# (-0500) time.  They won't "fall back" this year.  See Sara Shipley,
+# The difference an hour makes, Nando Times (2000-08-29 15:33 -0400).
+#
+# From Paul Eggert (2001-07-16):
+# The final rule was published in the
+# <a href="http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=2000_register&docid=fr17au00-22">
+# Federal Register 65, 160 (2000-08-17), page 50154-50158.
+# </a>
+#
+Zone America/Kentucky/Monticello -5:39:24 - LMT        1883 Nov 18 12:20:36
+                       -6:00   US      C%sT    1946
+                       -6:00   -       CST     1968
+                       -6:00   US      C%sT    2000 Oct 29  2:00
+                       -5:00   US      E%sT
+
+
+# From Rives McDow (2000-08-30):
+# Here ... are all the changes in the US since 1985.
+# Kearny County, KS (put all of county on central;
+#      previously split between MST and CST) ... 1990-10
+# Starke County, IN (from CST to EST) ... 1991-10
+# Oliver County, ND (from MST to CST) ... 1992-10
+# West Wendover, NV (from PST TO MST) ... 1999-10
+# Wayne County, KY (from CST to EST) ... 2000-10
+#
+# From Paul Eggert (2001-07-17):
+# We don't know where the line used to be within Kearny County, KS,
+# so omit that change for now.
+# See America/Indiana/Knox for the Starke County, IN change.
+# See America/North_Dakota/Center for the Oliver County, ND change.
+# West Wendover, NV officially switched from Pacific to mountain time on
+# 1999-10-31.  See the
+# <a href="http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=1999_register&docid=fr21oc99-15">
+# Federal Register 64, 203 (1999-10-21), page 56705-56707.
+# </a>
+# However, the Federal Register says that West Wendover already operated
+# on mountain time, and the rule merely made this official;
+# hence a separate tz entry is not needed.
+
+# Michigan
+#
+# From Bob Devine (1988-01-28):
+# Michigan didn't observe DST from 1968 to 1973.
+#
+# From Paul Eggert (1999-03-31):
+# Shanks writes that Michigan started using standard time on 1885-09-18,
+# but Howse writes (pp 124-125, referring to Popular Astronomy, 1901-01)
+# that Detroit kept
+#
+#      local time until 1900 when the City Council decreed that clocks should
+#      be put back twenty-eight minutes to Central Standard Time.  Half the
+#      city obeyed, half refused.  After considerable debate, the decision
+#      was rescinded and the city reverted to Sun time.  A derisive offer to
+#      erect a sundial in front of the city hall was referred to the
+#      Committee on Sewers.  Then, in 1905, Central time was adopted
+#      by city vote.
+#
+# This story is too entertaining to be false, so go with Howse over Shanks.
+#
+# From Paul Eggert (2001-03-06):
+# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
+# one hour in 1914.''  This change is not in Shanks.  We have no more
+# info, so omit this for now.
+#
+# Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule   Detroit 1948    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Detroit 1948    only    -       Sep     lastSun 2:00    0       S
+Rule   Detroit 1967    only    -       Jun     14      2:00    1:00    D
+Rule   Detroit 1967    only    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Detroit   -5:32:11 -      LMT     1905
+                       -6:00   -       CST     1915 May 15 2:00
+                       -5:00   -       EST     1942
+                       -5:00   US      E%sT    1946
+                       -5:00   Detroit E%sT    1973
+                       -5:00   US      E%sT    1975
+                       -5:00   -       EST     1975 Apr 27 2:00
+                       -5:00   US      E%sT
+#
+# Dickinson, Gogebic, Iron, and Menominee Counties, Michigan,
+# switched from EST to CST/CDT in 1973.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER
+Rule Menominee 1946    only    -       Apr     lastSun 2:00    1:00    D
+Rule Menominee 1946    only    -       Sep     lastSun 2:00    0       S
+Rule Menominee 1966    only    -       Apr     lastSun 2:00    1:00    D
+Rule Menominee 1966    only    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Menominee -5:50:27 -      LMT     1885 Sep 18 12:00
+                       -6:00   US      C%sT    1946
+                       -6:00 Menominee C%sT    1969 Apr 27 2:00
+                       -5:00   -       EST     1973 Apr 29 2:00
+                       -6:00   US      C%sT
+
+# Navassa
+# administered by the US Fish and Wildlife Service
+# claimed by US under the provisions of the 1856 Guano Islands Act
+# also claimed by Haiti
+# occupied 1857/1900 by the Navassa Phosphate Co
+# US lighthouse 1917/1996-09
+# currently uninhabited
+# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
+# _Los Angeles Times_ (1998-11-10), A1, A10; it cites
+# Jimmy Skaggs, _The Great Guano Rush_ (1994).
+
+################################################################################
+
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Other sources occasionally used include:
+#
+#      Edward W. Whitman, World Time Differences,
+#      Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
+#      which I found in the UCLA library.
+#
+#      <a href="http://www.pettswoodvillage.co.uk/Daylight_Savings_William_Willett.pdf">
+#      William Willett, The Waste of Daylight, 19th edition
+#      </a> (1914-03)
+#
+# See the `europe' file for Greenland.
+
+# Canada
+
+# From Alain LaBont<e'> (1994-11-14):
+# I post here the time zone abbreviations standardized in Canada
+# for both English and French in the CAN/CSA-Z234.4-89 standard....
+#
+#      UTC     Standard time   Daylight savings time
+#      offset  French  English French  English
+#      -2:30   -       -       HAT     NDT
+#      -3      -       -       HAA     ADT
+#      -3:30   HNT     NST     -       -
+#      -4      HNA     AST     HAE     EDT
+#      -5      HNE     EST     HAC     CDT
+#      -6      HNC     CST     HAR     MDT
+#      -7      HNR     MST     HAP     PDT
+#      -8      HNP     PST     HAY     YDT
+#      -9      HNY     YST     -       -
+#
+#      HN: Heure Normale       ST: Standard Time
+#      HA: Heure Avanc<e'>e    DT: Daylight saving Time
+#
+#      A: de l'Atlantique      Atlantic
+#      C: du Centre            Central
+#      E: de l'Est             Eastern
+#      M:                      Mountain
+#      N:                      Newfoundland
+#      P: du Pacifique         Pacific
+#      R: des Rocheuses
+#      T: de Terre-Neuve
+#      Y: du Yukon             Yukon
+#
+# From Paul Eggert (1994-11-22):
+# Alas, this sort of thing must be handled by localization software.
+
+# Unless otherwise specified, the data for Canada are all from Shanks
+# & Pottenger.
+
+# From Chris Walton (2006-04-01, 2006-04-25, 2006-06-26, 2007-01-31,
+# 2007-03-01):
+# The British Columbia government announced yesterday that it will
+# adjust daylight savings next year to align with changes in the
+# U.S. and the rest of Canada....
+# http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
+# ...
+# Nova Scotia
+# Daylight saving time will be extended by four weeks starting in 2007....
+# http://www.gov.ns.ca/just/regulations/rg2/2006/ma1206.pdf
+#
+# [For New Brunswick] the new legislation dictates that the time change is to
+# be done at 02:00 instead of 00:01.
+# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
+# ...
+# Manitoba has traditionally changed the clock every fall at 03:00.
+# As of 2006, the transition is to take place one hour earlier at 02:00.
+# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
+# ...
+# [Alberta, Ontario, Quebec] will follow US rules.
+# http://www.qp.gov.ab.ca/documents/spring/CH03_06.CFM
+# http://www.e-laws.gov.on.ca/DBLaws/Source/Regs/English/2006/R06111_e.htm
+# http://www2.publicationsduquebec.gouv.qc.ca/dynamicSearch/telecharge.php?type=5&file=2006C39A.PDF
+# ...
+# P.E.I. will follow US rules....
+# http://www.assembly.pe.ca/bills/pdf_chapter/62/3/chapter-41.pdf
+# ...
+# Province of Newfoundland and Labrador....
+# http://www.hoa.gov.nl.ca/hoa/bills/Bill0634.htm
+# ...
+# Yukon
+# http://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
+# ...
+# N.W.T. will follow US rules.  Whoever maintains the government web site
+# does not seem to believe in bookmarks.  To see the news release, click the
+# following link and search for "Daylight Savings Time Change".  Press the
+# "Daylight Savings Time Change" link; it will fire off a popup using
+# JavaScript.
+# http://www.exec.gov.nt.ca/currentnews/currentPR.asp?mode=archive
+# ...
+# Nunavut
+# An amendment to the Interpretation Act was registered on February 19/2007....
+# http://action.attavik.ca/home/justice-gn/attach/2007/gaz02part2.pdf
+
+# From Paul Eggert (2006-04-25):
+# H. David Matthews and Mary Vincent's map
+# <a href="http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp">
+# "It's about TIME", _Canadian Geographic_ (September-October 1998)
+# </a> contains detailed boundaries for regions observing nonstandard
+# time and daylight saving time arrangements in Canada circa 1998.
+#
+# INMS, the Institute for National Measurement Standards in Ottawa, has <a
+# href="http://inms-ienm.nrc-cnrc.gc.ca/en/time_services/daylight_saving_e.php">
+# information about standard and daylight saving time zones in Canada.
+# </a> (updated periodically).
+# Its unofficial information is often taken from Matthews and Vincent.
+
+# From Paul Eggert (2006-06-27):
+# For now, assume all of DST-observing Canada will fall into line with the
+# new US DST rules,
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Canada  1918    only    -       Apr     14      2:00    1:00    D
+Rule   Canada  1918    only    -       Oct     31      2:00    0       S
+Rule   Canada  1942    only    -       Feb      9      2:00    1:00    W # War
+Rule   Canada  1945    only    -       Aug     14      23:00u  1:00    P # Peace
+Rule   Canada  1945    only    -       Sep     30      2:00    0       S
+Rule   Canada  1974    1986    -       Apr     lastSun 2:00    1:00    D
+Rule   Canada  1974    2006    -       Oct     lastSun 2:00    0       S
+Rule   Canada  1987    2006    -       Apr     Sun>=1  2:00    1:00    D
+Rule   Canada  2007    max     -       Mar     Sun>=8  2:00    1:00    D
+Rule   Canada  2007    max     -       Nov     Sun>=1  2:00    0       S
+
+
+# Newfoundland and Labrador
+
+# From Paul Eggert (2000-10-02):
+# Matthews and Vincent (1998) write that Labrador should use NST/NDT,
+# but the only part of Labrador that follows the rules is the
+# southeast corner, including Port Hope Simpson and Mary's Harbour,
+# but excluding, say, Black Tickle.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   StJohns 1917    only    -       Apr      8      2:00    1:00    D
+Rule   StJohns 1917    only    -       Sep     17      2:00    0       S
+# Whitman gives 1919 Apr 5 and 1920 Apr 5; go with Shanks & Pottenger.
+Rule   StJohns 1919    only    -       May      5      23:00   1:00    D
+Rule   StJohns 1919    only    -       Aug     12      23:00   0       S
+# For 1931-1935 Whitman gives Apr same date; go with Shanks & Pottenger.
+Rule   StJohns 1920    1935    -       May     Sun>=1  23:00   1:00    D
+Rule   StJohns 1920    1935    -       Oct     lastSun 23:00   0       S
+# For 1936-1941 Whitman gives May Sun>=8 and Oct Sun>=1; go with Shanks &
+# Pottenger.
+Rule   StJohns 1936    1941    -       May     Mon>=9  0:00    1:00    D
+Rule   StJohns 1936    1941    -       Oct     Mon>=2  0:00    0       S
+# Whitman gives the following transitions:
+# 1942 03-01/12-31, 1943 05-30/09-05, 1944 07-10/09-02, 1945 01-01/10-07
+# but go with Shanks & Pottenger and assume they used Canadian rules.
+# For 1946-9 Whitman gives May 5,4,9,1 - Oct 1,5,3,2, and for 1950 he gives
+# Apr 30 - Sep 24; go with Shanks & Pottenger.
+Rule   StJohns 1946    1950    -       May     Sun>=8  2:00    1:00    D
+Rule   StJohns 1946    1950    -       Oct     Sun>=2  2:00    0       S
+Rule   StJohns 1951    1986    -       Apr     lastSun 2:00    1:00    D
+Rule   StJohns 1951    1959    -       Sep     lastSun 2:00    0       S
+Rule   StJohns 1960    1986    -       Oct     lastSun 2:00    0       S
+# From Paul Eggert (2000-10-02):
+# INMS (2000-09-12) says that, since 1988 at least, Newfoundland switches
+# at 00:01 local time.  For now, assume it started in 1987.
+Rule   StJohns 1987    only    -       Apr     Sun>=1  0:01    1:00    D
+Rule   StJohns 1987    2006    -       Oct     lastSun 0:01    0       S
+Rule   StJohns 1988    only    -       Apr     Sun>=1  0:01    2:00    DD
+Rule   StJohns 1989    2006    -       Apr     Sun>=1  0:01    1:00    D
+Rule   StJohns 2007    max     -       Mar     Sun>=8  0:01    1:00    D
+Rule   StJohns 2007    max     -       Nov     Sun>=1  0:01    0       S
+#
+# St John's has an apostrophe, but Posix file names can't have apostrophes.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/St_Johns  -3:30:52 -      LMT     1884
+                       -3:30:52 StJohns N%sT   1918
+                       -3:30:52 Canada N%sT    1919
+                       -3:30:52 StJohns N%sT   1935 Mar 30
+                       -3:30   StJohns N%sT    1942 May 11
+                       -3:30   Canada  N%sT    1946
+                       -3:30   StJohns N%sT
+
+# most of east Labrador
+
+# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Goose_Bay -4:01:40 -      LMT     1884 # Happy Valley-Goose Bay
+                       -3:30:52 -      NST     1918
+                       -3:30:52 Canada N%sT    1919
+                       -3:30:52 -      NST     1935 Mar 30
+                       -3:30   -       NST     1936
+                       -3:30   StJohns N%sT    1942 May 11
+                       -3:30   Canada  N%sT    1946
+                       -3:30   StJohns N%sT    1966 Mar 15 2:00
+                       -4:00   StJohns A%sT
+
+
+# west Labrador, Nova Scotia, Prince Edward I
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that since 1970 most of this region has been like
+# Halifax.  Many locales did not observe peacetime DST until 1972;
+# Glace Bay, NS is the largest that we know of.
+# Shanks & Pottenger also write that Liverpool, NS was the only town
+# in Canada to observe DST in 1971 but not 1970; for now we'll assume
+# this is a typo.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Halifax 1916    only    -       Apr      1      0:00    1:00    D
+Rule   Halifax 1916    only    -       Oct      1      0:00    0       S
+Rule   Halifax 1920    only    -       May      9      0:00    1:00    D
+Rule   Halifax 1920    only    -       Aug     29      0:00    0       S
+Rule   Halifax 1921    only    -       May      6      0:00    1:00    D
+Rule   Halifax 1921    1922    -       Sep      5      0:00    0       S
+Rule   Halifax 1922    only    -       Apr     30      0:00    1:00    D
+Rule   Halifax 1923    1925    -       May     Sun>=1  0:00    1:00    D
+Rule   Halifax 1923    only    -       Sep      4      0:00    0       S
+Rule   Halifax 1924    only    -       Sep     15      0:00    0       S
+Rule   Halifax 1925    only    -       Sep     28      0:00    0       S
+Rule   Halifax 1926    only    -       May     16      0:00    1:00    D
+Rule   Halifax 1926    only    -       Sep     13      0:00    0       S
+Rule   Halifax 1927    only    -       May      1      0:00    1:00    D
+Rule   Halifax 1927    only    -       Sep     26      0:00    0       S
+Rule   Halifax 1928    1931    -       May     Sun>=8  0:00    1:00    D
+Rule   Halifax 1928    only    -       Sep      9      0:00    0       S
+Rule   Halifax 1929    only    -       Sep      3      0:00    0       S
+Rule   Halifax 1930    only    -       Sep     15      0:00    0       S
+Rule   Halifax 1931    1932    -       Sep     Mon>=24 0:00    0       S
+Rule   Halifax 1932    only    -       May      1      0:00    1:00    D
+Rule   Halifax 1933    only    -       Apr     30      0:00    1:00    D
+Rule   Halifax 1933    only    -       Oct      2      0:00    0       S
+Rule   Halifax 1934    only    -       May     20      0:00    1:00    D
+Rule   Halifax 1934    only    -       Sep     16      0:00    0       S
+Rule   Halifax 1935    only    -       Jun      2      0:00    1:00    D
+Rule   Halifax 1935    only    -       Sep     30      0:00    0       S
+Rule   Halifax 1936    only    -       Jun      1      0:00    1:00    D
+Rule   Halifax 1936    only    -       Sep     14      0:00    0       S
+Rule   Halifax 1937    1938    -       May     Sun>=1  0:00    1:00    D
+Rule   Halifax 1937    1941    -       Sep     Mon>=24 0:00    0       S
+Rule   Halifax 1939    only    -       May     28      0:00    1:00    D
+Rule   Halifax 1940    1941    -       May     Sun>=1  0:00    1:00    D
+Rule   Halifax 1946    1949    -       Apr     lastSun 2:00    1:00    D
+Rule   Halifax 1946    1949    -       Sep     lastSun 2:00    0       S
+Rule   Halifax 1951    1954    -       Apr     lastSun 2:00    1:00    D
+Rule   Halifax 1951    1954    -       Sep     lastSun 2:00    0       S
+Rule   Halifax 1956    1959    -       Apr     lastSun 2:00    1:00    D
+Rule   Halifax 1956    1959    -       Sep     lastSun 2:00    0       S
+Rule   Halifax 1962    1973    -       Apr     lastSun 2:00    1:00    D
+Rule   Halifax 1962    1973    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Halifax   -4:14:24 -      LMT     1902 Jun 15
+                       -4:00   Halifax A%sT    1918
+                       -4:00   Canada  A%sT    1919
+                       -4:00   Halifax A%sT    1942 Feb  9 2:00s
+                       -4:00   Canada  A%sT    1946
+                       -4:00   Halifax A%sT    1974
+                       -4:00   Canada  A%sT
+Zone America/Glace_Bay -3:59:48 -      LMT     1902 Jun 15
+                       -4:00   Canada  A%sT    1953
+                       -4:00   Halifax A%sT    1954
+                       -4:00   -       AST     1972
+                       -4:00   Halifax A%sT    1974
+                       -4:00   Canada  A%sT
+
+# New Brunswick
+
+# From Paul Eggert (2007-01-31):
+# The Time Definition Act <http://www.gnb.ca/0062/PDF-acts/t-06.pdf>
+# says they changed at 00:01 through 2006, and
+# <http://www.canlii.org/nb/laws/sta/t-6/20030127/whole.html> makes it
+# clear that this was the case since at least 1993.
+# For now, assume it started in 1993.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Moncton 1933    1935    -       Jun     Sun>=8  1:00    1:00    D
+Rule   Moncton 1933    1935    -       Sep     Sun>=8  1:00    0       S
+Rule   Moncton 1936    1938    -       Jun     Sun>=1  1:00    1:00    D
+Rule   Moncton 1936    1938    -       Sep     Sun>=1  1:00    0       S
+Rule   Moncton 1939    only    -       May     27      1:00    1:00    D
+Rule   Moncton 1939    1941    -       Sep     Sat>=21 1:00    0       S
+Rule   Moncton 1940    only    -       May     19      1:00    1:00    D
+Rule   Moncton 1941    only    -       May      4      1:00    1:00    D
+Rule   Moncton 1946    1972    -       Apr     lastSun 2:00    1:00    D
+Rule   Moncton 1946    1956    -       Sep     lastSun 2:00    0       S
+Rule   Moncton 1957    1972    -       Oct     lastSun 2:00    0       S
+Rule   Moncton 1993    2006    -       Apr     Sun>=1  0:01    1:00    D
+Rule   Moncton 1993    2006    -       Oct     lastSun 0:01    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Moncton   -4:19:08 -      LMT     1883 Dec  9
+                       -5:00   -       EST     1902 Jun 15
+                       -4:00   Canada  A%sT    1933
+                       -4:00   Moncton A%sT    1942
+                       -4:00   Canada  A%sT    1946
+                       -4:00   Moncton A%sT    1973
+                       -4:00   Canada  A%sT    1993
+                       -4:00   Moncton A%sT    2007
+                       -4:00   Canada  A%sT
+
+# Quebec
+
+# From Paul Eggert (2006-07-09):
+# Shanks & Pottenger write that since 1970 most of Quebec has been
+# like Montreal.
+
+# From Paul Eggert (2006-06-27):
+# Matthews and Vincent (1998) also write that Quebec east of the -63
+# meridian is supposed to observe AST, but residents as far east as
+# Natashquan use EST/EDT, and residents east of Natashquan use AST.
+# In "Official time in Quebec" the Quebec department of justice writes in
+# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
+# that "The residents of the Municipality of the
+# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
+# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
+# written and use Atlantic standard time all year round. The same applies to
+# the residents of the Native facilities along the lower North Shore."
+# <http://www.assnat.qc.ca/eng/37legislature2/Projets-loi/Publics/06-a002.htm>
+# says this common practice was codified into law as of 2007.
+# For lack of better info, guess this practice began around 1970, contra to
+# Shanks & Pottenger who have this region observing AST/ADT.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Mont    1917    only    -       Mar     25      2:00    1:00    D
+Rule   Mont    1917    only    -       Apr     24      0:00    0       S
+Rule   Mont    1919    only    -       Mar     31      2:30    1:00    D
+Rule   Mont    1919    only    -       Oct     25      2:30    0       S
+Rule   Mont    1920    only    -       May      2      2:30    1:00    D
+Rule   Mont    1920    1922    -       Oct     Sun>=1  2:30    0       S
+Rule   Mont    1921    only    -       May      1      2:00    1:00    D
+Rule   Mont    1922    only    -       Apr     30      2:00    1:00    D
+Rule   Mont    1924    only    -       May     17      2:00    1:00    D
+Rule   Mont    1924    1926    -       Sep     lastSun 2:30    0       S
+Rule   Mont    1925    1926    -       May     Sun>=1  2:00    1:00    D
+# The 1927-to-1937 rules can be expressed more simply as
+# Rule Mont    1927    1937    -       Apr     lastSat 24:00   1:00    D
+# Rule Mont    1927    1937    -       Sep     lastSat 24:00   0       S
+# The rules below avoid use of 24:00
+# (which pre-1998 versions of zic cannot handle).
+Rule   Mont    1927    only    -       May     1       0:00    1:00    D
+Rule   Mont    1927    1932    -       Sep     lastSun 0:00    0       S
+Rule   Mont    1928    1931    -       Apr     lastSun 0:00    1:00    D
+Rule   Mont    1932    only    -       May     1       0:00    1:00    D
+Rule   Mont    1933    1940    -       Apr     lastSun 0:00    1:00    D
+Rule   Mont    1933    only    -       Oct     1       0:00    0       S
+Rule   Mont    1934    1939    -       Sep     lastSun 0:00    0       S
+Rule   Mont    1946    1973    -       Apr     lastSun 2:00    1:00    D
+Rule   Mont    1945    1948    -       Sep     lastSun 2:00    0       S
+Rule   Mont    1949    1950    -       Oct     lastSun 2:00    0       S
+Rule   Mont    1951    1956    -       Sep     lastSun 2:00    0       S
+Rule   Mont    1957    1973    -       Oct     lastSun 2:00    0       S
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Blanc-Sablon -3:48:28 -   LMT     1884
+                       -4:00   Canada  A%sT    1970
+                       -4:00   -       AST
+Zone America/Montreal  -4:54:16 -      LMT     1884
+                       -5:00   Mont    E%sT    1918
+                       -5:00   Canada  E%sT    1919
+                       -5:00   Mont    E%sT    1942 Feb  9 2:00s
+                       -5:00   Canada  E%sT    1946
+                       -5:00   Mont    E%sT    1974
+                       -5:00   Canada  E%sT
+
+
+# Ontario
+
+# From Paul Eggert (2006-07-09):
+# Shanks & Pottenger write that since 1970 most of Ontario has been like
+# Toronto.
+# Thunder Bay skipped DST in 1973.
+# Many smaller locales did not observe peacetime DST until 1974;
+# Nipigon (EST) and Rainy River (CST) are the largest that we know of.
+# Far west Ontario is like Winnipeg; far east Quebec is like Halifax.
+
+# From Mark Brader (2003-07-26):
+# [According to the Toronto Star] Orillia, Ontario, adopted DST
+# effective Saturday, 1912-06-22, 22:00; the article mentions that
+# Port Arthur (now part of Thunder Bay, Ontario) as well as Moose Jaw
+# have already done so.  In Orillia DST was to run until Saturday,
+# 1912-08-31 (no time mentioned), but it was met with considerable
+# hostility from certain segments of the public, and was revoked after
+# only two weeks -- I copied it as Saturday, 1912-07-07, 22:00, but
+# presumably that should be -07-06.  (1912-06-19, -07-12; also letters
+# earlier in June).
+#
+# Kenora, Ontario, was to abandon DST on 1914-06-01 (-05-21).
+
+# From Paul Eggert (1997-10-17):
+# Mark Brader writes that an article in the 1997-10-14 Toronto Star
+# says that Atikokan, Ontario currently does not observe DST,
+# but will vote on 11-10 whether to use EST/EDT.
+# He also writes that the
+# <a href="http://www.gov.on.ca/MBS/english/publications/statregs/conttext.html">
+# Ontario Time Act (1990, Chapter T.9)
+# </a>
+# says that Ontario east of 90W uses EST/EDT, and west of 90W uses CST/CDT.
+# Officially Atikokan is therefore on CST/CDT, and most likely this report
+# concerns a non-official time observed as a matter of local practice.
+#
+# From Paul Eggert (2000-10-02):
+# Matthews and Vincent (1998) write that Atikokan, Pickle Lake, and
+# New Osnaburgh observe CST all year, that Big Trout Lake observes
+# CST/CDT, and that Upsala and Shebandowan observe EST/EDT, all in
+# violation of the official Ontario rules.
+#
+# From Paul Eggert (2006-07-09):
+# Chris Walton (2006-07-06) mentioned an article by Stephanie MacLellan in the
+# 2005-07-21 Chronicle-Journal, which said:
+#
+#      The clocks in Atikokan stay set on standard time year-round.
+#      This means they spend about half the time on central time and
+#      the other half on eastern time.
+#
+#      For the most part, the system works, Mayor Dennis Brown said.
+#
+#      "The majority of businesses in Atikokan deal more with Eastern
+#      Canada, but there are some that deal with Western Canada," he
+#      said.  "I don't see any changes happening here."
+#
+# Walton also writes "Supposedly Pickle Lake and Mishkeegogamang
+# [New Osnaburgh] follow the same practice."
+
+# From Garry McKinnon (2006-07-14) via Chris Walton:
+# I chatted with a member of my board who has an outstanding memory
+# and a long history in Atikokan (and in the telecom industry) and he
+# can say for certain that Atikokan has been practicing the current
+# time keeping since 1952, at least.
+
+# From Paul Eggert (2006-07-17):
+# Shanks & Pottenger say that Atikokan has agreed with Rainy River
+# ever since standard time was introduced, but the information from
+# McKinnon sounds more authoritative.  For now, assume that Atikokan
+# switched to EST immediately after WWII era daylight saving time
+# ended.  This matches the old (less-populous) America/Coral_Harbour
+# entry since our cutoff date of 1970, so we can move
+# America/Coral_Harbour to the 'backward' file.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Toronto 1919    only    -       Mar     30      23:30   1:00    D
+Rule   Toronto 1919    only    -       Oct     26      0:00    0       S
+Rule   Toronto 1920    only    -       May      2      2:00    1:00    D
+Rule   Toronto 1920    only    -       Sep     26      0:00    0       S
+Rule   Toronto 1921    only    -       May     15      2:00    1:00    D
+Rule   Toronto 1921    only    -       Sep     15      2:00    0       S
+Rule   Toronto 1922    1923    -       May     Sun>=8  2:00    1:00    D
+# Shanks & Pottenger say 1923-09-19; assume it's a typo and that "-16"
+# was meant.
+Rule   Toronto 1922    1926    -       Sep     Sun>=15 2:00    0       S
+Rule   Toronto 1924    1927    -       May     Sun>=1  2:00    1:00    D
+# The 1927-to-1939 rules can be expressed more simply as
+# Rule Toronto 1927    1937    -       Sep     Sun>=25 2:00    0       S
+# Rule Toronto 1928    1937    -       Apr     Sun>=25 2:00    1:00    D
+# Rule Toronto 1938    1940    -       Apr     lastSun 2:00    1:00    D
+# Rule Toronto 1938    1939    -       Sep     lastSun 2:00    0       S
+# The rules below avoid use of Sun>=25
+# (which pre-2004 versions of zic cannot handle).
+Rule   Toronto 1927    1932    -       Sep     lastSun 2:00    0       S
+Rule   Toronto 1928    1931    -       Apr     lastSun 2:00    1:00    D
+Rule   Toronto 1932    only    -       May     1       2:00    1:00    D
+Rule   Toronto 1933    1940    -       Apr     lastSun 2:00    1:00    D
+Rule   Toronto 1933    only    -       Oct     1       2:00    0       S
+Rule   Toronto 1934    1939    -       Sep     lastSun 2:00    0       S
+Rule   Toronto 1945    1946    -       Sep     lastSun 2:00    0       S
+Rule   Toronto 1946    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Toronto 1947    1949    -       Apr     lastSun 0:00    1:00    D
+Rule   Toronto 1947    1948    -       Sep     lastSun 0:00    0       S
+Rule   Toronto 1949    only    -       Nov     lastSun 0:00    0       S
+Rule   Toronto 1950    1973    -       Apr     lastSun 2:00    1:00    D
+Rule   Toronto 1950    only    -       Nov     lastSun 2:00    0       S
+Rule   Toronto 1951    1956    -       Sep     lastSun 2:00    0       S
+# Shanks & Pottenger say Toronto ended DST a week early in 1971,
+# namely on 1971-10-24, but Mark Brader wrote (2003-05-31) that this
+# is wrong, and that he had confirmed it by checking the 1971-10-30
+# Toronto Star, which said that DST was ending 1971-10-31 as usual.
+Rule   Toronto 1957    1973    -       Oct     lastSun 2:00    0       S
+
+# From Paul Eggert (2003-07-27):
+# Willett (1914-03) writes (p. 17) "In the Cities of Fort William, and
+# Port Arthur, Ontario, the principle of the Bill has been in
+# operation for the past three years, and in the City of Moose Jaw,
+# Saskatchewan, for one year."
+
+# From David Bryan via Tory Tronrud, Director/Curator,
+# Thunder Bay Museum (2003-11-12):
+# There is some suggestion, however, that, by-law or not, daylight
+# savings time was being practiced in Fort William and Port Arthur
+# before 1909.... [I]n 1910, the line between the Eastern and Central
+# Time Zones was permanently moved about two hundred miles west to
+# include the Thunder Bay area....  When Canada adopted daylight
+# savings time in 1916, Fort William and Port Arthur, having done so
+# already, did not change their clocks....  During the Second World
+# War,... [t]he cities agreed to implement DST during the summer
+# months for the remainder of the war years.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Toronto   -5:17:32 -      LMT     1895
+                       -5:00   Canada  E%sT    1919
+                       -5:00   Toronto E%sT    1942 Feb  9 2:00s
+                       -5:00   Canada  E%sT    1946
+                       -5:00   Toronto E%sT    1974
+                       -5:00   Canada  E%sT
+Zone America/Thunder_Bay -5:57:00 -    LMT     1895
+                       -6:00   -       CST     1910
+                       -5:00   -       EST     1942
+                       -5:00   Canada  E%sT    1970
+                       -5:00   Mont    E%sT    1973
+                       -5:00   -       EST     1974
+                       -5:00   Canada  E%sT
+Zone America/Nipigon   -5:53:04 -      LMT     1895
+                       -5:00   Canada  E%sT    1940 Sep 29
+                       -5:00   1:00    EDT     1942 Feb  9 2:00s
+                       -5:00   Canada  E%sT
+Zone America/Rainy_River -6:18:16 -    LMT     1895
+                       -6:00   Canada  C%sT    1940 Sep 29
+                       -6:00   1:00    CDT     1942 Feb  9 2:00s
+                       -6:00   Canada  C%sT
+Zone America/Atikokan  -6:06:28 -      LMT     1895
+                       -6:00   Canada  C%sT    1940 Sep 29
+                       -6:00   1:00    CDT     1942 Feb  9 2:00s
+                       -6:00   Canada  C%sT    1945 Sep 30 2:00
+                       -5:00   -       EST
+
+
+# Manitoba
+
+# From Rob Douglas (2006-04-06):
+# the old Manitoba Time Act - as amended by Bill 2, assented to
+# March 27, 1987 ... said ...
+# "between two o'clock Central Standard Time in the morning of
+# the first Sunday of April of each year and two o'clock Central
+# Standard Time in the morning of the last Sunday of October next
+# following, one hour in advance of Central Standard Time."...
+# I believe that the English legislation [of the old time act] had =
+# been assented to (March 22, 1967)....
+# Also, as far as I can tell, there was no order-in-council varying
+# the time of Daylight Saving Time for 2005 and so the provisions of
+# the 1987 version would apply - the changeover was at 2:00 Central
+# Standard Time (i.e. not until 3:00 Central Daylight Time).
+
+# From Paul Eggert (2006-04-10):
+# Shanks & Pottenger say Manitoba switched at 02:00 (not 02:00s)
+# starting 1966.  Since 02:00s is clearly correct for 1967 on, assume
+# it was also 02:00s in 1966.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Winn    1916    only    -       Apr     23      0:00    1:00    D
+Rule   Winn    1916    only    -       Sep     17      0:00    0       S
+Rule   Winn    1918    only    -       Apr     14      2:00    1:00    D
+Rule   Winn    1918    only    -       Oct     31      2:00    0       S
+Rule   Winn    1937    only    -       May     16      2:00    1:00    D
+Rule   Winn    1937    only    -       Sep     26      2:00    0       S
+Rule   Winn    1942    only    -       Feb      9      2:00    1:00    W # War
+Rule   Winn    1945    only    -       Aug     14      23:00u  1:00    P # Peace
+Rule   Winn    1945    only    -       Sep     lastSun 2:00    0       S
+Rule   Winn    1946    only    -       May     12      2:00    1:00    D
+Rule   Winn    1946    only    -       Oct     13      2:00    0       S
+Rule   Winn    1947    1949    -       Apr     lastSun 2:00    1:00    D
+Rule   Winn    1947    1949    -       Sep     lastSun 2:00    0       S
+Rule   Winn    1950    only    -       May      1      2:00    1:00    D
+Rule   Winn    1950    only    -       Sep     30      2:00    0       S
+Rule   Winn    1951    1960    -       Apr     lastSun 2:00    1:00    D
+Rule   Winn    1951    1958    -       Sep     lastSun 2:00    0       S
+Rule   Winn    1959    only    -       Oct     lastSun 2:00    0       S
+Rule   Winn    1960    only    -       Sep     lastSun 2:00    0       S
+Rule   Winn    1963    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Winn    1963    only    -       Sep     22      2:00    0       S
+Rule   Winn    1966    1986    -       Apr     lastSun 2:00s   1:00    D
+Rule   Winn    1966    2005    -       Oct     lastSun 2:00s   0       S
+Rule   Winn    1987    2005    -       Apr     Sun>=1  2:00s   1:00    D
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Winnipeg  -6:28:36 -      LMT     1887 Jul 16
+                       -6:00   Winn    C%sT    2006
+                       -6:00   Canada  C%sT
+
+
+# Saskatchewan
+
+# From Mark Brader (2003-07-26):
+# The first actual adoption of DST in Canada was at the municipal
+# level.  As the [Toronto] Star put it (1912-06-07), "While people
+# elsewhere have long been talking of legislation to save daylight,
+# the city of Moose Jaw [Saskatchewan] has acted on its own hook."
+# DST in Moose Jaw began on Saturday, 1912-06-01 (no time mentioned:
+# presumably late evening, as below), and would run until "the end of
+# the summer".  The discrepancy between municipal time and railroad
+# time was noted.
+
+# From Paul Eggert (2003-07-27):
+# Willett (1914-03) notes that DST "has been in operation ... in the
+# City of Moose Jaw, Saskatchewan, for one year."
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say that since 1970 this region has mostly been as Regina.
+# Some western towns (e.g. Swift Current) switched from MST/MDT to CST in 1972.
+# Other western towns (e.g. Lloydminster) are like Edmonton.
+# Matthews and Vincent (1998) write that Denare Beach and Creighton
+# are like Winnipeg, in violation of Saskatchewan law.
+
+# From W. Jones (1992-11-06):
+# The. . .below is based on information I got from our law library, the
+# provincial archives, and the provincial Community Services department.
+# A precise history would require digging through newspaper archives, and
+# since you didn't say what you wanted, I didn't bother.
+#
+# Saskatchewan is split by a time zone meridian (105W) and over the years
+# the boundary became pretty ragged as communities near it reevaluated
+# their affiliations in one direction or the other.  In 1965 a provincial
+# referendum favoured legislating common time practices.
+#
+# On 15 April 1966 the Time Act (c. T-14, Revised Statutes of
+# Saskatchewan 1978) was proclaimed, and established that the eastern
+# part of Saskatchewan would use CST year round, that districts in
+# northwest Saskatchewan would by default follow CST but could opt to
+# follow Mountain Time rules (thus 1 hour difference in the winter and
+# zero in the summer), and that districts in southwest Saskatchewan would
+# by default follow MT but could opt to follow CST.
+#
+# It took a few years for the dust to settle (I know one story of a town
+# on one time zone having its school in another, such that a mom had to
+# serve her family lunch in two shifts), but presently it seems that only
+# a few towns on the border with Alberta (e.g. Lloydminster) follow MT
+# rules any more; all other districts appear to have used CST year round
+# since sometime in the 1960s.
+
+# From Chris Walton (2006-06-26):
+# The Saskatchewan time act which was last updated in 1996 is about 30 pages
+# long and rather painful to read.
+# http://www.qp.gov.sk.ca/documents/English/Statutes/Statutes/T14.pdf
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Regina  1918    only    -       Apr     14      2:00    1:00    D
+Rule   Regina  1918    only    -       Oct     31      2:00    0       S
+Rule   Regina  1930    1934    -       May     Sun>=1  0:00    1:00    D
+Rule   Regina  1930    1934    -       Oct     Sun>=1  0:00    0       S
+Rule   Regina  1937    1941    -       Apr     Sun>=8  0:00    1:00    D
+Rule   Regina  1937    only    -       Oct     Sun>=8  0:00    0       S
+Rule   Regina  1938    only    -       Oct     Sun>=1  0:00    0       S
+Rule   Regina  1939    1941    -       Oct     Sun>=8  0:00    0       S
+Rule   Regina  1942    only    -       Feb      9      2:00    1:00    W # War
+Rule   Regina  1945    only    -       Aug     14      23:00u  1:00    P # Peace
+Rule   Regina  1945    only    -       Sep     lastSun 2:00    0       S
+Rule   Regina  1946    only    -       Apr     Sun>=8  2:00    1:00    D
+Rule   Regina  1946    only    -       Oct     Sun>=8  2:00    0       S
+Rule   Regina  1947    1957    -       Apr     lastSun 2:00    1:00    D
+Rule   Regina  1947    1957    -       Sep     lastSun 2:00    0       S
+Rule   Regina  1959    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Regina  1959    only    -       Oct     lastSun 2:00    0       S
+#
+Rule   Swift   1957    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Swift   1957    only    -       Oct     lastSun 2:00    0       S
+Rule   Swift   1959    1961    -       Apr     lastSun 2:00    1:00    D
+Rule   Swift   1959    only    -       Oct     lastSun 2:00    0       S
+Rule   Swift   1960    1961    -       Sep     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Regina    -6:58:36 -      LMT     1905 Sep
+                       -7:00   Regina  M%sT    1960 Apr lastSun 2:00
+                       -6:00   -       CST
+Zone America/Swift_Current -7:11:20 -  LMT     1905 Sep
+                       -7:00   Canada  M%sT    1946 Apr lastSun 2:00
+                       -7:00   Regina  M%sT    1950
+                       -7:00   Swift   M%sT    1972 Apr lastSun 2:00
+                       -6:00   -       CST
+
+
+# Alberta
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Edm     1918    1919    -       Apr     Sun>=8  2:00    1:00    D
+Rule   Edm     1918    only    -       Oct     31      2:00    0       S
+Rule   Edm     1919    only    -       May     27      2:00    0       S
+Rule   Edm     1920    1923    -       Apr     lastSun 2:00    1:00    D
+Rule   Edm     1920    only    -       Oct     lastSun 2:00    0       S
+Rule   Edm     1921    1923    -       Sep     lastSun 2:00    0       S
+Rule   Edm     1942    only    -       Feb      9      2:00    1:00    W # War
+Rule   Edm     1945    only    -       Aug     14      23:00u  1:00    P # Peace
+Rule   Edm     1945    only    -       Sep     lastSun 2:00    0       S
+Rule   Edm     1947    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Edm     1947    only    -       Sep     lastSun 2:00    0       S
+Rule   Edm     1967    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Edm     1967    only    -       Oct     lastSun 2:00    0       S
+Rule   Edm     1969    only    -       Apr     lastSun 2:00    1:00    D
+Rule   Edm     1969    only    -       Oct     lastSun 2:00    0       S
+Rule   Edm     1972    1986    -       Apr     lastSun 2:00    1:00    D
+Rule   Edm     1972    2006    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Edmonton  -7:33:52 -      LMT     1906 Sep
+                       -7:00   Edm     M%sT    1987
+                       -7:00   Canada  M%sT
+
+
+# British Columbia
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that since 1970 most of this region has
+# been like Vancouver.
+# Dawson Creek uses MST.  Much of east BC is like Edmonton.
+# Matthews and Vincent (1998) write that Creston is like Dawson Creek.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Vanc    1918    only    -       Apr     14      2:00    1:00    D
+Rule   Vanc    1918    only    -       Oct     31      2:00    0       S
+Rule   Vanc    1942    only    -       Feb      9      2:00    1:00    W # War
+Rule   Vanc    1945    only    -       Aug     14      23:00u  1:00    P # Peace
+Rule   Vanc    1945    only    -       Sep     30      2:00    0       S
+Rule   Vanc    1946    1986    -       Apr     lastSun 2:00    1:00    D
+Rule   Vanc    1946    only    -       Oct     13      2:00    0       S
+Rule   Vanc    1947    1961    -       Sep     lastSun 2:00    0       S
+Rule   Vanc    1962    2006    -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Vancouver -8:12:28 -      LMT     1884
+                       -8:00   Vanc    P%sT    1987
+                       -8:00   Canada  P%sT
+Zone America/Dawson_Creek -8:00:56 -   LMT     1884
+                       -8:00   Canada  P%sT    1947
+                       -8:00   Vanc    P%sT    1972 Aug 30 2:00
+                       -7:00   -       MST
+
+
+# Northwest Territories, Nunavut, Yukon
+
+# From Paul Eggert (2006-03-22):
+# Dawson switched to PST in 1973.  Inuvik switched to MST in 1979.
+# Mathew Englander (1996-10-07) gives the following refs:
+#      * 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
+#      c. 7 defines Yukon standard time as UTC-9.  This is still valid;
+#      see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
+#      * C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
+#      * O.I.C. 1980/02 established DST.
+#      * O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
+# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go
+# with Englander.
+# From Chris Walton (2006-06-26):
+# Here is a link to the old daylight saving portion of the interpretation
+# act which was last updated in 1987:
+# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf
+
+# From Rives McDow (1999-09-04):
+# Nunavut ... moved ... to incorporate the whole territory into one time zone.
+# <a href="http://www.nunatsiaq.com/nunavut/nvt90903_13.html">
+# Nunavut moves to single time zone Oct. 31
+# </a>
+#
+# From Antoine Leca (1999-09-06):
+# We then need to create a new timezone for the Kitikmeot region of Nunavut
+# to differentiate it from the Yellowknife region.
+
+# From Paul Eggert (1999-09-20):
+# <a href="http://www.nunavut.com/basicfacts/english/basicfacts_1territory.html">
+# Basic Facts: The New Territory
+# </a> (1999) reports that Pangnirtung operates on eastern time,
+# and that Coral Harbour does not observe DST.  We don't know when
+# Pangnirtung switched to eastern time; we'll guess 1995.
+
+# From Rives McDow (1999-11-08):
+# On October 31, when the rest of Nunavut went to Central time,
+# Pangnirtung wobbled.  Here is the result of their wobble:
+#
+# The following businesses and organizations in Pangnirtung use Central Time:
+#
+#      First Air, Power Corp, Nunavut Construction, Health Center, RCMP,
+#      Eastern Arctic National Parks, A & D Specialist
+#
+# The following businesses and organizations in Pangnirtung use Eastern Time:
+#
+#      Hamlet office, All other businesses, Both schools, Airport operator
+#
+# This has made for an interesting situation there, which warranted the news.
+# No one there that I spoke with seems concerned, or has plans to
+# change the local methods of keeping time, as it evidently does not
+# really interfere with any activities or make things difficult locally.
+# They plan to celebrate New Year's turn-over twice, one hour apart,
+# so it appears that the situation will last at least that long.
+# The Nunavut Intergovernmental Affairs hopes that they will "come to
+# their senses", but the locals evidently don't see any problem with
+# the current state of affairs.
+
+# From Michaela Rodrigue, writing in the
+# <a href="http://www.nunatsiaq.com/archives/nunavut991130/nvt91119_17.html">
+# Nunatsiaq News (1999-11-19)</a>:
+# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
+# central - or Nunavut time - for government offices, and eastern time
+# for municipal offices and schools....  Igloolik [was similar but then]
+# made the switch to central time on Saturday, Nov. 6.
+
+# From Paul Eggert (2000-10-02):
+# Matthews and Vincent (1998) say the following, but we lack histories
+# for these potential new Zones.
+#
+# The Canadian Forces station at Alert uses Eastern Time while the
+# handful of residents at the Eureka weather station [in the Central
+# zone] skip daylight savings.  Baffin Island, which is crossed by the
+# Central, Eastern and Atlantic Time zones only uses Eastern Time.
+# Gjoa Haven, Taloyoak and Pelly Bay all use Mountain instead of
+# Central Time and Southampton Island [in the Central zone] is not
+# required to use daylight savings.
+
+# From
+# <a href="http://www.nunatsiaq.com/archives/nunavut001130/nvt21110_02.html">
+# Nunavut now has two time zones
+# </a> (2000-11-10):
+# The Nunavut government would allow its employees in Kugluktuk and
+# Cambridge Bay to operate on central time year-round, putting them
+# one hour behind the rest of Nunavut for six months during the winter.
+# At the end of October the two communities had rebelled against
+# Nunavut's unified time zone, refusing to shift to eastern time with
+# the rest of the territory for the winter.  Cambridge Bay remained on
+# central time, while Kugluktuk, even farther west, reverted to
+# mountain time, which they had used before the advent of Nunavut's
+# unified time zone in 1999.
+#
+# From Rives McDow (2001-01-20), quoting the Nunavut government:
+# The preceding decision came into effect at midnight, Saturday Nov 4, 2000.
+
+# From Paul Eggert (2000-12-04):
+# Let's just keep track of the official times for now.
+
+# From Rives McDow (2001-03-07):
+# The premier of Nunavut has issued a ministerial statement advising
+# that effective 2001-04-01, the territory of Nunavut will revert
+# back to three time zones (mountain, central, and eastern).  Of the
+# cities in Nunavut, Coral Harbor is the only one that I know of that
+# has said it will not observe dst, staying on EST year round.  I'm
+# checking for more info, and will get back to you if I come up with
+# more.
+# [Also see <http://www.nunatsiaq.com/nunavut/nvt10309_06.html> (2001-03-09).]
+
+# From Gwillim Law (2005-05-21):
+# According to maps at
+# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SWE.jpg
+# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SSE.jpg
+# (both dated 2003), and
+# http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp
+# (from a 1998 Canadian Geographic article), the de facto and de jure time
+# for Southampton Island (at the north end of Hudson Bay) is UTC-5 all year
+# round.  Using Google, it's easy to find other websites that confirm this.
+# I wasn't able to find how far back this time regimen goes, but since it
+# predates the creation of Nunavut, it probably goes back many years....
+# The Inuktitut name of Coral Harbour is Sallit, but it's rarely used.
+#
+# From Paul Eggert (2005-07-26):
+# For lack of better information, assume that Southampton Island observed
+# daylight saving only during wartime.
+
+# From Chris Walton (2007-03-01):
+# ... the community of Resolute (located on Cornwallis Island in
+# Nunavut) moved from Central Time to Eastern Time last November.
+# Basically the community did not change its clocks at the end of
+# daylight saving....
+# http://www.nnsl.com/frames/newspapers/2006-11/nov13_06none.html
+
+# From Chris Walton (2007-03-14):
+# Today I phoned the "hamlet office" to find out what Resolute was doing with
+# its clocks.
+#
+# The individual that answered the phone confirmed that the clocks did not
+# move at the end of daylight saving on October 29/2006.  He also told me that
+# the clocks did not move this past weekend (March 11/2007)....
+
+# From Chris Walton (2008-11-13):
+# ...the residents of Resolute believe that they are changing "time zones"
+# twice a year.  In winter months, local time is qualified with "Eastern
+# Time" which is really "Eastern Standard Time (UTC-5)".  In summer
+# months, local time is qualified with "Central Time" which is really
+# "Central Daylight Time (UTC-5)"...
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   NT_YK   1918    only    -       Apr     14      2:00    1:00    D
+Rule   NT_YK   1918    only    -       Oct     27      2:00    0       S
+Rule   NT_YK   1919    only    -       May     25      2:00    1:00    D
+Rule   NT_YK   1919    only    -       Nov      1      0:00    0       S
+Rule   NT_YK   1942    only    -       Feb      9      2:00    1:00    W # War
+Rule   NT_YK   1945    only    -       Aug     14      23:00u  1:00    P # Peace
+Rule   NT_YK   1945    only    -       Sep     30      2:00    0       S
+Rule   NT_YK   1965    only    -       Apr     lastSun 0:00    2:00    DD
+Rule   NT_YK   1965    only    -       Oct     lastSun 2:00    0       S
+Rule   NT_YK   1980    1986    -       Apr     lastSun 2:00    1:00    D
+Rule   NT_YK   1980    2006    -       Oct     lastSun 2:00    0       S
+Rule   NT_YK   1987    2006    -       Apr     Sun>=1  2:00    1:00    D
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# aka Panniqtuuq
+Zone America/Pangnirtung 0     -       zzz     1921 # trading post est.
+                       -4:00   NT_YK   A%sT    1995 Apr Sun>=1 2:00
+                       -5:00   Canada  E%sT    1999 Oct 31 2:00
+                       -6:00   Canada  C%sT    2000 Oct 29 2:00
+                       -5:00   Canada  E%sT
+# formerly Frobisher Bay
+Zone America/Iqaluit   0       -       zzz     1942 Aug # Frobisher Bay est.
+                       -5:00   NT_YK   E%sT    1999 Oct 31 2:00
+                       -6:00   Canada  C%sT    2000 Oct 29 2:00
+                       -5:00   Canada  E%sT
+# aka Qausuittuq
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Resolute 2006   max     -       Nov     Sun>=1  2:00    0       ES
+Rule   Resolute 2007   max     -       Mar     Sun>=8  2:00    0       CD
+Zone America/Resolute  0       -       zzz     1947 Aug 31 # Resolute founded
+                       -6:00   NT_YK   C%sT    2000 Oct 29 2:00
+                       -5:00   -       EST     2001 Apr  1 3:00
+                       -6:00   Canada  C%sT    2006 Oct 29 2:00
+                       -5:00   Resolute        %sT
+# aka Kangiqiniq
+Zone America/Rankin_Inlet 0    -       zzz     1957 # Rankin Inlet founded
+                       -6:00   NT_YK   C%sT    2000 Oct 29 2:00
+                       -5:00   -       EST     2001 Apr  1 3:00
+                       -6:00   Canada  C%sT
+# aka Iqaluktuuttiaq
+Zone America/Cambridge_Bay 0   -       zzz     1920 # trading post est.?
+                       -7:00   NT_YK   M%sT    1999 Oct 31 2:00
+                       -6:00   Canada  C%sT    2000 Oct 29 2:00
+                       -5:00   -       EST     2000 Nov  5 0:00
+                       -6:00   -       CST     2001 Apr  1 3:00
+                       -7:00   Canada  M%sT
+Zone America/Yellowknife 0     -       zzz     1935 # Yellowknife founded?
+                       -7:00   NT_YK   M%sT    1980
+                       -7:00   Canada  M%sT
+Zone America/Inuvik    0       -       zzz     1953 # Inuvik founded
+                       -8:00   NT_YK   P%sT    1979 Apr lastSun 2:00
+                       -7:00   NT_YK   M%sT    1980
+                       -7:00   Canada  M%sT
+Zone America/Whitehorse        -9:00:12 -      LMT     1900 Aug 20
+                       -9:00   NT_YK   Y%sT    1966 Jul 1 2:00
+                       -8:00   NT_YK   P%sT    1980
+                       -8:00   Canada  P%sT
+Zone America/Dawson    -9:17:40 -      LMT     1900 Aug 20
+                       -9:00   NT_YK   Y%sT    1973 Oct 28 0:00
+                       -8:00   NT_YK   P%sT    1980
+                       -8:00   Canada  P%sT
+
+
+###############################################################################
+
+# Mexico
+
+# From Paul Eggert (2001-03-05):
+# The Investigation and Analysis Service of the
+# Mexican Library of Congress (MLoC) has published a
+# <a href="http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/">
+# history of Mexican local time (in Spanish)
+# </a>.
+#
+# Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC.
+# (In all cases we go with the MLoC.)
+# S&P report that Baja was at -8:00 in 1922/1923.
+# S&P say the 1930 transition in Baja was 1930-11-16.
+# S&P report no DST during summer 1931.
+# S&P report a transition at 1932-03-30 23:00, not 1932-04-01.
+
+# From Gwillim Law (2001-02-20):
+# There are some other discrepancies between the Decrees page and the
+# tz database.  I think they can best be explained by supposing that
+# the researchers who prepared the Decrees page failed to find some of
+# the relevant documents.
+
+# From Alan Perry (1996-02-15):
+# A guy from our Mexico subsidiary finally found the Presidential Decree
+# outlining the timezone changes in Mexico.
+#
+# ------------- Begin Forwarded Message -------------
+#
+# I finally got my hands on the Official Presidential Decree that sets up the
+# rules for the DST changes. The rules are:
+#
+# 1. The country is divided in 3 timezones:
+#    - Baja California Norte (the Mexico/BajaNorte TZ)
+#    - Baja California Sur, Nayarit, Sinaloa and Sonora (the Mexico/BajaSur TZ)
+#    - The rest of the country (the Mexico/General TZ)
+#
+# 2. From the first Sunday in April at 2:00 AM to the last Sunday in October
+#    at 2:00 AM, the times in each zone are as follows:
+#    BajaNorte: GMT+7
+#    BajaSur:   GMT+6
+#    General:   GMT+5
+#
+# 3. The rest of the year, the times are as follows:
+#    BajaNorte: GMT+8
+#    BajaSur:   GMT+7
+#    General:   GMT+6
+#
+# The Decree was published in Mexico's Official Newspaper on January 4th.
+#
+# -------------- End Forwarded Message --------------
+# From Paul Eggert (1996-06-12):
+# For an English translation of the decree, see
+# <a href="http://mexico-travel.com/extra/timezone_eng.html">
+# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
+# </a>
+
+# From Rives McDow (1998-10-08):
+# The State of Quintana Roo has reverted back to central STD and DST times
+# (i.e. UTC -0600 and -0500 as of 1998-08-02).
+
+# From Rives McDow (2000-01-10):
+# Effective April 4, 1999 at 2:00 AM local time, Sonora changed to the time
+# zone 5 hours from the International Date Line, and will not observe daylight
+# savings time so as to stay on the same time zone as the southern part of
+# Arizona year round.
+
+# From Jesper Norgaard, translating
+# <http://www.reforma.com/nacional/articulo/064327/> (2001-01-17):
+# In Oaxaca, the 55.000 teachers from the Section 22 of the National
+# Syndicate of Education Workers, refuse to apply daylight saving each
+# year, so that the more than 10,000 schools work at normal hour the
+# whole year.
+
+# From Gwillim Law (2001-01-19):
+# <http://www.reforma.com/negocios_y_dinero/articulo/064481/> ... says
+# (translated):...
+# January 17, 2000 - The Energy Secretary, Ernesto Martens, announced
+# that Summer Time will be reduced from seven to five months, starting
+# this year....
+# <http://www.publico.com.mx/scripts/texto3.asp?action=pagina&pag=21&pos=p&secc=naci&date=01/17/2001>
+# [translated], says "summer time will ... take effect on the first Sunday
+# in May, and end on the last Sunday of September.
+
+# From Arthur David Olson (2001-01-25):
+# The 2001-01-24 traditional Washington Post contained the page one
+# story "Timely Issue Divides Mexicans."...
+# http://www.washingtonpost.com/wp-dyn/articles/A37383-2001Jan23.html
+# ... Mexico City Mayor Lopez Obrador "...is threatening to keep
+# Mexico City and its 20 million residents on a different time than
+# the rest of the country..." In particular, Lopez Obrador would abolish
+# observation of Daylight Saving Time.
+
+# <a href="http://www.conae.gob.mx/ahorro/decretohorver2001.html#decre">
+# Official statute published by the Energy Department
+# </a> (2001-02-01) shows Baja and Chihauhua as still using US DST rules,
+# and Sonora with no DST.  This was reported by Jesper Norgaard (2001-02-03).
+
+# From Paul Eggert (2001-03-03):
+#
+# <a href="http://www.latimes.com/news/nation/20010303/t000018766.html">
+# James F. Smith writes in today's LA Times
+# </a>
+# * Sonora will continue to observe standard time.
+# * Last week Mexico City's mayor Andres Manuel Lopez Obrador decreed that
+#   the Federal District will not adopt DST.
+# * 4 of 16 district leaders announced they'll ignore the decree.
+# * The decree does not affect federal-controlled facilities including
+#   the airport, banks, hospitals, and schools.
+#
+# For now we'll assume that the Federal District will bow to federal rules.
+
+# From Jesper Norgaard (2001-04-01):
+# I found some references to the Mexican application of daylight
+# saving, which modifies what I had already sent you, stating earlier
+# that a number of northern Mexican states would go on daylight
+# saving. The modification reverts this to only cover Baja California
+# (Norte), while all other states (except Sonora, who has no daylight
+# saving all year) will follow the original decree of president
+# Vicente Fox, starting daylight saving May 6, 2001 and ending
+# September 30, 2001.
+# References: "Diario de Monterrey" <www.diariodemonterrey.com/index.asp>
+# Palabra <http://palabra.infosel.com/010331/primera/ppri3101.pdf> (2001-03-31)
+
+# From Reuters (2001-09-04):
+# Mexico's Supreme Court on Tuesday declared that daylight savings was
+# unconstitutional in Mexico City, creating the possibility the
+# capital will be in a different time zone from the rest of the nation
+# next year....  The Supreme Court's ruling takes effect at 2:00
+# a.m. (0800 GMT) on Sept. 30, when Mexico is scheduled to revert to
+# standard time. "This is so residents of the Federal District are not
+# subject to unexpected time changes," a statement from the court said.
+
+# From Jesper Norgaard Welen (2002-03-12):
+# ... consulting my local grocery store(!) and my coworkers, they all insisted
+# that a new decision had been made to reinstate US style DST in Mexico....
+# http://www.conae.gob.mx/ahorro/horaver2001_m1_2002.html (2002-02-20)
+# confirms this.  Sonora as usual is the only state where DST is not applied.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Mexico  1939    only    -       Feb     5       0:00    1:00    D
+Rule   Mexico  1939    only    -       Jun     25      0:00    0       S
+Rule   Mexico  1940    only    -       Dec     9       0:00    1:00    D
+Rule   Mexico  1941    only    -       Apr     1       0:00    0       S
+Rule   Mexico  1943    only    -       Dec     16      0:00    1:00    W # War
+Rule   Mexico  1944    only    -       May     1       0:00    0       S
+Rule   Mexico  1950    only    -       Feb     12      0:00    1:00    D
+Rule   Mexico  1950    only    -       Jul     30      0:00    0       S
+Rule   Mexico  1996    2000    -       Apr     Sun>=1  2:00    1:00    D
+Rule   Mexico  1996    2000    -       Oct     lastSun 2:00    0       S
+Rule   Mexico  2001    only    -       May     Sun>=1  2:00    1:00    D
+Rule   Mexico  2001    only    -       Sep     lastSun 2:00    0       S
+Rule   Mexico  2002    max     -       Apr     Sun>=1  2:00    1:00    D
+Rule   Mexico  2002    max     -       Oct     lastSun 2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+# Quintana Roo
+Zone America/Cancun    -5:47:04 -      LMT     1922 Jan  1  0:12:56
+                       -6:00   -       CST     1981 Dec 23
+                       -5:00   Mexico  E%sT    1998 Aug  2  2:00
+                       -6:00   Mexico  C%sT
+# Campeche, Yucatan
+Zone America/Merida    -5:58:28 -      LMT     1922 Jan  1  0:01:32
+                       -6:00   -       CST     1981 Dec 23
+                       -5:00   -       EST     1982 Dec  2
+                       -6:00   Mexico  C%sT
+# Coahuila, Durango, Nuevo Leon, Tamaulipas
+Zone America/Monterrey -6:41:16 -      LMT     1921 Dec 31 23:18:44
+                       -6:00   -       CST     1988
+                       -6:00   US      C%sT    1989
+                       -6:00   Mexico  C%sT
+# Central Mexico
+Zone America/Mexico_City -6:36:36 -    LMT     1922 Jan  1  0:23:24
+                       -7:00   -       MST     1927 Jun 10 23:00
+                       -6:00   -       CST     1930 Nov 15
+                       -7:00   -       MST     1931 May  1 23:00
+                       -6:00   -       CST     1931 Oct
+                       -7:00   -       MST     1932 Apr  1
+                       -6:00   Mexico  C%sT    2001 Sep 30 02:00
+                       -6:00   -       CST     2002 Feb 20
+                       -6:00   Mexico  C%sT
+# Chihuahua
+Zone America/Chihuahua -7:04:20 -      LMT     1921 Dec 31 23:55:40
+                       -7:00   -       MST     1927 Jun 10 23:00
+                       -6:00   -       CST     1930 Nov 15
+                       -7:00   -       MST     1931 May  1 23:00
+                       -6:00   -       CST     1931 Oct
+                       -7:00   -       MST     1932 Apr  1
+                       -6:00   -       CST     1996
+                       -6:00   Mexico  C%sT    1998
+                       -6:00   -       CST     1998 Apr Sun>=1 3:00
+                       -7:00   Mexico  M%sT
+# Sonora
+Zone America/Hermosillo        -7:23:52 -      LMT     1921 Dec 31 23:36:08
+                       -7:00   -       MST     1927 Jun 10 23:00
+                       -6:00   -       CST     1930 Nov 15
+                       -7:00   -       MST     1931 May  1 23:00
+                       -6:00   -       CST     1931 Oct
+                       -7:00   -       MST     1932 Apr  1
+                       -6:00   -       CST     1942 Apr 24
+                       -7:00   -       MST     1949 Jan 14
+                       -8:00   -       PST     1970
+                       -7:00   Mexico  M%sT    1999
+                       -7:00   -       MST
+# Baja California Sur, Nayarit, Sinaloa
+Zone America/Mazatlan  -7:05:40 -      LMT     1921 Dec 31 23:54:20
+                       -7:00   -       MST     1927 Jun 10 23:00
+                       -6:00   -       CST     1930 Nov 15
+                       -7:00   -       MST     1931 May  1 23:00
+                       -6:00   -       CST     1931 Oct
+                       -7:00   -       MST     1932 Apr  1
+                       -6:00   -       CST     1942 Apr 24
+                       -7:00   -       MST     1949 Jan 14
+                       -8:00   -       PST     1970
+                       -7:00   Mexico  M%sT
+# Baja California
+Zone America/Tijuana   -7:48:04 -      LMT     1922 Jan  1  0:11:56
+                       -7:00   -       MST     1924
+                       -8:00   -       PST     1927 Jun 10 23:00
+                       -7:00   -       MST     1930 Nov 15
+                       -8:00   -       PST     1931 Apr  1
+                       -8:00   1:00    PDT     1931 Sep 30
+                       -8:00   -       PST     1942 Apr 24
+                       -8:00   1:00    PWT     1945 Aug 14 23:00u
+                       -8:00   1:00    PPT     1945 Nov 12 # Peace
+                       -8:00   -       PST     1948 Apr  5
+                       -8:00   1:00    PDT     1949 Jan 14
+                       -8:00   -       PST     1954
+                       -8:00   CA      P%sT    1961
+                       -8:00   -       PST     1976
+                       -8:00   US      P%sT    1996
+                       -8:00   Mexico  P%sT    2001
+                       -8:00   US      P%sT    2002 Feb 20
+                       -8:00   Mexico  P%sT
+# From Paul Eggert (2006-03-22):
+# Formerly there was an America/Ensenada zone, which differed from
+# America/Tijuana only in that it did not observe DST from 1976
+# through 1995.  This was as per Shanks (1999).  But Shanks & Pottenger say
+# Ensenada did not observe DST from 1948 through 1975.  Guy Harris reports
+# that the 1987 OAG says "Only Ensenada, Mexicale, San Felipe and
+# Tijuana observe DST," which agrees with Shanks & Pottenger but implies that
+# DST-observance was a town-by-town matter back then.  This concerns
+# data after 1970 so most likely there should be at least one Zone
+# other than America/Tijuana for Baja, but it's not clear yet what its
+# name or contents should be.
+#
+# Revillagigedo Is
+# no information
+
+###############################################################################
+
+# Anguilla
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Anguilla  -4:12:16 -      LMT     1912 Mar 2
+                       -4:00   -       AST
+
+# Antigua and Barbuda
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Antigua -4:07:12 -      LMT     1912 Mar 2
+                       -5:00   -       EST     1951
+                       -4:00   -       AST
+
+# Bahamas
+#
+# From Sue Williams (2006-12-07):
+# The Bahamas announced about a month ago that they plan to change their DST
+# rules to sync with the U.S. starting in 2007....
+# http://www.jonesbahamas.com/?c=45&a=10412
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Bahamas 1964    1975    -       Oct     lastSun 2:00    0       S
+Rule   Bahamas 1964    1975    -       Apr     lastSun 2:00    1:00    D
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Nassau  -5:09:24 -      LMT     1912 Mar 2
+                       -5:00   Bahamas E%sT    1976
+                       -5:00   US      E%sT
+
+# Barbados
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Barb    1977    only    -       Jun     12      2:00    1:00    D
+Rule   Barb    1977    1978    -       Oct     Sun>=1  2:00    0       S
+Rule   Barb    1978    1980    -       Apr     Sun>=15 2:00    1:00    D
+Rule   Barb    1979    only    -       Sep     30      2:00    0       S
+Rule   Barb    1980    only    -       Sep     25      2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Barbados  -3:58:28 -      LMT     1924            # Bridgetown
+                       -3:58:28 -      BMT     1932      # Bridgetown Mean Time
+                       -4:00   Barb    A%sT
+
+# Belize
+# Whitman entirely disagrees with Shanks; go with Shanks & Pottenger.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Belize  1918    1942    -       Oct     Sun>=2  0:00    0:30    HD
+Rule   Belize  1919    1943    -       Feb     Sun>=9  0:00    0       S
+Rule   Belize  1973    only    -       Dec      5      0:00    1:00    D
+Rule   Belize  1974    only    -       Feb      9      0:00    0       S
+Rule   Belize  1982    only    -       Dec     18      0:00    1:00    D
+Rule   Belize  1983    only    -       Feb     12      0:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Belize  -5:52:48 -      LMT     1912 Apr
+                       -6:00   Belize  C%sT
+
+# Bermuda
+
+# From Dan Jones, reporting in The Royal Gazette (2006-06-26):
+
+# Next year, however, clocks in the US will go forward on the second Sunday
+# in March, until the first Sunday in November.  And, after the Time Zone
+# (Seasonal Variation) Bill 2006 was passed in the House of Assembly on
+# Friday, the same thing will happen in Bermuda.
+# http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Atlantic/Bermuda  -4:19:04 -      LMT     1930 Jan  1 2:00    # Hamilton
+                       -4:00   -       AST     1974 Apr 28 2:00
+                       -4:00   Bahamas A%sT    1976
+                       -4:00   US      A%sT
+
+# Cayman Is
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Cayman  -5:25:32 -      LMT     1890            # Georgetown
+                       -5:07:12 -      KMT     1912 Feb    # Kingston Mean Time
+                       -5:00   -       EST
+
+# Costa Rica
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   CR      1979    1980    -       Feb     lastSun 0:00    1:00    D
+Rule   CR      1979    1980    -       Jun     Sun>=1  0:00    0       S
+Rule   CR      1991    1992    -       Jan     Sat>=15 0:00    1:00    D
+# IATA SSIM (1991-09) says the following was at 1:00;
+# go with Shanks & Pottenger.
+Rule   CR      1991    only    -       Jul      1      0:00    0       S
+Rule   CR      1992    only    -       Mar     15      0:00    0       S
+# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Costa_Rica        -5:36:20 -      LMT     1890            # San Jose
+                       -5:36:20 -      SJMT    1921 Jan 15 # San Jose Mean Time
+                       -6:00   CR      C%sT
+# Coco
+# no information; probably like America/Costa_Rica
+
+# Cuba
+
+# From Arthur David Olson (1999-03-29):
+# The 1999-03-28 exhibition baseball game held in Havana, Cuba, between
+# the Cuban National Team and the Baltimore Orioles was carried live on
+# the Orioles Radio Network, including affiliate WTOP in Washington, DC.
+# During the game, play-by-play announcer Jim Hunter noted that
+# "We'll be losing two hours of sleep...Cuba switched to Daylight Saving
+# Time today."  (The "two hour" remark referred to losing one hour of
+# sleep on 1999-03-28--when the announcers were in Cuba as it switched
+# to DST--and one more hour on 1999-04-04--when the announcers will have
+# returned to Baltimore, which switches on that date.)
+
+# From Evert van der Veer via Steffen Thorsen (2004-10-28):
+# Cuba is not going back to standard time this year.
+# From Paul Eggert (2006-03-22):
+# http://www.granma.cu/ingles/2004/septiembre/juev30/41medid-i.html
+# says that it's due to a problem at the Antonio Guiteras
+# thermoelectric plant, and says "This October there will be no return
+# to normal hours (after daylight saving time)".
+# For now, let's assume that it's a temporary measure.
+
+# From Carlos A. Carnero Delgado (2005-11-12):
+# This year (just like in 2004-2005) there's no change in time zone
+# adjustment in Cuba.  We will stay in daylight saving time:
+# http://www.granma.cu/espanol/2005/noviembre/mier9/horario.html
+
+# From Jesper Norgaard Welen (2006-10-21):
+# An article in GRANMA INTERNACIONAL claims that Cuba will end
+# the 3 years of permanent DST next weekend, see
+# http://www.granma.cu/ingles/2006/octubre/lun16/43horario.html
+# "On Saturday night, October 28 going into Sunday, October 29, at 01:00,
+# watches should be set back one hour -- going back to 00:00 hours -- returning
+# to the normal schedule....
+
+# From Paul Eggert (2007-03-02):
+# http://www.granma.cubaweb.cu/english/news/art89.html, dated yesterday,
+# says Cuban clocks will advance at midnight on March 10.
+# For lack of better information, assume Cuba will use US rules,
+# except that it switches at midnight standard time as usual.
+#
+# From Steffen Thorsen (2007-10-25):
+# Carlos Alberto Fonseca Arauz informed me that Cuba will end DST one week 
+# earlier - on the last Sunday of October, just like in 2006.
+# 
+# He supplied these references:
+# 
+# http://www.prensalatina.com.mx/article.asp?ID=%7B4CC32C1B-A9F7-42FB-8A07-8631AFC923AF%7D&language=ES
+# http://actualidad.terra.es/sociedad/articulo/cuba_llama_ahorrar_energia_cambio_1957044.htm
+# 
+# From Alex Kryvenishev (2007-10-25):
+# Here is also article from Granma (Cuba):
+# 
+# [Regira] el Horario Normal desde el [proximo] domingo 28 de octubre
+# http://www.granma.cubaweb.cu/2007/10/24/nacional/artic07.html
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_cuba03.html
+
+# From Arthur David Olson (2008-03-09):
+# I'm in Maryland which is now observing United States Eastern Daylight
+# Time. At 9:44 local time I used RealPlayer to listen to
+# <a href="http://media.enet.cu/radioreloj">
+# http://media.enet.cu/radioreloj
+# </a>, a Cuban information station, and heard
+# the time announced as "ocho cuarenta y cuatro" ("eight forty-four"),
+# indicating that Cuba is still on standard time.
+
+# From Steffen Thorsen (2008-03-12):
+# It seems that Cuba will start DST on Sunday, 2007-03-16...
+# It was announced yesterday, according to this source (in Spanish):
+# <a href="http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm">
+# http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm
+# </a>
+#
+# Some more background information is posted here:
+# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html">
+# http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
+# </a>
+#
+# The article also says that Cuba has been observing DST since 1963,
+# while Shanks (and tzdata) has 1965 as the first date (except in the
+# 1940's). Many other web pages in Cuba also claim that it has been
+# observed since 1963, but with the exception of 1970 - an exception
+# which is not present in tzdata/Shanks. So there is a chance we need to
+# change some historic records as well.
+#
+# One example:
+# <a href="http://www.radiohc.cu/espanol/noticias/mar07/11mar/hor.htm">
+# http://www.radiohc.cu/espanol/noticias/mar07/11mar/hor.htm
+# </a>
+
+# From Jesper Norgaard Welen (2008-03-13):
+# The Cuban time change has just been confirmed on the most authoritative
+# web site, the Granma.  Please check out
+# <a href="http://www.granma.cubaweb.cu/2008/03/13/nacional/artic10.html">
+# http://www.granma.cubaweb.cu/2008/03/13/nacional/artic10.html
+# </a>
+#
+# Basically as expected after Steffen Thorsens information, the change
+# will take place midnight between Saturday and Sunday.
+
+# From Arthur David Olson (2008-03-12):
+# Assume Sun>=15 (third Sunday) going forward.
+
+# From Alexander Krivenyshev (2009-03-04)
+# According to the Radio Reloj - Cuba will start Daylight Saving Time on
+# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009-
+# not on midnight March 14 / March 15 as previously thought.
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_cuba05.html">
+# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html
+# (in Spanish)
+# </a>
+
+# From Arthur David Olson (2009-03-09)
+# I listened over the Internet to
+# <a href="http://media.enet.cu/readioreloj">
+# http://media.enet.cu/readioreloj
+# </a>
+# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the
+# the time was announced as "diez cinco"--the same time as here, indicating
+# that has indeed switched to DST. Assume second Sunday from 2009 forward.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Cuba    1928    only    -       Jun     10      0:00    1:00    D
+Rule   Cuba    1928    only    -       Oct     10      0:00    0       S
+Rule   Cuba    1940    1942    -       Jun     Sun>=1  0:00    1:00    D
+Rule   Cuba    1940    1942    -       Sep     Sun>=1  0:00    0       S
+Rule   Cuba    1945    1946    -       Jun     Sun>=1  0:00    1:00    D
+Rule   Cuba    1945    1946    -       Sep     Sun>=1  0:00    0       S
+Rule   Cuba    1965    only    -       Jun     1       0:00    1:00    D
+Rule   Cuba    1965    only    -       Sep     30      0:00    0       S
+Rule   Cuba    1966    only    -       May     29      0:00    1:00    D
+Rule   Cuba    1966    only    -       Oct     2       0:00    0       S
+Rule   Cuba    1967    only    -       Apr     8       0:00    1:00    D
+Rule   Cuba    1967    1968    -       Sep     Sun>=8  0:00    0       S
+Rule   Cuba    1968    only    -       Apr     14      0:00    1:00    D
+Rule   Cuba    1969    1977    -       Apr     lastSun 0:00    1:00    D
+Rule   Cuba    1969    1971    -       Oct     lastSun 0:00    0       S
+Rule   Cuba    1972    1974    -       Oct     8       0:00    0       S
+Rule   Cuba    1975    1977    -       Oct     lastSun 0:00    0       S
+Rule   Cuba    1978    only    -       May     7       0:00    1:00    D
+Rule   Cuba    1978    1990    -       Oct     Sun>=8  0:00    0       S
+Rule   Cuba    1979    1980    -       Mar     Sun>=15 0:00    1:00    D
+Rule   Cuba    1981    1985    -       May     Sun>=5  0:00    1:00    D
+Rule   Cuba    1986    1989    -       Mar     Sun>=14 0:00    1:00    D
+Rule   Cuba    1990    1997    -       Apr     Sun>=1  0:00    1:00    D
+Rule   Cuba    1991    1995    -       Oct     Sun>=8  0:00s   0       S
+Rule   Cuba    1996    only    -       Oct      6      0:00s   0       S
+Rule   Cuba    1997    only    -       Oct     12      0:00s   0       S
+Rule   Cuba    1998    1999    -       Mar     lastSun 0:00s   1:00    D
+Rule   Cuba    1998    2003    -       Oct     lastSun 0:00s   0       S
+Rule   Cuba    2000    2004    -       Apr     Sun>=1  0:00s   1:00    D
+Rule   Cuba    2006    max     -       Oct     lastSun 0:00s   0       S
+Rule   Cuba    2007    only    -       Mar     Sun>=8  0:00s   1:00    D
+Rule   Cuba    2008    only    -       Mar     Sun>=15 0:00s   1:00    D
+Rule   Cuba    2009    max     -       Mar     Sun>=8  0:00s   1:00    D
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Havana  -5:29:28 -      LMT     1890
+                       -5:29:36 -      HMT     1925 Jul 19 12:00 # Havana MT
+                       -5:00   Cuba    C%sT
+
+# Dominica
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Dominica  -4:05:36 -      LMT     1911 Jul 1 0:01         # Roseau
+                       -4:00   -       AST
+
+# Dominican Republic
+
+# From Steffen Thorsen (2000-10-30):
+# Enrique Morales reported to me that the Dominican Republic has changed the
+# time zone to Eastern Standard Time as of Sunday 29 at 2 am....
+# http://www.listin.com.do/antes/261000/republica/princi.html
+
+# From Paul Eggert (2000-12-04):
+# That URL (2000-10-26, in Spanish) says they planned to use US-style DST.
+
+# From Rives McDow (2000-12-01):
+# Dominican Republic changed its mind and presidential decree on Tuesday,
+# November 28, 2000, with a new decree.  On Sunday, December 3 at 1:00 AM the
+# Dominican Republic will be reverting to 8 hours from the International Date
+# Line, and will not be using DST in the foreseeable future.  The reason they
+# decided to use DST was to be in synch with Puerto Rico, who was also going
+# to implement DST.  When Puerto Rico didn't implement DST, the president
+# decided to revert.
+
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   DR      1966    only    -       Oct     30      0:00    1:00    D
+Rule   DR      1967    only    -       Feb     28      0:00    0       S
+Rule   DR      1969    1973    -       Oct     lastSun 0:00    0:30    HD
+Rule   DR      1970    only    -       Feb     21      0:00    0       S
+Rule   DR      1971    only    -       Jan     20      0:00    0       S
+Rule   DR      1972    1974    -       Jan     21      0:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Santo_Domingo -4:39:36 -  LMT     1890
+                       -4:40   -       SDMT    1933 Apr  1 12:00 # S. Dom. MT
+                       -5:00   DR      E%sT    1974 Oct 27
+                       -4:00   -       AST     2000 Oct 29 02:00
+                       -5:00   US      E%sT    2000 Dec  3 01:00
+                       -4:00   -       AST
+
+# El Salvador
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Salv    1987    1988    -       May     Sun>=1  0:00    1:00    D
+Rule   Salv    1987    1988    -       Sep     lastSun 0:00    0       S
+# There are too many San Salvadors elsewhere, so use America/El_Salvador
+# instead of America/San_Salvador.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/El_Salvador -5:56:48 -    LMT     1921            # San Salvador
+                       -6:00   Salv    C%sT
+
+# Grenada
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Grenada -4:07:00 -      LMT     1911 Jul        # St George's
+                       -4:00   -       AST
+
+# Guadeloupe
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Guadeloupe        -4:06:08 -      LMT     1911 Jun 8      # Pointe a Pitre
+                       -4:00   -       AST
+# St Barthelemy
+Link America/Guadeloupe        America/St_Barthelemy
+# St Martin (French part)
+Link America/Guadeloupe        America/Marigot
+
+# Guatemala
+#
+# From Gwillim Law (2006-04-22), after a heads-up from Oscar van Vlijmen:
+# Diario Co Latino, at
+# http://www.diariocolatino.com/internacionales/detalles.asp?NewsID=8079,
+# says in an article dated 2006-04-19 that the Guatemalan government had
+# decided on that date to advance official time by 60 minutes, to lessen the
+# impact of the elevated cost of oil....  Daylight saving time will last from
+# 2006-04-29 24:00 (Guatemalan standard time) to 2006-09-30 (time unspecified).
+# From Paul Eggert (2006-06-22):
+# The Ministry of Energy and Mines, press release CP-15/2006
+# (2006-04-19), says DST ends at 24:00.  See
+# <http://www.sieca.org.gt/Sitio_publico/Energeticos/Doc/Medidas/Cambio_Horario_Nac_190406.pdf>.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Guat    1973    only    -       Nov     25      0:00    1:00    D
+Rule   Guat    1974    only    -       Feb     24      0:00    0       S
+Rule   Guat    1983    only    -       May     21      0:00    1:00    D
+Rule   Guat    1983    only    -       Sep     22      0:00    0       S
+Rule   Guat    1991    only    -       Mar     23      0:00    1:00    D
+Rule   Guat    1991    only    -       Sep      7      0:00    0       S
+Rule   Guat    2006    only    -       Apr     30      0:00    1:00    D
+Rule   Guat    2006    only    -       Oct      1      0:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Guatemala -6:02:04 -      LMT     1918 Oct 5
+                       -6:00   Guat    C%sT
+
+# Haiti
+# From Gwillim Law (2005-04-15):
+# Risto O. Nykanen wrote me that Haiti is now on DST.
+# I searched for confirmation, and I found a
+# <a href="http://www.haitianconsulate.org/time.doc"> press release
+# on the Web page of the Haitian Consulate in Chicago (2005-03-31),
+# </a>.  Translated from French, it says:
+#
+#  "The Prime Minister's Communication Office notifies the public in general
+#   and the press in particular that, following a decision of the Interior
+#   Ministry and the Territorial Collectivities [I suppose that means the
+#   provinces], Haiti will move to Eastern Daylight Time in the night from next
+#   Saturday the 2nd to Sunday the 3rd.
+#
+#  "Consequently, the Prime Minister's Communication Office wishes to inform
+#   the population that the country's clocks will be set forward one hour
+#   starting at midnight.  This provision will hold until the last Saturday in
+#   October 2005.
+#
+#  "Port-au-Prince, March 31, 2005"
+#
+# From Steffen Thorsen (2006-04-04):
+# I have been informed by users that Haiti observes DST this year like
+# last year, so the current "only" rule for 2005 might be changed to a
+# "max" rule or to last until 2006. (Who knows if they will observe DST
+# next year or if they will extend their DST like US/Canada next year).
+#
+# I have found this article about it (in French):
+# http://www.haitipressnetwork.com/news.cfm?articleID=7612
+#
+# The reason seems to be an energy crisis.
+
+# From Stephen Colebourne (2007-02-22):
+# Some IATA info: Haiti won't be having DST in 2007.
+
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Haiti   1983    only    -       May     8       0:00    1:00    D
+Rule   Haiti   1984    1987    -       Apr     lastSun 0:00    1:00    D
+Rule   Haiti   1983    1987    -       Oct     lastSun 0:00    0       S
+# Shanks & Pottenger say AT is 2:00, but IATA SSIM (1991/1997) says 1:00s.
+# Go with IATA.
+Rule   Haiti   1988    1997    -       Apr     Sun>=1  1:00s   1:00    D
+Rule   Haiti   1988    1997    -       Oct     lastSun 1:00s   0       S
+Rule   Haiti   2005    2006    -       Apr     Sun>=1  0:00    1:00    D
+Rule   Haiti   2005    2006    -       Oct     lastSun 0:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Port-au-Prince -4:49:20 - LMT     1890
+                       -4:49   -       PPMT    1917 Jan 24 12:00 # P-a-P MT
+                       -5:00   Haiti   E%sT
+
+# Honduras
+# Shanks & Pottenger say 1921 Jan 1; go with Whitman's more precise Apr 1.
+
+# From Paul Eggert (2006-05-05):
+# worldtimezone.com reports a 2006-05-02 Spanish-language AP article
+# saying Honduras will start using DST midnight Saturday, effective 4
+# months until September.  La Tribuna reported today
+# <http://www.latribuna.hn/99299.html> that Manuel Zelaya, the president
+# of Honduras, refused to back down on this.
+
+# From Jesper Norgaard Welen (2006-08-08):
+# It seems that Honduras has returned from DST to standard time this Monday at
+# 00:00 hours (prolonging Sunday to 25 hours duration).
+# http://www.worldtimezone.com/dst_news/dst_news_honduras04.html
+
+# From Paul Eggert (2006-08-08):
+# Also see Diario El Heraldo, The country returns to standard time (2006-08-08)
+# <http://www.elheraldo.hn/nota.php?nid=54941&sec=12>.
+# It mentions executive decree 18-2006.
+
+# From Steffen Thorsen (2006-08-17):
+# Honduras will observe DST from 2007 to 2009, exact dates are not
+# published, I have located this authoritative source:
+# http://www.presidencia.gob.hn/noticia.aspx?nId=47
+
+# From Steffen Thorsen (2007-03-30):
+# http://www.laprensahn.com/pais_nota.php?id04962=7386
+# So it seems that Honduras will not enter DST this year....
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Hond    1987    1988    -       May     Sun>=1  0:00    1:00    D
+Rule   Hond    1987    1988    -       Sep     lastSun 0:00    0       S
+Rule   Hond    2006    only    -       May     Sun>=1  0:00    1:00    D
+Rule   Hond    2006    only    -       Aug     Mon>=1  0:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Tegucigalpa -5:48:52 -    LMT     1921 Apr
+                       -6:00   Hond    C%sT
+#
+# Great Swan I ceded by US to Honduras in 1972
+
+# Jamaica
+
+# From Bob Devine (1988-01-28):
+# Follows US rules.
+
+# From U. S. Naval Observatory (1989-01-19):
+# JAMAICA             5 H  BEHIND UTC
+
+# From Shanks & Pottenger:
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Jamaica -5:07:12 -      LMT     1890            # Kingston
+                       -5:07:12 -      KMT     1912 Feb    # Kingston Mean Time
+                       -5:00   -       EST     1974 Apr 28 2:00
+                       -5:00   US      E%sT    1984
+                       -5:00   -       EST
+
+# Martinique
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Martinique        -4:04:20 -      LMT     1890            # Fort-de-France
+                       -4:04:20 -      FFMT    1911 May     # Fort-de-France MT
+                       -4:00   -       AST     1980 Apr  6
+                       -4:00   1:00    ADT     1980 Sep 28
+                       -4:00   -       AST
+
+# Montserrat
+# From Paul Eggert (2006-03-22):
+# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
+# world.gazetteer.com says Cork Hill is the most populous location now.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Montserrat        -4:08:52 -      LMT     1911 Jul 1 0:01   # Cork Hill
+                       -4:00   -       AST
+
+# Nicaragua
+#
+# This uses Shanks & Pottenger for times before 2005.
+#
+# From Steffen Thorsen (2005-04-12):
+# I've got reports from 8 different people that Nicaragua just started
+# DST on Sunday 2005-04-10, in order to save energy because of
+# expensive petroleum.  The exact end date for DST is not yet
+# announced, only "September" but some sites also say "mid-September".
+# Some background information is available on the President's official site:
+# http://www.presidencia.gob.ni/Presidencia/Files_index/Secretaria/Notas%20de%20Prensa/Presidente/2005/ABRIL/Gobierno-de-nicaragua-adelanta-hora-oficial-06abril.htm
+# The Decree, no 23-2005 is available here:
+# http://www.presidencia.gob.ni/buscador_gaceta/BD/DECRETOS/2005/Decreto%2023-2005%20Se%20adelanta%20en%20una%20hora%20en%20todo%20el%20territorio%20nacional%20apartir%20de%20las%2024horas%20del%2009%20de%20Abril.pdf
+#
+# From Paul Eggert (2005-05-01):
+# The decree doesn't say anything about daylight saving, but for now let's
+# assume that it is daylight saving....
+#
+# From Gwillim Law (2005-04-21):
+# The Associated Press story on the time change, which can be found at
+# http://www.lapalmainteractivo.com/guias/content/gen/ap/America_Latina/AMC_GEN_NICARAGUA_HORA.html
+# and elsewhere, says (fifth paragraph, translated from Spanish):  "The last
+# time that a change of clocks was applied to save energy was in the year 2000
+# during the Arnoldo Aleman administration."...
+# The northamerica file says that Nicaragua has been on UTC-6 continuously
+# since December 1998.  I wasn't able to find any details of Nicaraguan time
+# changes in 2000.  Perhaps a note could be added to the northamerica file, to
+# the effect that we have indirect evidence that DST was observed in 2000.
+#
+# From Jesper Norgaard Welen (2005-11-02):
+# Nicaragua left DST the 2005-10-02 at 00:00 (local time).
+# http://www.presidencia.gob.ni/presidencia/files_index/secretaria/comunicados/2005/septiembre/26septiembre-cambio-hora.htm
+# (2005-09-26)
+#
+# From Jesper Norgaard Welen (2006-05-05):
+# http://www.elnuevodiario.com.ni/2006/05/01/nacionales/18410
+# (my informal translation)
+# By order of the president of the republic, Enrique Bolanos, Nicaragua
+# advanced by sixty minutes their official time, yesterday at 2 in the
+# morning, and will stay that way until 30.th. of september.
+#
+# From Jesper Norgaard Welen (2006-09-30):
+# http://www.presidencia.gob.ni/buscador_gaceta/BD/DECRETOS/2006/D-063-2006P-PRN-Cambio-Hora.pdf
+# My informal translation runs:
+# The natural sun time is restored in all the national territory, in that the
+# time is returned one hour at 01:00 am of October 1 of 2006.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Nic     1979    1980    -       Mar     Sun>=16 0:00    1:00    D
+Rule   Nic     1979    1980    -       Jun     Mon>=23 0:00    0       S
+Rule   Nic     2005    only    -       Apr     10      0:00    1:00    D
+Rule   Nic     2005    only    -       Oct     Sun>=1  0:00    0       S
+Rule   Nic     2006    only    -       Apr     30      2:00    1:00    D
+Rule   Nic     2006    only    -       Oct     Sun>=1  1:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Managua -5:45:08 -      LMT     1890
+                       -5:45:12 -      MMT     1934 Jun 23 # Managua Mean Time?
+                       -6:00   -       CST     1973 May
+                       -5:00   -       EST     1975 Feb 16
+                       -6:00   Nic     C%sT    1992 Jan  1 4:00
+                       -5:00   -       EST     1992 Sep 24
+                       -6:00   -       CST     1993
+                       -5:00   -       EST     1997
+                       -6:00   Nic     C%sT
+
+# Panama
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Panama  -5:18:08 -      LMT     1890
+                       -5:19:36 -      CMT     1908 Apr 22   # Colon Mean Time
+                       -5:00   -       EST
+
+# Puerto Rico
+# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Puerto_Rico -4:24:25 -    LMT     1899 Mar 28 12:00    # San Juan
+                       -4:00   -       AST     1942 May  3
+                       -4:00   US      A%sT    1946
+                       -4:00   -       AST
+
+# St Kitts-Nevis
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/St_Kitts  -4:10:52 -      LMT     1912 Mar 2      # Basseterre
+                       -4:00   -       AST
+
+# St Lucia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/St_Lucia  -4:04:00 -      LMT     1890            # Castries
+                       -4:04:00 -      CMT     1912        # Castries Mean Time
+                       -4:00   -       AST
+
+# St Pierre and Miquelon
+# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Miquelon  -3:44:40 -      LMT     1911 May 15     # St Pierre
+                       -4:00   -       AST     1980 May
+                       -3:00   -       PMST    1987 # Pierre & Miquelon Time
+                       -3:00   Canada  PM%sT
+
+# St Vincent and the Grenadines
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/St_Vincent        -4:04:56 -      LMT     1890            # Kingstown
+                       -4:04:56 -      KMT     1912       # Kingstown Mean Time
+                       -4:00   -       AST
+
+# Turks and Caicos
+#
+# From Chris Dunn in
+# <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415007>
+# (2007-03-15): In the Turks & Caicos Islands (America/Grand_Turk) the
+# daylight saving dates for time changes have been adjusted to match
+# the recent U.S. change of dates.
+#
+# From Brian Inglis (2007-04-28):
+# http://www.turksandcaicos.tc/calendar/index.htm [2007-04-26]
+# there is an entry for Nov 4 "Daylight Savings Time Ends 2007" and three
+# rows before that there is an out of date entry for Oct:
+# "Eastern Standard Times Begins 2007
+# Clocks are set back one hour at 2:00 a.m. local Daylight Saving Time"
+# indicating that the normal ET rules are followed.
+#
+# From Paul Eggert (2006-05-01):
+# Shanks & Pottenger say they use US DST rules, but IATA SSIM (1991/1998)
+# says they switch at midnight.  Go with Shanks & Pottenger.
+#
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   TC      1979    1986    -       Apr     lastSun 2:00    1:00    D
+Rule   TC      1979    2006    -       Oct     lastSun 2:00    0       S
+Rule   TC      1987    2006    -       Apr     Sun>=1  2:00    1:00    D
+Rule   TC      2007    max     -       Mar     Sun>=8  2:00    1:00    D
+Rule   TC      2007    max     -       Nov     Sun>=1  2:00    0       S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Grand_Turk        -4:44:32 -      LMT     1890
+                       -5:07:12 -      KMT     1912 Feb    # Kingston Mean Time
+                       -5:00   TC      E%sT
+
+# British Virgin Is
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Tortola   -4:18:28 -      LMT     1911 Jul    # Road Town
+                       -4:00   -       AST
+
+# Virgin Is
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/St_Thomas -4:19:44 -      LMT     1911 Jul    # Charlotte Amalie
+                       -4:00   -       AST
diff --git a/extra/zoneinfo/pacificnew b/extra/zoneinfo/pacificnew
new file mode 100644 (file)
index 0000000..667940b
--- /dev/null
@@ -0,0 +1,26 @@
+# @(#)pacificnew       8.1
+
+# From Arthur David Olson (1989-04-05):
+# On 1989-04-05, the U. S. House of Representatives passed (238-154) a bill
+# establishing "Pacific Presidential Election Time"; it was not acted on
+# by the Senate or signed into law by the President.
+# You might want to change the "PE" (Presidential Election) below to
+# "Q" (Quadrennial) to maintain three-character zone abbreviations.
+# If you're really conservative, you might want to change it to "D".
+# Avoid "L" (Leap Year), which won't be true in 2100.
+
+# If Presidential Election Time is ever established, replace "XXXX" below
+# with the year the law takes effect and uncomment the "##" lines.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+## Rule        Twilite XXXX    max     -       Apr     Sun>=1  2:00    1:00    D
+## Rule        Twilite XXXX    max     uspres  Oct     lastSun 2:00    1:00    PE
+## Rule        Twilite XXXX    max     uspres  Nov     Sun>=7  2:00    0       S
+## Rule        Twilite XXXX    max     nonpres Oct     lastSun 2:00    0       S
+
+# Zone NAME                    GMTOFF  RULES/SAVE      FORMAT  [UNTIL]
+## Zone        America/Los_Angeles-PET -8:00   US              P%sT    XXXX
+##                             -8:00   Twilite         P%sT
+
+# For now...
+Link   America/Los_Angeles     US/Pacific-New  ##
diff --git a/extra/zoneinfo/solar87 b/extra/zoneinfo/solar87
new file mode 100644 (file)
index 0000000..7183932
--- /dev/null
@@ -0,0 +1,388 @@
+# @(#)solar87  8.1
+
+# So much for footnotes about Saudi Arabia.
+# Apparent noon times below are for Riyadh; your mileage will vary.
+# Times were computed using formulas in the U.S. Naval Observatory's
+# Almanac for Computers 1987; the formulas "will give EqT to an accuracy of
+# [plus or minus two] seconds during the current year."
+#
+# Rounding to the nearest five seconds results in fewer than
+# 256 different "time types"--a limit that's faced because time types are
+# stored on disk as unsigned chars.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   sol87   1987    only    -       Jan     1       12:03:20s -0:03:20 -
+Rule   sol87   1987    only    -       Jan     2       12:03:50s -0:03:50 -
+Rule   sol87   1987    only    -       Jan     3       12:04:15s -0:04:15 -
+Rule   sol87   1987    only    -       Jan     4       12:04:45s -0:04:45 -
+Rule   sol87   1987    only    -       Jan     5       12:05:10s -0:05:10 -
+Rule   sol87   1987    only    -       Jan     6       12:05:40s -0:05:40 -
+Rule   sol87   1987    only    -       Jan     7       12:06:05s -0:06:05 -
+Rule   sol87   1987    only    -       Jan     8       12:06:30s -0:06:30 -
+Rule   sol87   1987    only    -       Jan     9       12:06:55s -0:06:55 -
+Rule   sol87   1987    only    -       Jan     10      12:07:20s -0:07:20 -
+Rule   sol87   1987    only    -       Jan     11      12:07:45s -0:07:45 -
+Rule   sol87   1987    only    -       Jan     12      12:08:10s -0:08:10 -
+Rule   sol87   1987    only    -       Jan     13      12:08:30s -0:08:30 -
+Rule   sol87   1987    only    -       Jan     14      12:08:55s -0:08:55 -
+Rule   sol87   1987    only    -       Jan     15      12:09:15s -0:09:15 -
+Rule   sol87   1987    only    -       Jan     16      12:09:35s -0:09:35 -
+Rule   sol87   1987    only    -       Jan     17      12:09:55s -0:09:55 -
+Rule   sol87   1987    only    -       Jan     18      12:10:15s -0:10:15 -
+Rule   sol87   1987    only    -       Jan     19      12:10:35s -0:10:35 -
+Rule   sol87   1987    only    -       Jan     20      12:10:55s -0:10:55 -
+Rule   sol87   1987    only    -       Jan     21      12:11:10s -0:11:10 -
+Rule   sol87   1987    only    -       Jan     22      12:11:30s -0:11:30 -
+Rule   sol87   1987    only    -       Jan     23      12:11:45s -0:11:45 -
+Rule   sol87   1987    only    -       Jan     24      12:12:00s -0:12:00 -
+Rule   sol87   1987    only    -       Jan     25      12:12:15s -0:12:15 -
+Rule   sol87   1987    only    -       Jan     26      12:12:30s -0:12:30 -
+Rule   sol87   1987    only    -       Jan     27      12:12:40s -0:12:40 -
+Rule   sol87   1987    only    -       Jan     28      12:12:55s -0:12:55 -
+Rule   sol87   1987    only    -       Jan     29      12:13:05s -0:13:05 -
+Rule   sol87   1987    only    -       Jan     30      12:13:15s -0:13:15 -
+Rule   sol87   1987    only    -       Jan     31      12:13:25s -0:13:25 -
+Rule   sol87   1987    only    -       Feb     1       12:13:35s -0:13:35 -
+Rule   sol87   1987    only    -       Feb     2       12:13:40s -0:13:40 -
+Rule   sol87   1987    only    -       Feb     3       12:13:50s -0:13:50 -
+Rule   sol87   1987    only    -       Feb     4       12:13:55s -0:13:55 -
+Rule   sol87   1987    only    -       Feb     5       12:14:00s -0:14:00 -
+Rule   sol87   1987    only    -       Feb     6       12:14:05s -0:14:05 -
+Rule   sol87   1987    only    -       Feb     7       12:14:10s -0:14:10 -
+Rule   sol87   1987    only    -       Feb     8       12:14:10s -0:14:10 -
+Rule   sol87   1987    only    -       Feb     9       12:14:15s -0:14:15 -
+Rule   sol87   1987    only    -       Feb     10      12:14:15s -0:14:15 -
+Rule   sol87   1987    only    -       Feb     11      12:14:15s -0:14:15 -
+Rule   sol87   1987    only    -       Feb     12      12:14:15s -0:14:15 -
+Rule   sol87   1987    only    -       Feb     13      12:14:15s -0:14:15 -
+Rule   sol87   1987    only    -       Feb     14      12:14:15s -0:14:15 -
+Rule   sol87   1987    only    -       Feb     15      12:14:10s -0:14:10 -
+Rule   sol87   1987    only    -       Feb     16      12:14:10s -0:14:10 -
+Rule   sol87   1987    only    -       Feb     17      12:14:05s -0:14:05 -
+Rule   sol87   1987    only    -       Feb     18      12:14:00s -0:14:00 -
+Rule   sol87   1987    only    -       Feb     19      12:13:55s -0:13:55 -
+Rule   sol87   1987    only    -       Feb     20      12:13:50s -0:13:50 -
+Rule   sol87   1987    only    -       Feb     21      12:13:45s -0:13:45 -
+Rule   sol87   1987    only    -       Feb     22      12:13:35s -0:13:35 -
+Rule   sol87   1987    only    -       Feb     23      12:13:30s -0:13:30 -
+Rule   sol87   1987    only    -       Feb     24      12:13:20s -0:13:20 -
+Rule   sol87   1987    only    -       Feb     25      12:13:10s -0:13:10 -
+Rule   sol87   1987    only    -       Feb     26      12:13:00s -0:13:00 -
+Rule   sol87   1987    only    -       Feb     27      12:12:50s -0:12:50 -
+Rule   sol87   1987    only    -       Feb     28      12:12:40s -0:12:40 -
+Rule   sol87   1987    only    -       Mar     1       12:12:30s -0:12:30 -
+Rule   sol87   1987    only    -       Mar     2       12:12:20s -0:12:20 -
+Rule   sol87   1987    only    -       Mar     3       12:12:05s -0:12:05 -
+Rule   sol87   1987    only    -       Mar     4       12:11:55s -0:11:55 -
+Rule   sol87   1987    only    -       Mar     5       12:11:40s -0:11:40 -
+Rule   sol87   1987    only    -       Mar     6       12:11:25s -0:11:25 -
+Rule   sol87   1987    only    -       Mar     7       12:11:15s -0:11:15 -
+Rule   sol87   1987    only    -       Mar     8       12:11:00s -0:11:00 -
+Rule   sol87   1987    only    -       Mar     9       12:10:45s -0:10:45 -
+Rule   sol87   1987    only    -       Mar     10      12:10:30s -0:10:30 -
+Rule   sol87   1987    only    -       Mar     11      12:10:15s -0:10:15 -
+Rule   sol87   1987    only    -       Mar     12      12:09:55s -0:09:55 -
+Rule   sol87   1987    only    -       Mar     13      12:09:40s -0:09:40 -
+Rule   sol87   1987    only    -       Mar     14      12:09:25s -0:09:25 -
+Rule   sol87   1987    only    -       Mar     15      12:09:10s -0:09:10 -
+Rule   sol87   1987    only    -       Mar     16      12:08:50s -0:08:50 -
+Rule   sol87   1987    only    -       Mar     17      12:08:35s -0:08:35 -
+Rule   sol87   1987    only    -       Mar     18      12:08:15s -0:08:15 -
+Rule   sol87   1987    only    -       Mar     19      12:08:00s -0:08:00 -
+Rule   sol87   1987    only    -       Mar     20      12:07:40s -0:07:40 -
+Rule   sol87   1987    only    -       Mar     21      12:07:25s -0:07:25 -
+Rule   sol87   1987    only    -       Mar     22      12:07:05s -0:07:05 -
+Rule   sol87   1987    only    -       Mar     23      12:06:50s -0:06:50 -
+Rule   sol87   1987    only    -       Mar     24      12:06:30s -0:06:30 -
+Rule   sol87   1987    only    -       Mar     25      12:06:10s -0:06:10 -
+Rule   sol87   1987    only    -       Mar     26      12:05:55s -0:05:55 -
+Rule   sol87   1987    only    -       Mar     27      12:05:35s -0:05:35 -
+Rule   sol87   1987    only    -       Mar     28      12:05:15s -0:05:15 -
+Rule   sol87   1987    only    -       Mar     29      12:05:00s -0:05:00 -
+Rule   sol87   1987    only    -       Mar     30      12:04:40s -0:04:40 -
+Rule   sol87   1987    only    -       Mar     31      12:04:25s -0:04:25 -
+Rule   sol87   1987    only    -       Apr     1       12:04:05s -0:04:05 -
+Rule   sol87   1987    only    -       Apr     2       12:03:45s -0:03:45 -
+Rule   sol87   1987    only    -       Apr     3       12:03:30s -0:03:30 -
+Rule   sol87   1987    only    -       Apr     4       12:03:10s -0:03:10 -
+Rule   sol87   1987    only    -       Apr     5       12:02:55s -0:02:55 -
+Rule   sol87   1987    only    -       Apr     6       12:02:35s -0:02:35 -
+Rule   sol87   1987    only    -       Apr     7       12:02:20s -0:02:20 -
+Rule   sol87   1987    only    -       Apr     8       12:02:05s -0:02:05 -
+Rule   sol87   1987    only    -       Apr     9       12:01:45s -0:01:45 -
+Rule   sol87   1987    only    -       Apr     10      12:01:30s -0:01:30 -
+Rule   sol87   1987    only    -       Apr     11      12:01:15s -0:01:15 -
+Rule   sol87   1987    only    -       Apr     12      12:00:55s -0:00:55 -
+Rule   sol87   1987    only    -       Apr     13      12:00:40s -0:00:40 -
+Rule   sol87   1987    only    -       Apr     14      12:00:25s -0:00:25 -
+Rule   sol87   1987    only    -       Apr     15      12:00:10s -0:00:10 -
+Rule   sol87   1987    only    -       Apr     16      11:59:55s 0:00:05 -
+Rule   sol87   1987    only    -       Apr     17      11:59:45s 0:00:15 -
+Rule   sol87   1987    only    -       Apr     18      11:59:30s 0:00:30 -
+Rule   sol87   1987    only    -       Apr     19      11:59:15s 0:00:45 -
+Rule   sol87   1987    only    -       Apr     20      11:59:05s 0:00:55 -
+Rule   sol87   1987    only    -       Apr     21      11:58:50s 0:01:10 -
+Rule   sol87   1987    only    -       Apr     22      11:58:40s 0:01:20 -
+Rule   sol87   1987    only    -       Apr     23      11:58:25s 0:01:35 -
+Rule   sol87   1987    only    -       Apr     24      11:58:15s 0:01:45 -
+Rule   sol87   1987    only    -       Apr     25      11:58:05s 0:01:55 -
+Rule   sol87   1987    only    -       Apr     26      11:57:55s 0:02:05 -
+Rule   sol87   1987    only    -       Apr     27      11:57:45s 0:02:15 -
+Rule   sol87   1987    only    -       Apr     28      11:57:35s 0:02:25 -
+Rule   sol87   1987    only    -       Apr     29      11:57:25s 0:02:35 -
+Rule   sol87   1987    only    -       Apr     30      11:57:15s 0:02:45 -
+Rule   sol87   1987    only    -       May     1       11:57:10s 0:02:50 -
+Rule   sol87   1987    only    -       May     2       11:57:00s 0:03:00 -
+Rule   sol87   1987    only    -       May     3       11:56:55s 0:03:05 -
+Rule   sol87   1987    only    -       May     4       11:56:50s 0:03:10 -
+Rule   sol87   1987    only    -       May     5       11:56:45s 0:03:15 -
+Rule   sol87   1987    only    -       May     6       11:56:40s 0:03:20 -
+Rule   sol87   1987    only    -       May     7       11:56:35s 0:03:25 -
+Rule   sol87   1987    only    -       May     8       11:56:30s 0:03:30 -
+Rule   sol87   1987    only    -       May     9       11:56:25s 0:03:35 -
+Rule   sol87   1987    only    -       May     10      11:56:25s 0:03:35 -
+Rule   sol87   1987    only    -       May     11      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     12      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     13      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     14      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     15      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     16      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     17      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     18      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       May     19      11:56:25s 0:03:35 -
+Rule   sol87   1987    only    -       May     20      11:56:25s 0:03:35 -
+Rule   sol87   1987    only    -       May     21      11:56:30s 0:03:30 -
+Rule   sol87   1987    only    -       May     22      11:56:35s 0:03:25 -
+Rule   sol87   1987    only    -       May     23      11:56:40s 0:03:20 -
+Rule   sol87   1987    only    -       May     24      11:56:45s 0:03:15 -
+Rule   sol87   1987    only    -       May     25      11:56:50s 0:03:10 -
+Rule   sol87   1987    only    -       May     26      11:56:55s 0:03:05 -
+Rule   sol87   1987    only    -       May     27      11:57:00s 0:03:00 -
+Rule   sol87   1987    only    -       May     28      11:57:10s 0:02:50 -
+Rule   sol87   1987    only    -       May     29      11:57:15s 0:02:45 -
+Rule   sol87   1987    only    -       May     30      11:57:25s 0:02:35 -
+Rule   sol87   1987    only    -       May     31      11:57:30s 0:02:30 -
+Rule   sol87   1987    only    -       Jun     1       11:57:40s 0:02:20 -
+Rule   sol87   1987    only    -       Jun     2       11:57:50s 0:02:10 -
+Rule   sol87   1987    only    -       Jun     3       11:58:00s 0:02:00 -
+Rule   sol87   1987    only    -       Jun     4       11:58:10s 0:01:50 -
+Rule   sol87   1987    only    -       Jun     5       11:58:20s 0:01:40 -
+Rule   sol87   1987    only    -       Jun     6       11:58:30s 0:01:30 -
+Rule   sol87   1987    only    -       Jun     7       11:58:40s 0:01:20 -
+Rule   sol87   1987    only    -       Jun     8       11:58:50s 0:01:10 -
+Rule   sol87   1987    only    -       Jun     9       11:59:05s 0:00:55 -
+Rule   sol87   1987    only    -       Jun     10      11:59:15s 0:00:45 -
+Rule   sol87   1987    only    -       Jun     11      11:59:30s 0:00:30 -
+Rule   sol87   1987    only    -       Jun     12      11:59:40s 0:00:20 -
+Rule   sol87   1987    only    -       Jun     13      11:59:50s 0:00:10 -
+Rule   sol87   1987    only    -       Jun     14      12:00:05s -0:00:05 -
+Rule   sol87   1987    only    -       Jun     15      12:00:15s -0:00:15 -
+Rule   sol87   1987    only    -       Jun     16      12:00:30s -0:00:30 -
+Rule   sol87   1987    only    -       Jun     17      12:00:45s -0:00:45 -
+Rule   sol87   1987    only    -       Jun     18      12:00:55s -0:00:55 -
+Rule   sol87   1987    only    -       Jun     19      12:01:10s -0:01:10 -
+Rule   sol87   1987    only    -       Jun     20      12:01:20s -0:01:20 -
+Rule   sol87   1987    only    -       Jun     21      12:01:35s -0:01:35 -
+Rule   sol87   1987    only    -       Jun     22      12:01:50s -0:01:50 -
+Rule   sol87   1987    only    -       Jun     23      12:02:00s -0:02:00 -
+Rule   sol87   1987    only    -       Jun     24      12:02:15s -0:02:15 -
+Rule   sol87   1987    only    -       Jun     25      12:02:25s -0:02:25 -
+Rule   sol87   1987    only    -       Jun     26      12:02:40s -0:02:40 -
+Rule   sol87   1987    only    -       Jun     27      12:02:50s -0:02:50 -
+Rule   sol87   1987    only    -       Jun     28      12:03:05s -0:03:05 -
+Rule   sol87   1987    only    -       Jun     29      12:03:15s -0:03:15 -
+Rule   sol87   1987    only    -       Jun     30      12:03:30s -0:03:30 -
+Rule   sol87   1987    only    -       Jul     1       12:03:40s -0:03:40 -
+Rule   sol87   1987    only    -       Jul     2       12:03:50s -0:03:50 -
+Rule   sol87   1987    only    -       Jul     3       12:04:05s -0:04:05 -
+Rule   sol87   1987    only    -       Jul     4       12:04:15s -0:04:15 -
+Rule   sol87   1987    only    -       Jul     5       12:04:25s -0:04:25 -
+Rule   sol87   1987    only    -       Jul     6       12:04:35s -0:04:35 -
+Rule   sol87   1987    only    -       Jul     7       12:04:45s -0:04:45 -
+Rule   sol87   1987    only    -       Jul     8       12:04:55s -0:04:55 -
+Rule   sol87   1987    only    -       Jul     9       12:05:05s -0:05:05 -
+Rule   sol87   1987    only    -       Jul     10      12:05:15s -0:05:15 -
+Rule   sol87   1987    only    -       Jul     11      12:05:20s -0:05:20 -
+Rule   sol87   1987    only    -       Jul     12      12:05:30s -0:05:30 -
+Rule   sol87   1987    only    -       Jul     13      12:05:40s -0:05:40 -
+Rule   sol87   1987    only    -       Jul     14      12:05:45s -0:05:45 -
+Rule   sol87   1987    only    -       Jul     15      12:05:50s -0:05:50 -
+Rule   sol87   1987    only    -       Jul     16      12:06:00s -0:06:00 -
+Rule   sol87   1987    only    -       Jul     17      12:06:05s -0:06:05 -
+Rule   sol87   1987    only    -       Jul     18      12:06:10s -0:06:10 -
+Rule   sol87   1987    only    -       Jul     19      12:06:15s -0:06:15 -
+Rule   sol87   1987    only    -       Jul     20      12:06:15s -0:06:15 -
+Rule   sol87   1987    only    -       Jul     21      12:06:20s -0:06:20 -
+Rule   sol87   1987    only    -       Jul     22      12:06:25s -0:06:25 -
+Rule   sol87   1987    only    -       Jul     23      12:06:25s -0:06:25 -
+Rule   sol87   1987    only    -       Jul     24      12:06:25s -0:06:25 -
+Rule   sol87   1987    only    -       Jul     25      12:06:30s -0:06:30 -
+Rule   sol87   1987    only    -       Jul     26      12:06:30s -0:06:30 -
+Rule   sol87   1987    only    -       Jul     27      12:06:30s -0:06:30 -
+Rule   sol87   1987    only    -       Jul     28      12:06:30s -0:06:30 -
+Rule   sol87   1987    only    -       Jul     29      12:06:25s -0:06:25 -
+Rule   sol87   1987    only    -       Jul     30      12:06:25s -0:06:25 -
+Rule   sol87   1987    only    -       Jul     31      12:06:25s -0:06:25 -
+Rule   sol87   1987    only    -       Aug     1       12:06:20s -0:06:20 -
+Rule   sol87   1987    only    -       Aug     2       12:06:15s -0:06:15 -
+Rule   sol87   1987    only    -       Aug     3       12:06:10s -0:06:10 -
+Rule   sol87   1987    only    -       Aug     4       12:06:05s -0:06:05 -
+Rule   sol87   1987    only    -       Aug     5       12:06:00s -0:06:00 -
+Rule   sol87   1987    only    -       Aug     6       12:05:55s -0:05:55 -
+Rule   sol87   1987    only    -       Aug     7       12:05:50s -0:05:50 -
+Rule   sol87   1987    only    -       Aug     8       12:05:40s -0:05:40 -
+Rule   sol87   1987    only    -       Aug     9       12:05:35s -0:05:35 -
+Rule   sol87   1987    only    -       Aug     10      12:05:25s -0:05:25 -
+Rule   sol87   1987    only    -       Aug     11      12:05:15s -0:05:15 -
+Rule   sol87   1987    only    -       Aug     12      12:05:05s -0:05:05 -
+Rule   sol87   1987    only    -       Aug     13      12:04:55s -0:04:55 -
+Rule   sol87   1987    only    -       Aug     14      12:04:45s -0:04:45 -
+Rule   sol87   1987    only    -       Aug     15      12:04:35s -0:04:35 -
+Rule   sol87   1987    only    -       Aug     16      12:04:25s -0:04:25 -
+Rule   sol87   1987    only    -       Aug     17      12:04:10s -0:04:10 -
+Rule   sol87   1987    only    -       Aug     18      12:04:00s -0:04:00 -
+Rule   sol87   1987    only    -       Aug     19      12:03:45s -0:03:45 -
+Rule   sol87   1987    only    -       Aug     20      12:03:30s -0:03:30 -
+Rule   sol87   1987    only    -       Aug     21      12:03:15s -0:03:15 -
+Rule   sol87   1987    only    -       Aug     22      12:03:00s -0:03:00 -
+Rule   sol87   1987    only    -       Aug     23      12:02:45s -0:02:45 -
+Rule   sol87   1987    only    -       Aug     24      12:02:30s -0:02:30 -
+Rule   sol87   1987    only    -       Aug     25      12:02:15s -0:02:15 -
+Rule   sol87   1987    only    -       Aug     26      12:02:00s -0:02:00 -
+Rule   sol87   1987    only    -       Aug     27      12:01:40s -0:01:40 -
+Rule   sol87   1987    only    -       Aug     28      12:01:25s -0:01:25 -
+Rule   sol87   1987    only    -       Aug     29      12:01:05s -0:01:05 -
+Rule   sol87   1987    only    -       Aug     30      12:00:50s -0:00:50 -
+Rule   sol87   1987    only    -       Aug     31      12:00:30s -0:00:30 -
+Rule   sol87   1987    only    -       Sep     1       12:00:10s -0:00:10 -
+Rule   sol87   1987    only    -       Sep     2       11:59:50s 0:00:10 -
+Rule   sol87   1987    only    -       Sep     3       11:59:35s 0:00:25 -
+Rule   sol87   1987    only    -       Sep     4       11:59:15s 0:00:45 -
+Rule   sol87   1987    only    -       Sep     5       11:58:55s 0:01:05 -
+Rule   sol87   1987    only    -       Sep     6       11:58:35s 0:01:25 -
+Rule   sol87   1987    only    -       Sep     7       11:58:15s 0:01:45 -
+Rule   sol87   1987    only    -       Sep     8       11:57:55s 0:02:05 -
+Rule   sol87   1987    only    -       Sep     9       11:57:30s 0:02:30 -
+Rule   sol87   1987    only    -       Sep     10      11:57:10s 0:02:50 -
+Rule   sol87   1987    only    -       Sep     11      11:56:50s 0:03:10 -
+Rule   sol87   1987    only    -       Sep     12      11:56:30s 0:03:30 -
+Rule   sol87   1987    only    -       Sep     13      11:56:10s 0:03:50 -
+Rule   sol87   1987    only    -       Sep     14      11:55:45s 0:04:15 -
+Rule   sol87   1987    only    -       Sep     15      11:55:25s 0:04:35 -
+Rule   sol87   1987    only    -       Sep     16      11:55:05s 0:04:55 -
+Rule   sol87   1987    only    -       Sep     17      11:54:45s 0:05:15 -
+Rule   sol87   1987    only    -       Sep     18      11:54:20s 0:05:40 -
+Rule   sol87   1987    only    -       Sep     19      11:54:00s 0:06:00 -
+Rule   sol87   1987    only    -       Sep     20      11:53:40s 0:06:20 -
+Rule   sol87   1987    only    -       Sep     21      11:53:15s 0:06:45 -
+Rule   sol87   1987    only    -       Sep     22      11:52:55s 0:07:05 -
+Rule   sol87   1987    only    -       Sep     23      11:52:35s 0:07:25 -
+Rule   sol87   1987    only    -       Sep     24      11:52:15s 0:07:45 -
+Rule   sol87   1987    only    -       Sep     25      11:51:55s 0:08:05 -
+Rule   sol87   1987    only    -       Sep     26      11:51:35s 0:08:25 -
+Rule   sol87   1987    only    -       Sep     27      11:51:10s 0:08:50 -
+Rule   sol87   1987    only    -       Sep     28      11:50:50s 0:09:10 -
+Rule   sol87   1987    only    -       Sep     29      11:50:30s 0:09:30 -
+Rule   sol87   1987    only    -       Sep     30      11:50:10s 0:09:50 -
+Rule   sol87   1987    only    -       Oct     1       11:49:50s 0:10:10 -
+Rule   sol87   1987    only    -       Oct     2       11:49:35s 0:10:25 -
+Rule   sol87   1987    only    -       Oct     3       11:49:15s 0:10:45 -
+Rule   sol87   1987    only    -       Oct     4       11:48:55s 0:11:05 -
+Rule   sol87   1987    only    -       Oct     5       11:48:35s 0:11:25 -
+Rule   sol87   1987    only    -       Oct     6       11:48:20s 0:11:40 -
+Rule   sol87   1987    only    -       Oct     7       11:48:00s 0:12:00 -
+Rule   sol87   1987    only    -       Oct     8       11:47:45s 0:12:15 -
+Rule   sol87   1987    only    -       Oct     9       11:47:25s 0:12:35 -
+Rule   sol87   1987    only    -       Oct     10      11:47:10s 0:12:50 -
+Rule   sol87   1987    only    -       Oct     11      11:46:55s 0:13:05 -
+Rule   sol87   1987    only    -       Oct     12      11:46:40s 0:13:20 -
+Rule   sol87   1987    only    -       Oct     13      11:46:25s 0:13:35 -
+Rule   sol87   1987    only    -       Oct     14      11:46:10s 0:13:50 -
+Rule   sol87   1987    only    -       Oct     15      11:45:55s 0:14:05 -
+Rule   sol87   1987    only    -       Oct     16      11:45:45s 0:14:15 -
+Rule   sol87   1987    only    -       Oct     17      11:45:30s 0:14:30 -
+Rule   sol87   1987    only    -       Oct     18      11:45:20s 0:14:40 -
+Rule   sol87   1987    only    -       Oct     19      11:45:05s 0:14:55 -
+Rule   sol87   1987    only    -       Oct     20      11:44:55s 0:15:05 -
+Rule   sol87   1987    only    -       Oct     21      11:44:45s 0:15:15 -
+Rule   sol87   1987    only    -       Oct     22      11:44:35s 0:15:25 -
+Rule   sol87   1987    only    -       Oct     23      11:44:25s 0:15:35 -
+Rule   sol87   1987    only    -       Oct     24      11:44:20s 0:15:40 -
+Rule   sol87   1987    only    -       Oct     25      11:44:10s 0:15:50 -
+Rule   sol87   1987    only    -       Oct     26      11:44:05s 0:15:55 -
+Rule   sol87   1987    only    -       Oct     27      11:43:55s 0:16:05 -
+Rule   sol87   1987    only    -       Oct     28      11:43:50s 0:16:10 -
+Rule   sol87   1987    only    -       Oct     29      11:43:45s 0:16:15 -
+Rule   sol87   1987    only    -       Oct     30      11:43:45s 0:16:15 -
+Rule   sol87   1987    only    -       Oct     31      11:43:40s 0:16:20 -
+Rule   sol87   1987    only    -       Nov     1       11:43:40s 0:16:20 -
+Rule   sol87   1987    only    -       Nov     2       11:43:35s 0:16:25 -
+Rule   sol87   1987    only    -       Nov     3       11:43:35s 0:16:25 -
+Rule   sol87   1987    only    -       Nov     4       11:43:35s 0:16:25 -
+Rule   sol87   1987    only    -       Nov     5       11:43:35s 0:16:25 -
+Rule   sol87   1987    only    -       Nov     6       11:43:40s 0:16:20 -
+Rule   sol87   1987    only    -       Nov     7       11:43:40s 0:16:20 -
+Rule   sol87   1987    only    -       Nov     8       11:43:45s 0:16:15 -
+Rule   sol87   1987    only    -       Nov     9       11:43:50s 0:16:10 -
+Rule   sol87   1987    only    -       Nov     10      11:43:55s 0:16:05 -
+Rule   sol87   1987    only    -       Nov     11      11:44:00s 0:16:00 -
+Rule   sol87   1987    only    -       Nov     12      11:44:05s 0:15:55 -
+Rule   sol87   1987    only    -       Nov     13      11:44:15s 0:15:45 -
+Rule   sol87   1987    only    -       Nov     14      11:44:20s 0:15:40 -
+Rule   sol87   1987    only    -       Nov     15      11:44:30s 0:15:30 -
+Rule   sol87   1987    only    -       Nov     16      11:44:40s 0:15:20 -
+Rule   sol87   1987    only    -       Nov     17      11:44:50s 0:15:10 -
+Rule   sol87   1987    only    -       Nov     18      11:45:05s 0:14:55 -
+Rule   sol87   1987    only    -       Nov     19      11:45:15s 0:14:45 -
+Rule   sol87   1987    only    -       Nov     20      11:45:30s 0:14:30 -
+Rule   sol87   1987    only    -       Nov     21      11:45:45s 0:14:15 -
+Rule   sol87   1987    only    -       Nov     22      11:46:00s 0:14:00 -
+Rule   sol87   1987    only    -       Nov     23      11:46:15s 0:13:45 -
+Rule   sol87   1987    only    -       Nov     24      11:46:30s 0:13:30 -
+Rule   sol87   1987    only    -       Nov     25      11:46:50s 0:13:10 -
+Rule   sol87   1987    only    -       Nov     26      11:47:10s 0:12:50 -
+Rule   sol87   1987    only    -       Nov     27      11:47:25s 0:12:35 -
+Rule   sol87   1987    only    -       Nov     28      11:47:45s 0:12:15 -
+Rule   sol87   1987    only    -       Nov     29      11:48:05s 0:11:55 -
+Rule   sol87   1987    only    -       Nov     30      11:48:30s 0:11:30 -
+Rule   sol87   1987    only    -       Dec     1       11:48:50s 0:11:10 -
+Rule   sol87   1987    only    -       Dec     2       11:49:10s 0:10:50 -
+Rule   sol87   1987    only    -       Dec     3       11:49:35s 0:10:25 -
+Rule   sol87   1987    only    -       Dec     4       11:50:00s 0:10:00 -
+Rule   sol87   1987    only    -       Dec     5       11:50:25s 0:09:35 -
+Rule   sol87   1987    only    -       Dec     6       11:50:50s 0:09:10 -
+Rule   sol87   1987    only    -       Dec     7       11:51:15s 0:08:45 -
+Rule   sol87   1987    only    -       Dec     8       11:51:40s 0:08:20 -
+Rule   sol87   1987    only    -       Dec     9       11:52:05s 0:07:55 -
+Rule   sol87   1987    only    -       Dec     10      11:52:30s 0:07:30 -
+Rule   sol87   1987    only    -       Dec     11      11:53:00s 0:07:00 -
+Rule   sol87   1987    only    -       Dec     12      11:53:25s 0:06:35 -
+Rule   sol87   1987    only    -       Dec     13      11:53:55s 0:06:05 -
+Rule   sol87   1987    only    -       Dec     14      11:54:25s 0:05:35 -
+Rule   sol87   1987    only    -       Dec     15      11:54:50s 0:05:10 -
+Rule   sol87   1987    only    -       Dec     16      11:55:20s 0:04:40 -
+Rule   sol87   1987    only    -       Dec     17      11:55:50s 0:04:10 -
+Rule   sol87   1987    only    -       Dec     18      11:56:20s 0:03:40 -
+Rule   sol87   1987    only    -       Dec     19      11:56:50s 0:03:10 -
+Rule   sol87   1987    only    -       Dec     20      11:57:20s 0:02:40 -
+Rule   sol87   1987    only    -       Dec     21      11:57:50s 0:02:10 -
+Rule   sol87   1987    only    -       Dec     22      11:58:20s 0:01:40 -
+Rule   sol87   1987    only    -       Dec     23      11:58:50s 0:01:10 -
+Rule   sol87   1987    only    -       Dec     24      11:59:20s 0:00:40 -
+Rule   sol87   1987    only    -       Dec     25      11:59:50s 0:00:10 -
+Rule   sol87   1987    only    -       Dec     26      12:00:20s -0:00:20 -
+Rule   sol87   1987    only    -       Dec     27      12:00:45s -0:00:45 -
+Rule   sol87   1987    only    -       Dec     28      12:01:15s -0:01:15 -
+Rule   sol87   1987    only    -       Dec     29      12:01:45s -0:01:45 -
+Rule   sol87   1987    only    -       Dec     30      12:02:15s -0:02:15 -
+Rule   sol87   1987    only    -       Dec     31      12:02:45s -0:02:45 -
+
+# Riyadh is at about 46 degrees 46 minutes East:  3 hrs, 7 mins, 4 secs
+# Before and after 1987, we'll operate on local mean solar time.
+
+# Zone NAME            GMTOFF  RULES/SAVE      FORMAT  [UNTIL]
+Zone   Asia/Riyadh87   3:07:04 -               zzz     1987
+                       3:07:04 sol87           zzz     1988
+                       3:07:04 -               zzz
+# For backward compatibility...
+Link   Asia/Riyadh87   Mideast/Riyadh87
diff --git a/extra/zoneinfo/solar88 b/extra/zoneinfo/solar88
new file mode 100644 (file)
index 0000000..b4cfe8e
--- /dev/null
@@ -0,0 +1,388 @@
+# @(#)solar88  8.1
+
+# Apparent noon times below are for Riyadh; they're a bit off for other places.
+# Times were computed using formulas in the U.S. Naval Observatory's
+# Almanac for Computers 1988; the formulas "will give EqT to an accuracy of
+# [plus or minus two] seconds during the current year."
+#
+# Rounding to the nearest five seconds results in fewer than
+# 256 different "time types"--a limit that's faced because time types are
+# stored on disk as unsigned chars.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   sol88   1988    only    -       Jan     1       12:03:15s -0:03:15 -
+Rule   sol88   1988    only    -       Jan     2       12:03:40s -0:03:40 -
+Rule   sol88   1988    only    -       Jan     3       12:04:10s -0:04:10 -
+Rule   sol88   1988    only    -       Jan     4       12:04:40s -0:04:40 -
+Rule   sol88   1988    only    -       Jan     5       12:05:05s -0:05:05 -
+Rule   sol88   1988    only    -       Jan     6       12:05:30s -0:05:30 -
+Rule   sol88   1988    only    -       Jan     7       12:06:00s -0:06:00 -
+Rule   sol88   1988    only    -       Jan     8       12:06:25s -0:06:25 -
+Rule   sol88   1988    only    -       Jan     9       12:06:50s -0:06:50 -
+Rule   sol88   1988    only    -       Jan     10      12:07:15s -0:07:15 -
+Rule   sol88   1988    only    -       Jan     11      12:07:40s -0:07:40 -
+Rule   sol88   1988    only    -       Jan     12      12:08:05s -0:08:05 -
+Rule   sol88   1988    only    -       Jan     13      12:08:25s -0:08:25 -
+Rule   sol88   1988    only    -       Jan     14      12:08:50s -0:08:50 -
+Rule   sol88   1988    only    -       Jan     15      12:09:10s -0:09:10 -
+Rule   sol88   1988    only    -       Jan     16      12:09:30s -0:09:30 -
+Rule   sol88   1988    only    -       Jan     17      12:09:50s -0:09:50 -
+Rule   sol88   1988    only    -       Jan     18      12:10:10s -0:10:10 -
+Rule   sol88   1988    only    -       Jan     19      12:10:30s -0:10:30 -
+Rule   sol88   1988    only    -       Jan     20      12:10:50s -0:10:50 -
+Rule   sol88   1988    only    -       Jan     21      12:11:05s -0:11:05 -
+Rule   sol88   1988    only    -       Jan     22      12:11:25s -0:11:25 -
+Rule   sol88   1988    only    -       Jan     23      12:11:40s -0:11:40 -
+Rule   sol88   1988    only    -       Jan     24      12:11:55s -0:11:55 -
+Rule   sol88   1988    only    -       Jan     25      12:12:10s -0:12:10 -
+Rule   sol88   1988    only    -       Jan     26      12:12:25s -0:12:25 -
+Rule   sol88   1988    only    -       Jan     27      12:12:40s -0:12:40 -
+Rule   sol88   1988    only    -       Jan     28      12:12:50s -0:12:50 -
+Rule   sol88   1988    only    -       Jan     29      12:13:00s -0:13:00 -
+Rule   sol88   1988    only    -       Jan     30      12:13:10s -0:13:10 -
+Rule   sol88   1988    only    -       Jan     31      12:13:20s -0:13:20 -
+Rule   sol88   1988    only    -       Feb     1       12:13:30s -0:13:30 -
+Rule   sol88   1988    only    -       Feb     2       12:13:40s -0:13:40 -
+Rule   sol88   1988    only    -       Feb     3       12:13:45s -0:13:45 -
+Rule   sol88   1988    only    -       Feb     4       12:13:55s -0:13:55 -
+Rule   sol88   1988    only    -       Feb     5       12:14:00s -0:14:00 -
+Rule   sol88   1988    only    -       Feb     6       12:14:05s -0:14:05 -
+Rule   sol88   1988    only    -       Feb     7       12:14:10s -0:14:10 -
+Rule   sol88   1988    only    -       Feb     8       12:14:10s -0:14:10 -
+Rule   sol88   1988    only    -       Feb     9       12:14:15s -0:14:15 -
+Rule   sol88   1988    only    -       Feb     10      12:14:15s -0:14:15 -
+Rule   sol88   1988    only    -       Feb     11      12:14:15s -0:14:15 -
+Rule   sol88   1988    only    -       Feb     12      12:14:15s -0:14:15 -
+Rule   sol88   1988    only    -       Feb     13      12:14:15s -0:14:15 -
+Rule   sol88   1988    only    -       Feb     14      12:14:15s -0:14:15 -
+Rule   sol88   1988    only    -       Feb     15      12:14:10s -0:14:10 -
+Rule   sol88   1988    only    -       Feb     16      12:14:10s -0:14:10 -
+Rule   sol88   1988    only    -       Feb     17      12:14:05s -0:14:05 -
+Rule   sol88   1988    only    -       Feb     18      12:14:00s -0:14:00 -
+Rule   sol88   1988    only    -       Feb     19      12:13:55s -0:13:55 -
+Rule   sol88   1988    only    -       Feb     20      12:13:50s -0:13:50 -
+Rule   sol88   1988    only    -       Feb     21      12:13:45s -0:13:45 -
+Rule   sol88   1988    only    -       Feb     22      12:13:40s -0:13:40 -
+Rule   sol88   1988    only    -       Feb     23      12:13:30s -0:13:30 -
+Rule   sol88   1988    only    -       Feb     24      12:13:20s -0:13:20 -
+Rule   sol88   1988    only    -       Feb     25      12:13:15s -0:13:15 -
+Rule   sol88   1988    only    -       Feb     26      12:13:05s -0:13:05 -
+Rule   sol88   1988    only    -       Feb     27      12:12:55s -0:12:55 -
+Rule   sol88   1988    only    -       Feb     28      12:12:45s -0:12:45 -
+Rule   sol88   1988    only    -       Feb     29      12:12:30s -0:12:30 -
+Rule   sol88   1988    only    -       Mar     1       12:12:20s -0:12:20 -
+Rule   sol88   1988    only    -       Mar     2       12:12:10s -0:12:10 -
+Rule   sol88   1988    only    -       Mar     3       12:11:55s -0:11:55 -
+Rule   sol88   1988    only    -       Mar     4       12:11:45s -0:11:45 -
+Rule   sol88   1988    only    -       Mar     5       12:11:30s -0:11:30 -
+Rule   sol88   1988    only    -       Mar     6       12:11:15s -0:11:15 -
+Rule   sol88   1988    only    -       Mar     7       12:11:00s -0:11:00 -
+Rule   sol88   1988    only    -       Mar     8       12:10:45s -0:10:45 -
+Rule   sol88   1988    only    -       Mar     9       12:10:30s -0:10:30 -
+Rule   sol88   1988    only    -       Mar     10      12:10:15s -0:10:15 -
+Rule   sol88   1988    only    -       Mar     11      12:10:00s -0:10:00 -
+Rule   sol88   1988    only    -       Mar     12      12:09:45s -0:09:45 -
+Rule   sol88   1988    only    -       Mar     13      12:09:30s -0:09:30 -
+Rule   sol88   1988    only    -       Mar     14      12:09:10s -0:09:10 -
+Rule   sol88   1988    only    -       Mar     15      12:08:55s -0:08:55 -
+Rule   sol88   1988    only    -       Mar     16      12:08:40s -0:08:40 -
+Rule   sol88   1988    only    -       Mar     17      12:08:20s -0:08:20 -
+Rule   sol88   1988    only    -       Mar     18      12:08:05s -0:08:05 -
+Rule   sol88   1988    only    -       Mar     19      12:07:45s -0:07:45 -
+Rule   sol88   1988    only    -       Mar     20      12:07:30s -0:07:30 -
+Rule   sol88   1988    only    -       Mar     21      12:07:10s -0:07:10 -
+Rule   sol88   1988    only    -       Mar     22      12:06:50s -0:06:50 -
+Rule   sol88   1988    only    -       Mar     23      12:06:35s -0:06:35 -
+Rule   sol88   1988    only    -       Mar     24      12:06:15s -0:06:15 -
+Rule   sol88   1988    only    -       Mar     25      12:06:00s -0:06:00 -
+Rule   sol88   1988    only    -       Mar     26      12:05:40s -0:05:40 -
+Rule   sol88   1988    only    -       Mar     27      12:05:20s -0:05:20 -
+Rule   sol88   1988    only    -       Mar     28      12:05:05s -0:05:05 -
+Rule   sol88   1988    only    -       Mar     29      12:04:45s -0:04:45 -
+Rule   sol88   1988    only    -       Mar     30      12:04:25s -0:04:25 -
+Rule   sol88   1988    only    -       Mar     31      12:04:10s -0:04:10 -
+Rule   sol88   1988    only    -       Apr     1       12:03:50s -0:03:50 -
+Rule   sol88   1988    only    -       Apr     2       12:03:35s -0:03:35 -
+Rule   sol88   1988    only    -       Apr     3       12:03:15s -0:03:15 -
+Rule   sol88   1988    only    -       Apr     4       12:03:00s -0:03:00 -
+Rule   sol88   1988    only    -       Apr     5       12:02:40s -0:02:40 -
+Rule   sol88   1988    only    -       Apr     6       12:02:25s -0:02:25 -
+Rule   sol88   1988    only    -       Apr     7       12:02:05s -0:02:05 -
+Rule   sol88   1988    only    -       Apr     8       12:01:50s -0:01:50 -
+Rule   sol88   1988    only    -       Apr     9       12:01:35s -0:01:35 -
+Rule   sol88   1988    only    -       Apr     10      12:01:15s -0:01:15 -
+Rule   sol88   1988    only    -       Apr     11      12:01:00s -0:01:00 -
+Rule   sol88   1988    only    -       Apr     12      12:00:45s -0:00:45 -
+Rule   sol88   1988    only    -       Apr     13      12:00:30s -0:00:30 -
+Rule   sol88   1988    only    -       Apr     14      12:00:15s -0:00:15 -
+Rule   sol88   1988    only    -       Apr     15      12:00:00s 0:00:00 -
+Rule   sol88   1988    only    -       Apr     16      11:59:45s 0:00:15 -
+Rule   sol88   1988    only    -       Apr     17      11:59:30s 0:00:30 -
+Rule   sol88   1988    only    -       Apr     18      11:59:20s 0:00:40 -
+Rule   sol88   1988    only    -       Apr     19      11:59:05s 0:00:55 -
+Rule   sol88   1988    only    -       Apr     20      11:58:55s 0:01:05 -
+Rule   sol88   1988    only    -       Apr     21      11:58:40s 0:01:20 -
+Rule   sol88   1988    only    -       Apr     22      11:58:30s 0:01:30 -
+Rule   sol88   1988    only    -       Apr     23      11:58:15s 0:01:45 -
+Rule   sol88   1988    only    -       Apr     24      11:58:05s 0:01:55 -
+Rule   sol88   1988    only    -       Apr     25      11:57:55s 0:02:05 -
+Rule   sol88   1988    only    -       Apr     26      11:57:45s 0:02:15 -
+Rule   sol88   1988    only    -       Apr     27      11:57:35s 0:02:25 -
+Rule   sol88   1988    only    -       Apr     28      11:57:30s 0:02:30 -
+Rule   sol88   1988    only    -       Apr     29      11:57:20s 0:02:40 -
+Rule   sol88   1988    only    -       Apr     30      11:57:10s 0:02:50 -
+Rule   sol88   1988    only    -       May     1       11:57:05s 0:02:55 -
+Rule   sol88   1988    only    -       May     2       11:56:55s 0:03:05 -
+Rule   sol88   1988    only    -       May     3       11:56:50s 0:03:10 -
+Rule   sol88   1988    only    -       May     4       11:56:45s 0:03:15 -
+Rule   sol88   1988    only    -       May     5       11:56:40s 0:03:20 -
+Rule   sol88   1988    only    -       May     6       11:56:35s 0:03:25 -
+Rule   sol88   1988    only    -       May     7       11:56:30s 0:03:30 -
+Rule   sol88   1988    only    -       May     8       11:56:25s 0:03:35 -
+Rule   sol88   1988    only    -       May     9       11:56:25s 0:03:35 -
+Rule   sol88   1988    only    -       May     10      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     11      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     12      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     13      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     14      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     15      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     16      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     17      11:56:20s 0:03:40 -
+Rule   sol88   1988    only    -       May     18      11:56:25s 0:03:35 -
+Rule   sol88   1988    only    -       May     19      11:56:25s 0:03:35 -
+Rule   sol88   1988    only    -       May     20      11:56:30s 0:03:30 -
+Rule   sol88   1988    only    -       May     21      11:56:35s 0:03:25 -
+Rule   sol88   1988    only    -       May     22      11:56:40s 0:03:20 -
+Rule   sol88   1988    only    -       May     23      11:56:45s 0:03:15 -
+Rule   sol88   1988    only    -       May     24      11:56:50s 0:03:10 -
+Rule   sol88   1988    only    -       May     25      11:56:55s 0:03:05 -
+Rule   sol88   1988    only    -       May     26      11:57:00s 0:03:00 -
+Rule   sol88   1988    only    -       May     27      11:57:05s 0:02:55 -
+Rule   sol88   1988    only    -       May     28      11:57:15s 0:02:45 -
+Rule   sol88   1988    only    -       May     29      11:57:20s 0:02:40 -
+Rule   sol88   1988    only    -       May     30      11:57:30s 0:02:30 -
+Rule   sol88   1988    only    -       May     31      11:57:40s 0:02:20 -
+Rule   sol88   1988    only    -       Jun     1       11:57:50s 0:02:10 -
+Rule   sol88   1988    only    -       Jun     2       11:57:55s 0:02:05 -
+Rule   sol88   1988    only    -       Jun     3       11:58:05s 0:01:55 -
+Rule   sol88   1988    only    -       Jun     4       11:58:15s 0:01:45 -
+Rule   sol88   1988    only    -       Jun     5       11:58:30s 0:01:30 -
+Rule   sol88   1988    only    -       Jun     6       11:58:40s 0:01:20 -
+Rule   sol88   1988    only    -       Jun     7       11:58:50s 0:01:10 -
+Rule   sol88   1988    only    -       Jun     8       11:59:00s 0:01:00 -
+Rule   sol88   1988    only    -       Jun     9       11:59:15s 0:00:45 -
+Rule   sol88   1988    only    -       Jun     10      11:59:25s 0:00:35 -
+Rule   sol88   1988    only    -       Jun     11      11:59:35s 0:00:25 -
+Rule   sol88   1988    only    -       Jun     12      11:59:50s 0:00:10 -
+Rule   sol88   1988    only    -       Jun     13      12:00:00s 0:00:00 -
+Rule   sol88   1988    only    -       Jun     14      12:00:15s -0:00:15 -
+Rule   sol88   1988    only    -       Jun     15      12:00:25s -0:00:25 -
+Rule   sol88   1988    only    -       Jun     16      12:00:40s -0:00:40 -
+Rule   sol88   1988    only    -       Jun     17      12:00:55s -0:00:55 -
+Rule   sol88   1988    only    -       Jun     18      12:01:05s -0:01:05 -
+Rule   sol88   1988    only    -       Jun     19      12:01:20s -0:01:20 -
+Rule   sol88   1988    only    -       Jun     20      12:01:30s -0:01:30 -
+Rule   sol88   1988    only    -       Jun     21      12:01:45s -0:01:45 -
+Rule   sol88   1988    only    -       Jun     22      12:02:00s -0:02:00 -
+Rule   sol88   1988    only    -       Jun     23      12:02:10s -0:02:10 -
+Rule   sol88   1988    only    -       Jun     24      12:02:25s -0:02:25 -
+Rule   sol88   1988    only    -       Jun     25      12:02:35s -0:02:35 -
+Rule   sol88   1988    only    -       Jun     26      12:02:50s -0:02:50 -
+Rule   sol88   1988    only    -       Jun     27      12:03:00s -0:03:00 -
+Rule   sol88   1988    only    -       Jun     28      12:03:15s -0:03:15 -
+Rule   sol88   1988    only    -       Jun     29      12:03:25s -0:03:25 -
+Rule   sol88   1988    only    -       Jun     30      12:03:40s -0:03:40 -
+Rule   sol88   1988    only    -       Jul     1       12:03:50s -0:03:50 -
+Rule   sol88   1988    only    -       Jul     2       12:04:00s -0:04:00 -
+Rule   sol88   1988    only    -       Jul     3       12:04:10s -0:04:10 -
+Rule   sol88   1988    only    -       Jul     4       12:04:25s -0:04:25 -
+Rule   sol88   1988    only    -       Jul     5       12:04:35s -0:04:35 -
+Rule   sol88   1988    only    -       Jul     6       12:04:45s -0:04:45 -
+Rule   sol88   1988    only    -       Jul     7       12:04:55s -0:04:55 -
+Rule   sol88   1988    only    -       Jul     8       12:05:05s -0:05:05 -
+Rule   sol88   1988    only    -       Jul     9       12:05:10s -0:05:10 -
+Rule   sol88   1988    only    -       Jul     10      12:05:20s -0:05:20 -
+Rule   sol88   1988    only    -       Jul     11      12:05:30s -0:05:30 -
+Rule   sol88   1988    only    -       Jul     12      12:05:35s -0:05:35 -
+Rule   sol88   1988    only    -       Jul     13      12:05:45s -0:05:45 -
+Rule   sol88   1988    only    -       Jul     14      12:05:50s -0:05:50 -
+Rule   sol88   1988    only    -       Jul     15      12:05:55s -0:05:55 -
+Rule   sol88   1988    only    -       Jul     16      12:06:00s -0:06:00 -
+Rule   sol88   1988    only    -       Jul     17      12:06:05s -0:06:05 -
+Rule   sol88   1988    only    -       Jul     18      12:06:10s -0:06:10 -
+Rule   sol88   1988    only    -       Jul     19      12:06:15s -0:06:15 -
+Rule   sol88   1988    only    -       Jul     20      12:06:20s -0:06:20 -
+Rule   sol88   1988    only    -       Jul     21      12:06:25s -0:06:25 -
+Rule   sol88   1988    only    -       Jul     22      12:06:25s -0:06:25 -
+Rule   sol88   1988    only    -       Jul     23      12:06:25s -0:06:25 -
+Rule   sol88   1988    only    -       Jul     24      12:06:30s -0:06:30 -
+Rule   sol88   1988    only    -       Jul     25      12:06:30s -0:06:30 -
+Rule   sol88   1988    only    -       Jul     26      12:06:30s -0:06:30 -
+Rule   sol88   1988    only    -       Jul     27      12:06:30s -0:06:30 -
+Rule   sol88   1988    only    -       Jul     28      12:06:30s -0:06:30 -
+Rule   sol88   1988    only    -       Jul     29      12:06:25s -0:06:25 -
+Rule   sol88   1988    only    -       Jul     30      12:06:25s -0:06:25 -
+Rule   sol88   1988    only    -       Jul     31      12:06:20s -0:06:20 -
+Rule   sol88   1988    only    -       Aug     1       12:06:15s -0:06:15 -
+Rule   sol88   1988    only    -       Aug     2       12:06:15s -0:06:15 -
+Rule   sol88   1988    only    -       Aug     3       12:06:10s -0:06:10 -
+Rule   sol88   1988    only    -       Aug     4       12:06:05s -0:06:05 -
+Rule   sol88   1988    only    -       Aug     5       12:05:55s -0:05:55 -
+Rule   sol88   1988    only    -       Aug     6       12:05:50s -0:05:50 -
+Rule   sol88   1988    only    -       Aug     7       12:05:45s -0:05:45 -
+Rule   sol88   1988    only    -       Aug     8       12:05:35s -0:05:35 -
+Rule   sol88   1988    only    -       Aug     9       12:05:25s -0:05:25 -
+Rule   sol88   1988    only    -       Aug     10      12:05:20s -0:05:20 -
+Rule   sol88   1988    only    -       Aug     11      12:05:10s -0:05:10 -
+Rule   sol88   1988    only    -       Aug     12      12:05:00s -0:05:00 -
+Rule   sol88   1988    only    -       Aug     13      12:04:50s -0:04:50 -
+Rule   sol88   1988    only    -       Aug     14      12:04:35s -0:04:35 -
+Rule   sol88   1988    only    -       Aug     15      12:04:25s -0:04:25 -
+Rule   sol88   1988    only    -       Aug     16      12:04:15s -0:04:15 -
+Rule   sol88   1988    only    -       Aug     17      12:04:00s -0:04:00 -
+Rule   sol88   1988    only    -       Aug     18      12:03:50s -0:03:50 -
+Rule   sol88   1988    only    -       Aug     19      12:03:35s -0:03:35 -
+Rule   sol88   1988    only    -       Aug     20      12:03:20s -0:03:20 -
+Rule   sol88   1988    only    -       Aug     21      12:03:05s -0:03:05 -
+Rule   sol88   1988    only    -       Aug     22      12:02:50s -0:02:50 -
+Rule   sol88   1988    only    -       Aug     23      12:02:35s -0:02:35 -
+Rule   sol88   1988    only    -       Aug     24      12:02:20s -0:02:20 -
+Rule   sol88   1988    only    -       Aug     25      12:02:00s -0:02:00 -
+Rule   sol88   1988    only    -       Aug     26      12:01:45s -0:01:45 -
+Rule   sol88   1988    only    -       Aug     27      12:01:30s -0:01:30 -
+Rule   sol88   1988    only    -       Aug     28      12:01:10s -0:01:10 -
+Rule   sol88   1988    only    -       Aug     29      12:00:50s -0:00:50 -
+Rule   sol88   1988    only    -       Aug     30      12:00:35s -0:00:35 -
+Rule   sol88   1988    only    -       Aug     31      12:00:15s -0:00:15 -
+Rule   sol88   1988    only    -       Sep     1       11:59:55s 0:00:05 -
+Rule   sol88   1988    only    -       Sep     2       11:59:35s 0:00:25 -
+Rule   sol88   1988    only    -       Sep     3       11:59:20s 0:00:40 -
+Rule   sol88   1988    only    -       Sep     4       11:59:00s 0:01:00 -
+Rule   sol88   1988    only    -       Sep     5       11:58:40s 0:01:20 -
+Rule   sol88   1988    only    -       Sep     6       11:58:20s 0:01:40 -
+Rule   sol88   1988    only    -       Sep     7       11:58:00s 0:02:00 -
+Rule   sol88   1988    only    -       Sep     8       11:57:35s 0:02:25 -
+Rule   sol88   1988    only    -       Sep     9       11:57:15s 0:02:45 -
+Rule   sol88   1988    only    -       Sep     10      11:56:55s 0:03:05 -
+Rule   sol88   1988    only    -       Sep     11      11:56:35s 0:03:25 -
+Rule   sol88   1988    only    -       Sep     12      11:56:15s 0:03:45 -
+Rule   sol88   1988    only    -       Sep     13      11:55:50s 0:04:10 -
+Rule   sol88   1988    only    -       Sep     14      11:55:30s 0:04:30 -
+Rule   sol88   1988    only    -       Sep     15      11:55:10s 0:04:50 -
+Rule   sol88   1988    only    -       Sep     16      11:54:50s 0:05:10 -
+Rule   sol88   1988    only    -       Sep     17      11:54:25s 0:05:35 -
+Rule   sol88   1988    only    -       Sep     18      11:54:05s 0:05:55 -
+Rule   sol88   1988    only    -       Sep     19      11:53:45s 0:06:15 -
+Rule   sol88   1988    only    -       Sep     20      11:53:25s 0:06:35 -
+Rule   sol88   1988    only    -       Sep     21      11:53:00s 0:07:00 -
+Rule   sol88   1988    only    -       Sep     22      11:52:40s 0:07:20 -
+Rule   sol88   1988    only    -       Sep     23      11:52:20s 0:07:40 -
+Rule   sol88   1988    only    -       Sep     24      11:52:00s 0:08:00 -
+Rule   sol88   1988    only    -       Sep     25      11:51:40s 0:08:20 -
+Rule   sol88   1988    only    -       Sep     26      11:51:15s 0:08:45 -
+Rule   sol88   1988    only    -       Sep     27      11:50:55s 0:09:05 -
+Rule   sol88   1988    only    -       Sep     28      11:50:35s 0:09:25 -
+Rule   sol88   1988    only    -       Sep     29      11:50:15s 0:09:45 -
+Rule   sol88   1988    only    -       Sep     30      11:49:55s 0:10:05 -
+Rule   sol88   1988    only    -       Oct     1       11:49:35s 0:10:25 -
+Rule   sol88   1988    only    -       Oct     2       11:49:20s 0:10:40 -
+Rule   sol88   1988    only    -       Oct     3       11:49:00s 0:11:00 -
+Rule   sol88   1988    only    -       Oct     4       11:48:40s 0:11:20 -
+Rule   sol88   1988    only    -       Oct     5       11:48:25s 0:11:35 -
+Rule   sol88   1988    only    -       Oct     6       11:48:05s 0:11:55 -
+Rule   sol88   1988    only    -       Oct     7       11:47:50s 0:12:10 -
+Rule   sol88   1988    only    -       Oct     8       11:47:30s 0:12:30 -
+Rule   sol88   1988    only    -       Oct     9       11:47:15s 0:12:45 -
+Rule   sol88   1988    only    -       Oct     10      11:47:00s 0:13:00 -
+Rule   sol88   1988    only    -       Oct     11      11:46:45s 0:13:15 -
+Rule   sol88   1988    only    -       Oct     12      11:46:30s 0:13:30 -
+Rule   sol88   1988    only    -       Oct     13      11:46:15s 0:13:45 -
+Rule   sol88   1988    only    -       Oct     14      11:46:00s 0:14:00 -
+Rule   sol88   1988    only    -       Oct     15      11:45:45s 0:14:15 -
+Rule   sol88   1988    only    -       Oct     16      11:45:35s 0:14:25 -
+Rule   sol88   1988    only    -       Oct     17      11:45:20s 0:14:40 -
+Rule   sol88   1988    only    -       Oct     18      11:45:10s 0:14:50 -
+Rule   sol88   1988    only    -       Oct     19      11:45:00s 0:15:00 -
+Rule   sol88   1988    only    -       Oct     20      11:44:45s 0:15:15 -
+Rule   sol88   1988    only    -       Oct     21      11:44:40s 0:15:20 -
+Rule   sol88   1988    only    -       Oct     22      11:44:30s 0:15:30 -
+Rule   sol88   1988    only    -       Oct     23      11:44:20s 0:15:40 -
+Rule   sol88   1988    only    -       Oct     24      11:44:10s 0:15:50 -
+Rule   sol88   1988    only    -       Oct     25      11:44:05s 0:15:55 -
+Rule   sol88   1988    only    -       Oct     26      11:44:00s 0:16:00 -
+Rule   sol88   1988    only    -       Oct     27      11:43:55s 0:16:05 -
+Rule   sol88   1988    only    -       Oct     28      11:43:50s 0:16:10 -
+Rule   sol88   1988    only    -       Oct     29      11:43:45s 0:16:15 -
+Rule   sol88   1988    only    -       Oct     30      11:43:40s 0:16:20 -
+Rule   sol88   1988    only    -       Oct     31      11:43:40s 0:16:20 -
+Rule   sol88   1988    only    -       Nov     1       11:43:35s 0:16:25 -
+Rule   sol88   1988    only    -       Nov     2       11:43:35s 0:16:25 -
+Rule   sol88   1988    only    -       Nov     3       11:43:35s 0:16:25 -
+Rule   sol88   1988    only    -       Nov     4       11:43:35s 0:16:25 -
+Rule   sol88   1988    only    -       Nov     5       11:43:40s 0:16:20 -
+Rule   sol88   1988    only    -       Nov     6       11:43:40s 0:16:20 -
+Rule   sol88   1988    only    -       Nov     7       11:43:45s 0:16:15 -
+Rule   sol88   1988    only    -       Nov     8       11:43:45s 0:16:15 -
+Rule   sol88   1988    only    -       Nov     9       11:43:50s 0:16:10 -
+Rule   sol88   1988    only    -       Nov     10      11:44:00s 0:16:00 -
+Rule   sol88   1988    only    -       Nov     11      11:44:05s 0:15:55 -
+Rule   sol88   1988    only    -       Nov     12      11:44:10s 0:15:50 -
+Rule   sol88   1988    only    -       Nov     13      11:44:20s 0:15:40 -
+Rule   sol88   1988    only    -       Nov     14      11:44:30s 0:15:30 -
+Rule   sol88   1988    only    -       Nov     15      11:44:40s 0:15:20 -
+Rule   sol88   1988    only    -       Nov     16      11:44:50s 0:15:10 -
+Rule   sol88   1988    only    -       Nov     17      11:45:00s 0:15:00 -
+Rule   sol88   1988    only    -       Nov     18      11:45:15s 0:14:45 -
+Rule   sol88   1988    only    -       Nov     19      11:45:25s 0:14:35 -
+Rule   sol88   1988    only    -       Nov     20      11:45:40s 0:14:20 -
+Rule   sol88   1988    only    -       Nov     21      11:45:55s 0:14:05 -
+Rule   sol88   1988    only    -       Nov     22      11:46:10s 0:13:50 -
+Rule   sol88   1988    only    -       Nov     23      11:46:30s 0:13:30 -
+Rule   sol88   1988    only    -       Nov     24      11:46:45s 0:13:15 -
+Rule   sol88   1988    only    -       Nov     25      11:47:05s 0:12:55 -
+Rule   sol88   1988    only    -       Nov     26      11:47:20s 0:12:40 -
+Rule   sol88   1988    only    -       Nov     27      11:47:40s 0:12:20 -
+Rule   sol88   1988    only    -       Nov     28      11:48:00s 0:12:00 -
+Rule   sol88   1988    only    -       Nov     29      11:48:25s 0:11:35 -
+Rule   sol88   1988    only    -       Nov     30      11:48:45s 0:11:15 -
+Rule   sol88   1988    only    -       Dec     1       11:49:05s 0:10:55 -
+Rule   sol88   1988    only    -       Dec     2       11:49:30s 0:10:30 -
+Rule   sol88   1988    only    -       Dec     3       11:49:55s 0:10:05 -
+Rule   sol88   1988    only    -       Dec     4       11:50:15s 0:09:45 -
+Rule   sol88   1988    only    -       Dec     5       11:50:40s 0:09:20 -
+Rule   sol88   1988    only    -       Dec     6       11:51:05s 0:08:55 -
+Rule   sol88   1988    only    -       Dec     7       11:51:35s 0:08:25 -
+Rule   sol88   1988    only    -       Dec     8       11:52:00s 0:08:00 -
+Rule   sol88   1988    only    -       Dec     9       11:52:25s 0:07:35 -
+Rule   sol88   1988    only    -       Dec     10      11:52:55s 0:07:05 -
+Rule   sol88   1988    only    -       Dec     11      11:53:20s 0:06:40 -
+Rule   sol88   1988    only    -       Dec     12      11:53:50s 0:06:10 -
+Rule   sol88   1988    only    -       Dec     13      11:54:15s 0:05:45 -
+Rule   sol88   1988    only    -       Dec     14      11:54:45s 0:05:15 -
+Rule   sol88   1988    only    -       Dec     15      11:55:15s 0:04:45 -
+Rule   sol88   1988    only    -       Dec     16      11:55:45s 0:04:15 -
+Rule   sol88   1988    only    -       Dec     17      11:56:15s 0:03:45 -
+Rule   sol88   1988    only    -       Dec     18      11:56:40s 0:03:20 -
+Rule   sol88   1988    only    -       Dec     19      11:57:10s 0:02:50 -
+Rule   sol88   1988    only    -       Dec     20      11:57:40s 0:02:20 -
+Rule   sol88   1988    only    -       Dec     21      11:58:10s 0:01:50 -
+Rule   sol88   1988    only    -       Dec     22      11:58:40s 0:01:20 -
+Rule   sol88   1988    only    -       Dec     23      11:59:10s 0:00:50 -
+Rule   sol88   1988    only    -       Dec     24      11:59:40s 0:00:20 -
+Rule   sol88   1988    only    -       Dec     25      12:00:10s -0:00:10 -
+Rule   sol88   1988    only    -       Dec     26      12:00:40s -0:00:40 -
+Rule   sol88   1988    only    -       Dec     27      12:01:10s -0:01:10 -
+Rule   sol88   1988    only    -       Dec     28      12:01:40s -0:01:40 -
+Rule   sol88   1988    only    -       Dec     29      12:02:10s -0:02:10 -
+Rule   sol88   1988    only    -       Dec     30      12:02:35s -0:02:35 -
+Rule   sol88   1988    only    -       Dec     31      12:03:05s -0:03:05 -
+
+# Riyadh is at about 46 degrees 46 minutes East:  3 hrs, 7 mins, 4 secs
+# Before and after 1988, we'll operate on local mean solar time.
+
+# Zone NAME            GMTOFF  RULES/SAVE      FORMAT  [UNTIL]
+Zone   Asia/Riyadh88   3:07:04 -               zzz     1988
+                       3:07:04 sol88           zzz     1989
+                       3:07:04 -               zzz
+# For backward compatibility...
+Link   Asia/Riyadh88   Mideast/Riyadh88
diff --git a/extra/zoneinfo/solar89 b/extra/zoneinfo/solar89
new file mode 100644 (file)
index 0000000..8c48531
--- /dev/null
@@ -0,0 +1,393 @@
+# @(#)solar89  8.1
+
+# Apparent noon times below are for Riyadh; they're a bit off for other places.
+# Times were computed using a formula provided by the U. S. Naval Observatory:
+#      eqt = -105.8 * sin(l) + 596.2 * sin(2 * l) + 4.4 * sin(3 * l)
+#              -12.7 * sin(4 * l) - 429.0 * cos(l) - 2.1 * cos (2 * l)
+#              + 19.3 * cos(3 * l);
+# where l is the "mean longitude of the Sun" given by
+#      l = 279.642 degrees + 0.985647 * d
+# and d is the interval in days from January 0, 0 hours Universal Time
+# (equaling the day of the year plus the fraction of a day from zero hours).
+# The accuracy of the formula is plus or minus three seconds.
+#
+# Rounding to the nearest five seconds results in fewer than
+# 256 different "time types"--a limit that's faced because time types are
+# stored on disk as unsigned chars.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   sol89   1989    only    -       Jan     1       12:03:35s -0:03:35 -
+Rule   sol89   1989    only    -       Jan     2       12:04:05s -0:04:05 -
+Rule   sol89   1989    only    -       Jan     3       12:04:30s -0:04:30 -
+Rule   sol89   1989    only    -       Jan     4       12:05:00s -0:05:00 -
+Rule   sol89   1989    only    -       Jan     5       12:05:25s -0:05:25 -
+Rule   sol89   1989    only    -       Jan     6       12:05:50s -0:05:50 -
+Rule   sol89   1989    only    -       Jan     7       12:06:15s -0:06:15 -
+Rule   sol89   1989    only    -       Jan     8       12:06:45s -0:06:45 -
+Rule   sol89   1989    only    -       Jan     9       12:07:10s -0:07:10 -
+Rule   sol89   1989    only    -       Jan     10      12:07:35s -0:07:35 -
+Rule   sol89   1989    only    -       Jan     11      12:07:55s -0:07:55 -
+Rule   sol89   1989    only    -       Jan     12      12:08:20s -0:08:20 -
+Rule   sol89   1989    only    -       Jan     13      12:08:45s -0:08:45 -
+Rule   sol89   1989    only    -       Jan     14      12:09:05s -0:09:05 -
+Rule   sol89   1989    only    -       Jan     15      12:09:25s -0:09:25 -
+Rule   sol89   1989    only    -       Jan     16      12:09:45s -0:09:45 -
+Rule   sol89   1989    only    -       Jan     17      12:10:05s -0:10:05 -
+Rule   sol89   1989    only    -       Jan     18      12:10:25s -0:10:25 -
+Rule   sol89   1989    only    -       Jan     19      12:10:45s -0:10:45 -
+Rule   sol89   1989    only    -       Jan     20      12:11:05s -0:11:05 -
+Rule   sol89   1989    only    -       Jan     21      12:11:20s -0:11:20 -
+Rule   sol89   1989    only    -       Jan     22      12:11:35s -0:11:35 -
+Rule   sol89   1989    only    -       Jan     23      12:11:55s -0:11:55 -
+Rule   sol89   1989    only    -       Jan     24      12:12:10s -0:12:10 -
+Rule   sol89   1989    only    -       Jan     25      12:12:20s -0:12:20 -
+Rule   sol89   1989    only    -       Jan     26      12:12:35s -0:12:35 -
+Rule   sol89   1989    only    -       Jan     27      12:12:50s -0:12:50 -
+Rule   sol89   1989    only    -       Jan     28      12:13:00s -0:13:00 -
+Rule   sol89   1989    only    -       Jan     29      12:13:10s -0:13:10 -
+Rule   sol89   1989    only    -       Jan     30      12:13:20s -0:13:20 -
+Rule   sol89   1989    only    -       Jan     31      12:13:30s -0:13:30 -
+Rule   sol89   1989    only    -       Feb     1       12:13:40s -0:13:40 -
+Rule   sol89   1989    only    -       Feb     2       12:13:45s -0:13:45 -
+Rule   sol89   1989    only    -       Feb     3       12:13:55s -0:13:55 -
+Rule   sol89   1989    only    -       Feb     4       12:14:00s -0:14:00 -
+Rule   sol89   1989    only    -       Feb     5       12:14:05s -0:14:05 -
+Rule   sol89   1989    only    -       Feb     6       12:14:10s -0:14:10 -
+Rule   sol89   1989    only    -       Feb     7       12:14:10s -0:14:10 -
+Rule   sol89   1989    only    -       Feb     8       12:14:15s -0:14:15 -
+Rule   sol89   1989    only    -       Feb     9       12:14:15s -0:14:15 -
+Rule   sol89   1989    only    -       Feb     10      12:14:20s -0:14:20 -
+Rule   sol89   1989    only    -       Feb     11      12:14:20s -0:14:20 -
+Rule   sol89   1989    only    -       Feb     12      12:14:20s -0:14:20 -
+Rule   sol89   1989    only    -       Feb     13      12:14:15s -0:14:15 -
+Rule   sol89   1989    only    -       Feb     14      12:14:15s -0:14:15 -
+Rule   sol89   1989    only    -       Feb     15      12:14:10s -0:14:10 -
+Rule   sol89   1989    only    -       Feb     16      12:14:10s -0:14:10 -
+Rule   sol89   1989    only    -       Feb     17      12:14:05s -0:14:05 -
+Rule   sol89   1989    only    -       Feb     18      12:14:00s -0:14:00 -
+Rule   sol89   1989    only    -       Feb     19      12:13:55s -0:13:55 -
+Rule   sol89   1989    only    -       Feb     20      12:13:50s -0:13:50 -
+Rule   sol89   1989    only    -       Feb     21      12:13:40s -0:13:40 -
+Rule   sol89   1989    only    -       Feb     22      12:13:35s -0:13:35 -
+Rule   sol89   1989    only    -       Feb     23      12:13:25s -0:13:25 -
+Rule   sol89   1989    only    -       Feb     24      12:13:15s -0:13:15 -
+Rule   sol89   1989    only    -       Feb     25      12:13:05s -0:13:05 -
+Rule   sol89   1989    only    -       Feb     26      12:12:55s -0:12:55 -
+Rule   sol89   1989    only    -       Feb     27      12:12:45s -0:12:45 -
+Rule   sol89   1989    only    -       Feb     28      12:12:35s -0:12:35 -
+Rule   sol89   1989    only    -       Mar     1       12:12:25s -0:12:25 -
+Rule   sol89   1989    only    -       Mar     2       12:12:10s -0:12:10 -
+Rule   sol89   1989    only    -       Mar     3       12:12:00s -0:12:00 -
+Rule   sol89   1989    only    -       Mar     4       12:11:45s -0:11:45 -
+Rule   sol89   1989    only    -       Mar     5       12:11:35s -0:11:35 -
+Rule   sol89   1989    only    -       Mar     6       12:11:20s -0:11:20 -
+Rule   sol89   1989    only    -       Mar     7       12:11:05s -0:11:05 -
+Rule   sol89   1989    only    -       Mar     8       12:10:50s -0:10:50 -
+Rule   sol89   1989    only    -       Mar     9       12:10:35s -0:10:35 -
+Rule   sol89   1989    only    -       Mar     10      12:10:20s -0:10:20 -
+Rule   sol89   1989    only    -       Mar     11      12:10:05s -0:10:05 -
+Rule   sol89   1989    only    -       Mar     12      12:09:50s -0:09:50 -
+Rule   sol89   1989    only    -       Mar     13      12:09:30s -0:09:30 -
+Rule   sol89   1989    only    -       Mar     14      12:09:15s -0:09:15 -
+Rule   sol89   1989    only    -       Mar     15      12:09:00s -0:09:00 -
+Rule   sol89   1989    only    -       Mar     16      12:08:40s -0:08:40 -
+Rule   sol89   1989    only    -       Mar     17      12:08:25s -0:08:25 -
+Rule   sol89   1989    only    -       Mar     18      12:08:05s -0:08:05 -
+Rule   sol89   1989    only    -       Mar     19      12:07:50s -0:07:50 -
+Rule   sol89   1989    only    -       Mar     20      12:07:30s -0:07:30 -
+Rule   sol89   1989    only    -       Mar     21      12:07:15s -0:07:15 -
+Rule   sol89   1989    only    -       Mar     22      12:06:55s -0:06:55 -
+Rule   sol89   1989    only    -       Mar     23      12:06:35s -0:06:35 -
+Rule   sol89   1989    only    -       Mar     24      12:06:20s -0:06:20 -
+Rule   sol89   1989    only    -       Mar     25      12:06:00s -0:06:00 -
+Rule   sol89   1989    only    -       Mar     26      12:05:40s -0:05:40 -
+Rule   sol89   1989    only    -       Mar     27      12:05:25s -0:05:25 -
+Rule   sol89   1989    only    -       Mar     28      12:05:05s -0:05:05 -
+Rule   sol89   1989    only    -       Mar     29      12:04:50s -0:04:50 -
+Rule   sol89   1989    only    -       Mar     30      12:04:30s -0:04:30 -
+Rule   sol89   1989    only    -       Mar     31      12:04:10s -0:04:10 -
+Rule   sol89   1989    only    -       Apr     1       12:03:55s -0:03:55 -
+Rule   sol89   1989    only    -       Apr     2       12:03:35s -0:03:35 -
+Rule   sol89   1989    only    -       Apr     3       12:03:20s -0:03:20 -
+Rule   sol89   1989    only    -       Apr     4       12:03:00s -0:03:00 -
+Rule   sol89   1989    only    -       Apr     5       12:02:45s -0:02:45 -
+Rule   sol89   1989    only    -       Apr     6       12:02:25s -0:02:25 -
+Rule   sol89   1989    only    -       Apr     7       12:02:10s -0:02:10 -
+Rule   sol89   1989    only    -       Apr     8       12:01:50s -0:01:50 -
+Rule   sol89   1989    only    -       Apr     9       12:01:35s -0:01:35 -
+Rule   sol89   1989    only    -       Apr     10      12:01:20s -0:01:20 -
+Rule   sol89   1989    only    -       Apr     11      12:01:05s -0:01:05 -
+Rule   sol89   1989    only    -       Apr     12      12:00:50s -0:00:50 -
+Rule   sol89   1989    only    -       Apr     13      12:00:35s -0:00:35 -
+Rule   sol89   1989    only    -       Apr     14      12:00:20s -0:00:20 -
+Rule   sol89   1989    only    -       Apr     15      12:00:05s -0:00:05 -
+Rule   sol89   1989    only    -       Apr     16      11:59:50s 0:00:10 -
+Rule   sol89   1989    only    -       Apr     17      11:59:35s 0:00:25 -
+Rule   sol89   1989    only    -       Apr     18      11:59:20s 0:00:40 -
+Rule   sol89   1989    only    -       Apr     19      11:59:10s 0:00:50 -
+Rule   sol89   1989    only    -       Apr     20      11:58:55s 0:01:05 -
+Rule   sol89   1989    only    -       Apr     21      11:58:45s 0:01:15 -
+Rule   sol89   1989    only    -       Apr     22      11:58:30s 0:01:30 -
+Rule   sol89   1989    only    -       Apr     23      11:58:20s 0:01:40 -
+Rule   sol89   1989    only    -       Apr     24      11:58:10s 0:01:50 -
+Rule   sol89   1989    only    -       Apr     25      11:58:00s 0:02:00 -
+Rule   sol89   1989    only    -       Apr     26      11:57:50s 0:02:10 -
+Rule   sol89   1989    only    -       Apr     27      11:57:40s 0:02:20 -
+Rule   sol89   1989    only    -       Apr     28      11:57:30s 0:02:30 -
+Rule   sol89   1989    only    -       Apr     29      11:57:20s 0:02:40 -
+Rule   sol89   1989    only    -       Apr     30      11:57:15s 0:02:45 -
+Rule   sol89   1989    only    -       May     1       11:57:05s 0:02:55 -
+Rule   sol89   1989    only    -       May     2       11:57:00s 0:03:00 -
+Rule   sol89   1989    only    -       May     3       11:56:50s 0:03:10 -
+Rule   sol89   1989    only    -       May     4       11:56:45s 0:03:15 -
+Rule   sol89   1989    only    -       May     5       11:56:40s 0:03:20 -
+Rule   sol89   1989    only    -       May     6       11:56:35s 0:03:25 -
+Rule   sol89   1989    only    -       May     7       11:56:30s 0:03:30 -
+Rule   sol89   1989    only    -       May     8       11:56:30s 0:03:30 -
+Rule   sol89   1989    only    -       May     9       11:56:25s 0:03:35 -
+Rule   sol89   1989    only    -       May     10      11:56:25s 0:03:35 -
+Rule   sol89   1989    only    -       May     11      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       May     12      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       May     13      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       May     14      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       May     15      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       May     16      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       May     17      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       May     18      11:56:25s 0:03:35 -
+Rule   sol89   1989    only    -       May     19      11:56:25s 0:03:35 -
+Rule   sol89   1989    only    -       May     20      11:56:30s 0:03:30 -
+Rule   sol89   1989    only    -       May     21      11:56:35s 0:03:25 -
+Rule   sol89   1989    only    -       May     22      11:56:35s 0:03:25 -
+Rule   sol89   1989    only    -       May     23      11:56:40s 0:03:20 -
+Rule   sol89   1989    only    -       May     24      11:56:45s 0:03:15 -
+Rule   sol89   1989    only    -       May     25      11:56:55s 0:03:05 -
+Rule   sol89   1989    only    -       May     26      11:57:00s 0:03:00 -
+Rule   sol89   1989    only    -       May     27      11:57:05s 0:02:55 -
+Rule   sol89   1989    only    -       May     28      11:57:15s 0:02:45 -
+Rule   sol89   1989    only    -       May     29      11:57:20s 0:02:40 -
+Rule   sol89   1989    only    -       May     30      11:57:30s 0:02:30 -
+Rule   sol89   1989    only    -       May     31      11:57:35s 0:02:25 -
+Rule   sol89   1989    only    -       Jun     1       11:57:45s 0:02:15 -
+Rule   sol89   1989    only    -       Jun     2       11:57:55s 0:02:05 -
+Rule   sol89   1989    only    -       Jun     3       11:58:05s 0:01:55 -
+Rule   sol89   1989    only    -       Jun     4       11:58:15s 0:01:45 -
+Rule   sol89   1989    only    -       Jun     5       11:58:25s 0:01:35 -
+Rule   sol89   1989    only    -       Jun     6       11:58:35s 0:01:25 -
+Rule   sol89   1989    only    -       Jun     7       11:58:45s 0:01:15 -
+Rule   sol89   1989    only    -       Jun     8       11:59:00s 0:01:00 -
+Rule   sol89   1989    only    -       Jun     9       11:59:10s 0:00:50 -
+Rule   sol89   1989    only    -       Jun     10      11:59:20s 0:00:40 -
+Rule   sol89   1989    only    -       Jun     11      11:59:35s 0:00:25 -
+Rule   sol89   1989    only    -       Jun     12      11:59:45s 0:00:15 -
+Rule   sol89   1989    only    -       Jun     13      12:00:00s 0:00:00 -
+Rule   sol89   1989    only    -       Jun     14      12:00:10s -0:00:10 -
+Rule   sol89   1989    only    -       Jun     15      12:00:25s -0:00:25 -
+Rule   sol89   1989    only    -       Jun     16      12:00:35s -0:00:35 -
+Rule   sol89   1989    only    -       Jun     17      12:00:50s -0:00:50 -
+Rule   sol89   1989    only    -       Jun     18      12:01:05s -0:01:05 -
+Rule   sol89   1989    only    -       Jun     19      12:01:15s -0:01:15 -
+Rule   sol89   1989    only    -       Jun     20      12:01:30s -0:01:30 -
+Rule   sol89   1989    only    -       Jun     21      12:01:40s -0:01:40 -
+Rule   sol89   1989    only    -       Jun     22      12:01:55s -0:01:55 -
+Rule   sol89   1989    only    -       Jun     23      12:02:10s -0:02:10 -
+Rule   sol89   1989    only    -       Jun     24      12:02:20s -0:02:20 -
+Rule   sol89   1989    only    -       Jun     25      12:02:35s -0:02:35 -
+Rule   sol89   1989    only    -       Jun     26      12:02:45s -0:02:45 -
+Rule   sol89   1989    only    -       Jun     27      12:03:00s -0:03:00 -
+Rule   sol89   1989    only    -       Jun     28      12:03:10s -0:03:10 -
+Rule   sol89   1989    only    -       Jun     29      12:03:25s -0:03:25 -
+Rule   sol89   1989    only    -       Jun     30      12:03:35s -0:03:35 -
+Rule   sol89   1989    only    -       Jul     1       12:03:45s -0:03:45 -
+Rule   sol89   1989    only    -       Jul     2       12:04:00s -0:04:00 -
+Rule   sol89   1989    only    -       Jul     3       12:04:10s -0:04:10 -
+Rule   sol89   1989    only    -       Jul     4       12:04:20s -0:04:20 -
+Rule   sol89   1989    only    -       Jul     5       12:04:30s -0:04:30 -
+Rule   sol89   1989    only    -       Jul     6       12:04:40s -0:04:40 -
+Rule   sol89   1989    only    -       Jul     7       12:04:50s -0:04:50 -
+Rule   sol89   1989    only    -       Jul     8       12:05:00s -0:05:00 -
+Rule   sol89   1989    only    -       Jul     9       12:05:10s -0:05:10 -
+Rule   sol89   1989    only    -       Jul     10      12:05:20s -0:05:20 -
+Rule   sol89   1989    only    -       Jul     11      12:05:25s -0:05:25 -
+Rule   sol89   1989    only    -       Jul     12      12:05:35s -0:05:35 -
+Rule   sol89   1989    only    -       Jul     13      12:05:40s -0:05:40 -
+Rule   sol89   1989    only    -       Jul     14      12:05:50s -0:05:50 -
+Rule   sol89   1989    only    -       Jul     15      12:05:55s -0:05:55 -
+Rule   sol89   1989    only    -       Jul     16      12:06:00s -0:06:00 -
+Rule   sol89   1989    only    -       Jul     17      12:06:05s -0:06:05 -
+Rule   sol89   1989    only    -       Jul     18      12:06:10s -0:06:10 -
+Rule   sol89   1989    only    -       Jul     19      12:06:15s -0:06:15 -
+Rule   sol89   1989    only    -       Jul     20      12:06:20s -0:06:20 -
+Rule   sol89   1989    only    -       Jul     21      12:06:20s -0:06:20 -
+Rule   sol89   1989    only    -       Jul     22      12:06:25s -0:06:25 -
+Rule   sol89   1989    only    -       Jul     23      12:06:25s -0:06:25 -
+Rule   sol89   1989    only    -       Jul     24      12:06:30s -0:06:30 -
+Rule   sol89   1989    only    -       Jul     25      12:06:30s -0:06:30 -
+Rule   sol89   1989    only    -       Jul     26      12:06:30s -0:06:30 -
+Rule   sol89   1989    only    -       Jul     27      12:06:30s -0:06:30 -
+Rule   sol89   1989    only    -       Jul     28      12:06:30s -0:06:30 -
+Rule   sol89   1989    only    -       Jul     29      12:06:25s -0:06:25 -
+Rule   sol89   1989    only    -       Jul     30      12:06:25s -0:06:25 -
+Rule   sol89   1989    only    -       Jul     31      12:06:20s -0:06:20 -
+Rule   sol89   1989    only    -       Aug     1       12:06:20s -0:06:20 -
+Rule   sol89   1989    only    -       Aug     2       12:06:15s -0:06:15 -
+Rule   sol89   1989    only    -       Aug     3       12:06:10s -0:06:10 -
+Rule   sol89   1989    only    -       Aug     4       12:06:05s -0:06:05 -
+Rule   sol89   1989    only    -       Aug     5       12:06:00s -0:06:00 -
+Rule   sol89   1989    only    -       Aug     6       12:05:50s -0:05:50 -
+Rule   sol89   1989    only    -       Aug     7       12:05:45s -0:05:45 -
+Rule   sol89   1989    only    -       Aug     8       12:05:35s -0:05:35 -
+Rule   sol89   1989    only    -       Aug     9       12:05:30s -0:05:30 -
+Rule   sol89   1989    only    -       Aug     10      12:05:20s -0:05:20 -
+Rule   sol89   1989    only    -       Aug     11      12:05:10s -0:05:10 -
+Rule   sol89   1989    only    -       Aug     12      12:05:00s -0:05:00 -
+Rule   sol89   1989    only    -       Aug     13      12:04:50s -0:04:50 -
+Rule   sol89   1989    only    -       Aug     14      12:04:40s -0:04:40 -
+Rule   sol89   1989    only    -       Aug     15      12:04:30s -0:04:30 -
+Rule   sol89   1989    only    -       Aug     16      12:04:15s -0:04:15 -
+Rule   sol89   1989    only    -       Aug     17      12:04:05s -0:04:05 -
+Rule   sol89   1989    only    -       Aug     18      12:03:50s -0:03:50 -
+Rule   sol89   1989    only    -       Aug     19      12:03:35s -0:03:35 -
+Rule   sol89   1989    only    -       Aug     20      12:03:25s -0:03:25 -
+Rule   sol89   1989    only    -       Aug     21      12:03:10s -0:03:10 -
+Rule   sol89   1989    only    -       Aug     22      12:02:55s -0:02:55 -
+Rule   sol89   1989    only    -       Aug     23      12:02:40s -0:02:40 -
+Rule   sol89   1989    only    -       Aug     24      12:02:20s -0:02:20 -
+Rule   sol89   1989    only    -       Aug     25      12:02:05s -0:02:05 -
+Rule   sol89   1989    only    -       Aug     26      12:01:50s -0:01:50 -
+Rule   sol89   1989    only    -       Aug     27      12:01:30s -0:01:30 -
+Rule   sol89   1989    only    -       Aug     28      12:01:15s -0:01:15 -
+Rule   sol89   1989    only    -       Aug     29      12:00:55s -0:00:55 -
+Rule   sol89   1989    only    -       Aug     30      12:00:40s -0:00:40 -
+Rule   sol89   1989    only    -       Aug     31      12:00:20s -0:00:20 -
+Rule   sol89   1989    only    -       Sep     1       12:00:00s 0:00:00 -
+Rule   sol89   1989    only    -       Sep     2       11:59:45s 0:00:15 -
+Rule   sol89   1989    only    -       Sep     3       11:59:25s 0:00:35 -
+Rule   sol89   1989    only    -       Sep     4       11:59:05s 0:00:55 -
+Rule   sol89   1989    only    -       Sep     5       11:58:45s 0:01:15 -
+Rule   sol89   1989    only    -       Sep     6       11:58:25s 0:01:35 -
+Rule   sol89   1989    only    -       Sep     7       11:58:05s 0:01:55 -
+Rule   sol89   1989    only    -       Sep     8       11:57:45s 0:02:15 -
+Rule   sol89   1989    only    -       Sep     9       11:57:20s 0:02:40 -
+Rule   sol89   1989    only    -       Sep     10      11:57:00s 0:03:00 -
+Rule   sol89   1989    only    -       Sep     11      11:56:40s 0:03:20 -
+Rule   sol89   1989    only    -       Sep     12      11:56:20s 0:03:40 -
+Rule   sol89   1989    only    -       Sep     13      11:56:00s 0:04:00 -
+Rule   sol89   1989    only    -       Sep     14      11:55:35s 0:04:25 -
+Rule   sol89   1989    only    -       Sep     15      11:55:15s 0:04:45 -
+Rule   sol89   1989    only    -       Sep     16      11:54:55s 0:05:05 -
+Rule   sol89   1989    only    -       Sep     17      11:54:35s 0:05:25 -
+Rule   sol89   1989    only    -       Sep     18      11:54:10s 0:05:50 -
+Rule   sol89   1989    only    -       Sep     19      11:53:50s 0:06:10 -
+Rule   sol89   1989    only    -       Sep     20      11:53:30s 0:06:30 -
+Rule   sol89   1989    only    -       Sep     21      11:53:10s 0:06:50 -
+Rule   sol89   1989    only    -       Sep     22      11:52:45s 0:07:15 -
+Rule   sol89   1989    only    -       Sep     23      11:52:25s 0:07:35 -
+Rule   sol89   1989    only    -       Sep     24      11:52:05s 0:07:55 -
+Rule   sol89   1989    only    -       Sep     25      11:51:45s 0:08:15 -
+Rule   sol89   1989    only    -       Sep     26      11:51:25s 0:08:35 -
+Rule   sol89   1989    only    -       Sep     27      11:51:05s 0:08:55 -
+Rule   sol89   1989    only    -       Sep     28      11:50:40s 0:09:20 -
+Rule   sol89   1989    only    -       Sep     29      11:50:20s 0:09:40 -
+Rule   sol89   1989    only    -       Sep     30      11:50:00s 0:10:00 -
+Rule   sol89   1989    only    -       Oct     1       11:49:45s 0:10:15 -
+Rule   sol89   1989    only    -       Oct     2       11:49:25s 0:10:35 -
+Rule   sol89   1989    only    -       Oct     3       11:49:05s 0:10:55 -
+Rule   sol89   1989    only    -       Oct     4       11:48:45s 0:11:15 -
+Rule   sol89   1989    only    -       Oct     5       11:48:30s 0:11:30 -
+Rule   sol89   1989    only    -       Oct     6       11:48:10s 0:11:50 -
+Rule   sol89   1989    only    -       Oct     7       11:47:50s 0:12:10 -
+Rule   sol89   1989    only    -       Oct     8       11:47:35s 0:12:25 -
+Rule   sol89   1989    only    -       Oct     9       11:47:20s 0:12:40 -
+Rule   sol89   1989    only    -       Oct     10      11:47:00s 0:13:00 -
+Rule   sol89   1989    only    -       Oct     11      11:46:45s 0:13:15 -
+Rule   sol89   1989    only    -       Oct     12      11:46:30s 0:13:30 -
+Rule   sol89   1989    only    -       Oct     13      11:46:15s 0:13:45 -
+Rule   sol89   1989    only    -       Oct     14      11:46:00s 0:14:00 -
+Rule   sol89   1989    only    -       Oct     15      11:45:50s 0:14:10 -
+Rule   sol89   1989    only    -       Oct     16      11:45:35s 0:14:25 -
+Rule   sol89   1989    only    -       Oct     17      11:45:20s 0:14:40 -
+Rule   sol89   1989    only    -       Oct     18      11:45:10s 0:14:50 -
+Rule   sol89   1989    only    -       Oct     19      11:45:00s 0:15:00 -
+Rule   sol89   1989    only    -       Oct     20      11:44:50s 0:15:10 -
+Rule   sol89   1989    only    -       Oct     21      11:44:40s 0:15:20 -
+Rule   sol89   1989    only    -       Oct     22      11:44:30s 0:15:30 -
+Rule   sol89   1989    only    -       Oct     23      11:44:20s 0:15:40 -
+Rule   sol89   1989    only    -       Oct     24      11:44:10s 0:15:50 -
+Rule   sol89   1989    only    -       Oct     25      11:44:05s 0:15:55 -
+Rule   sol89   1989    only    -       Oct     26      11:44:00s 0:16:00 -
+Rule   sol89   1989    only    -       Oct     27      11:43:50s 0:16:10 -
+Rule   sol89   1989    only    -       Oct     28      11:43:45s 0:16:15 -
+Rule   sol89   1989    only    -       Oct     29      11:43:40s 0:16:20 -
+Rule   sol89   1989    only    -       Oct     30      11:43:40s 0:16:20 -
+Rule   sol89   1989    only    -       Oct     31      11:43:35s 0:16:25 -
+Rule   sol89   1989    only    -       Nov     1       11:43:35s 0:16:25 -
+Rule   sol89   1989    only    -       Nov     2       11:43:35s 0:16:25 -
+Rule   sol89   1989    only    -       Nov     3       11:43:30s 0:16:30 -
+Rule   sol89   1989    only    -       Nov     4       11:43:35s 0:16:25 -
+Rule   sol89   1989    only    -       Nov     5       11:43:35s 0:16:25 -
+Rule   sol89   1989    only    -       Nov     6       11:43:35s 0:16:25 -
+Rule   sol89   1989    only    -       Nov     7       11:43:40s 0:16:20 -
+Rule   sol89   1989    only    -       Nov     8       11:43:45s 0:16:15 -
+Rule   sol89   1989    only    -       Nov     9       11:43:50s 0:16:10 -
+Rule   sol89   1989    only    -       Nov     10      11:43:55s 0:16:05 -
+Rule   sol89   1989    only    -       Nov     11      11:44:00s 0:16:00 -
+Rule   sol89   1989    only    -       Nov     12      11:44:05s 0:15:55 -
+Rule   sol89   1989    only    -       Nov     13      11:44:15s 0:15:45 -
+Rule   sol89   1989    only    -       Nov     14      11:44:25s 0:15:35 -
+Rule   sol89   1989    only    -       Nov     15      11:44:35s 0:15:25 -
+Rule   sol89   1989    only    -       Nov     16      11:44:45s 0:15:15 -
+Rule   sol89   1989    only    -       Nov     17      11:44:55s 0:15:05 -
+Rule   sol89   1989    only    -       Nov     18      11:45:10s 0:14:50 -
+Rule   sol89   1989    only    -       Nov     19      11:45:20s 0:14:40 -
+Rule   sol89   1989    only    -       Nov     20      11:45:35s 0:14:25 -
+Rule   sol89   1989    only    -       Nov     21      11:45:50s 0:14:10 -
+Rule   sol89   1989    only    -       Nov     22      11:46:05s 0:13:55 -
+Rule   sol89   1989    only    -       Nov     23      11:46:25s 0:13:35 -
+Rule   sol89   1989    only    -       Nov     24      11:46:40s 0:13:20 -
+Rule   sol89   1989    only    -       Nov     25      11:47:00s 0:13:00 -
+Rule   sol89   1989    only    -       Nov     26      11:47:20s 0:12:40 -
+Rule   sol89   1989    only    -       Nov     27      11:47:35s 0:12:25 -
+Rule   sol89   1989    only    -       Nov     28      11:47:55s 0:12:05 -
+Rule   sol89   1989    only    -       Nov     29      11:48:20s 0:11:40 -
+Rule   sol89   1989    only    -       Nov     30      11:48:40s 0:11:20 -
+Rule   sol89   1989    only    -       Dec     1       11:49:00s 0:11:00 -
+Rule   sol89   1989    only    -       Dec     2       11:49:25s 0:10:35 -
+Rule   sol89   1989    only    -       Dec     3       11:49:50s 0:10:10 -
+Rule   sol89   1989    only    -       Dec     4       11:50:15s 0:09:45 -
+Rule   sol89   1989    only    -       Dec     5       11:50:35s 0:09:25 -
+Rule   sol89   1989    only    -       Dec     6       11:51:00s 0:09:00 -
+Rule   sol89   1989    only    -       Dec     7       11:51:30s 0:08:30 -
+Rule   sol89   1989    only    -       Dec     8       11:51:55s 0:08:05 -
+Rule   sol89   1989    only    -       Dec     9       11:52:20s 0:07:40 -
+Rule   sol89   1989    only    -       Dec     10      11:52:50s 0:07:10 -
+Rule   sol89   1989    only    -       Dec     11      11:53:15s 0:06:45 -
+Rule   sol89   1989    only    -       Dec     12      11:53:45s 0:06:15 -
+Rule   sol89   1989    only    -       Dec     13      11:54:10s 0:05:50 -
+Rule   sol89   1989    only    -       Dec     14      11:54:40s 0:05:20 -
+Rule   sol89   1989    only    -       Dec     15      11:55:10s 0:04:50 -
+Rule   sol89   1989    only    -       Dec     16      11:55:40s 0:04:20 -
+Rule   sol89   1989    only    -       Dec     17      11:56:05s 0:03:55 -
+Rule   sol89   1989    only    -       Dec     18      11:56:35s 0:03:25 -
+Rule   sol89   1989    only    -       Dec     19      11:57:05s 0:02:55 -
+Rule   sol89   1989    only    -       Dec     20      11:57:35s 0:02:25 -
+Rule   sol89   1989    only    -       Dec     21      11:58:05s 0:01:55 -
+Rule   sol89   1989    only    -       Dec     22      11:58:35s 0:01:25 -
+Rule   sol89   1989    only    -       Dec     23      11:59:05s 0:00:55 -
+Rule   sol89   1989    only    -       Dec     24      11:59:35s 0:00:25 -
+Rule   sol89   1989    only    -       Dec     25      12:00:05s -0:00:05 -
+Rule   sol89   1989    only    -       Dec     26      12:00:35s -0:00:35 -
+Rule   sol89   1989    only    -       Dec     27      12:01:05s -0:01:05 -
+Rule   sol89   1989    only    -       Dec     28      12:01:35s -0:01:35 -
+Rule   sol89   1989    only    -       Dec     29      12:02:00s -0:02:00 -
+Rule   sol89   1989    only    -       Dec     30      12:02:30s -0:02:30 -
+Rule   sol89   1989    only    -       Dec     31      12:03:00s -0:03:00 -
+
+# Riyadh is at about 46 degrees 46 minutes East:  3 hrs, 7 mins, 4 secs
+# Before and after 1989, we'll operate on local mean solar time.
+
+# Zone NAME            GMTOFF  RULES/SAVE      FORMAT  [UNTIL]
+Zone   Asia/Riyadh89   3:07:04 -               zzz     1989
+                       3:07:04 sol89           zzz     1990
+                       3:07:04 -               zzz
+# For backward compatibility...
+Link   Asia/Riyadh89   Mideast/Riyadh89
diff --git a/extra/zoneinfo/southamerica b/extra/zoneinfo/southamerica
new file mode 100644 (file)
index 0000000..5824b7f
--- /dev/null
@@ -0,0 +1,1473 @@
+# @(#)southamerica     8.34
+# <pre>
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Earlier editions of these tables used the North American style (e.g. ARST and
+# ARDT for Argentine Standard and Daylight Time), but the following quote
+# suggests that it's better to use European style (e.g. ART and ARST).
+#      I suggest the use of _Summer time_ instead of the more cumbersome
+#      _daylight-saving time_.  _Summer time_ seems to be in general use
+#      in Europe and South America.
+#      -- E O Cutler, _New York Times_ (1937-02-14), quoted in
+#      H L Mencken, _The American Language: Supplement I_ (1960), p 466
+#
+# Earlier editions of these tables also used the North American style
+# for time zones in Brazil, but this was incorrect, as Brazilians say
+# "summer time".  Reinaldo Goulart, a Sao Paulo businessman active in
+# the railroad sector, writes (1999-07-06):
+#      The subject of time zones is currently a matter of discussion/debate in
+#      Brazil.  Let's say that "the Brasilia time" is considered the
+#      "official time" because Brasilia is the capital city.
+#      The other three time zones are called "Brasilia time "minus one" or
+#      "plus one" or "plus two".  As far as I know there is no such
+#      name/designation as "Eastern Time" or "Central Time".
+# So I invented the following (English-language) abbreviations for now.
+# Corrections are welcome!
+#              std     dst
+#      -2:00   FNT     FNST    Fernando de Noronha
+#      -3:00   BRT     BRST    Brasilia
+#      -4:00   AMT     AMST    Amazon
+#      -5:00   ACT     ACST    Acre
+
+###############################################################################
+
+###############################################################################
+
+# Argentina
+
+# From Bob Devine (1988-01-28):
+# Argentina: first Sunday in October to first Sunday in April since 1976.
+# Double Summer time from 1969 to 1974.  Switches at midnight.
+
+# From U. S. Naval Observatory (1988-01-199):
+# ARGENTINA           3 H BEHIND   UTC
+
+# From Hernan G. Otero (1995-06-26):
+# I am sending modifications to the Argentine time zone table...
+# AR was chosen because they are the ISO letters that represent Argentina.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Arg     1930    only    -       Dec      1      0:00    1:00    S
+Rule   Arg     1931    only    -       Apr      1      0:00    0       -
+Rule   Arg     1931    only    -       Oct     15      0:00    1:00    S
+Rule   Arg     1932    1940    -       Mar      1      0:00    0       -
+Rule   Arg     1932    1939    -       Nov      1      0:00    1:00    S
+Rule   Arg     1940    only    -       Jul      1      0:00    1:00    S
+Rule   Arg     1941    only    -       Jun     15      0:00    0       -
+Rule   Arg     1941    only    -       Oct     15      0:00    1:00    S
+Rule   Arg     1943    only    -       Aug      1      0:00    0       -
+Rule   Arg     1943    only    -       Oct     15      0:00    1:00    S
+Rule   Arg     1946    only    -       Mar      1      0:00    0       -
+Rule   Arg     1946    only    -       Oct      1      0:00    1:00    S
+Rule   Arg     1963    only    -       Oct      1      0:00    0       -
+Rule   Arg     1963    only    -       Dec     15      0:00    1:00    S
+Rule   Arg     1964    1966    -       Mar      1      0:00    0       -
+Rule   Arg     1964    1966    -       Oct     15      0:00    1:00    S
+Rule   Arg     1967    only    -       Apr      2      0:00    0       -
+Rule   Arg     1967    1968    -       Oct     Sun>=1  0:00    1:00    S
+Rule   Arg     1968    1969    -       Apr     Sun>=1  0:00    0       -
+Rule   Arg     1974    only    -       Jan     23      0:00    1:00    S
+Rule   Arg     1974    only    -       May      1      0:00    0       -
+Rule   Arg     1988    only    -       Dec      1      0:00    1:00    S
+#
+# From Hernan G. Otero (1995-06-26):
+# These corrections were contributed by InterSoft Argentina S.A.,
+# obtaining the data from the:
+# Talleres de Hidrografia Naval Argentina
+# (Argentine Naval Hydrography Institute)
+Rule   Arg     1989    1993    -       Mar     Sun>=1  0:00    0       -
+Rule   Arg     1989    1992    -       Oct     Sun>=15 0:00    1:00    S
+#
+# From Hernan G. Otero (1995-06-26):
+# From this moment on, the law that mandated the daylight saving
+# time corrections was derogated and no more modifications
+# to the time zones (for daylight saving) are now made.
+#
+# From Rives McDow (2000-01-10):
+# On October 3, 1999, 0:00 local, Argentina implemented daylight savings time,
+# which did not result in the switch of a time zone, as they stayed 9 hours
+# from the International Date Line.
+Rule   Arg     1999    only    -       Oct     Sun>=1  0:00    1:00    S
+# From Paul Eggert (2007-12-28):
+# DST was set to expire on March 5, not March 3, but since it was converted
+# to standard time on March 3 it's more convenient for us to pretend that
+# it ended on March 3.
+Rule   Arg     2000    only    -       Mar     3       0:00    0       -
+#
+# From Peter Gradelski via Steffen Thorsen (2000-03-01):
+# We just checked with our Sao Paulo office and they say the government of
+# Argentina decided not to become one of the countries that go on or off DST.
+# So Buenos Aires should be -3 hours from GMT at all times.
+#
+# From Fabian L. Arce Jofre (2000-04-04):
+# The law that claimed DST for Argentina was derogated by President Fernando
+# de la Rua on March 2, 2000, because it would make people spend more energy
+# in the winter time, rather than less.  The change took effect on March 3.
+#
+# From Mariano Absatz (2001-06-06):
+# one of the major newspapers here in Argentina said that the 1999
+# Timezone Law (which never was effectively applied) will (would?) be
+# in effect.... The article is at
+# http://ar.clarin.com/diario/2001-06-06/e-01701.htm
+# ... The Law itself is "Ley No 25155", sanctioned on 1999-08-25, enacted
+# 1999-09-17, and published 1999-09-21.  The official publication is at:
+# http://www.boletin.jus.gov.ar/BON/Primera/1999/09-Septiembre/21/PDF/BO21-09-99LEG.PDF
+# Regretfully, you have to subscribe (and pay) for the on-line version....
+#
+# (2001-06-12):
+# the timezone for Argentina will not change next Sunday.
+# Apparently it will do so on Sunday 24th....
+# http://ar.clarin.com/diario/2001-06-12/s-03501.htm
+#
+# (2001-06-25):
+# Last Friday (yes, the last working day before the date of the change), the
+# Senate annulled the 1999 law that introduced the changes later postponed.
+# http://www.clarin.com.ar/diario/2001-06-22/s-03601.htm
+# It remains the vote of the Deputies..., but it will be the same....
+# This kind of things had always been done this way in Argentina.
+# We are still -03:00 all year round in all of the country.
+#
+# From Steffen Thorsen (2007-12-21):
+# A user (Leonardo Chaim) reported that Argentina will adopt DST....
+# all of the country (all Zone-entries) are affected.  News reports like
+# http://www.lanacion.com.ar/opinion/nota.asp?nota_id=973037 indicate
+# that Argentina will use DST next year as well, from October to
+# March, although exact rules are not given.
+#
+# From Jesper Norgaard Welen (2007-12-26)
+# The last hurdle of Argentina DST is over, the proposal was approved in
+# the lower chamber too (Deputados) with a vote 192 for and 2 against.
+# By the way thanks to Mariano Absatz and Daniel Mario Vega for the link to
+# the original scanned proposal, where the dates and the zero hours are
+# clear and unambiguous...This is the article about final approval:
+# <a href="http://www.lanacion.com.ar/politica/nota.asp?nota_id=973996">
+# http://www.lanacion.com.ar/politica/nota.asp?nota_id=973996
+# </a>
+#
+# From Paul Eggert (2007-12-22):
+# For dates after mid-2008, the following rules are my guesses and
+# are quite possibly wrong, but are more likely than no DST at all.
+
+# From Alexander Krivenyshev (2008-09-05):
+# As per message from Carlos Alberto Fonseca Arauz (Nicaragua),
+# Argentina will start DST on Sunday October 19, 2008.
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_argentina03.html">
+# http://www.worldtimezone.com/dst_news/dst_news_argentina03.html
+# </a>
+# OR
+# <a href="http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)">
+# http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)
+# </a>
+
+# From Rodrigo Severo (2008-10-06):
+# Here is some info available at a Gentoo bug related to TZ on Argentina's DST:
+# ...
+# ------- Comment #1 from [jmdocile]  2008-10-06 16:28 0000 -------
+# Hi, there is a problem with timezone-data-2008e and maybe with
+# timezone-data-2008f
+# Argentinian law [Number] 25.155 is no longer valid.
+# <a href="http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm">
+# http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm
+# </a>
+# The new one is law [Number] 26.350
+# <a href="http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm">
+# http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm
+# </a>
+# So there is no summer time in Argentina for now.
+
+# From Mariano Absatz (2008-10-20):
+# Decree 1693/2008 applies Law 26.350 for the summer 2008/2009 establishing DST in Argentina
+# From 2008-10-19 until 2009-03-15
+# <a href="http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=16102008&pi=3&pf=4&s=0&sec=01">
+# http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=16102008&pi=3&pf=4&s=0&sec=01
+# </a>
+#
+# Decree 1705/2008 excepting 12 Provinces from applying DST in the summer 2008/2009:
+# Catamarca, La Rioja, Mendoza, Salta, San Juan, San Luis, La Pampa, Neuquen, Rio Negro, Chubut, Santa Cruz
+# and Tierra del Fuego
+# <a href="http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=17102008&pi=1&pf=1&s=0&sec=01">
+# http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=17102008&pi=1&pf=1&s=0&sec=01
+# </a>
+#
+# Press release 235 dated Saturday October 18th, from the Government of the Province of Jujuy saying
+# it will not apply DST either (even when it was not included in Decree 1705/2008)
+# <a href="http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc">
+# http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc
+# </a>
+
+Rule   Arg     2007    only    -       Dec     30      0:00    1:00    S
+Rule   Arg     2008    max     -       Mar     Sun>=15 0:00    0       -
+Rule   Arg     2008    max     -       Oct     Sun>=15 0:00    1:00    S
+# From Mariano Absatz (2004-05-21):
+# Today it was officially published that the Province of Mendoza is changing
+# its timezone this winter... starting tomorrow night....
+# http://www.gobernac.mendoza.gov.ar/boletin/pdf/20040521-27158-normas.pdf
+# From Paul Eggert (2004-05-24):
+# It's Law No. 7,210.  This change is due to a public power emergency, so for
+# now we'll assume it's for this year only.
+#
+# From Paul Eggert (2006-03-22):
+# <a href="http://www.spicasc.net/horvera.html">
+# Hora de verano para la Republica Argentina (2003-06-08)
+# </a> says that standard time in Argentina from 1894-10-31
+# to 1920-05-01 was -4:16:48.25.  Go with this more-precise value
+# over Shanks & Pottenger.
+#
+# From Mariano Absatz (2004-06-05):
+# These media articles from a major newspaper mostly cover the current state:
+# http://www.lanacion.com.ar/04/05/27/de_604825.asp
+# http://www.lanacion.com.ar/04/05/28/de_605203.asp
+#
+# The following eight (8) provinces pulled clocks back to UTC-04:00 at
+# midnight Monday May 31st. (that is, the night between 05/31 and 06/01).
+# Apparently, all nine provinces would go back to UTC-03:00 at the same
+# time in October 17th.
+#
+# Catamarca, Chubut, La Rioja, San Juan, San Luis, Santa Cruz,
+# Tierra del Fuego, Tucuman.
+#
+# From Mariano Absatz (2004-06-14):
+# ... this weekend, the Province of Tucuman decided it'd go back to UTC-03:00
+# yesterday midnight (that is, at 24:00 Saturday 12th), since the people's
+# annoyance with the change is much higher than the power savings obtained....
+#
+# From Gwillim Law (2004-06-14):
+# http://www.lanacion.com.ar/04/06/10/de_609078.asp ...
+#     "The time change in Tierra del Fuego was a conflicted decision from
+#   the start.  The government had decreed that the measure would take
+#   effect on June 1, but a normative error forced the new time to begin
+#   three days earlier, from a Saturday to a Sunday....
+# Our understanding was that the change was originally scheduled to take place
+# on June 1 at 00:00 in Chubut, Santa Cruz, Tierra del Fuego (and some other
+# provinces).  Sunday was May 30, only two days earlier.  So the article
+# contains a contradiction.  I would give more credence to the Saturday/Sunday
+# date than the "three days earlier" phrase, and conclude that Tierra del
+# Fuego set its clocks back at 2004-05-30 00:00.
+#
+# From Steffen Thorsen (2004-10-05):
+# The previous law 7210 which changed the province of Mendoza's time zone
+# back in May have been modified slightly in a new law 7277, which set the
+# new end date to 2004-09-26 (original date was 2004-10-17).
+# http://www.gobernac.mendoza.gov.ar/boletin/pdf/20040924-27244-normas.pdf
+#
+# From Mariano Absatz (2004-10-05):
+# San Juan changed from UTC-03:00 to UTC-04:00 at midnight between
+# Sunday, May 30th and Monday, May 31st.  It changed back to UTC-03:00
+# at midnight between Saturday, July 24th and Sunday, July 25th....
+# http://www.sanjuan.gov.ar/prensa/archivo/000329.html
+# http://www.sanjuan.gov.ar/prensa/archivo/000426.html
+# http://www.sanjuan.gov.ar/prensa/archivo/000441.html
+
+# From Alex Krivenyshev (2008-01-17):
+# Here are articles that Argentina Province San Luis is planning to end DST
+# as earlier as upcoming Monday January 21, 2008 or February 2008:
+#
+# Provincia argentina retrasa reloj y marca diferencia con resto del pais
+# (Argentine Province delayed clock and mark difference with the rest of the
+# country)
+# <a href="http://cl.invertia.com/noticias/noticia.aspx?idNoticia=200801171849_EFE_ET4373&idtel">
+# http://cl.invertia.com/noticias/noticia.aspx?idNoticia=200801171849_EFE_ET4373&idtel
+# </a>
+#
+# Es inminente que en San Luis atrasen una hora los relojes
+# (It is imminent in San Luis clocks one hour delay)
+# <a href="http://www.lagaceta.com.ar/vernotae.asp?id_nota=253414">
+# http://www.lagaceta.com.ar/vernotae.asp?id_nota=253414
+# </a>
+#
+# <a href="http://www.worldtimezone.net/dst_news/dst_news_argentina02.html">
+# http://www.worldtimezone.net/dst_news/dst_news_argentina02.html
+# </a>
+
+# From Jesper Norgaard Welen (2008-01-18):
+# The page of the San Luis provincial government
+# <a href="http://www.sanluis.gov.ar/notas.asp?idCanal=0&id=22812">
+# http://www.sanluis.gov.ar/notas.asp?idCanal=0&id=22812
+# </a>
+# confirms what Alex Krivenyshev has earlier sent to the tz
+# emailing list about that San Luis plans to return to standard
+# time much earlier than the rest of the country. It also
+# confirms that upon request the provinces San Juan and Mendoza 
+# refused to follow San Luis in this change. 
+# 
+# The change is supposed to take place Monday the 21.st at 0:00
+# hours. As far as I understand it if this goes ahead, we need
+# a new timezone for San Luis (although there are also documented
+# independent changes in the southamerica file of San Luis in
+# 1990 and 1991 which has not been confirmed).
+
+# From Jesper Norgaard Welen (2008-01-25):
+# Unfortunately the below page has become defunct, about the San Luis
+# time change. Perhaps because it now is part of a group of pages "Most
+# important pages of 2008."
+#
+# You can use
+# <a href="http://www.sanluis.gov.ar/notas.asp?idCanal=8141&id=22834">
+# http://www.sanluis.gov.ar/notas.asp?idCanal=8141&id=22834
+# </a>
+# instead it seems. Or use "Buscador" from the main page of the San Luis
+# government, and fill in "huso" and click OK, and you will get 3 pages
+# from which the first one is identical to the above.
+
+# From Mariano Absatz (2008-01-28):
+# I can confirm that the Province of San Luis (and so far only that
+# province) decided to go back to UTC-3 effective midnight Jan 20th 2008
+# (that is, Monday 21st at 0:00 is the time the clocks were delayed back
+# 1 hour), and they intend to keep UTC-3 as their timezone all year round
+# (that is, unless they change their mind any minute now).
+#
+# So we'll have to add yet another city to 'southamerica' (I think San
+# Luis city is the mos populated city in the Province, so it'd be
+# America/Argentina/San_Luis... of course I can't remember if San Luis's
+# history of particular changes goes along with Mendoza or San Juan :-(
+# (I only remember not being able to collect hard facts about San Luis
+# back in 2004, when these provinces changed to UTC-4 for a few days, I
+# mailed them personally and never got an answer).
+
+# From Paul Eggert (2008-06-30):
+# Unless otherwise specified, data are from Shanks & Pottenger through 1992,
+# from the IATA otherwise.  As noted below, Shanks & Pottenger say that
+# America/Cordoba split into 6 subregions during 1991/1992, one of which
+# was America/San_Luis, but we haven't verified this yet so for now we'll
+# keep America/Cordoba a single region rather than splitting it into the
+# other 5 subregions.
+
+# From Mariano Absatz (2009-03-13):
+# Yesterday (with our usual 2-day notice) the Province of San Luis
+# decided that next Sunday instead of "staying" @utc-03:00 they will go
+# to utc-04:00 until the second Saturday in October...
+#
+# The press release is at
+# <a href="http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102">
+# http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102
+# </a>
+# (I couldn't find the decree, but
+# <a href="http://www.sanluis.gov.ar">
+# www.sanluis.gov.ar
+# <a/>
+# is the official page for the Province Government).
+#
+# There's also a note in only one of the major national papers (La Nación) at
+# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
+# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
+# </a>
+# 
+# The press release says:
+#  (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
+# atrasar una hora sus relojes.
+#
+# A partir de entonces, San Luis establecerá el huso horario propio de
+# la Provincia. De esta manera, durante el periodo del calendario anual
+# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
+# domingo de marzo y las 24:00 del segundo sábado de octubre.
+# Quick&dirty translation
+# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
+# inhabitants) will have to turn back one hour their clocks
+#
+# Since then, San Luis will establish its own Province timezone. Thus,
+# during 2009, this timezone change will run from 00:00 the third Sunday
+# in March until 24:00 of the second Saturday in October.
+
+# From Arthur David Olson (2009-03-16):
+# The unofficial claim at
+# <a href="http://www.timeanddate.com/news/time/san-luis-new-time-zone.html">
+# http://www.timeanddate.com/news/time/san-luis-new-time-zone.html
+# </a>
+# is that "The province will most likely follow the next daylight saving schedule,
+# which is planned for the second Sunday in October."
+
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+#
+# Buenos Aires (BA), Capital Federal (CF),
+Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
+                       -4:16:48 -      CMT     1920 May # Cordoba Mean Time
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   Arg     AR%sT
+#
+# Cordoba (CB), Santa Fe (SF), Entre Rios (ER), Corrientes (CN), Misiones (MN),
+# Chaco (CC), Formosa (FM), Santiago del Estero (SE)
+#
+# Shanks & Pottenger also make the following claims, which we haven't verified:
+# - Formosa switched to -3:00 on 1991-01-07.
+# - Misiones switched to -3:00 on 1990-12-29.
+# - Chaco switched to -3:00 on 1991-01-04.
+# - Santiago del Estero switched to -4:00 on 1991-04-01,
+#   then to -3:00 on 1991-04-26.
+#
+Zone America/Argentina/Cordoba -4:16:48 - LMT  1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1991 Mar  3
+                       -4:00   -       WART    1991 Oct 20
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   Arg     AR%sT
+#
+# Salta (SA), La Pampa (LP), Neuquen (NQ), Rio Negro (RN)
+Zone America/Argentina/Salta -4:21:40 - LMT    1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1991 Mar  3
+                       -4:00   -       WART    1991 Oct 20
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+#
+# Tucuman (TM)
+Zone America/Argentina/Tucuman -4:20:52 - LMT  1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1991 Mar  3
+                       -4:00   -       WART    1991 Oct 20
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   -       ART     2004 Jun  1
+                       -4:00   -       WART    2004 Jun 13
+                       -3:00   Arg     AR%sT
+#
+# La Rioja (LR)
+Zone America/Argentina/La_Rioja -4:27:24 - LMT 1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1991 Mar  1
+                       -4:00   -       WART    1991 May  7
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   -       ART     2004 Jun  1
+                       -4:00   -       WART    2004 Jun 20
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+#
+# San Juan (SJ)
+Zone America/Argentina/San_Juan -4:34:04 - LMT 1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1991 Mar  1
+                       -4:00   -       WART    1991 May  7
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   -       ART     2004 May 31
+                       -4:00   -       WART    2004 Jul 25
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+#
+# Jujuy (JY)
+Zone America/Argentina/Jujuy -4:21:12 -        LMT     1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1990 Mar  4
+                       -4:00   -       WART    1990 Oct 28
+                       -4:00   1:00    WARST   1991 Mar 17
+                       -4:00   -       WART    1991 Oct  6
+                       -3:00   1:00    ARST    1992
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+#
+# Catamarca (CT), Chubut (CH)
+Zone America/Argentina/Catamarca -4:23:08 - LMT        1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1991 Mar  3
+                       -4:00   -       WART    1991 Oct 20
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   -       ART     2004 Jun  1
+                       -4:00   -       WART    2004 Jun 20
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+#
+# Mendoza (MZ)
+Zone America/Argentina/Mendoza -4:35:16 - LMT  1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1990 Mar  4
+                       -4:00   -       WART    1990 Oct 15
+                       -4:00   1:00    WARST   1991 Mar  1
+                       -4:00   -       WART    1991 Oct 15
+                       -4:00   1:00    WARST   1992 Mar  1
+                       -4:00   -       WART    1992 Oct 18
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   -       ART     2004 May 23
+                       -4:00   -       WART    2004 Sep 26
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+#
+# San Luis (SL)
+Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
+                       -4:16:48 -      CMT     1920 May
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1990
+                       -3:00   1:00    ARST    1990 Mar 14
+                       -4:00   -       WART    1990 Oct 15
+                       -4:00   1:00    WARST   1991 Mar  1
+                       -4:00   -       WART    1991 Jun  1
+                       -3:00   -       ART     1999 Oct  3
+                       -4:00   1:00    WARST   2000 Mar  3
+                       -3:00   -       ART     2004 May 31
+                       -4:00   -       WART    2004 Jul 25
+                       -3:00   Arg     AR%sT   2008 Jan 21
+                       -3:00   -       ART     2009 Mar 15
+                       -4:00   Arg     WAR%sT
+#
+# Santa Cruz (SC)
+Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
+                       -4:16:48 -      CMT     1920 May # Cordoba Mean Time
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   -       ART     2004 Jun  1
+                       -4:00   -       WART    2004 Jun 20
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+#
+# Tierra del Fuego, Antartida e Islas del Atlantico Sur (TF)
+Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
+                       -4:16:48 -      CMT     1920 May # Cordoba Mean Time
+                       -4:00   -       ART     1930 Dec
+                       -4:00   Arg     AR%sT   1969 Oct  5
+                       -3:00   Arg     AR%sT   1999 Oct  3
+                       -4:00   Arg     AR%sT   2000 Mar  3
+                       -3:00   -       ART     2004 May 30
+                       -4:00   -       WART    2004 Jun 20
+                       -3:00   Arg     AR%sT   2008 Oct 18
+                       -3:00   -       ART
+
+# Aruba
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Aruba   -4:40:24 -      LMT     1912 Feb 12     # Oranjestad
+                       -4:30   -       ANT     1965 # Netherlands Antilles Time
+                       -4:00   -       AST
+
+# Bolivia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/La_Paz  -4:32:36 -      LMT     1890
+                       -4:32:36 -      CMT     1931 Oct 15 # Calamarca MT
+                       -4:32:36 1:00   BOST    1932 Mar 21 # Bolivia ST
+                       -4:00   -       BOT     # Bolivia Time
+
+# Brazil
+
+# From Paul Eggert (1993-11-18):
+# The mayor of Rio recently attempted to change the time zone rules
+# just in his city, in order to leave more summer time for the tourist trade.
+# The rule change lasted only part of the day;
+# the federal government refused to follow the city's rules, and business
+# was in a chaos, so the mayor backed down that afternoon.
+
+# From IATA SSIM (1996-02):
+# _Only_ the following states in BR1 observe DST: Rio Grande do Sul (RS),
+# Santa Catarina (SC), Parana (PR), Sao Paulo (SP), Rio de Janeiro (RJ),
+# Espirito Santo (ES), Minas Gerais (MG), Bahia (BA), Goias (GO),
+# Distrito Federal (DF), Tocantins (TO), Sergipe [SE] and Alagoas [AL].
+# [The last three states are new to this issue of the IATA SSIM.]
+
+# From Gwillim Law (1996-10-07):
+# Geography, history (Tocantins was part of Goias until 1989), and other
+# sources of time zone information lead me to believe that AL, SE, and TO were
+# always in BR1, and so the only change was whether or not they observed DST....
+# The earliest issue of the SSIM I have is 2/91.  Each issue from then until
+# 9/95 says that DST is observed only in the ten states I quoted from 9/95,
+# along with Mato Grosso (MT) and Mato Grosso do Sul (MS), which are in BR2
+# (UTC-4)....  The other two time zones given for Brazil are BR3, which is
+# UTC-5, no DST, and applies only in the state of Acre (AC); and BR4, which is
+# UTC-2, and applies to Fernando de Noronha (formerly FN, but I believe it's
+# become part of the state of Pernambuco).  The boundary between BR1 and BR2
+# has never been clearly stated.  They've simply been called East and West.
+# However, some conclusions can be drawn from another IATA manual: the Airline
+# Coding Directory, which lists close to 400 airports in Brazil.  For each
+# airport it gives a time zone which is coded to the SSIM.  From that
+# information, I'm led to conclude that the states of Amapa (AP), Ceara (CE),
+# Maranhao (MA), Paraiba (PR), Pernambuco (PE), Piaui (PI), and Rio Grande do
+# Norte (RN), and the eastern part of Para (PA) are all in BR1 without DST.
+
+# From Marcos Tadeu (1998-09-27):
+# <a href="http://pcdsh01.on.br/verao1.html">
+# Brazilian official page
+# </a>
+
+# From Jesper Norgaard (2000-11-03):
+# [For an official list of which regions in Brazil use which time zones, see:]
+# http://pcdsh01.on.br/Fusbr.htm
+# http://pcdsh01.on.br/Fusbrhv.htm
+
+# From Celso Doria via David Madeo (2002-10-09):
+# The reason for the delay this year has to do with elections in Brazil.
+#
+# Unlike in the United States, elections in Brazil are 100% computerized and
+# the results are known almost immediately.  Yesterday, it was the first
+# round of the elections when 115 million Brazilians voted for President,
+# Governor, Senators, Federal Deputies, and State Deputies.  Nobody is
+# counting (or re-counting) votes anymore and we know there will be a second
+# round for the Presidency and also for some Governors.  The 2nd round will
+# take place on October 27th.
+#
+# The reason why the DST will only begin November 3rd is that the thousands
+# of electoral machines used cannot have their time changed, and since the
+# Constitution says the elections must begin at 8:00 AM and end at 5:00 PM,
+# the Government decided to postpone DST, instead of changing the Constitution
+# (maybe, for the next elections, it will be possible to change the clock)...
+
+# From Rodrigo Severo (2004-10-04):
+# It's just the biannual change made necessary by the much hyped, supposedly
+# modern Brazilian eletronic voting machines which, apparently, can't deal
+# with a time change between the first and the second rounds of the elections.
+
+# From Steffen Thorsen (2007-09-20):
+# Brazil will start DST on 2007-10-14 00:00 and end on 2008-02-17 00:00:
+# http://www.mme.gov.br/site/news/detail.do;jsessionid=BBA06811AFCAAC28F0285210913513DA?newsId=13975
+
+# From Paul Schulze (2008-06-24):
+# ...by law number 11.662 of April 24, 2008 (published in the "Diario
+# Oficial da Uniao"...) in Brazil there are changes in the timezones,
+# effective today (00:00am at June 24, 2008) as follows:
+#
+# a) The timezone UTC+5 is e[x]tinguished, with all the Acre state and the
+# part of the Amazonas state that had this timezone now being put to the
+# timezone UTC+4
+# b) The whole Para state now is put at timezone UTC+3, instead of just
+# part of it, as was before.
+#
+# This change follows a proposal of senator Tiao Viana of Acre state, that
+# proposed it due to concerns about open television channels displaying
+# programs inappropriate to youths in the states that had the timezone
+# UTC+5 too early in the night. In the occasion, some more corrections
+# were proposed, trying to unify the timezones of any given state. This
+# change modifies timezone rules defined in decree 2.784 of 18 June,
+# 1913.
+
+# From Rodrigo Severo (2008-06-24):
+# Just correcting the URL:
+# <a href="https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=3Ddo&secao=3D1&pagina=3D1&data=3D25/04/2008">
+# https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=3Ddo&secao=3D1&pagina=3D1&data=3D25/04/2008
+# </a>
+#
+# As a result of the above Decree I believe the America/Rio_Branco
+# timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall
+# be created to represent the the west side of the Para State. I
+# suggest this new timezone be called Santarem as the most
+# important/populated city in the affected area.
+#
+# This new timezone would be the same as the Rio_Branco timezone up to
+# the 2008/06/24 change which would be to UTC-3 instead of UTC-4.
+
+# From Alex Krivenyshev (2008-06-24):
+# This is a quick reference page for New and Old Brazil Time Zones map.
+# <a href="http://www.worldtimezone.com/brazil-time-new-old.php">
+# http://www.worldtimezone.com/brazil-time-new-old.php
+# </a>
+#
+# - 4 time zones replaced by 3 time zones-eliminating time zone UTC- 05
+# (state Acre and the part of the Amazonas will be UTC/GMT- 04) - western
+# part of Par state is moving to one timezone UTC- 03 (from UTC -04).
+
+# From Paul Eggert (2002-10-10):
+# The official decrees referenced below are mostly taken from
+# <a href="http://pcdsh01.on.br/DecHV.html">
+# Decretos sobre o Horario de Verao no Brasil
+# </a>.
+
+# From Steffen Thorsen (2008-08-29):
+# As announced by the government and many newspapers in Brazil late
+# yesterday, Brazil will start DST on 2008-10-19 (need to change rule) and
+# it will end on 2009-02-15 (current rule for Brazil is fine). Based on
+# past years experience with the elections, there was a good chance that
+# the start was postponed to November, but it did not happen this year.
+#
+# It has not yet been posted to http://pcdsh01.on.br/DecHV.html
+#
+# An official page about it:
+# <a href="http://www.mme.gov.br/site/news/detail.do?newsId=16722">
+# http://www.mme.gov.br/site/news/detail.do?newsId=16722
+# </a>
+# Note that this link does not always work directly, but must be accessed
+# by going to
+# <a href="http://www.mme.gov.br/first">
+# http://www.mme.gov.br/first
+# </a>
+#
+# One example link that works directly:
+# <a href="http://jornale.com.br/index.php?option=com_content&task=view&id=13530&Itemid=54">
+# http://jornale.com.br/index.php?option=com_content&task=view&id=13530&Itemid=54
+# (Portuguese)
+# </a>
+#
+# We have a written a short article about it as well:
+# <a href="http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html">
+# http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
+# </a>
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# Decree <a href="http://pcdsh01.on.br/HV20466.htm">20,466</a> (1931-10-01)
+# Decree <a href="http://pcdsh01.on.br/HV21896.htm">21,896</a> (1932-01-10)
+Rule   Brazil  1931    only    -       Oct      3      11:00   1:00    S
+Rule   Brazil  1932    1933    -       Apr      1       0:00   0       -
+Rule   Brazil  1932    only    -       Oct      3       0:00   1:00    S
+# Decree <a href="http://pcdsh01.on.br/HV23195.htm">23,195</a> (1933-10-10)
+# revoked DST.
+# Decree <a href="http://pcdsh01.on.br/HV27496.htm">27,496</a> (1949-11-24)
+# Decree <a href="http://pcdsh01.on.br/HV27998.htm">27,998</a> (1950-04-13)
+Rule   Brazil  1949    1952    -       Dec      1       0:00   1:00    S
+Rule   Brazil  1950    only    -       Apr     16       1:00   0       -
+Rule   Brazil  1951    1952    -       Apr      1       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV32308.htm">32,308</a> (1953-02-24)
+Rule   Brazil  1953    only    -       Mar      1       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV34724.htm">34,724</a> (1953-11-30)
+# revoked DST.
+# Decree <a href="http://pcdsh01.on.br/HV52700.htm">52,700</a> (1963-10-18)
+# established DST from 1963-10-23 00:00 to 1964-02-29 00:00
+# in SP, RJ, GB, MG, ES, due to the prolongation of the drought.
+# Decree <a href="http://pcdsh01.on.br/HV53071.htm">53,071</a> (1963-12-03)
+# extended the above decree to all of the national territory on 12-09.
+Rule   Brazil  1963    only    -       Dec      9       0:00   1:00    S
+# Decree <a href="http://pcdsh01.on.br/HV53604.htm">53,604</a> (1964-02-25)
+# extended summer time by one day to 1964-03-01 00:00 (start of school).
+Rule   Brazil  1964    only    -       Mar      1       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV55639.htm">55,639</a> (1965-01-27)
+Rule   Brazil  1965    only    -       Jan     31       0:00   1:00    S
+Rule   Brazil  1965    only    -       Mar     31       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV57303.htm">57,303</a> (1965-11-22)
+Rule   Brazil  1965    only    -       Dec      1       0:00   1:00    S
+# Decree <a href="http://pcdsh01.on.br/HV57843.htm">57,843</a> (1966-02-18)
+Rule   Brazil  1966    1968    -       Mar      1       0:00   0       -
+Rule   Brazil  1966    1967    -       Nov      1       0:00   1:00    S
+# Decree <a href="http://pcdsh01.on.br/HV63429.htm">63,429</a> (1968-10-15)
+# revoked DST.
+# Decree <a href="http://pcdsh01.on.br/HV91698.htm">91,698</a> (1985-09-27)
+Rule   Brazil  1985    only    -       Nov      2       0:00   1:00    S
+# Decree 92,310 (1986-01-21)
+# Decree 92,463 (1986-03-13)
+Rule   Brazil  1986    only    -       Mar     15       0:00   0       -
+# Decree 93,316 (1986-10-01)
+Rule   Brazil  1986    only    -       Oct     25       0:00   1:00    S
+Rule   Brazil  1987    only    -       Feb     14       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV94922.htm">94,922</a> (1987-09-22)
+Rule   Brazil  1987    only    -       Oct     25       0:00   1:00    S
+Rule   Brazil  1988    only    -       Feb      7       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV96676.htm">96,676</a> (1988-09-12)
+# except for the states of AC, AM, PA, RR, RO, and AP (then a territory)
+Rule   Brazil  1988    only    -       Oct     16       0:00   1:00    S
+Rule   Brazil  1989    only    -       Jan     29       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV98077.htm">98,077</a> (1989-08-21)
+# with the same exceptions
+Rule   Brazil  1989    only    -       Oct     15       0:00   1:00    S
+Rule   Brazil  1990    only    -       Feb     11       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV99530.htm">99,530</a> (1990-09-17)
+# adopted by RS, SC, PR, SP, RJ, ES, MG, GO, MS, DF.
+# Decree 99,629 (1990-10-19) adds BA, MT.
+Rule   Brazil  1990    only    -       Oct     21       0:00   1:00    S
+Rule   Brazil  1991    only    -       Feb     17       0:00   0       -
+# <a href="http://pcdsh01.on.br/HV1991.htm">Unnumbered decree</a> (1991-09-25)
+# adopted by RS, SC, PR, SP, RJ, ES, MG, BA, GO, MT, MS, DF.
+Rule   Brazil  1991    only    -       Oct     20       0:00   1:00    S
+Rule   Brazil  1992    only    -       Feb      9       0:00   0       -
+# <a href="http://pcdsh01.on.br/HV1992.htm">Unnumbered decree</a> (1992-10-16)
+# adopted by same states.
+Rule   Brazil  1992    only    -       Oct     25       0:00   1:00    S
+Rule   Brazil  1993    only    -       Jan     31       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV942.htm">942</a> (1993-09-28)
+# adopted by same states, plus AM.
+# Decree <a href="http://pcdsh01.on.br/HV1252.htm">1,252</a> (1994-09-22;
+# web page corrected 2004-01-07) adopted by same states, minus AM.
+# Decree <a href="http://pcdsh01.on.br/HV1636.htm">1,636</a> (1995-09-14)
+# adopted by same states, plus MT and TO.
+# Decree <a href="http://pcdsh01.on.br/HV1674.htm">1,674</a> (1995-10-13)
+# adds AL, SE.
+Rule   Brazil  1993    1995    -       Oct     Sun>=11  0:00   1:00    S
+Rule   Brazil  1994    1995    -       Feb     Sun>=15  0:00   0       -
+Rule   Brazil  1996    only    -       Feb     11       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/HV2000.htm">2,000</a> (1996-09-04)
+# adopted by same states, minus AL, SE.
+Rule   Brazil  1996    only    -       Oct      6       0:00   1:00    S
+Rule   Brazil  1997    only    -       Feb     16       0:00   0       -
+# From Daniel C. Sobral (1998-02-12):
+# In 1997, the DS began on October 6. The stated reason was that
+# because international television networks ignored Brazil's policy on DS,
+# they bought the wrong times on satellite for coverage of Pope's visit.
+# This year, the ending date of DS was postponed to March 1
+# to help dealing with the shortages of electric power.
+#
+# Decree 2,317 (1997-09-04), adopted by same states.
+Rule   Brazil  1997    only    -       Oct      6       0:00   1:00    S
+# Decree <a href="http://pcdsh01.on.br/figuras/HV2495.JPG">2,495</a>
+# (1998-02-10)
+Rule   Brazil  1998    only    -       Mar      1       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/figuras/Hv98.jpg">2,780</a> (1998-09-11)
+# adopted by the same states as before.
+Rule   Brazil  1998    only    -       Oct     11       0:00   1:00    S
+Rule   Brazil  1999    only    -       Feb     21       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/figuras/HV3150.gif">3,150</a>
+# (1999-08-23) adopted by same states.
+# Decree <a href="http://pcdsh01.on.br/DecHV99.gif">3,188</a> (1999-09-30)
+# adds SE, AL, PB, PE, RN, CE, PI, MA and RR.
+Rule   Brazil  1999    only    -       Oct      3       0:00   1:00    S
+Rule   Brazil  2000    only    -       Feb     27       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/DEC3592.htm">3,592</a> (2000-09-06)
+# adopted by the same states as before.
+# Decree <a href="http://pcdsh01.on.br/Dec3630.jpg">3,630</a> (2000-10-13)
+# repeals DST in PE and RR, effective 2000-10-15 00:00.
+# Decree <a href="http://pcdsh01.on.br/Dec3632.jpg">3,632</a> (2000-10-17)
+# repeals DST in SE, AL, PB, RN, CE, PI and MA, effective 2000-10-22 00:00.
+# Decree <a href="http://pcdsh01.on.br/figuras/HV3916.gif">3,916</a>
+# (2001-09-13) reestablishes DST in AL, CE, MA, PB, PE, PI, RN, SE.
+Rule   Brazil  2000    2001    -       Oct     Sun>=8   0:00   1:00    S
+Rule   Brazil  2001    2006    -       Feb     Sun>=15  0:00   0       -
+# Decree 4,399 (2002-10-01) repeals DST in AL, CE, MA, PB, PE, PI, RN, SE.
+# <a href="http://www.presidencia.gov.br/CCIVIL/decreto/2002/D4399.htm">4,399</a>
+Rule   Brazil  2002    only    -       Nov      3       0:00   1:00    S
+# Decree 4,844 (2003-09-24; corrected 2003-09-26) repeals DST in BA, MT, TO.
+# <a href="http://www.presidencia.gov.br/CCIVIL/decreto/2003/D4844.htm">4,844</a>
+Rule   Brazil  2003    only    -       Oct     19       0:00   1:00    S
+# Decree 5,223 (2004-10-01) reestablishes DST in MT.
+# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2004-2006/2004/Decreto/D5223.htm">5,223</a>
+Rule   Brazil  2004    only    -       Nov      2       0:00   1:00    S
+# Decree <a href="http://pcdsh01.on.br/DecHV5539.gif">5,539</a> (2005-09-19),
+# adopted by the same states as before.
+Rule   Brazil  2005    only    -       Oct     16       0:00   1:00    S
+# Decree <a href="http://pcdsh01.on.br/DecHV5920.gif">5,920</a> (2006-10-03),
+# adopted by the same states as before.
+Rule   Brazil  2006    only    -       Nov      5       0:00   1:00    S
+Rule   Brazil  2007    only    -       Feb     25       0:00   0       -
+# Decree <a href="http://pcdsh01.on.br/DecHV6212.gif">6,212</a> (2007-09-26),
+# adopted by the same states as before.
+Rule   Brazil  2007    only    -       Oct     Sun>=8   0:00   1:00    S
+# From Frederico A. C. Neves (2008-09-10):
+# Acording to this decree
+# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm">
+# http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
+# </a>
+# [t]he DST period in Brazil now on will be from the 3rd Oct Sunday to the
+# 3rd Feb Sunday. There is an exception on the return date when this is
+# the Carnival Sunday then the return date will be the next Sunday...
+Rule   Brazil  2008    max     -       Oct     Sun>=15 0:00    1:00    S
+Rule   Brazil  2008    2011    -       Feb     Sun>=15 0:00    0       -
+Rule   Brazil  2012    only    -       Feb     Sun>=22 0:00    0       -
+Rule   Brazil  2013    2014    -       Feb     Sun>=15 0:00    0       -
+Rule   Brazil  2015    only    -       Feb     Sun>=22 0:00    0       -
+Rule   Brazil  2016    2022    -       Feb     Sun>=15 0:00    0       -
+Rule   Brazil  2023    only    -       Feb     Sun>=22 0:00    0       -
+Rule   Brazil  2024    2025    -       Feb     Sun>=15 0:00    0       -
+Rule   Brazil  2026    only    -       Feb     Sun>=22 0:00    0       -
+Rule   Brazil  2027    2033    -       Feb     Sun>=15 0:00    0       -
+Rule   Brazil  2034    only    -       Feb     Sun>=22 0:00    0       -
+Rule   Brazil  2035    2036    -       Feb     Sun>=15 0:00    0       -
+Rule   Brazil  2037    only    -       Feb     Sun>=22 0:00    0       -
+# From Arthur David Olson (2008-09-29):
+# The next is wrong in some years but is better than nothing.
+Rule   Brazil  2038    max     -       Feb     Sun>=15 0:00    0       -
+
+# The latest ruleset listed above says that the following states observe DST:
+# DF, ES, GO, MG, MS, MT, PR, RJ, RS, SC, SP.
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+#
+# Fernando de Noronha (administratively part of PE)
+Zone America/Noronha   -2:09:40 -      LMT     1914
+                       -2:00   Brazil  FN%sT   1990 Sep 17
+                       -2:00   -       FNT     1999 Sep 30
+                       -2:00   Brazil  FN%sT   2000 Oct 15
+                       -2:00   -       FNT     2001 Sep 13
+                       -2:00   Brazil  FN%sT   2002 Oct  1
+                       -2:00   -       FNT
+# Other Atlantic islands have no permanent settlement.
+# These include Trindade and Martin Vaz (administratively part of ES),
+# Atol das Rocas (RN), and Penedos de Sao Pedro e Sao Paulo (PE).
+# Fernando de Noronha was a separate territory from 1942-09-02 to 1989-01-01;
+# it also included the Penedos.
+#
+# Amapa (AP), east Para (PA)
+# East Para includes Belem, Maraba, Serra Norte, and Sao Felix do Xingu.
+# The division between east and west Para is the river Xingu.
+# In the north a very small part from the river Javary (now Jari I guess,
+# the border with Amapa) to the Amazon, then to the Xingu.
+Zone America/Belem     -3:13:56 -      LMT     1914
+                       -3:00   Brazil  BR%sT   1988 Sep 12
+                       -3:00   -       BRT
+#
+# west Para (PA)
+# West Para includes Altamira, Oribidos, Prainha, Oriximina, and Santarem.
+Zone America/Santarem  -3:38:48 -      LMT     1914
+                       -4:00   Brazil  AM%sT   1988 Sep 12
+                       -4:00   -       AMT     2008 Jun 24 00:00
+                       -3:00   -       BRT
+#
+# Maranhao (MA), Piaui (PI), Ceara (CE), Rio Grande do Norte (RN),
+# Paraiba (PB)
+Zone America/Fortaleza -2:34:00 -      LMT     1914
+                       -3:00   Brazil  BR%sT   1990 Sep 17
+                       -3:00   -       BRT     1999 Sep 30
+                       -3:00   Brazil  BR%sT   2000 Oct 22
+                       -3:00   -       BRT     2001 Sep 13
+                       -3:00   Brazil  BR%sT   2002 Oct  1
+                       -3:00   -       BRT
+#
+# Pernambuco (PE) (except Atlantic islands)
+Zone America/Recife    -2:19:36 -      LMT     1914
+                       -3:00   Brazil  BR%sT   1990 Sep 17
+                       -3:00   -       BRT     1999 Sep 30
+                       -3:00   Brazil  BR%sT   2000 Oct 15
+                       -3:00   -       BRT     2001 Sep 13
+                       -3:00   Brazil  BR%sT   2002 Oct  1
+                       -3:00   -       BRT
+#
+# Tocantins (TO)
+Zone America/Araguaina -3:12:48 -      LMT     1914
+                       -3:00   Brazil  BR%sT   1990 Sep 17
+                       -3:00   -       BRT     1995 Sep 14
+                       -3:00   Brazil  BR%sT   2003 Sep 24
+                       -3:00   -       BRT
+#
+# Alagoas (AL), Sergipe (SE)
+Zone America/Maceio    -2:22:52 -      LMT     1914
+                       -3:00   Brazil  BR%sT   1990 Sep 17
+                       -3:00   -       BRT     1995 Oct 13
+                       -3:00   Brazil  BR%sT   1996 Sep  4
+                       -3:00   -       BRT     1999 Sep 30
+                       -3:00   Brazil  BR%sT   2000 Oct 22
+                       -3:00   -       BRT     2001 Sep 13
+                       -3:00   Brazil  BR%sT   2002 Oct  1
+                       -3:00   -       BRT
+#
+# Bahia (BA)
+# There are too many Salvadors elsewhere, so use America/Bahia instead
+# of America/Salvador.
+Zone America/Bahia     -2:34:04 -      LMT     1914
+                       -3:00   Brazil  BR%sT   2003 Sep 24
+                       -3:00   -       BRT
+#
+# Goias (GO), Distrito Federal (DF), Minas Gerais (MG),
+# Espirito Santo (ES), Rio de Janeiro (RJ), Sao Paulo (SP), Parana (PR),
+# Santa Catarina (SC), Rio Grande do Sul (RS)
+Zone America/Sao_Paulo -3:06:28 -      LMT     1914
+                       -3:00   Brazil  BR%sT   1963 Oct 23 00:00
+                       -3:00   1:00    BRST    1964
+                       -3:00   Brazil  BR%sT
+#
+# Mato Grosso do Sul (MS)
+Zone America/Campo_Grande -3:38:28 -   LMT     1914
+                       -4:00   Brazil  AM%sT
+#
+# Mato Grosso (MT)
+Zone America/Cuiaba    -3:44:20 -      LMT     1914
+                       -4:00   Brazil  AM%sT   2003 Sep 24
+                       -4:00   -       AMT     2004 Oct  1
+                       -4:00   Brazil  AM%sT
+#
+# Rondonia (RO)
+Zone America/Porto_Velho -4:15:36 -    LMT     1914
+                       -4:00   Brazil  AM%sT   1988 Sep 12
+                       -4:00   -       AMT
+#
+# Roraima (RR)
+Zone America/Boa_Vista -4:02:40 -      LMT     1914
+                       -4:00   Brazil  AM%sT   1988 Sep 12
+                       -4:00   -       AMT     1999 Sep 30
+                       -4:00   Brazil  AM%sT   2000 Oct 15
+                       -4:00   -       AMT
+#
+# east Amazonas (AM): Boca do Acre, Jutai, Manaus, Floriano Peixoto
+# The great circle line from Tabatinga to Porto Acre divides
+# east from west Amazonas.
+Zone America/Manaus    -4:00:04 -      LMT     1914
+                       -4:00   Brazil  AM%sT   1988 Sep 12
+                       -4:00   -       AMT     1993 Sep 28
+                       -4:00   Brazil  AM%sT   1994 Sep 22
+                       -4:00   -       AMT
+#
+# west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant,
+#      Eirunepe, Envira, Ipixuna
+Zone America/Eirunepe  -4:39:28 -      LMT     1914
+                       -5:00   Brazil  AC%sT   1988 Sep 12
+                       -5:00   -       ACT     1993 Sep 28
+                       -5:00   Brazil  AC%sT   1994 Sep 22
+                       -5:00   -       ACT     2008 Jun 24 00:00
+                       -4:00   -       AMT
+#
+# Acre (AC)
+Zone America/Rio_Branco        -4:31:12 -      LMT     1914
+                       -5:00   Brazil  AC%sT   1988 Sep 12
+                       -5:00   -       ACT     2008 Jun 24 00:00
+                       -4:00   -       AMT
+
+# Chile
+
+# From Eduardo Krell (1995-10-19):
+# The law says to switch to DST at midnight [24:00] on the second SATURDAY
+# of October....  The law is the same for March and October.
+# (1998-09-29):
+# Because of the drought this year, the government decided to go into
+# DST earlier (saturday 9/26 at 24:00). This is a one-time change only ...
+# (unless there's another dry season next year, I guess).
+
+# From Julio I. Pacheco Troncoso (1999-03-18):
+# Because of the same drought, the government decided to end DST later,
+# on April 3, (one-time change).
+
+# From Oscar van Vlijmen (2006-10-08):
+# http://www.horaoficial.cl/cambio.htm
+
+# From Jesper Norgaard Welen (2006-10-08):
+# I think that there are some obvious mistakes in the suggested link
+# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4
+# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15
+# (they should have been 1990-09-15 and 1990-09-16 respectively), but
+# anyhow it clears up some doubts too.
+
+# From Paul Eggert (2006-12-27):
+# The following data for Chile and America/Santiago are from
+# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by
+# Jesper Norgaard Welen.  The data for Pacific/Easter are from Shanks
+# & Pottenger, except with DST transitions after 1932 cloned from
+# America/Santiago.  The pre-1980 Pacific/Easter data are dubious,
+# but we have no other source.
+
+# From German Poo-Caaman~o (2008-03-03):
+# Due to drought, Chile extends Daylight Time in three weeks.  This
+# is one-time change (Saturday 3/29 at 24:00 for America/Santiago
+# and Saturday 3/29 at 22:00 for Pacific/Easter)
+# The Supreme Decree is located at 
+# <a href="http://www.shoa.cl/servicios/supremo316.pdf">
+# http://www.shoa.cl/servicios/supremo316.pdf
+# </a>
+# and the instructions for 2008 are located in:
+# <a href="http://www.horaoficial.cl/cambio.htm">
+# http://www.horaoficial.cl/cambio.htm
+# </a>.
+
+# From Jose Miguel Garrido (2008-03-05):
+# ...
+# You could see the announces of the change on 
+# <a href="http://www.shoa.cl/noticias/2008/04hora/hora.htm">
+# http://www.shoa.cl/noticias/2008/04hora/hora.htm
+# </a>.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Chile   1927    1932    -       Sep      1      0:00    1:00    S
+Rule   Chile   1928    1932    -       Apr      1      0:00    0       -
+Rule   Chile   1942    only    -       Jun      1      4:00u   0       -
+Rule   Chile   1942    only    -       Aug      1      5:00u   1:00    S
+Rule   Chile   1946    only    -       Jul     15      4:00u   1:00    S
+Rule   Chile   1946    only    -       Sep      1      3:00u   0:00    -
+Rule   Chile   1947    only    -       Apr      1      4:00u   0       -
+Rule   Chile   1968    only    -       Nov      3      4:00u   1:00    S
+Rule   Chile   1969    only    -       Mar     30      3:00u   0       -
+Rule   Chile   1969    only    -       Nov     23      4:00u   1:00    S
+Rule   Chile   1970    only    -       Mar     29      3:00u   0       -
+Rule   Chile   1971    only    -       Mar     14      3:00u   0       -
+Rule   Chile   1970    1972    -       Oct     Sun>=9  4:00u   1:00    S
+Rule   Chile   1972    1986    -       Mar     Sun>=9  3:00u   0       -
+Rule   Chile   1973    only    -       Sep     30      4:00u   1:00    S
+Rule   Chile   1974    1987    -       Oct     Sun>=9  4:00u   1:00    S
+Rule   Chile   1987    only    -       Apr     12      3:00u   0       -
+Rule   Chile   1988    1989    -       Mar     Sun>=9  3:00u   0       -
+Rule   Chile   1988    only    -       Oct     Sun>=1  4:00u   1:00    S
+Rule   Chile   1989    only    -       Oct     Sun>=9  4:00u   1:00    S
+Rule   Chile   1990    only    -       Mar     18      3:00u   0       -
+Rule   Chile   1990    only    -       Sep     16      4:00u   1:00    S
+Rule   Chile   1991    1996    -       Mar     Sun>=9  3:00u   0       -
+Rule   Chile   1991    1997    -       Oct     Sun>=9  4:00u   1:00    S
+Rule   Chile   1997    only    -       Mar     30      3:00u   0       -
+Rule   Chile   1998    only    -       Mar     Sun>=9  3:00u   0       -
+Rule   Chile   1998    only    -       Sep     27      4:00u   1:00    S
+Rule   Chile   1999    only    -       Apr      4      3:00u   0       -
+Rule   Chile   1999    max     -       Oct     Sun>=9  4:00u   1:00    S
+Rule   Chile   2000    2007    -       Mar     Sun>=9  3:00u   0       -
+# N.B.: the end of March 29 in Chile is March 30 in Universal time,
+# which is used below in specifying the transition.
+Rule   Chile   2008    only    -       Mar     30      3:00u   0       -
+Rule   Chile   2009    max     -       Mar     Sun>=9  3:00u   0       -
+# IATA SSIM anomalies: (1992-02) says 1992-03-14;
+# (1996-09) says 1998-03-08.  Ignore these.
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Santiago  -4:42:46 -      LMT     1890
+                       -4:42:46 -      SMT     1910        # Santiago Mean Time
+                       -5:00   -       CLT     1916 Jul  1 # Chile Time
+                       -4:42:46 -      SMT     1918 Sep  1 # Santiago Mean Time
+                       -4:00   -       CLT     1919 Jul  1 # Chile Time
+                       -4:42:46 -      SMT     1927 Sep  1 # Santiago Mean Time
+                       -5:00   Chile   CL%sT   1947 May 22 # Chile Time
+                       -4:00   Chile   CL%sT
+Zone Pacific/Easter    -7:17:44 -      LMT     1890
+                       -7:17:28 -      EMT     1932 Sep    # Easter Mean Time
+                       -7:00   Chile   EAS%sT  1982 Mar 13 21:00 # Easter I Time
+                       -6:00   Chile   EAS%sT
+#
+# Sala y Gomez Island is like Pacific/Easter.
+# Other Chilean locations, including Juan Fernandez Is, San Ambrosio,
+# San Felix, and Antarctic bases, are like America/Santiago.
+
+# Colombia
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   CO      1992    only    -       May      3      0:00    1:00    S
+Rule   CO      1993    only    -       Apr      4      0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Bogota  -4:56:20 -      LMT     1884 Mar 13
+                       -4:56:20 -      BMT     1914 Nov 23 # Bogota Mean Time
+                       -5:00   CO      CO%sT   # Colombia Time
+# Malpelo, Providencia, San Andres
+# no information; probably like America/Bogota
+
+# Curacao
+#
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say that The Bottom and Philipsburg have been at
+# -4:00 since standard time was introduced on 1912-03-02; and that
+# Kralendijk and Rincon used Kralendijk Mean Time (-4:33:08) from
+# 1912-02-02 to 1965-01-01.  The former is dubious, since S&P also say
+# Saba Island has been like Curacao.
+# This all predates our 1970 cutoff, though.
+#
+# By July 2007 Curacao and St Maarten are planned to become
+# associated states within the Netherlands, much like Aruba;
+# Bonaire, Saba and St Eustatius would become directly part of the
+# Netherlands as Kingdom Islands.  This won't affect their time zones
+# though, as far as we know.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Curacao -4:35:44 -      LMT     1912 Feb 12     # Willemstad
+                       -4:30   -       ANT     1965 # Netherlands Antilles Time
+                       -4:00   -       AST
+
+# Ecuador
+#
+# From Paul Eggert (2007-03-04):
+# Apparently Ecuador had a failed experiment with DST in 1992.
+# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
+# <http://www.hoy.com.ec/NoticiaNue.asp?row_id=249856> (2006-11-06) both
+# talk about "hora Sixto".  Leave this alone for now, as we have no data.
+#
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Guayaquil -5:19:20 -      LMT     1890
+                       -5:14:00 -      QMT     1931 # Quito Mean Time
+                       -5:00   -       ECT          # Ecuador Time
+Zone Pacific/Galapagos -5:58:24 -      LMT     1931 # Puerto Baquerizo Moreno
+                       -5:00   -       ECT     1986
+                       -6:00   -       GALT         # Galapagos Time
+
+# Falklands
+
+# From Paul Eggert (2006-03-22):
+# Between 1990 and 2000 inclusive, Shanks & Pottenger and the IATA agree except
+# the IATA gives 1996-09-08.  Go with Shanks & Pottenger.
+
+# From Falkland Islands Government Office, London (2001-01-22)
+# via Jesper Norgaard:
+# ... the clocks revert back to Local Mean Time at 2 am on Sunday 15
+# April 2001 and advance one hour to summer time at 2 am on Sunday 2
+# September.  It is anticipated that the clocks will revert back at 2
+# am on Sunday 21 April 2002 and advance to summer time at 2 am on
+# Sunday 1 September.
+
+# From Rives McDow (2001-02-13):
+#
+# I have communicated several times with people there, and the last
+# time I had communications that was helpful was in 1998.  Here is
+# what was said then:
+#
+# "The general rule was that Stanley used daylight saving and the Camp
+# did not. However for various reasons many people in the Camp have
+# started to use daylight saving (known locally as 'Stanley Time')
+# There is no rule as to who uses daylight saving - it is a matter of
+# personal choice and so it is impossible to draw a map showing who
+# uses it and who does not. Any list would be out of date as soon as
+# it was produced. This year daylight saving ended on April 18/19th
+# and started again on September 12/13th.  I do not know what the rule
+# is, but can find out if you like.  We do not change at the same time
+# as UK or Chile."
+#
+# I did have in my notes that the rule was "Second Saturday in Sep at
+# 0:00 until third Saturday in Apr at 0:00".  I think that this does
+# not agree in some cases with Shanks; is this true?
+#
+# Also, there is no mention in the list that some areas in the
+# Falklands do not use DST.  I have found in my communications there
+# that these areas are on the western half of East Falkland and all of
+# West Falkland.  Stanley is the only place that consistently observes
+# DST.  Again, as in other places in the world, the farmers don't like
+# it.  West Falkland is almost entirely sheep farmers.
+#
+# I know one lady there that keeps a list of which farm keeps DST and
+# which doesn't each year.  She runs a shop in Stanley, and says that
+# the list changes each year.  She uses it to communicate to her
+# customers, catching them when they are home for lunch or dinner.
+
+# From Paul Eggert (2001-03-05):
+# For now, we'll just record the time in Stanley, since we have no
+# better info.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Falk    1937    1938    -       Sep     lastSun 0:00    1:00    S
+Rule   Falk    1938    1942    -       Mar     Sun>=19 0:00    0       -
+Rule   Falk    1939    only    -       Oct     1       0:00    1:00    S
+Rule   Falk    1940    1942    -       Sep     lastSun 0:00    1:00    S
+Rule   Falk    1943    only    -       Jan     1       0:00    0       -
+Rule   Falk    1983    only    -       Sep     lastSun 0:00    1:00    S
+Rule   Falk    1984    1985    -       Apr     lastSun 0:00    0       -
+Rule   Falk    1984    only    -       Sep     16      0:00    1:00    S
+Rule   Falk    1985    2000    -       Sep     Sun>=9  0:00    1:00    S
+Rule   Falk    1986    2000    -       Apr     Sun>=16 0:00    0       -
+Rule   Falk    2001    max     -       Apr     Sun>=15 2:00    0       -
+Rule   Falk    2001    max     -       Sep     Sun>=1  2:00    1:00    S
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Atlantic/Stanley  -3:51:24 -      LMT     1890
+                       -3:51:24 -      SMT     1912 Mar 12  # Stanley Mean Time
+                       -4:00   Falk    FK%sT   1983 May     # Falkland Is Time
+                       -3:00   Falk    FK%sT   1985 Sep 15
+                       -4:00   Falk    FK%sT
+
+# French Guiana
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Cayenne   -3:29:20 -      LMT     1911 Jul
+                       -4:00   -       GFT     1967 Oct # French Guiana Time
+                       -3:00   -       GFT
+
+# Guyana
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Guyana  -3:52:40 -      LMT     1915 Mar        # Georgetown
+                       -3:45   -       GBGT    1966 May 26 # Br Guiana Time
+                       -3:45   -       GYT     1975 Jul 31 # Guyana Time
+                       -3:00   -       GYT     1991
+# IATA SSIM (1996-06) says -4:00.  Assume a 1991 switch.
+                       -4:00   -       GYT
+
+# Paraguay
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
+# and autumn transitions are from 00:00 -> 23:00.  Go with pre-1999
+# editions of Shanks, and with the IATA, who say transitions occur at 00:00.
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Para    1975    1988    -       Oct      1      0:00    1:00    S
+Rule   Para    1975    1978    -       Mar      1      0:00    0       -
+Rule   Para    1979    1991    -       Apr      1      0:00    0       -
+Rule   Para    1989    only    -       Oct     22      0:00    1:00    S
+Rule   Para    1990    only    -       Oct      1      0:00    1:00    S
+Rule   Para    1991    only    -       Oct      6      0:00    1:00    S
+Rule   Para    1992    only    -       Mar      1      0:00    0       -
+Rule   Para    1992    only    -       Oct      5      0:00    1:00    S
+Rule   Para    1993    only    -       Mar     31      0:00    0       -
+Rule   Para    1993    1995    -       Oct      1      0:00    1:00    S
+Rule   Para    1994    1995    -       Feb     lastSun 0:00    0       -
+Rule   Para    1996    only    -       Mar      1      0:00    0       -
+# IATA SSIM (2000-02) says 1999-10-10; ignore this for now.
+# From Steffen Thorsen (2000-10-02):
+# I have three independent reports that Paraguay changed to DST this Sunday
+# (10-01).
+#
+# Translated by Gwillim Law (2001-02-27) from
+# <a href="http://www.diarionoticias.com.py/011000/nacional/naciona1.htm">
+# Noticias, a daily paper in Asuncion, Paraguay (2000-10-01)
+# </a>:
+# Starting at 0:00 today, the clock will be set forward 60 minutes, in
+# fulfillment of Decree No. 7,273 of the Executive Power....  The time change
+# system has been operating for several years.  Formerly there was a separate
+# decree each year; the new law has the same effect, but permanently.  Every
+# year, the time will change on the first Sunday of October; likewise, the
+# clock will be set back on the first Sunday of March.
+#
+Rule   Para    1996    2001    -       Oct     Sun>=1  0:00    1:00    S
+# IATA SSIM (1997-09) says Mar 1; go with Shanks & Pottenger.
+Rule   Para    1997    only    -       Feb     lastSun 0:00    0       -
+# Shanks & Pottenger say 1999-02-28; IATA SSIM (1999-02) says 1999-02-27, but
+# (1999-09) reports no date; go with above sources and Gerd Knops (2001-02-27).
+Rule   Para    1998    2001    -       Mar     Sun>=1  0:00    0       -
+# From Rives McDow (2002-02-28):
+# A decree was issued in Paraguay (no. 16350) on 2002-02-26 that changed the
+# dst method to be from the first Sunday in September to the first Sunday in
+# April.
+Rule   Para    2002    2004    -       Apr     Sun>=1  0:00    0       -
+Rule   Para    2002    2003    -       Sep     Sun>=1  0:00    1:00    S
+#
+# From Jesper Norgaard Welen (2005-01-02):
+# There are several sources that claim that Paraguay made
+# a timezone rule change in autumn 2004.
+# From Steffen Thorsen (2005-01-05):
+# Decree 1,867 (2004-03-05)
+# From Carlos Raul Perasso via Jesper Norgaard Welen (2006-10-13)
+# <http://www.presidencia.gov.py/decretos/D1867.pdf>
+Rule   Para    2004    max     -       Oct     Sun>=15 0:00    1:00    S
+Rule   Para    2005    max     -       Mar     Sun>=8  0:00    0       -
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Asuncion  -3:50:40 -      LMT     1890
+                       -3:50:40 -      AMT     1931 Oct 10 # Asuncion Mean Time
+                       -4:00   -       PYT     1972 Oct # Paraguay Time
+                       -3:00   -       PYT     1974 Apr
+                       -4:00   Para    PY%sT
+
+# Peru
+#
+# <a href="news:xrGmb.39935$gA1.13896113@news4.srv.hcvlny.cv.net">
+# From Evelyn C. Leeper via Mark Brader (2003-10-26):</a>
+# When we were in Peru in 1985-1986, they apparently switched over
+# sometime between December 29 and January 3 while we were on the Amazon.
+#
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger don't have this transition.  Assume 1986 was like 1987.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   Peru    1938    only    -       Jan      1      0:00    1:00    S
+Rule   Peru    1938    only    -       Apr      1      0:00    0       -
+Rule   Peru    1938    1939    -       Sep     lastSun 0:00    1:00    S
+Rule   Peru    1939    1940    -       Mar     Sun>=24 0:00    0       -
+Rule   Peru    1986    1987    -       Jan      1      0:00    1:00    S
+Rule   Peru    1986    1987    -       Apr      1      0:00    0       -
+Rule   Peru    1990    only    -       Jan      1      0:00    1:00    S
+Rule   Peru    1990    only    -       Apr      1      0:00    0       -
+# IATA is ambiguous for 1993/1995; go with Shanks & Pottenger.
+Rule   Peru    1994    only    -       Jan      1      0:00    1:00    S
+Rule   Peru    1994    only    -       Apr      1      0:00    0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Lima    -5:08:12 -      LMT     1890
+                       -5:08:36 -      LMT     1908 Jul 28 # Lima Mean Time?
+                       -5:00   Peru    PE%sT   # Peru Time
+
+# South Georgia
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone Atlantic/South_Georgia -2:26:08 - LMT     1890            # Grytviken
+                       -2:00   -       GST     # South Georgia Time
+
+# South Sandwich Is
+# uninhabited; scientific personnel have wintered
+
+# Suriname
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Paramaribo        -3:40:40 -      LMT     1911
+                       -3:40:52 -      PMT     1935     # Paramaribo Mean Time
+                       -3:40:36 -      PMT     1945 Oct # The capital moved?
+                       -3:30   -       NEGT    1975 Nov 20 # Dutch Guiana Time
+                       -3:30   -       SRT     1984 Oct # Suriname Time
+                       -3:00   -       SRT
+
+# Trinidad and Tobago
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Port_of_Spain -4:06:04 -  LMT     1912 Mar 2
+                       -4:00   -       AST
+
+# Uruguay
+# From Paul Eggert (1993-11-18):
+# Uruguay wins the prize for the strangest peacetime manipulation of the rules.
+# From Shanks & Pottenger:
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+# Whitman gives 1923 Oct 1; go with Shanks & Pottenger.
+Rule   Uruguay 1923    only    -       Oct      2       0:00   0:30    HS
+Rule   Uruguay 1924    1926    -       Apr      1       0:00   0       -
+Rule   Uruguay 1924    1925    -       Oct      1       0:00   0:30    HS
+Rule   Uruguay 1933    1935    -       Oct     lastSun  0:00   0:30    HS
+# Shanks & Pottenger give 1935 Apr 1 0:00 & 1936 Mar 30 0:00; go with Whitman.
+Rule   Uruguay 1934    1936    -       Mar     Sat>=25 23:30s  0       -
+Rule   Uruguay 1936    only    -       Nov      1       0:00   0:30    HS
+Rule   Uruguay 1937    1941    -       Mar     lastSun  0:00   0       -
+# Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
+Rule   Uruguay 1937    1940    -       Oct     lastSun  0:00   0:30    HS
+# Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
+# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
+Rule   Uruguay 1941    only    -       Aug      1       0:00   0:30    HS
+Rule   Uruguay 1942    only    -       Jan      1       0:00   0       -
+Rule   Uruguay 1942    only    -       Dec     14       0:00   1:00    S
+Rule   Uruguay 1943    only    -       Mar     14       0:00   0       -
+Rule   Uruguay 1959    only    -       May     24       0:00   1:00    S
+Rule   Uruguay 1959    only    -       Nov     15       0:00   0       -
+Rule   Uruguay 1960    only    -       Jan     17       0:00   1:00    S
+Rule   Uruguay 1960    only    -       Mar      6       0:00   0       -
+Rule   Uruguay 1965    1967    -       Apr     Sun>=1   0:00   1:00    S
+Rule   Uruguay 1965    only    -       Sep     26       0:00   0       -
+Rule   Uruguay 1966    1967    -       Oct     31       0:00   0       -
+Rule   Uruguay 1968    1970    -       May     27       0:00   0:30    HS
+Rule   Uruguay 1968    1970    -       Dec      2       0:00   0       -
+Rule   Uruguay 1972    only    -       Apr     24       0:00   1:00    S
+Rule   Uruguay 1972    only    -       Aug     15       0:00   0       -
+Rule   Uruguay 1974    only    -       Mar     10       0:00   0:30    HS
+Rule   Uruguay 1974    only    -       Dec     22       0:00   1:00    S
+Rule   Uruguay 1976    only    -       Oct      1       0:00   0       -
+Rule   Uruguay 1977    only    -       Dec      4       0:00   1:00    S
+Rule   Uruguay 1978    only    -       Apr      1       0:00   0       -
+Rule   Uruguay 1979    only    -       Oct      1       0:00   1:00    S
+Rule   Uruguay 1980    only    -       May      1       0:00   0       -
+Rule   Uruguay 1987    only    -       Dec     14       0:00   1:00    S
+Rule   Uruguay 1988    only    -       Mar     14       0:00   0       -
+Rule   Uruguay 1988    only    -       Dec     11       0:00   1:00    S
+Rule   Uruguay 1989    only    -       Mar     12       0:00   0       -
+Rule   Uruguay 1989    only    -       Oct     29       0:00   1:00    S
+# Shanks & Pottenger say no DST was observed in 1990/1 and 1991/2,
+# and that 1992/3's DST was from 10-25 to 03-01.  Go with IATA.
+Rule   Uruguay 1990    1992    -       Mar     Sun>=1   0:00   0       -
+Rule   Uruguay 1990    1991    -       Oct     Sun>=21  0:00   1:00    S
+Rule   Uruguay 1992    only    -       Oct     18       0:00   1:00    S
+Rule   Uruguay 1993    only    -       Feb     28       0:00   0       -
+# From Eduardo Cota (2004-09-20):
+# The uruguayan government has decreed a change in the local time....
+# http://www.presidencia.gub.uy/decretos/2004091502.htm
+Rule   Uruguay 2004    only    -       Sep     19       0:00   1:00    S
+# From Steffen Thorsen (2005-03-11):
+# Uruguay's DST was scheduled to end on Sunday, 2005-03-13, but in order to
+# save energy ... it was postponed two weeks....
+# http://www.presidencia.gub.uy/_Web/noticias/2005/03/2005031005.htm
+Rule   Uruguay 2005    only    -       Mar     27       2:00   0       -
+# From Eduardo Cota (2005-09-27):
+# http://www.presidencia.gub.uy/_Web/decretos/2005/09/CM%20119_09%2009%202005_00001.PDF
+# This means that from 2005-10-09 at 02:00 local time, until 2006-03-12 at
+# 02:00 local time, official time in Uruguay will be at GMT -2.
+Rule   Uruguay 2005    only    -       Oct      9       2:00   1:00    S
+Rule   Uruguay 2006    only    -       Mar     12       2:00   0       -
+# From Jesper Norgaard Welen (2006-09-06):
+# http://www.presidencia.gub.uy/_web/decretos/2006/09/CM%20210_08%2006%202006_00001.PDF
+Rule   Uruguay 2006    max     -       Oct     Sun>=1   2:00   1:00    S
+Rule   Uruguay 2007    max     -       Mar     Sun>=8   2:00   0       -
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone America/Montevideo        -3:44:44 -      LMT     1898 Jun 28
+                       -3:44:44 -      MMT     1920 May  1     # Montevideo MT
+                       -3:30   Uruguay UY%sT   1942 Dec 14     # Uruguay Time
+                       -3:00   Uruguay UY%sT
+
+# Venezuela
+#
+# From John Stainforth (2007-11-28):
+# ... the change for Venezuela originally expected for 2007-12-31 has
+# been brought forward to 2007-12-09.  The official announcement was
+# published today in the "Gaceta Oficial de la Republica Bolivariana
+# de Venezuela, numero 38.819" (official document for all laws or
+# resolution publication)
+# http://www.globovision.com/news.php?nid=72208
+
+# Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
+Zone   America/Caracas -4:27:44 -      LMT     1890
+                       -4:27:40 -      CMT     1912 Feb 12 # Caracas Mean Time?
+                       -4:30   -       VET     1965         # Venezuela Time
+                       -4:00   -       VET     2007 Dec  9 03:00
+                       -4:30   -       VET
diff --git a/extra/zoneinfo/systemv b/extra/zoneinfo/systemv
new file mode 100644 (file)
index 0000000..6cf9645
--- /dev/null
@@ -0,0 +1,36 @@
+# @(#)systemv  8.1
+
+# Old rules, should the need arise.
+# No attempt is made to handle Newfoundland, since it cannot be expressed
+# using the System V "TZ" scheme (half-hour offset), or anything outside
+# North America (no support for non-standard DST start/end dates), nor
+# the changes in the DST rules in the US after 1976 (which occurred after
+# the old rules were written).
+#
+# If you need the old rules, uncomment ## lines.
+# Compile this *without* leap second correction for true conformance.
+
+# Rule NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule   SystemV min     1973    -       Apr     lastSun 2:00    1:00    D
+Rule   SystemV min     1973    -       Oct     lastSun 2:00    0       S
+Rule   SystemV 1974    only    -       Jan     6       2:00    1:00    D
+Rule   SystemV 1974    only    -       Nov     lastSun 2:00    0       S
+Rule   SystemV 1975    only    -       Feb     23      2:00    1:00    D
+Rule   SystemV 1975    only    -       Oct     lastSun 2:00    0       S
+Rule   SystemV 1976    max     -       Apr     lastSun 2:00    1:00    D
+Rule   SystemV 1976    max     -       Oct     lastSun 2:00    0       S
+
+# Zone NAME            GMTOFF  RULES/SAVE      FORMAT  [UNTIL]
+## Zone        SystemV/AST4ADT -4:00   SystemV         A%sT
+## Zone        SystemV/EST5EDT -5:00   SystemV         E%sT
+## Zone        SystemV/CST6CDT -6:00   SystemV         C%sT
+## Zone        SystemV/MST7MDT -7:00   SystemV         M%sT
+## Zone        SystemV/PST8PDT -8:00   SystemV         P%sT
+## Zone        SystemV/YST9YDT -9:00   SystemV         Y%sT
+## Zone        SystemV/AST4    -4:00   -               AST
+## Zone        SystemV/EST5    -5:00   -               EST
+## Zone        SystemV/CST6    -6:00   -               CST
+## Zone        SystemV/MST7    -7:00   -               MST
+## Zone        SystemV/PST8    -8:00   -               PST
+## Zone        SystemV/YST9    -9:00   -               YST
+## Zone        SystemV/HST10   -10:00  -               HST
diff --git a/extra/zoneinfo/zoneinfo.factor b/extra/zoneinfo/zoneinfo.factor
new file mode 100644 (file)
index 0000000..e298046
--- /dev/null
@@ -0,0 +1,157 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: combinators combinators.smart io.encodings.utf8 io.files
+kernel namespaces sequences splitting unicode.case accessors
+math.parser calendar ;
+IN: zoneinfo
+
+CONSTANT: zoneinfo-paths
+{
+    "vocab:zoneinfo/africa"
+    "vocab:zoneinfo/antarctica"
+    "vocab:zoneinfo/asia"
+    "vocab:zoneinfo/australasia"
+    "vocab:zoneinfo/europe"
+    "vocab:zoneinfo/northamerica"
+    "vocab:zoneinfo/pacificnew"
+    "vocab:zoneinfo/solar87"
+    "vocab:zoneinfo/solar88"
+    "vocab:zoneinfo/solar89"
+    "vocab:zoneinfo/southamerica"
+    "vocab:zoneinfo/systemv"
+    "vocab:zoneinfo/leapseconds"
+}
+
+SYMBOL: last-zone
+
+TUPLE: raw-zone name gmt-offset rules/save format until ;
+TUPLE: raw-rule name from to type in on at save letters ;
+TUPLE: raw-link from to ;
+TUPLE: raw-leap year month day hms corr r/s ;
+
+TUPLE: zone name ;
+TUPLE: rule name from to at ;
+TUPLE: link ;
+TUPLE: leap ;
+
+: rule-to ( m string -- m n )
+    {
+        { "only" [ dup ] }
+        { "max" [ 1/0. ] }
+        [ string>number ]
+    } case ;
+
+: raw-rule>rule ( raw-rule -- rule )
+    ;
+
+: parse-rule ( seq -- rule )
+    [
+        {
+            [ drop ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+        } spread
+    ] input<sequence raw-rule boa ;
+
+: raw-zone>zone ( raw-zone -- zone )
+    ;
+
+: parse-zone ( seq -- zone )
+    {
+        [ second ]
+        [ third ]
+        [ fourth ]
+        [ 4 swap nth ]
+        [ 5 tail harvest ]
+    } cleave raw-zone boa ;
+
+: parse-partial-zone ( seq -- zone )
+    [ last-zone get name>> ] dip
+    {
+        [ first ]
+        [ second ]
+        [ 2 swap nth ]
+        [ 3 tail harvest ]
+    } cleave raw-zone boa ;
+
+: raw-link>link ( raw-link -- link )
+    ;
+
+: parse-link ( seq -- link )
+    [
+        {
+            [ drop ]
+            [ ]
+            [ ]
+        } spread
+    ] input<sequence raw-link boa ;
+
+: raw-leap>leap ( raw-leap -- leap )
+    ;
+
+: parse-leap ( seq -- link )
+    [
+        {
+            [ drop ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+            [ ]
+        } spread
+    ] input<sequence raw-leap boa ;
+
+: parse-line ( seq -- tuple )
+    dup first >lower
+    {
+        { "zone" [ parse-zone dup last-zone set raw-zone>zone ] }
+        { "rule" [ parse-rule raw-rule>rule ] }
+        { "link" [ parse-link raw-link>link ] }
+        { "leap" [ parse-leap raw-leap>leap ] }
+        [ drop harvest parse-partial-zone ]
+    } case ;
+
+: parse-zoneinfo-file ( path -- seq )
+    utf8 file-lines
+    [ "#" split1 drop ] map harvest
+    [ "\t " split harvest ] map harvest
+    [ [ parse-line ] map ] with-scope ;
+
+: load-zoneinfo-files ( -- seq )
+    zoneinfo-paths [ parse-zoneinfo-file ] map ;
+
+
+
+! Rule
+! name - string
+! from - year or "min"
+! name    "France"
+! from    "1938"  or "min"
+! to      "1945" or "max" or "only"
+! type    "-"  always "-"
+! in      "Mar"  -- 3-letter month name
+! on      "26"  or "Mon>=15"  or lastSun lastFri
+! at      "23:00s"  "12:13:00s" "1:00s" "1:00u"
+! save    "-0:00:05" "1:00" "0:14:15"
+! letters "S" or "-" or "AMT" "BDST"
+
+! Zone
+! name       "Indian/Maldives"
+! gmt-offset "4:54:00" "9:55:56" "-9:55:56"
+! rules/save "-" "0:20" "0:30" "1:00" "AN" "W-Eur" "Winn" "Zion" "sol87" "sol88"
+! format     "LMT" "%s" "%sT" "A%sT" "AC%sT" "ACT"
+! until      { "1880" }
+    ! { "1847" "Dec" "1" "0:00s" }
+    ! { "1883" "Nov" "18" "12:12:57" }
+    ! { "1989" "Sep" "lastSun" "2:00s" }
+
+! Link
+! T{ link { from "Asia/Riyadh88" } { to "Mideast/Riyadh88" } }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/unmaintained/animations/animations-docs.factor b/unmaintained/animations/animations-docs.factor
new file mode 100644 (file)
index 0000000..3e426a2
--- /dev/null
@@ -0,0 +1,67 @@
+USING: help.markup help.syntax ;
+IN: animations
+
+HELP: animate ( quot duration -- )
+
+{ $values
+    { "quot" "a quot which uses " { $link progress } }
+    { "duration" "a duration of time" }
+}
+{ $description
+    { $link animate } " calls " { $link reset-progress }
+    " , then continously calls the given quot until the"
+    " duration of time has elapsed. The quot should use "
+    { $link progress } " at least once."
+}
+{ $examples
+    { $unchecked-example 
+        "USING: animations calendar threads prettyprint ;"
+        "[ 1 sleep progress unparse write \" ms elapsed\" print ] "
+        "1/20 seconds animate ;"
+        "46 ms elapsed\n17 ms elapsed"
+    }
+    { $notes "The amount of time elapsed between these iterations will very." }
+} ;
+
+HELP: reset-progress ( -- )
+{ $description
+    "Initiates the timer. Call this before using "
+    "a loop which makes use of " { $link progress } "."
+} ;
+
+HELP: progress
+{ $values { "time" "an integer" } }
+{ $description
+    "Gives the time elapsed since the last time"
+    " this word was called, in milliseconds." 
+}
+{ $examples
+    { $unchecked-example
+        "USING: animations threads prettyprint ;"
+        "reset-progress 3 "
+        "[ 1 sleep progress unparse write \"ms elapsed\" print ] "
+        "times ;"
+        "31 ms elapsed\n18 ms elapsed\n16 ms elapsed"
+    }
+    { $notes "The amount of time elapsed between these iterations will very." }
+} ;
+
+ARTICLE: "animations" "Animations"
+"Provides a lightweight framework for properly simulating continuous"
+" functions of real time. This framework helps one create animations "
+"that use rates which do not change across platforms. The speed of the "
+"computer should correlate with the smoothness of the animation, not "
+"the speed of the animation!"
+{ $subsections
+    animate
+    reset-progress
+    progress
+}
+! A little talk about when to use progress and when to use animate
+    { $link progress } " specifically provides the length of time since "
+    { $link reset-progress } " was called, and also calls "
+    { $link reset-progress } " as its last action. This can be directly "
+    "used when one's quote runs for a specific number of iterations, instead "
+    "of a length of time. If the animation is like most, and is expected to "
+    "run for a specific length of time, " { $link animate } " should be used." ;
+ABOUT: "animations"
\ No newline at end of file
diff --git a/unmaintained/animations/animations.factor b/unmaintained/animations/animations.factor
new file mode 100644 (file)
index 0000000..8f416dc
--- /dev/null
@@ -0,0 +1,17 @@
+! Small library for cross-platform continuous functions of real time
+
+USING: kernel shuffle system locals
+prettyprint math io namespaces threads calendar ;
+IN: animations
+
+SYMBOL: last-loop
+SYMBOL: sleep-period
+
+: reset-progress ( -- ) millis last-loop set ;
+! : my-progress ( -- progress ) millis 
+: progress ( -- time ) millis last-loop get - reset-progress ;
+: progress-peek ( -- progress ) millis last-loop get - ;
+: set-end ( duration -- end-time ) duration>milliseconds millis + ;
+: loop ( quot end -- ) dup millis > [ [ dup call ] dip loop ] [ 2drop ] if ; inline
+: animate ( quot duration -- ) reset-progress set-end loop ; inline
+: sample ( revs quot -- avg ) reset-progress dupd times progress swap / ; inline
diff --git a/unmaintained/animations/authors.txt b/unmaintained/animations/authors.txt
new file mode 100644 (file)
index 0000000..137b160
--- /dev/null
@@ -0,0 +1 @@
+Reginald Ford
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/unmaintained/drills/deployed/deploy.factor b/unmaintained/drills/deployed/deploy.factor
new file mode 100644 (file)
index 0000000..c1e9307
--- /dev/null
@@ -0,0 +1,14 @@
+USING: tools.deploy.config ;
+H{
+    { deploy-name "drills" }
+    { deploy-c-types? t }
+    { "stop-after-last-window?" t }
+    { deploy-unicode? t }
+    { deploy-threads? t }
+    { deploy-reflection 6 }
+    { deploy-word-defs? t }
+    { deploy-math? t }
+    { deploy-ui? t }
+    { deploy-word-props? t }
+    { deploy-io 3 }
+}
diff --git a/unmaintained/drills/deployed/deployed.factor b/unmaintained/drills/deployed/deployed.factor
new file mode 100644 (file)
index 0000000..5681c73
--- /dev/null
@@ -0,0 +1,36 @@
+USING: arrays cocoa.dialogs combinators continuations
+fry grouping io.encodings.utf8 io.files io.styles kernel math
+math.parser models models.arrow models.history namespaces random
+sequences splitting ui ui.gadgets.alerts ui.gadgets.book-extras
+ui.gadgets.books ui.gadgets.buttons ui.gadgets.frames
+ui.gadgets.grids ui.gadgets.labels ui.gadgets.tracks fonts
+wrap.strings system ;
+EXCLUDE: accessors => change-model ;
+IN: drills.deployed
+SYMBOLS: it startLength ;
+: big ( gadget -- gadget ) T{ font { name "sans-serif" } { size 30 } } >>font ;
+: card ( model quot -- button ) <arrow> <label-control> big [ next ] <book-btn> ;
+: op ( quot str -- gadget ) <label> big swap <book-bevel-btn> ;
+
+: show ( model -- gadget ) dup it set-global [ random ] <arrow>
+   { [ [ first ] card ]
+     [ [ second ] card ]
+     [ '[ |<< it get _ model-changed ] "No" op ]
+          [ '[ |<< [ it get [
+        _ value>> swap remove
+        [ [ it get go-back ] "Drill Complete" alert return ] when-empty
+     ] change-model ] with-return ] "Yes" op ]
+   } cleave
+2array { 1 0 } <track> swap [ 0.5 track-add ] each
+3array <book*> 3 3 <frame> { 1 1 } >>filled-cell { 450 175 } >>pref-dim swap { 1 1 } grid-add
+it get [ length startLength get swap - number>string "/" startLength get number>string 3append ] <arrow> <label-control> { 1 2 } grid-add ;
+
+: drill ( -- ) [
+   open-panel [
+         [ utf8 file-lines [ "\t" split [ 25 wrap-string ] map ] map dup [ first2 swap 2array ] map append ] map concat
+            [ length startLength set-global ] keep <history> [ add-history ] [ show ] bi
+         "Got it?" open-window
+   ] [ 0 exit ] if*
+] with-ui ;
+
+MAIN: drill
\ No newline at end of file
diff --git a/unmaintained/drills/deployed/tags.txt b/unmaintained/drills/deployed/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/unmaintained/drills/drills.factor b/unmaintained/drills/drills.factor
new file mode 100644 (file)
index 0000000..1da1fca
--- /dev/null
@@ -0,0 +1,37 @@
+USING: arrays cocoa.dialogs combinators continuations
+fry grouping io.encodings.utf8 io.files io.styles kernel math
+math.parser models models.arrow models.history namespaces random
+sequences splitting ui ui.gadgets.alerts ui.gadgets.book-extras
+ui.gadgets.books ui.gadgets.buttons ui.gadgets.frames
+ui.gadgets.grids ui.gadgets.labels ui.gadgets.tracks fonts
+wrap.strings ;
+EXCLUDE: accessors => change-model ;
+
+IN: drills
+SYMBOLS: it startLength ;
+: big ( gadget -- gadget ) T{ font { name "sans-serif" } { size 30 } } >>font ;
+: card ( model quot -- button ) <arrow> <label-control> big [ next ] <book-btn> ;
+: op ( quot str -- gadget ) <label> big swap <book-border-btn> ;
+
+: show ( model -- gadget ) dup it set-global [ random ] <arrow>
+   { [ [ first ] card ]
+     [ [ second ] card ]
+     [ '[ |<< it get _ model-changed ] "No" op ]
+          [ '[ |<< [ it get [
+        _ value>> swap remove
+        [ [ it get go-back ] "Drill Complete" alert return ] when-empty
+     ] change-model ] with-return ] "Yes" op ]
+   } cleave
+2array { 1 0 } <track> swap [ 0.5 track-add ] each
+3array <book*> 3 3 <frame> { 1 1 } >>filled-cell { 450 175 } >>pref-dim swap { 1 1 } grid-add
+it get [ length startLength get swap - number>string "/" startLength get number>string 3append ] <arrow> <label-control> { 1 2 } grid-add ;
+
+: drill ( -- ) [
+   open-panel [
+         [ utf8 file-lines [ "\t" split [ 25 wrap-string ] map ] map dup [ first2 swap 2array ] map append ] map concat
+            [ length startLength set-global ] keep <history> [ add-history ] [ show ] bi
+         "Got it?" open-window
+   ] when*
+] with-ui ;
+
+MAIN: drill
\ No newline at end of file
diff --git a/unmaintained/drills/tags.txt b/unmaintained/drills/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/unmaintained/models/combinators/authors.txt b/unmaintained/models/combinators/authors.txt
new file mode 100644 (file)
index 0000000..2300f69
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
diff --git a/unmaintained/models/combinators/combinators-docs.factor b/unmaintained/models/combinators/combinators-docs.factor
new file mode 100644 (file)
index 0000000..8ac3657
--- /dev/null
@@ -0,0 +1,41 @@
+USING: help.markup help.syntax models models.arrow sequences monads ;
+IN: models.combinators
+
+HELP: merge
+{ $values { "models" "a list of models" } { "model" basic-model } }
+{ $description "Creates a model that merges the updates of others" } ;
+
+HELP: filter-model
+{ $values { "model" model } { "quot" "quotation with stack effect ( a b -- c )" } { "filter-model" filter-model } }
+{ $description "Creates a model that uses the updates of another model only when they satisfy a given predicate" } ;
+
+HELP: fold
+{ $values { "model" model } { "oldval" "starting value" } { "quot" "applied to update and previous values" } { "model" model } }
+{ $description "Similar to " { $link reduce } " but works on models, applying a quotation to the previous and new values at each update" } ;
+
+HELP: switch-models
+{ $values { "model1" model } { "model2" model } { "model'" model } }
+{ $description "Creates a model that starts with the behavior of model2 and switches to the behavior of model1 on its update" } ;
+
+HELP: <mapped>
+{ $values { "model" model } { "quot" "applied to model's value on updates" } { "model" model } }
+{ $description "An expanded version of " { $link <arrow> } ". Use " { $link fmap } " instead." } ;
+
+HELP: when-model
+{ $values { "model" model } { "quot" "called on the model if the quot yields true" } { "cond" "a quotation called on the model's value, yielding a boolean value"  } }
+{ $description "Calls quot when model updates if its value meets the condition set in cond" } ;
+
+HELP: with-self
+{ $values { "quot" "quotation that recieves its own return value" } { "model" model } }
+{ $description "Fixed points for models: the quot reacts to the same model to gives" } ;
+
+HELP: #1
+{ $values { "model" model } { "model'" model } }
+{ $description "Moves a model to the top of its dependencies' connections, thus being notified before the others" } ;
+
+ARTICLE: "models.combinators" "Extending models"
+"The " { $vocab-link "models.combinators" } " library expands models to have discrete start and end times. "
+"Also, it provides methods of manipulating and combining models, expecially useful when programming user interfaces: "
+"The output models of some gadgets (see " { $vocab-link "ui.gadgets.controls" } " ) can be manipulated and used as the input models of others. " ;
+
+ABOUT: "models.combinators"
diff --git a/unmaintained/models/combinators/combinators.factor b/unmaintained/models/combinators/combinators.factor
new file mode 100644 (file)
index 0000000..4896910
--- /dev/null
@@ -0,0 +1,105 @@
+USING: accessors arrays kernel models models.product monads
+sequences sequences.extras shuffle ;
+FROM: syntax => >> ;
+IN: models.combinators
+
+TUPLE: multi-model < model important? ;
+GENERIC: (model-changed) ( model observer -- )
+: <multi-model> ( models kind -- model ) f swap new-model [ [ add-dependency ] curry each ] keep ;
+M: multi-model model-changed over value>> [ (model-changed) ] [ 2drop ] if ;
+M: multi-model model-activated dup dependencies>> [ value>> ] find nip
+   [ swap model-changed ] [ drop ] if* ;
+
+: #1 ( model -- model' ) t >>important? ;
+
+IN: models
+: notify-connections ( model -- )
+    dup connections>> dup [ dup multi-model? [ important?>> ] [ drop f ] if ] find-all
+    [ second tuck [ remove ] dip prefix ] each
+    [ model-changed ] with each ;
+IN: models.combinators
+
+TUPLE: basic-model < multi-model ;
+M: basic-model (model-changed) [ value>> ] dip set-model ;
+: merge ( models -- model ) basic-model <multi-model> ;
+: 2merge ( model1 model2 -- model ) 2array merge ;
+: <basic> ( value -- model ) basic-model new-model ;
+
+TUPLE: filter-model < multi-model quot ;
+M: filter-model (model-changed) [ value>> ] dip 2dup quot>> call( a -- ? )
+   [ set-model ] [ 2drop ] if ;
+: filter-model ( model quot -- filter-model ) [ 1array \ filter-model <multi-model> ] dip >>quot ;
+
+TUPLE: fold-model < multi-model quot base values ;
+M: fold-model (model-changed) 2dup base>> =
+    [ [ [ value>> ] [ [ values>> ] [ quot>> ] bi ] bi* swapd reduce* ] keep set-model ]
+    [ [ [ value>> ] [ values>> ] bi* push ]
+      [ [ [ value>> ] [ [ value>> ] [ quot>> ] bi ] bi* call( val oldval -- newval ) ] keep set-model ] 2bi
+    ] if ;
+M: fold-model model-activated drop ;
+: new-fold-model ( deps -- model ) fold-model <multi-model> V{ } clone >>values ;
+: fold ( model oldval quot -- model ) rot 1array new-fold-model swap >>quot
+   swap >>value ;
+: fold* ( model oldmodel quot -- model ) over [ [ 2array new-fold-model ] dip >>quot ]
+    dip [ >>base ] [ value>> >>value ] bi ;
+
+TUPLE: updater-model < multi-model values updates ;
+M: updater-model (model-changed) [ tuck updates>> =
+   [ [ values>> value>> ] keep set-model ]
+   [ drop ] if ] keep f swap (>>value) ;
+: updates ( values updates -- model ) [ 2array updater-model <multi-model> ] 2keep
+   [ >>values ] [ >>updates ] bi* ;
+
+SYMBOL: switch
+TUPLE: switch-model < multi-model original switcher on ;
+M: switch-model (model-changed) 2dup switcher>> =
+   [ [ value>> ] dip over switch = [ nip [ original>> ] keep f >>on model-changed ] [ t >>on set-model ] if ]
+   [ dup on>> [ 2drop ] [ [ value>> ] dip over [ set-model ] [ 2drop ] if ] if ] if ;
+: switch-models ( model1 model2 -- model' ) swap [ 2array switch-model <multi-model> ] 2keep
+   [ [ value>> >>value ] [ >>original ] bi ] [ >>switcher ] bi* ;
+M: switch-model model-activated [ original>> ] keep model-changed ;
+: >behavior ( event -- behavior ) t >>value ;
+
+TUPLE: mapped-model < multi-model model quot ;
+: new-mapped-model ( model quot class -- mapped-model ) [ over 1array ] dip
+   <multi-model> swap >>quot swap >>model ;
+: <mapped> ( model quot -- model ) mapped-model new-mapped-model ;
+M: mapped-model (model-changed)
+    [ [ value>> ] [ quot>> ] bi* call( old -- new ) ] [ nip ] 2bi
+    set-model ;
+
+TUPLE: side-effect-model < mapped-model ;
+M: side-effect-model (model-changed) [ value>> ] dip [ quot>> call( old -- ) ] 2keep set-model ;
+
+TUPLE: quot-model < mapped-model ;
+M: quot-model (model-changed) nip [ quot>> call( -- b ) ] keep set-model ;
+
+TUPLE: action-value < basic-model parent ;
+: <action-value> ( parent value -- model ) action-value new-model swap >>parent ;
+M: action-value model-activated dup parent>> dup activate-model model-changed ; ! a fake dependency of sorts
+
+TUPLE: action < multi-model quot ;
+M: action (model-changed) [ [ value>> ] [ quot>> ] bi* call( a -- b ) ] keep value>>
+   [ swap add-connection ] 2keep model-changed ;
+: <action> ( model quot -- action-model ) [ 1array action <multi-model> ] dip >>quot dup f <action-value> >>value value>> ;
+
+TUPLE: collection < multi-model ;
+: <collection> ( models -- product ) collection <multi-model> ;
+M: collection (model-changed)
+    nip
+    dup dependencies>> [ value>> ] all?
+    [ dup [ value>> ] product-value swap set-model ]
+    [ drop ] if ;
+M: collection model-activated dup (model-changed) ;
+
+! for side effects
+TUPLE: (when-model) < multi-model quot cond ;
+: when-model ( model quot cond -- model ) rot 1array (when-model) <multi-model> swap >>cond swap >>quot ;
+M: (when-model) (model-changed) [ quot>> ] 2keep
+    [ value>> ] [ cond>> ] bi* call( a -- ? ) [ call( model -- ) ] [ 2drop ] if ;
+
+! only used in construction
+: with-self ( quot: ( model -- model ) -- model ) [ f <basic> dup ] dip call swap [ add-dependency ] keep ; inline
+
+USE: models.combinators.templates
+<< { "$>" "<$" "fmap" } [ fmaps ] each >>
diff --git a/unmaintained/models/combinators/summary.txt b/unmaintained/models/combinators/summary.txt
new file mode 100644 (file)
index 0000000..1e5347e
--- /dev/null
@@ -0,0 +1 @@
+Model combination and manipulation
\ No newline at end of file
diff --git a/unmaintained/models/combinators/templates/templates.factor b/unmaintained/models/combinators/templates/templates.factor
new file mode 100644 (file)
index 0000000..685ad93
--- /dev/null
@@ -0,0 +1,23 @@
+USING: kernel sequences functors fry macros generalizations ;
+IN: models.combinators.templates
+FROM: models.combinators => <collection> #1 ;
+FUNCTOR: fmaps ( W -- )
+W        IS ${W}
+w-n      DEFINES ${W}-n
+w-2      DEFINES 2${W}
+w-3      DEFINES 3${W}
+w-4      DEFINES 4${W}
+w-n*     DEFINES ${W}-n*
+w-2*     DEFINES 2${W}*
+w-3*     DEFINES 3${W}*
+w-4*     DEFINES 4${W}*
+WHERE
+MACRO: w-n ( int -- quot ) dup '[ [ _ narray <collection> ] dip [ _ firstn ] prepend W ] ;
+: w-2 ( a b quot -- mapped ) 2 w-n ; inline
+: w-3 ( a b c quot -- mapped ) 3 w-n ; inline
+: w-4 ( a b c d quot -- mapped ) 4 w-n ; inline
+MACRO: w-n* ( int -- quot ) dup '[ [ _ narray <collection> #1 ] dip [ _ firstn ] prepend W ] ;
+: w-2* ( a b quot -- mapped ) 2 w-n* ; inline
+: w-3* ( a b c quot -- mapped ) 3 w-n* ; inline
+: w-4* ( a b c d quot -- mapped ) 4 w-n* ; inline
+;FUNCTOR
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/unmaintained/recipes/authors.txt b/unmaintained/recipes/authors.txt
new file mode 100644 (file)
index 0000000..ce0899f
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
\ No newline at end of file
diff --git a/unmaintained/recipes/icons/back.tiff b/unmaintained/recipes/icons/back.tiff
new file mode 100644 (file)
index 0000000..27b8112
Binary files /dev/null and b/unmaintained/recipes/icons/back.tiff differ
diff --git a/unmaintained/recipes/icons/hate.tiff b/unmaintained/recipes/icons/hate.tiff
new file mode 100644 (file)
index 0000000..d7d5f8e
Binary files /dev/null and b/unmaintained/recipes/icons/hate.tiff differ
diff --git a/unmaintained/recipes/icons/love.tiff b/unmaintained/recipes/icons/love.tiff
new file mode 100644 (file)
index 0000000..ae2fa7b
Binary files /dev/null and b/unmaintained/recipes/icons/love.tiff differ
diff --git a/unmaintained/recipes/icons/more.tiff b/unmaintained/recipes/icons/more.tiff
new file mode 100644 (file)
index 0000000..b4ec27b
Binary files /dev/null and b/unmaintained/recipes/icons/more.tiff differ
diff --git a/unmaintained/recipes/icons/submit.tiff b/unmaintained/recipes/icons/submit.tiff
new file mode 100644 (file)
index 0000000..7c98267
Binary files /dev/null and b/unmaintained/recipes/icons/submit.tiff differ
diff --git a/unmaintained/recipes/recipes.factor b/unmaintained/recipes/recipes.factor
new file mode 100644 (file)
index 0000000..d546859
--- /dev/null
@@ -0,0 +1,61 @@
+USING: accessors arrays colors.constants combinators
+db.sqlite db.tuples db.types kernel locals math
+monads persistency sequences sequences.extras ui ui.gadgets.controls
+ui.gadgets.layout models.combinators ui.gadgets.labels
+ui.gadgets.scrollers ui.pens.solid io.files.temp ;
+FROM: sets => prune ;
+IN: recipes
+
+STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } { genre { VARCHAR 100 } } ;
+: <recipe> ( title genre text -- recipe ) recipe new swap >>txt swap >>genre swap >>title 0 >>votes ;
+"recipes.db" temp-file <sqlite-db> recipe define-db
+: top-recipes ( offset search -- recipes ) <query> T{ recipe } rot >>title >>tuple
+    "votes" >>order 30 >>limit swap >>offset get-tuples ;
+: top-genres ( -- genres ) f f top-recipes [ genre>> ] map prune 4 short head-slice ;
+
+: interface ( -- book ) [ 
+     [
+        [ $ TOOLBAR $ ] <hbox> COLOR: AliceBlue <solid> >>interior ,
+        [ "Genres:" <label> , <spacer> $ ALL $ $ GENRES $ ] <hbox>
+            { 5 0 } >>gap COLOR: gray <solid> >>interior ,
+        $ RECIPES $
+     ] <vbox> ,
+     [
+        [ "Title:" <label> , $ TITLE $ "Genre:" <label> , $ GENRE $ ] <hbox> ,
+        $ BODY $
+        $ BUTTON $
+     ] <vbox> ,
+  ] <book*> { 350 245 } >>pref-dim ;
+  
+:: recipe-browser ( -- ) [ [
+    interface
+      <table*> :> tbl
+      "okay" <model-border-btn> BUTTON -> :> ok
+      IMG-MODEL-BTN: submit [ store-tuple ] >>value TOOLBAR -> :> submit
+      IMG-MODEL-BTN: love 1 >>value TOOLBAR ->
+      IMG-MODEL-BTN: hate -1 >>value -> 2array merge :> votes
+      IMG-MODEL-BTN: back -> [ -30 ] <$
+      IMG-MODEL-BTN: more -> [ 30 ] <$ 2array merge :> viewed
+      <spacer> <model-field*> ->% 1 :> search
+      submit ok [ [ drop ] ] <$ 2array merge [ drop ] >>value :> quot
+      viewed 0 [ + ] fold search ok t <basic> "all" <model-btn> ALL ->
+      tbl selection>> votes [ [ + ] curry change-votes modify-tuple ] 2$>
+        4array merge
+        [ drop [ f ] [ "%" dup surround <pattern> ] if-empty top-recipes ] 3fmap :> ups
+      ups [ top-genres [ <model-btn> GENRES -> ] map merge ] bind*
+        [ text>> T{ recipe } swap >>genre get-tuples ] fmap
+      tbl swap ups 2merge >>model
+        [ [ title>> ] [ genre>> ] bi 2array ] >>quot
+        { "Title" "Genre" } >>column-titles dup <scroller> RECIPES ,% 1 actions>>
+      submit [ "" dup dup <recipe> ] <$ 2array merge
+        { [ [ title>> ] fmap <model-field> TITLE ->% .5 ]
+          [ [ genre>> ] fmap <model-field> GENRE ->% .5 ]
+          [ [ txt>> ] fmap <model-editor> BODY ->% 1 ]
+        } cleave
+        [ <recipe> ] 3fmap
+      [ [ 1 ] <$ ]
+      [ quot ok updates #1 [ call( recipe -- ) 0 ] 2fmap ] bi
+      2merge 0 <basic> switch-models >>model
+   ] with-interface "recipes" open-window ] with-ui ;
+
+MAIN: recipe-browser
\ No newline at end of file
diff --git a/unmaintained/recipes/summary.txt b/unmaintained/recipes/summary.txt
new file mode 100644 (file)
index 0000000..98b1ece
--- /dev/null
@@ -0,0 +1 @@
+Database backed recipe sharing
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/unmaintained/sudokus/authors.txt b/unmaintained/sudokus/authors.txt
new file mode 100644 (file)
index 0000000..ce0899f
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
\ No newline at end of file
diff --git a/unmaintained/sudokus/sudokus.factor b/unmaintained/sudokus/sudokus.factor
new file mode 100644 (file)
index 0000000..c7bc694
--- /dev/null
@@ -0,0 +1,40 @@
+USING: accessors arrays combinators.short-circuit grouping kernel lists
+lists.lazy locals math math.functions math.parser math.ranges
+models.product monads random sequences sets ui ui.gadgets.controls
+ui.gadgets.layout models.combinators ui.gadgets.alerts vectors fry
+ui.gadgets.labels shuffle ;
+IN: sudokus
+
+: row ( index -- row ) 1 + 9 / ceiling ;
+: col ( index -- col ) 9 mod 1 + ;
+: sq ( index -- square ) [ row ] [ col ] bi [ 3 / ceiling ] bi@ 2array ;
+: near ( a pos -- ? ) { [ [ row ] bi@ = ] [ [ col ] bi@ = ] [ [ sq ] bi@ = ] } 2|| ;
+: nth-or-lower ( n seq -- elt ) [ length 1 - 2dup > [ nip ] [ drop ] if ] keep nth ;
+
+:: solutions ( puzzle random? -- solutions )
+    f puzzle random? [ indices [ f ] [ random? swap nth-or-lower ] if-empty ] [ index ] if
+    [ :> pos
+      1 9 [a,b] 80 iota [ pos near ] filter [ puzzle nth ] map prune diff
+      [ 1array puzzle pos cut-slice rest surround ] map >list [ random? solutions ] bind
+    ] [ puzzle list-monad return ] if* ;
+
+: solution ( puzzle random? -- solution ) dupd solutions dup +nil+ = [ drop "Unsolvable" alert* ] [ nip car ] if ;
+: hint ( puzzle -- puzzle' ) [ [ f swap indices random dup ] [ f solution ] bi nth ] keep swapd >vector [ set-nth ] keep ;
+: create ( difficulty -- puzzle ) 81 [ f ] replicate
+    40 random solution [ [ f swap [ length random ] keep set-nth ] curry times ] keep ;
+
+: do-sudoku ( -- ) [ [
+        [
+            81 [ "" ] replicate <basic> switch-models [ [ <basic> ] map 9 group [ 3 group ] map 3 group
+               [ [ [ <spacer> [ [ <model-field> ->% 2 [ string>number ] fmap ]
+                    map <spacer> ] map concat ] <hbox> , ] map concat <spacer> ] map concat <product>
+               [ "Difficulty:" <label> , "1" <basic> <model-field> -> [ string>number 1 or 1 + 10 * ] fmap
+               "Generate" <model-border-btn> -> updates [ create ] fmap <spacer>
+               "Hint" <model-border-btn> -> "Solve" <model-border-btn> -> ] <hbox> ,
+               roll [ swap updates ] curry bi@
+               [ [ hint ] fmap ] [ [ f solution ] fmap ] bi* 3array merge [ [ [ number>string ] [ "" ] if* ] map ] fmap
+           ] bind
+        ] with-self , ] <vbox> { 280 220 } >>pref-dim
+    "Sudoku Sleuth" open-window ] with-ui ;
+
+MAIN: do-sudoku
diff --git a/unmaintained/sudokus/summary.txt b/unmaintained/sudokus/summary.txt
new file mode 100644 (file)
index 0000000..d66e7be
--- /dev/null
@@ -0,0 +1 @@
+graphical sudoku solver
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/unmaintained/ui/gadgets/alerts/alerts.factor b/unmaintained/ui/gadgets/alerts/alerts.factor
new file mode 100644 (file)
index 0000000..70943e6
--- /dev/null
@@ -0,0 +1,29 @@
+USING: accessors models monads macros generalizations kernel
+ui ui.gadgets.controls models.combinators ui.gadgets.layout ui.gadgets
+ui.gadgets.labels ui.gadgets.editors ui.gadgets.buttons
+ui.gadgets.packs locals sequences fonts io.styles
+wrap.strings ;
+
+IN: ui.gadgets.alerts
+:: alert ( quot string -- ) <pile> { 10 10 } >>gap 1 >>align
+   string 22 wrap-lines <label> T{ font { name "sans-serif" } { size 18 } } >>font { 200 100 } >>pref-dim add-gadget 
+   "okay" [ close-window ] quot append <border-button> add-gadget "" open-window ;
+
+: alert* ( str -- ) [ ] swap alert ;
+
+:: ask-user ( string -- model' )
+    [
+        string <label>  T{ font { name "sans-serif" } { size 14 } } >>font dup , :> lbl
+        <model-field*> ->% 1 :> fldm
+        "okay" <model-border-btn> :> btn
+        btn -> [ fldm swap updates ]
+               [ [ drop lbl close-window ] $> , ] bi
+    ] <vbox> { 161 86 } >>pref-dim "" open-window ;
+
+MACRO: ask-buttons ( buttons -- quot ) dup length [
+      [ swap
+         [ 22 wrap-lines <label> T{ font { name "sans-serif" } { size 18 } } >>font ,
+         [ [ <model-border-btn> [ close-window ] >>hook -> ] map ] <hbox> , ] <vbox>
+         "" open-window
+      ] dip firstn
+   ] 2curry ;
diff --git a/unmaintained/ui/gadgets/alerts/authors.txt b/unmaintained/ui/gadgets/alerts/authors.txt
new file mode 100644 (file)
index 0000000..ce0899f
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/alerts/summary.txt b/unmaintained/ui/gadgets/alerts/summary.txt
new file mode 100644 (file)
index 0000000..f1cd420
--- /dev/null
@@ -0,0 +1 @@
+Really simple dialog boxes
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/comboboxes/authors.txt b/unmaintained/ui/gadgets/comboboxes/authors.txt
new file mode 100644 (file)
index 0000000..ce0899f
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/comboboxes/comboboxes.factor b/unmaintained/ui/gadgets/comboboxes/comboboxes.factor
new file mode 100644 (file)
index 0000000..3eb1180
--- /dev/null
@@ -0,0 +1,22 @@
+USING: accessors arrays kernel math.rectangles sequences
+ui.gadgets.controls models.combinators ui.gadgets ui.gadgets.glass
+ui.gadgets.labels ui.gestures ;
+QUALIFIED-WITH: ui.gadgets.tables tbl
+IN: ui.gadgets.comboboxes
+
+TUPLE: combo-table < table spawner ;
+
+M: combo-table handle-gesture [ call-next-method drop ] 2keep swap
+   T{ button-up } = [
+      [ spawner>> ]
+      [ tbl:selected-row [ swap set-control-value ] [ 2drop ] if ]
+      [ hide-glass ] tri
+   ] [ drop ] if t ;
+
+TUPLE: combobox < label-control table ;
+combobox H{
+   { T{ button-down } [ dup table>> over >>spawner <zero-rect> show-glass ] }
+} set-gestures
+
+: <combobox> ( options -- combobox ) [ first [ combobox new-label ] keep <basic> >>model ] keep
+    <basic> combo-table new-table [ 1array ] >>quot >>table ;
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/comboboxes/summary.txt b/unmaintained/ui/gadgets/comboboxes/summary.txt
new file mode 100644 (file)
index 0000000..0f2ce2b
--- /dev/null
@@ -0,0 +1 @@
+Combo boxes have a model choosen from a list of options
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/controls/authors.txt b/unmaintained/ui/gadgets/controls/authors.txt
new file mode 100644 (file)
index 0000000..2300f69
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
diff --git a/unmaintained/ui/gadgets/controls/controls-docs.factor b/unmaintained/ui/gadgets/controls/controls-docs.factor
new file mode 100644 (file)
index 0000000..1df6005
--- /dev/null
@@ -0,0 +1,71 @@
+USING: accessors help.markup help.syntax ui.gadgets.buttons
+ui.gadgets.editors models ui.gadgets ;
+IN: ui.gadgets.controls
+
+HELP: <model-btn>
+{ $values { "gadget" "the button's label" } { "button" button } }
+{ $description "Creates an button whose signal updates on clicks.  " } ;
+
+HELP: <model-border-btn>
+{ $values { "text" "the button's label" } { "button" button } }
+{ $description "Creates an button whose signal updates on clicks.  " } ;
+
+HELP: <table>
+{ $values { "model" "values the table is to display" } { "table" table } }
+{ $description "Creates an " { $link table } } ;
+
+HELP: <table*>
+{ $values { "table" table } }
+{ $description "Creates an " { $link table } " with no initial values to display" } ;
+
+HELP: <list>
+{ $values { "column-model" "values the table is to display" } { "table" table } }
+{ $description "Creates an " { $link table } " with a val-quot that renders each element as its own row" } ;
+
+HELP: <list*>
+{ $values { "table" table } }
+{ $description "Creates an model-list with no initial values to display" } ;
+
+HELP: indexed
+{ $values { "table" table } }
+{ $description "Sets the output model of an table to the selected-index, rather than the selected-value" } ;
+
+HELP: <model-field>
+{ $values { "model" model } { "gadget" model-field } }
+{ $description "Creates a field with an initial value" } ;
+
+HELP: <model-field*>
+{ $values { "field" model-field } }
+{ $description "Creates a field with an empty initial value" } ;
+
+HELP: <empty-field>
+{ $values { "model" model } { "field" model-field } }
+{ $description "Creates a field with an empty initial value that switches to another signal on its update" } ;
+
+HELP: <model-editor>
+{ $values { "model" model } { "gadget" model-field } }
+{ $description "Creates an editor with an initial value" } ;
+
+HELP: <model-editor*>
+{ $values { "editor" "an editor" } }
+{ $description "Creates a editor with an empty initial value" } ;
+
+HELP: <empty-editor>
+{ $values { "model" model } { "editor" "an editor" } }
+{ $description "Creates a field with an empty initial value that switches to another signal on its update" } ;
+
+HELP: <model-action-field>
+{ $values { "field" action-field } }
+{ $description "Field that updates its model with its contents when the user hits the return key" } ;
+
+HELP: IMG-MODEL-BTN:
+{ $syntax "IMAGE-MODEL-BTN: filename" }
+{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path" } ;
+
+HELP: IMG-BTN:
+{ $syntax "[ do-something ] IMAGE-BTN: filename" }
+{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path, calling the specified quotation on click" } ;
+
+HELP: output-model
+{ $values { "gadget" gadget } { "model" model } }
+{ $description "Returns the model a gadget uses for output. Often the same as " { $link model>> } } ;
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/controls/controls.factor b/unmaintained/ui/gadgets/controls/controls.factor
new file mode 100644 (file)
index 0000000..5de6da8
--- /dev/null
@@ -0,0 +1,83 @@
+USING: accessors assocs arrays kernel models monads sequences
+models.combinators ui.gadgets ui.gadgets.borders ui.gadgets.buttons
+ui.gadgets.buttons.private ui.gadgets.editors ui.gadgets.editors.private
+words images.loader ui.gadgets.scrollers ui.images vocabs.parser lexer
+models.range ui.gadgets.sliders ;
+QUALIFIED-WITH: ui.gadgets.sliders slider
+QUALIFIED-WITH: ui.gadgets.tables tbl
+EXCLUDE: ui.gadgets.editors => model-field ;
+IN: ui.gadgets.controls
+
+TUPLE: model-btn < button hook value ;
+: <model-btn> ( gadget -- button ) [
+      [ dup hook>> [ call( button -- ) ] [ drop ] if* ]
+      [ [ [ value>> ] [ ] bi or ] keep set-control-value ]
+      [ model>> f swap (>>value) ] tri
+   ] model-btn new-button f <basic> >>model ;
+: <model-border-btn> ( text -- button ) <model-btn> border-button-theme ;
+
+TUPLE: table < tbl:table { quot initial: [ ] } { val-quot initial: [ ] } color-quot column-titles column-alignment actions ;
+M: table tbl:column-titles column-titles>> ;
+M: table tbl:column-alignment column-alignment>> ;
+M: table tbl:row-columns quot>> [ call( a -- b ) ] [ drop f ] if* ;
+M: table tbl:row-value val-quot>> [ call( a -- b ) ]  [ drop f ] if* ;
+M: table tbl:row-color color-quot>> [ call( a -- b ) ]  [ drop f ] if* ;
+
+: new-table ( model class -- table ) f swap tbl:new-table dup >>renderer
+   f <basic> >>actions dup actions>> [ set-model ] curry >>action ;
+: <table> ( model -- table ) table new-table ;
+: <table*> ( -- table ) V{ } clone <model> <table> ;
+: <list> ( column-model -- table ) <table> [ 1array ] >>quot ;
+: <list*> ( -- table ) V{ } clone <model> <list> ;
+: indexed ( table -- table ) f >>val-quot ;
+
+TUPLE: model-field < field model* ;
+: init-field ( model -- model' ) [ [ ] [ "" ] if* ] change-value ;
+: <model-field> ( model -- gadget ) model-field new-field swap init-field >>model* ;
+M: model-field graft*
+    [ [ model*>> value>> ] [ editor>> ] bi set-editor-string ]
+    [ dup editor>> model>> add-connection ]
+    [ dup model*>> add-connection ] tri ;
+M: model-field ungraft*
+   [ dup editor>> model>> remove-connection ]
+   [ dup model*>> remove-connection ] bi ;
+M: model-field model-changed 2dup model*>> =
+    [ [ value>> ] [ editor>> ] bi* set-editor-string ]
+    [ nip [ editor>> editor-string ] [ model*>> ] bi set-model ] if ;
+: (new-field) ( editor field -- gadget ) [ new-editor ] dip new-border dup gadget-child >>editor
+    field-theme { 1 0 } >>align ; inline
+: <model-field*> ( -- field ) "" <model> <model-field> ;
+: <empty-field> ( model -- field ) "" <model> switch-models <model-field> ;
+: <model-editor> ( model -- gadget ) multiline-editor model-field (new-field) swap init-field >>model* ;
+: <model-editor*> ( -- editor ) "" <model> <model-editor> ;
+: <empty-editor> ( model -- editor ) "" <model> switch-models <model-editor> ;
+
+: <model-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
+    f <model> >>model ;
+
+: <slider> ( init page min max step -- slider ) <range> horizontal slider:<slider> ;
+
+: image-prep ( -- image ) scan current-vocab name>> "vocab:" "/icons/" surround ".tiff" surround <image-name> dup cached-image drop ;
+SYNTAX: IMG-MODEL-BTN: image-prep [ <model-btn> ] curry append! ;
+
+SYNTAX: IMG-BTN: image-prep [ swap <button> ] curry append! ;
+
+GENERIC: output-model ( gadget -- model )
+M: gadget output-model model>> ;
+M: table output-model dup val-quot>> [ selection>> ] [ selection-index>> ] if ;
+M: model-field output-model model*>> ;
+M: scroller output-model viewport>> children>> first output-model ;
+M: slider output-model model>> range-model ;
+
+IN: accessors
+M: model-btn text>> children>> first text>> ;
+
+IN: ui.gadgets.controls
+
+SINGLETON: gadget-monad
+INSTANCE: gadget-monad monad
+INSTANCE: gadget monad
+M: gadget monad-of drop gadget-monad ;
+M: gadget-monad return drop <gadget> swap >>model ;
+M: gadget >>= output-model [ swap call( x -- y ) ] curry ; 
diff --git a/unmaintained/ui/gadgets/controls/summary.txt b/unmaintained/ui/gadgets/controls/summary.txt
new file mode 100644 (file)
index 0000000..eeef94d
--- /dev/null
@@ -0,0 +1 @@
+Gadgets with expanded model usage
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/layout/authors.txt b/unmaintained/ui/gadgets/layout/authors.txt
new file mode 100644 (file)
index 0000000..2300f69
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
diff --git a/unmaintained/ui/gadgets/layout/layout-docs.factor b/unmaintained/ui/gadgets/layout/layout-docs.factor
new file mode 100644 (file)
index 0000000..cd8f62b
--- /dev/null
@@ -0,0 +1,53 @@
+USING: help.markup help.syntax models ui.gadgets.tracks ;
+IN: ui.gadgets.layout
+
+HELP: ,
+{ $values { "item" "a gadget or model" } }
+{ $description "Used in a series of gadgets created by a box, accumulating the gadget" } ;
+
+HELP: ,%
+{ $syntax "gadget ,% width" }
+{ $description "Like ',' but stretches the gadget to always fill a percent of the parent" } ;
+
+HELP: ->
+{ $values { "uiitem" "a gadget or model" } { "model" model } }
+{ $description "Like ',' but passes its model on for further use." } ;
+
+HELP: ->%
+{ $syntax "gadget ,% width" }
+{ $description "Like '->' but stretches the gadget to always fill a percent of the parent" } ;
+
+HELP: <spacer>
+{ $description "Grows to fill any empty space in a box" } ;
+
+HELP: <hbox>
+{ $values { "gadgets" "a list of gadgets" } { "track" track } }
+{ $syntax "[ gadget , gadget , ... ] <hbox>" }
+{ $description "Creates an horizontal track containing the gadgets listed in the quotation" } ;
+
+HELP: <vbox>
+{ $values { "gadgets" "a list of gadgets" } { "track" track } }
+{ $syntax "[ gadget , gadget , ... ] <hbox>" }
+{ $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
+
+HELP: $
+{ $syntax "$ PLACEHOLDER-NAME $" }
+{ $description "Defines an insertion point in a template named PLACEHOLDER-NAME which can be used by calling its name" } ;
+
+HELP: with-interface
+{ $values { "quot" "quotation that builds a template and inserts into it" } }
+{ $description "Create templates, used with " { $link POSTPONE: $ } } ;
+
+ARTICLE: "ui.gadgets.layout" "GUI Layout"
+"Laying out GUIs works the same way as building lists with " { $vocab-link "make" }
+". Gadgets are layed out using " { $vocab-link "ui.gadgets.tracks" } " through " { $link <hbox> } " and " { $link <vbox> } ", which allow both fixed and percentage widths. "
+{ $link , } " and " { $link -> }  " add a model or gadget to the gadget you're building. "
+"Also, books can be made with " { $link <book> } ". "
+{ $link <spacer> } "s add flexable space between items. " $nl
+"Using " { $link with-interface } ", one can pre-build templates to add items to later: "
+"Like in the StringTemplate framework for java, placeholders are defined using $ PLACERHOLDER-NAME $ "
+"Using PLACEHOLDER-NAME again sets it as the current insertion point. "
+"For examples using normal layout, see the " { $vocab-link "sudokus" } " demo. "
+"For examples of templating, see the " { $vocab-link "recipes" } " demo. " ;
+
+ABOUT: "ui.gadgets.layout"
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/layout/layout.factor b/unmaintained/ui/gadgets/layout/layout.factor
new file mode 100644 (file)
index 0000000..c287b9a
--- /dev/null
@@ -0,0 +1,90 @@
+USING: accessors assocs arrays fry kernel lexer make math.parser
+models monads namespaces parser sequences
+sequences.extras models.combinators ui.gadgets
+ui.gadgets.tracks words ui.gadgets.controls ;
+QUALIFIED: make
+QUALIFIED-WITH: ui.gadgets.books book
+IN: ui.gadgets.layout
+
+SYMBOL: templates
+TUPLE: layout gadget size ; C: <layout> layout
+TUPLE: placeholder < gadget members ;
+: <placeholder> ( -- placeholder ) placeholder new V{ } clone >>members ;
+
+: (remove-members) ( placeholder members -- ) [ [ model? ] filter swap parent>> model>> [ remove-connection ] curry each ]
+    [ nip [ gadget? ] filter [ unparent ] each ] 2bi ;
+
+: remove-members ( placeholder -- ) dup members>> [ drop ] [ [ (remove-members) ] keep delete-all ] if-empty ;
+: add-member ( obj placeholder -- ) over layout? [ [ gadget>> ] dip ] when members>> push ;
+
+: , ( item -- ) make:, ;
+: make* ( quot -- list ) { } make ; inline
+
+! Just take the previous mentioned placeholder and use it
+! If there is no previously mentioned placeholder, we're probably making a box, and will create the placeholder ourselves
+DEFER: with-interface
+: insertion-quot ( quot -- quot' )
+    make:building get [ [ placeholder? ] find-last nip [ <placeholder> dup , ] unless*
+    [ templates get ] 2dip swap '[ [ _ templates set _ , @ ] with-interface ] ] when* ;
+
+SYNTAX: ,% scan string>number [ <layout> , ] curry append! ;
+SYNTAX: ->% scan string>number '[ [ _ <layout> , ] [ output-model ] bi ] append! ;
+
+GENERIC: -> ( uiitem -- model )
+M: gadget -> dup , output-model ;
+M: model -> dup , ;
+
+: <spacer> ( -- ) <gadget> 1 <layout> , ;
+
+: add-layout ( track layout -- track ) [ gadget>> ] [ size>> ] bi track-add ;
+: layouts ( sized? gadgets -- layouts ) [ [ gadget? ] [ layout? ] bi or ] filter swap
+   [ [ dup layout? [ f <layout> ] unless ] map ]
+   [ [ dup gadget? [ gadget>> ] unless ] map ] if ;
+: make-layout ( building sized? -- models layouts ) [ swap layouts ] curry
+   [ make* [ [ model? ] filter ] ] dip bi ; inline
+: <box> ( gadgets type -- track )
+   [ t make-layout ] dip <track>
+   swap [ add-layout ] each
+   swap [ <collection> >>model ] unless-empty ; inline
+: <hbox> ( gadgets -- track ) horizontal <box> ; inline
+: <vbox> ( gadgets -- track ) vertical <box> ; inline
+
+: make-book ( models gadgets model -- book ) book:<book> swap [ "No models in books" throw ] unless-empty ;
+: <book> ( quot: ( -- model ) -- book ) f make-layout rot 0 >>value make-book ; inline
+: <book*> ( quot -- book ) f make-layout f make-book ; inline
+
+ERROR: not-in-template word ;
+SYNTAX: $ CREATE-WORD dup
+    [ [ dup templates get at [ nip , ] [ not-in-template ] if* ] curry (( -- )) define-declared "$" expect ]
+    [ [ <placeholder> [ swap templates get set-at ] keep , ] curry ] bi append! ;
+
+: insert-gadget ( number parent gadget -- ) -rot [ but-last insert-nth ] change-children drop ;
+: insert-size ( number parent size -- ) -rot [ but-last insert-nth ] change-sizes drop ;
+: insertion-point ( placeholder -- number parent ) dup parent>> [ children>> index ] keep ;
+
+GENERIC: >layout ( gadget -- layout )
+M: gadget >layout f <layout> ;
+M: layout >layout ;
+
+GENERIC# (add-gadget-at) 2 ( parent item n -- )
+M: gadget (add-gadget-at) -rot [ add-gadget ] keep insert-gadget ;
+M: track (add-gadget-at) -rot >layout [ add-layout ] keep [ gadget>> insert-gadget ] [ size>> insert-size ] 3bi ;
+
+GENERIC# add-gadget-at 1 ( item location -- )
+M: object add-gadget-at insertion-point -rot (add-gadget-at) ;
+M: model add-gadget-at parent>> dup book:book? [ "No models in books" throw ]
+   [ dup model>> dup collection? [ nip swap add-connection ] [ drop [ 1array <collection> ] dip (>>model) ] if ] if ;
+: track-add-at ( item location size -- ) swap [ <layout> ] dip add-gadget-at ;
+: (track-add-at) ( parent item n size -- ) swap [ <layout> ] dip (add-gadget-at) ;
+
+: insert-item ( item location -- ) [ dup get [ drop ] [ remove-members ] if ] [ on ] [ ] tri
+    [ add-member ] 2keep add-gadget-at ;
+
+: insert-items ( makelist -- ) t swap [ dup placeholder? [ nip ] [ over insert-item ] if ] each drop ;
+
+: with-interface ( quot -- ) [ make* ] curry H{ } clone templates rot with-variable [ insert-items ] with-scope ; inline
+
+M: model >>= [ swap insertion-quot <action> ] curry ;
+M: model fmap insertion-quot <mapped> ;
+M: model $> insertion-quot side-effect-model new-mapped-model ;
+M: model <$ insertion-quot quot-model new-mapped-model ;
diff --git a/unmaintained/ui/gadgets/layout/summary.txt b/unmaintained/ui/gadgets/layout/summary.txt
new file mode 100644 (file)
index 0000000..30b5ef5
--- /dev/null
@@ -0,0 +1 @@
+Syntax for easily building GUIs and using templates
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/poppers/authors.txt b/unmaintained/ui/gadgets/poppers/authors.txt
new file mode 100644 (file)
index 0000000..ce0899f
--- /dev/null
@@ -0,0 +1 @@
+Sam Anklesaria
\ No newline at end of file
diff --git a/unmaintained/ui/gadgets/poppers/poppers.factor b/unmaintained/ui/gadgets/poppers/poppers.factor
new file mode 100644 (file)
index 0000000..1c815d5
--- /dev/null
@@ -0,0 +1,50 @@
+! Copyright (C) 2009 Sam Anklesaria
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays accessors combinators kernel math
+models models.combinators namespaces sequences
+ui.gadgets ui.gadgets.controls ui.gadgets.layout
+ui.gadgets.tracks ui.gestures ui.gadgets.line-support ;
+EXCLUDE: ui.gadgets.editors => model-field ;
+IN: ui.gadgets.poppers
+
+TUPLE: popped < model-field { fatal? initial: t } ;
+TUPLE: popped-editor < multiline-editor ;
+: <popped> ( text -- gadget ) <basic> init-field popped-editor popped (new-field) swap >>model* ;
+
+: set-expansion ( popped size -- ) over dup parent>> [ children>> index ] [ sizes>> ] bi set-nth relayout ;
+: new-popped ( popped -- ) insertion-point "" <popped>
+    [ rot 1 + f (track-add-at) ] keep [ relayout ] [ request-focus ] bi ;
+: focus-prev ( popped -- ) dup parent>> children>> length 1 =
+    [ drop ] [
+        insertion-point [ 1 - dup -1 = [ drop 1 ] when ] [ children>> ] bi* nth
+        [ request-focus ] [ editor>> end-of-document ] bi
+    ] if ;
+: initial-popped ( popper -- ) "" <popped> [ f track-add drop ] keep request-focus ;
+
+TUPLE: popper < track { unfocus-hook initial: [ drop ] } ;
+! list of strings is model (make shown objects implement sequence protocol)
+: <popper> ( model -- popper ) vertical popper new-track swap >>model ;
+
+M: popped handle-gesture swap {
+    { gain-focus [ 1 set-expansion f ] }
+    { lose-focus [ dup parent>>
+        [ [ unfocus-hook>> call( a -- ) ] curry [ f set-expansion ] bi ]
+        [ drop ] if* f
+    ] }
+    { T{ key-up f f "RET" } [ dup editor>> delete-previous-character new-popped f ] }
+    { T{ key-up f f "BACKSPACE" } [ dup editor>> editor-string "" =
+        [ dup fatal?>> [ [ focus-prev ] [ unparent ] bi ] [ t >>fatal? drop ] if ]
+        [ f >>fatal? drop ] if f
+    ] }
+    [ swap call-next-method ]
+} case ;
+
+M: popper handle-gesture swap T{ button-down f f 1 } =
+    [ hand-click# get 2 = [ initial-popped ] [ drop ] if ] [ drop ] if f ;
+
+M: popper model-changed
+    [ children>> [ unparent ] each ]
+    [ [ value>> [ <popped> ] map ] dip [ f track-add ] reduce request-focus ] bi ;
+
+M: popped pref-dim* editor>> [ pref-dim* first ] [ line-height ] bi 2array ;
+M: popper focusable-child* children>> [ t ] [ first ] if-empty ;
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 384b2fd57aa5f6ad08dfe52ab033d937dcbbb540..a0dbe228e530a99041057c188da9c5d536041e85 100644 (file)
@@ -1,4 +1,4 @@
 include vm/Config.unix
 PLAF_DLL_OBJS += vm/os-genunix.o vm/os-freebsd.o
 CFLAGS += -export-dynamic
-LIBS = -L/usr/local/lib/ -lm $(X11_UI_LIBS)
+LIBS = -L/usr/local/lib/ -lm -lrt $(X11_UI_LIBS)
index eb3a19d75a08fe82673b571a7d9e158f86ea3a7d..4a859b1216ec1c404a5ee04bd182146669000432 100644 (file)
@@ -1,4 +1,4 @@
 include vm/Config.unix
 PLAF_DLL_OBJS += vm/os-genunix.o vm/os-linux.o
 CFLAGS += -export-dynamic
-LIBS = -ldl -lm -lpthread $(X11_UI_LIBS)
+LIBS = -ldl -lm -lrt -lpthread $(X11_UI_LIBS)
index ba5ecd19a5729edd37483b86d83e3a99eb94274e..72a4056c90b4e44c96b9bc66f09a4681f81c7b97 100644 (file)
@@ -2,4 +2,4 @@ include vm/Config.unix
 PLAF_DLL_OBJS += vm/os-genunix.o vm/os-netbsd.o
 CFLAGS += -export-dynamic
 LIBPATH = -L/usr/X11R7/lib -Wl,-rpath,/usr/X11R7/lib -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib
-LIBS = -lm -lssl -lcrypto $(X11_UI_LIBS)
+LIBS = -lm -lrt -lssl -lcrypto $(X11_UI_LIBS)
index 98b7de16d8207fb0fc3b2a4f4be792fc4cfdf861..a2d7b1f271093fb9db609b7078820bdf4911c926 100644 (file)
@@ -1,6 +1,6 @@
 include vm/Config.unix
 PLAF_DLL_OBJS += vm/os-genunix.o vm/os-solaris.o
 CFLAGS += -D_STDC_C99 -Drestrict="" -export-dynamic
-LIBS += -ldl -lsocket -lnsl -lm -R/opt/PM/lib -R/opt/csw/lib \
+LIBS += -ldl -lsocket -lnsl -lm -lrt -R/opt/PM/lib -R/opt/csw/lib \
        -R/usr/local/lib -R/usr/sfw/lib -R/usr/X11R6/lib \
        -R/opt/sfw/lib $(X11_UI_LIBS)
index 9a00bafd3853ea762f4a0a100249c6add1b3dfc1..2c2c58c2787110e1b9569bcfd308bce7aa384885 100644 (file)
@@ -5,7 +5,7 @@ namespace factor
  * It is up to the caller to fill in the object's fields in a meaningful
  * fashion!
  */
-inline object *factor_vm::allot_object(header header, cell size)
+inline object *factor_vm::allot_object(cell type, cell size)
 {
        /* If the object is smaller than the nursery, allocate it in the nursery,
        after a GC if needed */
@@ -17,13 +17,13 @@ inline object *factor_vm::allot_object(header header, cell size)
 
                object *obj = nursery.allot(size);
 
-               obj->h = header;
+               obj->initialize(type);
                return obj;
        }
        /* If the object is bigger than the nursery, allocate it in
        tenured space */
        else
-               return allot_large_object(header,size);
+               return allot_large_object(type,size);
 }
 
 }
index 3945670e7dc7456fd241c85f52fb57b2c43f4736..4c97ef59a0f0dd93ffafbffe48e40e48e55a43d4 100644 (file)
@@ -3,7 +3,6 @@
 namespace factor
 {
 
-/* make a new array with an initial element */
 array *factor_vm::allot_array(cell capacity, cell fill_)
 {
        data_root<object> fill(fill_,this);
@@ -12,12 +11,13 @@ array *factor_vm::allot_array(cell capacity, cell fill_)
        return new_array;
 }
 
-/* push a new array on the stack */
 void factor_vm::primitive_array()
 {
-       cell initial = dpop();
-       cell size = unbox_array_size();
-       dpush(tag<array>(allot_array(size,initial)));
+       data_root<object> fill(dpop(),this);
+       cell capacity = unbox_array_size();
+       array *new_array = allot_uninitialized_array<array>(capacity);
+       memset_cell(new_array->data(),fill.value(),capacity * sizeof(cell));
+       dpush(tag<array>(new_array));
 }
 
 cell factor_vm::allot_array_1(cell obj_)
@@ -54,9 +54,10 @@ cell factor_vm::allot_array_4(cell v1_, cell v2_, cell v3_, cell v4_)
 
 void factor_vm::primitive_resize_array()
 {
-       array *a = untag_check<array>(dpop());
+       data_root<array> a(dpop(),this);
+       a.untag_check(this);
        cell capacity = unbox_array_size();
-       dpush(tag<array>(reallot_array(a,capacity)));
+       dpush(tag<array>(reallot_array(a.untagged(),capacity)));
 }
 
 void growable_array::add(cell elt_)
index 8eb2b530b0686944d44c34255c657fc9bf7ad6d4..5d6a0445fdd285b7d127e599cbbcf6ffb68ad765 100755 (executable)
@@ -5,7 +5,7 @@ inline cell array_nth(array *array, cell slot)
 {
 #ifdef FACTOR_DEBUG
        assert(slot < array_capacity(array));
-       assert(array->h.hi_tag() == ARRAY_TYPE);
+       assert(array->type() == ARRAY_TYPE);
 #endif
        return array->data()[slot];
 }
@@ -14,7 +14,7 @@ inline void factor_vm::set_array_nth(array *array, cell slot, cell value)
 {
 #ifdef FACTOR_DEBUG
        assert(slot < array_capacity(array));
-       assert(array->h.hi_tag() == ARRAY_TYPE);
+       assert(array->type() == ARRAY_TYPE);
 #endif
        cell *slot_ptr = &array->data()[slot];
        *slot_ptr = value;
index 03a6ea5ad0c623ddb667224f4708be7755cad3e8..6cd2a5b6945b56f754a39c382c66a4472969b938 100644 (file)
@@ -1,7 +1,29 @@
 namespace factor
 {
 
-/* These algorithms were snarfed from various places. I did not come up with them myself */
+inline cell log2(cell x)
+{
+       cell n;
+#if defined(FACTOR_X86) || defined(FACTOR_AMD64)
+       asm ("bsr %1, %0;":"=r"(n):"r"(x));
+#elif defined(FACTOR_PPC)
+       asm ("cntlzw %1, %0;":"=r"(n):"r"(x));
+       n = (31 - n);
+#else
+       #error Unsupported CPU
+#endif
+       return n;
+}
+
+inline cell rightmost_clear_bit(cell x)
+{
+       return log2(~x & (x + 1));
+}
+
+inline cell rightmost_set_bit(cell x)
+{
+       return log2(x & -x);
+}
 
 inline cell popcount(cell x)
 {
@@ -24,39 +46,7 @@ inline cell popcount(cell x)
        x = (x       +  (x >> 4)) & k4 ; // put count of each 8 bits into those 8 bits
        x = (x * kf) >> ks; // returns 8 most significant bits of x + (x<<8) + (x<<16) + (x<<24) + ...
 
-       return (cell)x;
-}
-
-inline cell log2(cell x)
-{
-#if defined(FACTOR_X86)
-       cell n;
-       asm ("bsr %1, %0;":"=r"(n):"r"(x));
-#elif defined(FACTOR_AMD64)
-       cell n;
-       asm ("bsr %1, %0;":"=r"(n):"r"(x));
-#else
-       cell n = 0;
-#ifdef FACTOR_64
-       if (x >= (cell)1 << 32) { x >>= 32; n += 32; }
-#endif
-       if (x >= (cell)1 << 16) { x >>= 16; n += 16; }
-       if (x >= (cell)1 <<  8) { x >>=  8; n +=  8; }
-       if (x >= (cell)1 <<  4) { x >>=  4; n +=  4; }
-       if (x >= (cell)1 <<  2) { x >>=  2; n +=  2; }
-       if (x >= (cell)1 <<  1) {           n +=  1; }
-#endif
-       return n;
-}
-
-inline cell rightmost_clear_bit(cell x)
-{
-       return log2(~x & (x + 1));
-}
-
-inline cell rightmost_set_bit(cell x)
-{
-       return log2(x & -x);
+       return x;
 }
 
 }
index b317c39f62e21e274740db5fe4d626bb7454d8ed..7cfe6c2ff0d6dbea3e393cfb02a2bdb8c7a4f4c7 100644 (file)
@@ -24,9 +24,10 @@ void factor_vm::primitive_uninitialized_byte_array()
 
 void factor_vm::primitive_resize_byte_array()
 {
-       byte_array *array = untag_check<byte_array>(dpop());
+       data_root<byte_array> array(dpop(),this);
+       array.untag_check(this);
        cell capacity = unbox_array_size();
-       dpush(tag<byte_array>(reallot_array(array,capacity)));
+       dpush(tag<byte_array>(reallot_array(array.untagged(),capacity)));
 }
 
 void growable_byte_array::append_bytes(void *elts, cell len)
index a3d6fcf94168654646704d454472cce9678ef345..a96baff6ec33d64a2b796c3be4e880d4d5745f1c 100755 (executable)
@@ -15,14 +15,8 @@ struct growable_byte_array {
 
 template<typename Type> byte_array *factor_vm::byte_array_from_value(Type *value)
 {
-       return byte_array_from_values(value,1);
-}
-
-template<typename Type> byte_array *factor_vm::byte_array_from_values(Type *values, cell len)
-{
-       cell size = sizeof(Type) * len;
-       byte_array *data = allot_uninitialized_array<byte_array>(size);
-       memcpy(data->data<char>(),values,size);
+       byte_array *data = allot_uninitialized_array<byte_array>(sizeof(Type));
+       memcpy(data->data<char>(),value,sizeof(Type));
        return data;
 }
 
index 0f17d4041dfdbb266ce1f400e414523c48403160..09410d4ae4ed17d3d22f6c454082a06264b7b6f9 100644 (file)
@@ -42,7 +42,7 @@ template<typename Visitor> struct code_block_visitor {
 
        void visit_object_code_block(object *obj)
        {
-               switch(obj->h.hi_tag())
+               switch(obj->type())
                {
                case WORD_TYPE:
                        {
index 2e28da3f49812c2fddad308de19db0c7be80be87..db5b33ba23944884ae32faf093cd504876271915 100644 (file)
@@ -16,11 +16,10 @@ template<typename TargetGeneration, typename Policy> struct collector_workhorse
                parent->check_data_pointer(untagged);
 
                /* is there another forwarding pointer? */
-               while(untagged->h.forwarding_pointer_p())
-                       untagged = untagged->h.forwarding_pointer();
+               while(untagged->forwarding_pointer_p())
+                       untagged = untagged->forwarding_pointer();
 
                /* we've found the destination */
-               untagged->h.check_header();
                return untagged;
        }
 
@@ -32,7 +31,7 @@ template<typename TargetGeneration, typename Policy> struct collector_workhorse
                if(!newpointer) longjmp(parent->current_gc->gc_unwind,1);
 
                memcpy(newpointer,untagged,size);
-               untagged->h.forward_to(newpointer);
+               untagged->forward_to(newpointer);
 
                policy.promoted_object(newpointer);
 
@@ -114,7 +113,7 @@ template<typename TargetGeneration, typename Policy> struct collector {
        void trace_object(object *ptr)
        {
                workhorse.visit_slots(ptr);
-               if(ptr->h.hi_tag() == ALIEN_TYPE)
+               if(ptr->type() == ALIEN_TYPE)
                        ((alien *)ptr)->update_address();
        }
 
index 1c9dfc0defc60178398289465ba6c09acfae9409..0bbc7c8d069a41334beadde0b642feed351de310 100644 (file)
@@ -45,7 +45,7 @@ struct compaction_sizer {
        {
                if(!forwarding_map->marked_p(obj))
                        return forwarding_map->unmarked_block_size(obj);
-               else if(obj->h.hi_tag() == TUPLE_TYPE)
+               else if(obj->type() == TUPLE_TYPE)
                        return align(tuple_size_with_forwarding(forwarding_map,obj),data_alignment);
                else
                        return obj->size();
@@ -72,7 +72,7 @@ struct object_compaction_updater {
        void operator()(object *old_address, object *new_address, cell size)
        {
                cell payload_start;
-               if(old_address->h.hi_tag() == TUPLE_TYPE)
+               if(old_address->type() == TUPLE_TYPE)
                        payload_start = tuple_size_with_forwarding(data_forwarding_map,old_address);
                else
                        payload_start = old_address->binary_payload_start();
index 16b882f2cc442e4e2db46d04d8713fec46a73e4d..f5fac1119ef54630a96d66a3f8c6bcad8bced9a4 100644 (file)
@@ -3,6 +3,20 @@
 namespace factor
 {
 
+context::context(cell ds_size, cell rs_size) :
+       callstack_top(NULL),
+       callstack_bottom(NULL),
+       datastack(0),
+       retainstack(0),
+       datastack_save(0),
+       retainstack_save(0),
+       magic_frame(NULL),
+       datastack_region(new segment(ds_size,false)),
+       retainstack_region(new segment(rs_size,false)),
+       catchstack_save(0),
+       current_callback_save(0),
+       next(NULL) {}
+
 void factor_vm::reset_datastack()
 {
        ds = ds_bot - sizeof(cell);
@@ -42,11 +56,7 @@ context *factor_vm::alloc_context()
                unused_contexts = unused_contexts->next;
        }
        else
-       {
-               new_context = new context;
-               new_context->datastack_region = new segment(ds_size,false);
-               new_context->retainstack_region = new segment(rs_size,false);
-       }
+               new_context = new context(ds_size,rs_size);
 
        return new_context;
 }
index aa6f9ec8cecf7a9fc966ce670d3b35940eb4594d..ddbae5de78baefbaa212c1d862e09f95ce66ffc7 100644 (file)
@@ -46,6 +46,8 @@ struct context {
        cell current_callback_save;
 
        context *next;
+
+       context(cell ds_size, cell rs_size);
 };
 
 #define ds_bot (ctx->datastack_region->start)
index c62b433af07ca61a8ad8819f9bcf809efe57404c..c9d9ef085487bdedaa7253a8f9c223c478f7f0ba 100755 (executable)
@@ -126,7 +126,7 @@ cell object::size() const
 {
        if(free_p()) return ((free_heap_block *)this)->size();
 
-       switch(h.hi_tag())
+       switch(type())
        {
        case ARRAY_TYPE:
                return align(array_size((array*)this),data_alignment);
@@ -166,7 +166,9 @@ the GC. Some types have a binary payload at the end (string, word, DLL) which
 we ignore. */
 cell object::binary_payload_start() const
 {
-       switch(h.hi_tag())
+       if(free_p()) return 0;
+
+       switch(type())
        {
        /* these objects do not refer to other objects at all */
        case FLOAT_TYPE:
@@ -234,7 +236,7 @@ struct object_accumulator {
 
        void operator()(object *obj)
        {
-               if(type == TYPE_COUNT || obj->h.hi_tag() == type)
+               if(type == TYPE_COUNT || obj->type() == type)
                        objects.push_back(tag_dynamic(obj));
        }
 };
diff --git a/vm/data_heap_checker.cpp b/vm/data_heap_checker.cpp
new file mode 100644 (file)
index 0000000..fb05508
--- /dev/null
@@ -0,0 +1,101 @@
+#include "master.hpp"
+
+/* A tool to debug write barriers. Call check_data_heap() to ensure that all
+cards that should be marked are actually marked. */
+
+namespace factor
+{
+
+enum generation {
+       nursery_generation,
+       aging_generation,
+       tenured_generation
+};
+
+inline generation generation_of(factor_vm *parent, object *obj)
+{
+       if(parent->data->nursery->contains_p(obj))
+               return nursery_generation;
+       else if(parent->data->aging->contains_p(obj))
+               return aging_generation;
+       else if(parent->data->tenured->contains_p(obj))
+               return tenured_generation;
+       else
+       {
+               critical_error("Bad object",(cell)obj);
+               return (generation)-1;
+       }
+}
+
+struct slot_checker {
+       factor_vm *parent;
+       object *obj;
+       generation gen;
+
+       explicit slot_checker(factor_vm *parent_, object *obj_, generation gen_) :
+               parent(parent_), obj(obj_), gen(gen_) {}
+
+       void check_write_barrier(cell *slot_ptr, generation target, char mask)
+       {
+               cell object_card_pointer = parent->cards_offset + ((cell)obj >> card_bits);
+               cell slot_card_pointer = parent->cards_offset + ((cell)slot_ptr >> card_bits);
+               char slot_card_value = *(char *)slot_card_pointer;
+               if((slot_card_value & mask) != mask)
+               {
+                       printf("card not marked\n");
+                       printf("source generation: %d\n",gen);
+                       printf("target generation: %d\n",target);
+                       printf("object: 0x%lx\n",(cell)obj);
+                       printf("object type: %ld\n",obj->type());
+                       printf("slot pointer: 0x%lx\n",(cell)slot_ptr);
+                       printf("slot value: 0x%lx\n",*slot_ptr);
+                       printf("card of object: 0x%lx\n",object_card_pointer);
+                       printf("card of slot: 0x%lx\n",slot_card_pointer);
+                       printf("\n");
+                       parent->factorbug();
+               }
+       }
+
+       void operator()(cell *slot_ptr)
+       {
+               if(!immediate_p(*slot_ptr))
+               {
+                       generation target = generation_of(parent,untag<object>(*slot_ptr));
+                       switch(gen)
+                       {
+                       case nursery_generation:
+                               break;
+                       case aging_generation:
+                               if(target == nursery_generation)
+                                       check_write_barrier(slot_ptr,target,card_points_to_nursery);
+                               break;
+                       case tenured_generation:
+                               if(target == nursery_generation)
+                                       check_write_barrier(slot_ptr,target,card_points_to_nursery);
+                               else if(target == aging_generation)
+                                       check_write_barrier(slot_ptr,target,card_points_to_aging);
+                               break;
+                       }
+               }
+       }
+};
+
+struct object_checker {
+       factor_vm *parent;
+
+       explicit object_checker(factor_vm *parent_) : parent(parent_) {}
+
+       void operator()(object *obj)
+       {
+               slot_checker checker(parent,obj,generation_of(parent,obj));
+               obj->each_slot(checker);
+       }
+};
+
+void factor_vm::check_data_heap()
+{
+       object_checker checker(this);
+       each_object(checker);
+}
+
+}
index df2361541956ec2016f51864fc378efb97469fb4..aa16b39a81ca1e17f7e8b98410d0f8d774eb3d8c 100755 (executable)
@@ -243,7 +243,7 @@ struct object_dumper {
 
        void operator()(object *obj)
        {
-               if(type == TYPE_COUNT || obj->h.hi_tag() == type)
+               if(type == TYPE_COUNT || obj->type() == type)
                {
                        std::cout << padded_address((cell)obj) << " ";
                        parent->print_nested_obj(tag_dynamic(obj),2);
@@ -288,7 +288,7 @@ struct data_reference_object_visitor {
        void operator()(object *obj)
        {
                data_reference_slot_visitor visitor(look_for,obj,parent);
-               parent->do_slots(obj,visitor);
+               obj->each_slot(visitor);
        }
 };
 
index 589d1898b15ab83e05b8b83aaf9fc4433bad3a8a..39088500adbe3fcbde73bab19a426ed4c531d654 100755 (executable)
@@ -119,7 +119,7 @@ void factor_vm::init_factor(vm_parameters *p)
        if(p->image_path == NULL)
                p->image_path = default_image_path();
 
-       srand(current_micros());
+       srand(system_micros());
        init_ffi();
        init_stacks(p->ds_size,p->rs_size);
        init_callbacks(p->callback_size);
@@ -167,7 +167,14 @@ void factor_vm::start_factor(vm_parameters *p)
        if(p->fep) factorbug();
 
        nest_stacks(NULL);
-       c_to_factor_toplevel(special_objects[OBJ_BOOT]);
+       c_to_factor_toplevel(special_objects[OBJ_STARTUP_QUOT]);
+       unnest_stacks();
+}
+
+void factor_vm::stop_factor()
+{
+       nest_stacks(NULL);
+       c_to_factor_toplevel(special_objects[OBJ_SHUTDOWN_QUOT]);
        unnest_stacks();
 }
 
index cde6a2d781d5a4c7fddecb95393fe24f12be6fa0..ed961e3dab4766ef8212ddf52a9ab4ac18fd4d10 100644 (file)
@@ -39,39 +39,59 @@ void free_list::add_to_free_list(free_heap_block *block)
 free_heap_block *free_list::find_free_block(cell size)
 {
        /* Check small free lists */
-       for(cell i = size / block_granularity; i < free_list_count; i++)
+       if(size / block_granularity < free_list_count)
        {
-               std::vector<free_heap_block *> &blocks = small_blocks[i];
-               if(blocks.size())
+               std::vector<free_heap_block *> &blocks = small_blocks[size / block_granularity];
+               if(blocks.size() == 0)
                {
-                       free_heap_block *block = blocks.back();
-                       blocks.pop_back();
-
-                       free_block_count--;
-                       free_space -= block->size();
-
-                       return block;
+                       /* Round up to a multiple of 'size' */
+                       cell large_block_size = ((allocation_page_size + size - 1) / size) * size;
+
+                       /* Allocate a block this big */
+                       free_heap_block *large_block = find_free_block(large_block_size);
+                       if(!large_block) return NULL;
+
+                       large_block = split_free_block(large_block,large_block_size);
+
+                       /* Split it up into pieces and add each piece back to the free list */
+                       for(cell offset = 0; offset < large_block_size; offset += size)
+                       {
+                               free_heap_block *small_block = large_block;
+                               large_block = (free_heap_block *)((cell)large_block + size);
+                               small_block->make_free(size);
+                               add_to_free_list(small_block);
+                       }
                }
-       }
-
-       /* Check large free lists */
-       free_heap_block key;
-       key.make_free(size);
-       large_block_set::iterator iter = large_blocks.lower_bound(&key);
-       large_block_set::iterator end = large_blocks.end();
 
-       if(iter != end)
-       {
-               free_heap_block *block = *iter;
-               large_blocks.erase(iter);
+               free_heap_block *block = blocks.back();
+               blocks.pop_back();
 
                free_block_count--;
                free_space -= block->size();
 
                return block;
        }
+       else
+       {
+               /* Check large free list */
+               free_heap_block key;
+               key.make_free(size);
+               large_block_set::iterator iter = large_blocks.lower_bound(&key);
+               large_block_set::iterator end = large_blocks.end();
 
-       return NULL;
+               if(iter != end)
+               {
+                       free_heap_block *block = *iter;
+                       large_blocks.erase(iter);
+
+                       free_block_count--;
+                       free_space -= block->size();
+
+                       return block;
+               }
+
+               return NULL;
+       }
 }
 
 free_heap_block *free_list::split_free_block(free_heap_block *block, cell size)
@@ -90,22 +110,7 @@ free_heap_block *free_list::split_free_block(free_heap_block *block, cell size)
 
 bool free_list::can_allot_p(cell size)
 {
-       /* Check small free lists */
-       for(cell i = size / block_granularity; i < free_list_count; i++)
-       {
-               if(small_blocks[i].size()) return true;
-       }
-
-       /* Check large free lists */
-       large_block_set::const_iterator iter = large_blocks.begin();
-       large_block_set::const_iterator end = large_blocks.end();
-
-       for(; iter != end; iter++)
-       {
-               if((*iter)->size() >= size) return true;
-       }
-
-       return false;
+       return largest_free_block() >= std::max(size,allocation_page_size);
 }
 
 cell free_list::largest_free_block()
index ad880b92d03640362edf8b8aae391e85a92a0504..d934ec34ac752a400f260de843afd0bbced67bee 100644 (file)
@@ -2,6 +2,7 @@ namespace factor
 {
 
 static const cell free_list_count = 32;
+static const cell allocation_page_size = 1024;
 
 struct free_heap_block
 {
@@ -9,7 +10,7 @@ struct free_heap_block
 
        bool free_p() const
        {
-               return header & 1 == 1;
+               return (header & 1) == 1;
        }
 
        cell size() const
index 07c410218c2a69682a1691a6c1dbf7e9f0cf0f7c..188ab55efc067547cb5068d43ff323b792f478af 100644 (file)
@@ -126,8 +126,12 @@ void factor_vm::collect_full(bool trace_contexts_p)
 {
        collect_mark_impl(trace_contexts_p);
        collect_sweep_impl();
-       if(data->tenured->largest_free_block() <= data->nursery->size + data->aging->size)
+       if(data->low_memory_p())
+       {
+               current_gc->op = collect_compact_op;
+               current_gc->event->op = collect_compact_op;
                collect_compact_impl(trace_contexts_p);
+       }
        else
                update_code_heap_words_and_literals();
 }
index 977266bd7d7c0afdef6092bf4b554d03e997ecbd..ff458e95dce7254365fce26fced193e740f10c47 100755 (executable)
--- a/vm/gc.cpp
+++ b/vm/gc.cpp
@@ -8,7 +8,7 @@ gc_event::gc_event(gc_op op_, factor_vm *parent) :
        cards_scanned(0),
        decks_scanned(0),
        code_blocks_scanned(0),
-       start_time(current_micros()),
+       start_time(nano_count()),
        card_scan_time(0),
        code_scan_time(0),
        data_sweep_time(0),
@@ -17,70 +17,70 @@ gc_event::gc_event(gc_op op_, factor_vm *parent) :
 {
        data_heap_before = parent->data_room();
        code_heap_before = parent->code_room();
-       start_time = current_micros();
+       start_time = nano_count();
 }
 
 void gc_event::started_card_scan()
 {
-       temp_time = current_micros();
+       temp_time = nano_count();
 }
 
 void gc_event::ended_card_scan(cell cards_scanned_, cell decks_scanned_)
 {
        cards_scanned += cards_scanned_;
        decks_scanned += decks_scanned_;
-       card_scan_time = (current_micros() - temp_time);
+       card_scan_time = (nano_count() - temp_time);
 }
 
 void gc_event::started_code_scan()
 {
-       temp_time = current_micros();
+       temp_time = nano_count();
 }
 
 void gc_event::ended_code_scan(cell code_blocks_scanned_)
 {
        code_blocks_scanned += code_blocks_scanned_;
-       code_scan_time = (current_micros() - temp_time);
+       code_scan_time = (nano_count() - temp_time);
 }
 
 void gc_event::started_data_sweep()
 {
-       temp_time = current_micros();
+       temp_time = nano_count();
 }
 
 void gc_event::ended_data_sweep()
 {
-       data_sweep_time = (current_micros() - temp_time);
+       data_sweep_time = (nano_count() - temp_time);
 }
 
 void gc_event::started_code_sweep()
 {
-       temp_time = current_micros();
+       temp_time = nano_count();
 }
 
 void gc_event::ended_code_sweep()
 {
-       code_sweep_time = (current_micros() - temp_time);
+       code_sweep_time = (nano_count() - temp_time);
 }
 
 void gc_event::started_compaction()
 {
-       temp_time = current_micros();
+       temp_time = nano_count();
 }
 
 void gc_event::ended_compaction()
 {
-       compaction_time = (current_micros() - temp_time);
+       compaction_time = (nano_count() - temp_time);
 }
 
 void gc_event::ended_gc(factor_vm *parent)
 {
        data_heap_after = parent->data_room();
        code_heap_after = parent->code_room();
-       total_time = current_micros() - start_time;
+       total_time = nano_count() - start_time;
 }
 
-gc_state::gc_state(gc_op op_, factor_vm *parent) : op(op_), start_time(current_micros())
+gc_state::gc_state(gc_op op_, factor_vm *parent) : op(op_), start_time(nano_count())
 {
        event = new gc_event(op,parent);
 }
@@ -234,7 +234,7 @@ VM_C_API void inline_gc(cell *data_roots_base, cell data_roots_size, factor_vm *
  * It is up to the caller to fill in the object's fields in a meaningful
  * fashion!
  */
-object *factor_vm::allot_large_object(header header, cell size)
+object *factor_vm::allot_large_object(cell type, cell size)
 {
        /* If tenured space does not have enough room, collect and compact */
        if(!data->tenured->can_allot_p(size))
@@ -257,7 +257,7 @@ object *factor_vm::allot_large_object(header header, cell size)
        a nursery allocation */
        write_barrier(obj,size);
 
-       obj->h = header;
+       obj->initialize(type);
        return obj;
 }
 
@@ -270,11 +270,25 @@ void factor_vm::primitive_disable_gc_events()
 {
        if(gc_events)
        {
-               byte_array *data = byte_array_from_values(&gc_events->front(),gc_events->size());
-               dpush(tag<byte_array>(data));
+               growable_array result(this);
 
-               delete gc_events;
-               gc_events = NULL;
+               std::vector<gc_event> *gc_events = this->gc_events;
+               this->gc_events = NULL;
+
+               std::vector<gc_event>::const_iterator iter = gc_events->begin();
+               std::vector<gc_event>::const_iterator end = gc_events->end();
+
+               for(; iter != end; iter++)
+               {
+                       gc_event event = *iter;
+                       byte_array *obj = byte_array_from_value(&event);
+                       result.add(tag<byte_array>(obj));
+               }
+
+               result.trim();
+               dpush(result.elements.value());
+
+               delete this->gc_events;
        }
        else
                dpush(false_object);
index a9250eddb20e17f3123d5a96fb5779fa1e099078..d80d57dafefefb0fd74c4028976da401251b4b8f 100755 (executable)
--- a/vm/gc.hpp
+++ b/vm/gc.hpp
@@ -26,7 +26,7 @@ struct gc_event {
        cell data_sweep_time;
        cell code_sweep_time;
        cell compaction_time;
-       cell temp_time;
+       u64 temp_time;
 
        explicit gc_event(gc_op op_, factor_vm *parent);
        void started_card_scan();
index f45785f9ef69d45e10ebb546bc8eeebbd81b0c4f..4c3620277cf22fb9277325d19b582620ace26ecb 100755 (executable)
@@ -4,7 +4,7 @@ namespace factor
 template<typename Array> cell array_capacity(const Array *array)
 {
 #ifdef FACTOR_DEBUG
-       assert(array->h.hi_tag() == Array::type_number);
+       assert(array->type() == Array::type_number);
 #endif
        return array->capacity >> TAG_BITS;
 }
index be6cd813fc21978d610ca5409d1063e471ba6c17..f297cbd1377fa91162e1c5f84d46fb90425b3675 100755 (executable)
@@ -135,12 +135,12 @@ void factor_vm::relocate_object(object *object,
        cell data_relocation_base,
        cell code_relocation_base)
 {
-       cell hi_tag = object->h.hi_tag();
+       cell type = object->type();
        
        /* Tuple relocation is a bit trickier; we have to fix up the
-       layout object before we can get the tuple size, so do_slots is
+       layout object before we can get the tuple size, so each_slot is
        out of the question */
-       if(hi_tag == TUPLE_TYPE)
+       if(type == TUPLE_TYPE)
        {
                tuple *t = (tuple *)object;
                data_fixup(&t->layout,data_relocation_base);
@@ -154,9 +154,9 @@ void factor_vm::relocate_object(object *object,
        else
        {
                object_fixupper fixupper(this,data_relocation_base);
-               do_slots(object,fixupper);
+               object->each_slot(fixupper);
 
-               switch(hi_tag)
+               switch(type)
                {
                case WORD_TYPE:
                        fixup_word((word *)object,code_relocation_base);
@@ -291,7 +291,7 @@ bool factor_vm::save_image(const vm_char *filename)
        h.bignum_neg_one = bignum_neg_one;
 
        for(cell i = 0; i < special_object_count; i++)
-               h.special_objects[i] = (save_env_p(i) ? special_objects[i] : false_object);
+               h.special_objects[i] = (save_special_p(i) ? special_objects[i] : false_object);
 
        bool ok = true;
 
@@ -326,7 +326,7 @@ void factor_vm::primitive_save_image_and_exit()
 
        /* strip out special_objects data which is set on startup anyway */
        for(cell i = 0; i < special_object_count; i++)
-               if(!save_env_p(i)) special_objects[i] = false_object;
+               if(!save_special_p(i)) special_objects[i] = false_object;
 
        gc(collect_compact_op,
                0, /* requested size */
index 541ee227ee752f40eaaa4705c6388e311aa0da91..b03a0d22444b7518090b04c63a295f94d954d2e2 100644 (file)
@@ -51,8 +51,6 @@ static const cell data_alignment = 16;
 
 #define TYPE_COUNT 14
 
-#define FORWARDING_POINTER 5 /* can be anything other than FIXNUM_TYPE */
-
 enum code_block_type
 {
        code_block_unoptimized,
@@ -95,59 +93,59 @@ inline static cell tag_fixnum(fixnum untagged)
 
 struct object;
 
-struct header {
-       cell value;
+#define NO_TYPE_CHECK static const cell type_number = TYPE_COUNT
+
+struct object {
+       NO_TYPE_CHECK;
+       cell header;
+
+       cell size() const;
+       cell binary_payload_start() const;
 
-        /* Default ctor to make gcc 3.x happy */
-        explicit header() { abort(); }
+       cell *slots() const { return (cell *)this; }
 
-       explicit header(cell value_) : value(value_ << TAG_BITS) {}
+       template<typename Iterator> void each_slot(Iterator &iter);
 
-       void check_header() const
+       /* Only valid for objects in tenured space; must cast to free_heap_block
+       to do anything with it if its free */
+       bool free_p() const
        {
-#ifdef FACTOR_DEBUG
-               assert(TAG(value) == FIXNUM_TYPE && untag_fixnum(value) < TYPE_COUNT);
-#endif
+               return (header & 1) == 1;
        }
 
-       cell hi_tag() const
+       cell type() const
        {
-               check_header();
-               return value >> TAG_BITS;
+               return (header >> 2) & TAG_MASK;
        }
 
-       bool forwarding_pointer_p() const
+       void initialize(cell type)
        {
-               return TAG(value) == FORWARDING_POINTER;
+               header = type << 2;
        }
 
-       object *forwarding_pointer() const
+       cell hashcode() const
        {
-               return (object *)UNTAG(value);
+               return (header >> 6);
        }
 
-       void forward_to(object *pointer)
+       void set_hashcode(cell hashcode)
        {
-               value = RETAG(pointer,FORWARDING_POINTER);
+               header = (header & 0x3f) | (hashcode << 6);
        }
-};
 
-#define NO_TYPE_CHECK static const cell type_number = TYPE_COUNT
-
-struct object {
-       NO_TYPE_CHECK;
-       header h;
-
-       cell size() const;
-       cell binary_payload_start() const;
+       bool forwarding_pointer_p() const
+       {
+               return (header & 2) == 2;
+       }
 
-       cell *slots()  const { return (cell *)this; }
+       object *forwarding_pointer() const
+       {
+               return (object *)UNTAG(header);
+       }
 
-       /* Only valid for objects in tenured space; must fast to free_heap_block
-       to do anything with it if its free */
-       bool free_p() const
+       void forward_to(object *pointer)
        {
-               return h.value & 1 == 1;
+               header = ((cell)pointer | 2);
        }
 };
 
index fa2446d54f1f5d1f2aad2dd1144492db7116b710..b034eaf803b713fca5f2097212c136f7444f9569 100644 (file)
@@ -16,6 +16,26 @@ void factor_vm::primitive_set_special_object()
        special_objects[e] = value;
 }
 
+void factor_vm::primitive_identity_hashcode()
+{
+       cell tagged = dpeek();
+       object *obj = untag<object>(tagged);
+       drepl(tag_fixnum(obj->hashcode()));
+}
+
+void factor_vm::compute_identity_hashcode(object *obj)
+{
+       object_counter++;
+       if(object_counter == 0) object_counter++;
+       obj->set_hashcode((cell)obj ^ object_counter);
+}
+
+void factor_vm::primitive_compute_identity_hashcode()
+{
+       object *obj = untag<object>(dpop());
+       compute_identity_hashcode(obj);
+}
+
 void factor_vm::primitive_set_slot()
 {
        fixnum slot = untag_fixnum(dpop());
@@ -36,8 +56,9 @@ cell factor_vm::clone_object(cell obj_)
        else
        {
                cell size = object_size(obj.value());
-               object *new_obj = allot_object(header(obj.type()),size);
+               object *new_obj = allot_object(obj.type(),size);
                memcpy(new_obj,obj.untagged(),size);
+               new_obj->set_hashcode(0);
                return tag_dynamic(new_obj);
        }
 }
index c4e8547ce6fdf644283dd5cfb06084b45ae99392..55b5f9063db54d5a61fa92b820f3e128561c8e51 100644 (file)
@@ -4,39 +4,40 @@ namespace factor
 static const cell special_object_count = 70;
 
 enum special_object {
-       OBJ_NAMESTACK,            /* used by library only */
-       OBJ_CATCHSTACK,           /* used by library only, per-callback */
+       OBJ_NAMESTACK,             /* used by library only */
+       OBJ_CATCHSTACK,            /* used by library only, per-callback */
 
-       OBJ_CURRENT_CALLBACK = 2, /* used by library only, per-callback */
-       OBJ_WALKER_HOOK,          /* non-local exit hook, used by library only */
-       OBJ_CALLCC_1,             /* used to pass the value in callcc1 */
+       OBJ_CURRENT_CALLBACK = 2,  /* used by library only, per-callback */
+       OBJ_WALKER_HOOK,           /* non-local exit hook, used by library only */
+       OBJ_CALLCC_1,              /* used to pass the value in callcc1 */
 
-       OBJ_BREAK            = 5, /* quotation called by throw primitive */
-       OBJ_ERROR,                /* a marker consed onto kernel errors */
+       OBJ_BREAK = 5,             /* quotation called by throw primitive */
+       OBJ_ERROR,                 /* a marker consed onto kernel errors */
 
-       OBJ_CELL_SIZE        = 7, /* sizeof(cell) */
-       OBJ_CPU,                  /* CPU architecture */
-       OBJ_OS,                   /* operating system name */
+       OBJ_CELL_SIZE = 7,         /* sizeof(cell) */
+       OBJ_CPU,                   /* CPU architecture */
+       OBJ_OS,                    /* operating system name */
 
-       OBJ_ARGS            = 10, /* command line arguments */
-       OBJ_STDIN,                /* stdin FILE* handle */
-       OBJ_STDOUT,               /* stdout FILE* handle */
+       OBJ_ARGS = 10,             /* command line arguments */
+       OBJ_STDIN,                 /* stdin FILE* handle */
+       OBJ_STDOUT,                /* stdout FILE* handle */
 
-       OBJ_IMAGE           = 13, /* image path name */
-       OBJ_EXECUTABLE,           /* runtime executable path name */
+       OBJ_IMAGE = 13,            /* image path name */
+       OBJ_EXECUTABLE,            /* runtime executable path name */
 
-       OBJ_EMBEDDED        = 15, /* are we embedded in another app? */
-       OBJ_EVAL_CALLBACK,        /* used when Factor is embedded in a C app */
-       OBJ_YIELD_CALLBACK,       /* used when Factor is embedded in a C app */
-       OBJ_SLEEP_CALLBACK,       /* used when Factor is embedded in a C app */
+       OBJ_EMBEDDED = 15,         /* are we embedded in another app? */
+       OBJ_EVAL_CALLBACK,         /* used when Factor is embedded in a C app */
+       OBJ_YIELD_CALLBACK,        /* used when Factor is embedded in a C app */
+       OBJ_SLEEP_CALLBACK,        /* used when Factor is embedded in a C app */
 
-       OBJ_COCOA_EXCEPTION = 19, /* Cocoa exception handler quotation */
+       OBJ_COCOA_EXCEPTION = 19,  /* Cocoa exception handler quotation */
 
-       OBJ_BOOT            = 20, /* boot quotation */
-       OBJ_GLOBAL,               /* global namespace */
+       OBJ_STARTUP_QUOT = 20,     /* startup quotation */
+       OBJ_GLOBAL,                /* global namespace */
+       OBJ_SHUTDOWN_QUOT,         /* shutdown quotation */
 
        /* Quotation compilation in quotations.c */
-       JIT_PROLOG          = 23,
+       JIT_PROLOG = 23,
        JIT_PRIMITIVE_WORD,
        JIT_PRIMITIVE,
        JIT_WORD_JUMP,
@@ -60,10 +61,14 @@ enum special_object {
        JIT_DECLARE_WORD,
 
        /* Callback stub generation in callbacks.c */
-       CALLBACK_STUB       = 45,
+       CALLBACK_STUB = 45,
+       
+       /* Incremented on every modify-code-heap call; invalidates call( inline
+       caching */
+       REDEFINITION_COUNTER = 46,
 
        /* Polymorphic inline cache generation in inline_cache.c */
-       PIC_LOAD            = 47,
+       PIC_LOAD = 47,
        PIC_TAG,
        PIC_TUPLE,
        PIC_CHECK_TAG,
@@ -73,29 +78,46 @@ enum special_object {
        PIC_MISS_TAIL_WORD,
 
        /* Megamorphic cache generation in dispatch.c */
-       MEGA_LOOKUP         = 57,
+       MEGA_LOOKUP = 57,
        MEGA_LOOKUP_WORD,
        MEGA_MISS_WORD,
 
-       OBJ_UNDEFINED       = 60, /* default quotation for undefined words */
+       OBJ_UNDEFINED = 60,       /* default quotation for undefined words */
 
-       OBJ_STDERR          = 61, /* stderr FILE* handle */
+       OBJ_STDERR = 61,          /* stderr FILE* handle */
 
-       OBJ_STAGE2          = 62, /* have we bootstrapped? */
+       OBJ_STAGE2 = 62,          /* have we bootstrapped? */
 
-       OBJ_CURRENT_THREAD  = 63,
+       OBJ_CURRENT_THREAD = 63,
 
-       OBJ_THREADS         = 64,
-       OBJ_RUN_QUEUE       = 65,
-       OBJ_SLEEP_QUEUE     = 66,
+       OBJ_THREADS = 64,
+       OBJ_RUN_QUEUE = 65,
+       OBJ_SLEEP_QUEUE = 66,
 };
 
-#define OBJ_FIRST_SAVE OBJ_BOOT
+/* save-image-and-exit discards special objects that are filled in on startup
+anyway, to reduce image size */
+#define OBJ_FIRST_SAVE OBJ_STARTUP_QUOT
 #define OBJ_LAST_SAVE OBJ_STAGE2
 
-inline static bool save_env_p(cell i)
+inline static bool save_special_p(cell i)
 {
        return (i >= OBJ_FIRST_SAVE && i <= OBJ_LAST_SAVE);
 }
 
+template<typename Iterator> void object::each_slot(Iterator &iter)
+{
+       cell scan = (cell)this;
+       cell payload_start = binary_payload_start();
+       cell end = scan + payload_start;
+
+       scan += sizeof(cell);
+
+       while(scan < end)
+       {
+               iter((cell *)scan);
+               scan += sizeof(cell);
+       }
+}
+
 }
index 065f0dfd4094174d49603976bedac5ad43359fdc..ba23125e802c616281ef8f10be40252b530ce328 100644 (file)
@@ -1,4 +1,5 @@
 #include "master.hpp"
+#include <time.h>
 
 namespace factor
 {
@@ -34,4 +35,14 @@ const char *default_image_path()
        return new_path;
 }
 
+u64 nano_count()
+{
+       struct timespec t;
+       int ret;
+       ret = clock_gettime(CLOCK_MONOTONIC,&t);
+       if(ret != 0)
+               fatal_error("clock_gettime failed", 0);
+       return (u64)t.tv_sec * 1000000000 + t.tv_nsec;
+}
+
 }
index 438957bd047ff2c765b3a2d75d5bff0f537cb814..a4b21911009fbfc16243f5538931be41311d4eda 100644 (file)
@@ -1,5 +1,6 @@
 #import <Cocoa/Cocoa.h>
 
+#include <mach/mach_time.h>
 #include "master.hpp"
 
 namespace factor
@@ -84,4 +85,16 @@ Protocol *objc_getProtocol(char *name)
                return nil;
 }
 
+u64 nano_count()
+{
+       u64 t;
+       mach_timebase_info_data_t info;
+       kern_return_t ret;
+       t = mach_absolute_time();
+       ret = mach_timebase_info(&info);
+       if(ret != 0)
+               fatal_error("mach_timebase_info failed",ret);
+       return t * (info.numer/info.denom);
+}
+
 }
index cd885411369fc83c6b4715e4f349b60442edca82..f47dc1d3639f417a0c41da2374e78f362320edef 100644 (file)
@@ -40,16 +40,29 @@ factor_vm *tls_vm()
 
 static void *null_dll;
 
-s64 current_micros()
+u64 system_micros()
 {
        struct timeval t;
        gettimeofday(&t,NULL);
-       return (s64)t.tv_sec * 1000000 + t.tv_usec;
+       return (u64)t.tv_sec * 1000000 + t.tv_usec;
 }
 
-void sleep_micros(cell usec)
+void sleep_nanos(u64 nsec)
 {
-       usleep(usec);
+       timespec ts;
+       timespec ts_rem;
+       int ret;
+       ts.tv_sec = nsec / 1000000000;
+       ts.tv_nsec = nsec % 1000000000;
+       ret = nanosleep(&ts,&ts_rem);
+       while(ret == -1 && errno == EINTR)
+       {
+               memcpy(&ts, &ts_rem, sizeof(ts));
+               ret = nanosleep(&ts, &ts_rem);
+       }
+
+       if(ret == -1)
+               fatal_error("nanosleep failed", 0);
 }
 
 void factor_vm::init_ffi()
index 05ab8b1120e3a4f29219aadb8d3d307074bd7882..fa9bc71417bd2f83aa8a3f2b7ed744b47070ce2c 100644 (file)
@@ -52,8 +52,9 @@ void unix_init_signals();
 void signal_handler(int signal, siginfo_t* siginfo, void* uap);
 void dump_stack_signal(int signal, siginfo_t* siginfo, void* uap);
 
-s64 current_micros();
-void sleep_micros(cell usec);
+u64 system_micros();
+u64 nano_count();
+void sleep_nanos(u64 nsec);
 
 void init_platform_globals();
 
index f51953e6ebf737337465103f9132990810b92244..a57db667c421b76c549ad604b0681cb735c59e70 100644 (file)
@@ -3,7 +3,7 @@
 namespace factor
 {
 
-s64 current_micros()
+u64 system_micros()
 {
        SYSTEMTIME st;
        FILETIME ft;
index f41262e54bb8d256a7dbdd62d7001d07018e9073..48da3fa5512e2d254125fa054dc220419dd3682c 100644 (file)
@@ -22,7 +22,7 @@ char *getenv(char *name);
 #define snprintf _snprintf
 #define snwprintf _snwprintf
 
-s64 current_micros();
+u64 system_micros();
 void c_to_factor_toplevel(cell quot);
 void open_console();
 
index 0c5ddd99e19b40ae46eebe4e8606e78243cf0e79..796834a9c4529582586199b4493f7d6b618cc8b3 100755 (executable)
@@ -28,14 +28,34 @@ factor_vm *tls_vm()
        return vm;
 }
 
-s64 current_micros()
+u64 system_micros()
 {
        FILETIME t;
        GetSystemTimeAsFileTime(&t);
-       return (((s64)t.dwLowDateTime | (s64)t.dwHighDateTime<<32)
+       return (((u64)t.dwLowDateTime | (u64)t.dwHighDateTime<<32)
                - EPOCH_OFFSET) / 10;
 }
 
+u64 nano_count()
+{
+       LARGE_INTEGER count;
+       LARGE_INTEGER frequency;
+       BOOL ret;
+       ret = QueryPerformanceCounter(&count);
+       if(ret == 0)
+               fatal_error("QueryPerformanceCounter", 0);
+       ret = QueryPerformanceFrequency(&frequency);
+       if(ret == 0)
+               fatal_error("QueryPerformanceFrequency", 0);
+       
+       return count.QuadPart*(1000000000/frequency.QuadPart);
+}
+
+void sleep_nanos(u64 nsec)
+{
+       Sleep((DWORD)(nsec/1000000));
+}
+
 LONG factor_vm::exception_handler(PEXCEPTION_POINTERS pe)
 {
        PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord;
index 48745584d3c29ee8d4513e635cdfff08a4b0975c..78426b19ca0e57c7b61be1ebb2e9315ea25bd975 100755 (executable)
@@ -126,11 +126,6 @@ segment::~segment()
                fatal_error("Segment deallocation failed",0);
 }
 
-void factor_vm::sleep_micros(u64 usec)
-{
-       Sleep((DWORD)(usec / 1000));
-}
-
 long getpagesize()
 {
        static long g_pagesize = 0;
index 403842b2cb6220ce05af969abab11f64cf891922..eeac2a42ddff2f79348e7a17897cda15f47df062 100644 (file)
@@ -43,7 +43,9 @@ typedef wchar_t vm_char;
 inline static void init_signals() {}
 inline static void early_init() {}
 
-s64 current_micros();
+u64 system_micros();
+u64 nano_count();
+void sleep_nanos(u64 nsec);
 long getpagesize();
 
 }
index 013250a502dc924e01f62ad5a32c6df07f841145..dc1ca8246db24328ee872acca8f175105b63c081 100644 (file)
@@ -66,7 +66,8 @@ PRIMITIVE_FORWARD(set_callstack)
 PRIMITIVE_FORWARD(exit)
 PRIMITIVE_FORWARD(data_room)
 PRIMITIVE_FORWARD(code_room)
-PRIMITIVE_FORWARD(micros)
+PRIMITIVE_FORWARD(system_micros)
+PRIMITIVE_FORWARD(nano_count)
 PRIMITIVE_FORWARD(modify_code_heap)
 PRIMITIVE_FORWARD(dlopen)
 PRIMITIVE_FORWARD(dlsym)
@@ -126,6 +127,8 @@ PRIMITIVE_FORWARD(strip_stack_traces)
 PRIMITIVE_FORWARD(callback)
 PRIMITIVE_FORWARD(enable_gc_events)
 PRIMITIVE_FORWARD(disable_gc_events)
+PRIMITIVE_FORWARD(identity_hashcode)
+PRIMITIVE_FORWARD(compute_identity_hashcode)
 
 const primitive_type primitives[] = {
        primitive_bignum_to_fixnum,
@@ -200,7 +203,8 @@ const primitive_type primitives[] = {
        primitive_exit,
        primitive_data_room,
        primitive_code_room,
-       primitive_micros,
+       primitive_system_micros,
+       primitive_nano_count,
        primitive_modify_code_heap,
        primitive_dlopen,
        primitive_dlsym,
@@ -288,6 +292,8 @@ const primitive_type primitives[] = {
        primitive_callback,
        primitive_enable_gc_events,
        primitive_disable_gc_events,
+       primitive_identity_hashcode,
+       primitive_compute_identity_hashcode,
 };
 
 }
index 403d26f0ca92036796d89bf026170ce4234e4257..19348be4efc1fabc333001e779032b49b92f17b9 100755 (executable)
@@ -37,8 +37,21 @@ void factor_vm::set_profiling(bool profiling)
        for(cell i = 0; i < length; i++)
        {
                tagged<word> word(array_nth(words.untagged(),i));
+
+               /* Note: can't do w->profiling = ... since LHS evaluates
+               before RHS, and if RHS does a GC, we will have an
+               invalid pointer on the LHS */
                if(profiling)
+               {
+                       if(!word->profiling)
+                       {
+                               code_block *profiling_block = compile_profiling_stub(word.value());
+                               word->profiling = profiling_block;
+                       }
+
                        word->counter = tag_fixnum(0);
+               }
+
                update_word_xt(word.untagged());
        }
 
index 59375df1fbd6e00d4ae66166f304843774419506..1bb2e0c44ebdc8e879810d45b7b66dd149b50ecb 100755 (executable)
@@ -8,14 +8,19 @@ void factor_vm::primitive_exit()
        exit(to_fixnum(dpop()));
 }
 
-void factor_vm::primitive_micros()
+void factor_vm::primitive_system_micros()
 {
-       box_unsigned_8(current_micros());
+       box_unsigned_8(system_micros());
+}
+
+void factor_vm::primitive_nano_count()
+{
+       box_unsigned_8(nano_count());
 }
 
 void factor_vm::primitive_sleep()
 {
-       sleep_micros(to_cell(dpop()));
+       sleep_nanos(to_unsigned_8(dpop()));
 }
 
 }
index 9e135e6779d501bfe47d53bcf973eb823dd48ac0..d9a32517a410d5dfd729ca226f9e46411c85c3c3 100644 (file)
@@ -157,9 +157,10 @@ string* factor_vm::reallot_string(string *str_, cell capacity)
 
 void factor_vm::primitive_resize_string()
 {
-       string* str = untag_check<string>(dpop());
+       data_root<string> str(dpop(),this);
+       str.untag_check(this);
        cell capacity = unbox_array_size();
-       dpush(tag<string>(reallot_string(str,capacity)));
+       dpush(tag<string>(reallot_string(str.untagged(),capacity)));
 }
 
 void factor_vm::primitive_string_nth()
index e520e326fa95325787f947d0366844552a77ba8f..e9f89528bc3b0f68c6bd18240b9ae8e59590e32f 100755 (executable)
@@ -8,7 +8,7 @@ template<typename Type> cell tag(Type *value)
 
 inline static cell tag_dynamic(object *value)
 {
-       return RETAG(value,value->h.hi_tag());
+       return RETAG(value,value->type());
 }
 
 template<typename Type>
index 022ddfa603f22d02d90db8aa2087b3c27b341981..67997e859021b1686232aa0b984a46f1d0e00f3b 100755 (executable)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -81,6 +81,9 @@ struct factor_vm
        /* Number of entries in a polymorphic inline cache */
        cell max_pic_size;
 
+       /* Incrementing object counter for identity hashing */
+       cell object_counter;
+
        // contexts
        void reset_datastack();
        void reset_retainstack();
@@ -114,13 +117,17 @@ struct factor_vm
 
        // run
        void primitive_exit();
-       void primitive_micros();
+       void primitive_system_micros();
+       void primitive_nano_count();
        void primitive_sleep();
        void primitive_set_slot();
 
        // objects
        void primitive_special_object();
        void primitive_set_special_object();
+       void primitive_identity_hashcode();
+       void compute_identity_hashcode(object *obj);
+       void primitive_compute_identity_hashcode();
        cell object_size(cell tagged);
        cell clone_object(cell obj_);
        void primitive_clone();
@@ -256,11 +263,16 @@ struct factor_vm
 
        inline void write_barrier(object *obj, cell size)
        {
-               char *start = (char *)obj;
-               for(cell offset = 0; offset < size; offset += card_size)
-                       write_barrier((cell *)(start + offset));
+               cell start = (cell)obj & -card_size;
+               cell end = ((cell)obj + size + card_size - 1) & -card_size;
+
+               for(cell offset = start; offset < end; offset += card_size)
+                       write_barrier((cell *)offset);
        }
 
+       // data heap checker
+       void check_data_heap();
+
        // gc
        void end_gc();
        void start_gc_again();
@@ -284,12 +296,12 @@ struct factor_vm
        void inline_gc(cell *data_roots_base, cell data_roots_size);
        void primitive_enable_gc_events();
        void primitive_disable_gc_events();
-       object *allot_object(header header, cell size);
-       object *allot_large_object(header header, cell size);
+       object *allot_object(cell type, cell size);
+       object *allot_large_object(cell type, cell size);
 
        template<typename Type> Type *allot(cell size)
        {
-               return (Type *)allot_object(header(Type::type_number),size);
+               return (Type *)allot_object(Type::type_number,size);
        }
 
        inline void check_data_pointer(object *pointer)
@@ -368,7 +380,6 @@ struct factor_vm
        void primitive_resize_byte_array();
 
        template<typename Type> byte_array *byte_array_from_value(Type *value);
-       template<typename Type> byte_array *byte_array_from_values(Type *values, cell len);
 
        //tuples
        void primitive_tuple();
@@ -573,24 +584,6 @@ struct factor_vm
        void save_callstack_bottom(stack_frame *callstack_bottom);
        template<typename Iterator> void iterate_callstack(context *ctx, Iterator &iterator);
 
-       /* Every object has a regular representation in the runtime, which makes GC
-       much simpler. Every slot of the object until binary_payload_start is a pointer
-       to some other object. */
-       template<typename Iterator> void do_slots(object *obj, Iterator &iter)
-       {
-               cell scan = (cell)obj;
-               cell payload_start = obj->binary_payload_start();
-               cell end = scan + payload_start;
-
-               scan += sizeof(cell);
-
-               while(scan < end)
-               {
-                       iter((cell *)scan);
-                       scan += sizeof(cell);
-               }
-       }
-
        //alien
        char *pinned_alien_offset(cell obj);
        cell allot_alien(cell delegate_, cell displacement);
@@ -656,6 +649,7 @@ struct factor_vm
        void init_factor(vm_parameters *p);
        void pass_args_to_factor(int argc, vm_char **argv);
        void start_factor(vm_parameters *p);
+       void stop_factor();
        void start_embedded_factor(vm_parameters *p);
        void start_standalone_factor(int argc, vm_char **argv);
        char *factor_eval_string(char *string);
@@ -673,7 +667,6 @@ struct factor_vm
 
        // os-windows
   #if defined(WINDOWS)
-       void sleep_micros(u64 usec);
        const vm_char *vm_executable_path();
        const vm_char *default_image_path();
        void windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length);
index dfaeed2496300b5e844a9f49dc088f2a11934a4b..a9375cfbc669188b385dd2b0842c3dfc10a0293a 100644 (file)
@@ -23,10 +23,14 @@ word *factor_vm::allot_word(cell name_, cell vocab_, cell hashcode_)
        new_word->code = NULL;
 
        jit_compile_word(new_word.value(),new_word->def,true);
-       update_word_xt(new_word.untagged());
-
        if(profiling_p)
+       {
+               code_block *profiling_block = compile_profiling_stub(new_word.value());
+               new_word->profiling = profiling_block;
                relocate_code_block(new_word->profiling);
+       }
+
+       update_word_xt(new_word.untagged());
 
        return new_word.untagged();
 }
@@ -58,24 +62,10 @@ void factor_vm::primitive_word_xt()
        }
 }
 
-/* Allocates memory */
-void factor_vm::update_word_xt(word *w_)
+void factor_vm::update_word_xt(word *w)
 {
-       data_root<word> w(w_,this);
-
-       if(profiling_p)
-       {
-               if(!w->profiling)
-               {
-                       /* Note: can't do w->profiling = ... since LHS evaluates
-                       before RHS, and if RHS does a GC, we will have an
-                       invalid pointer on the LHS */
-                       code_block *profiling = compile_profiling_stub(w.value());
-                       w->profiling = profiling;
-               }
-
+       if(profiling_p && w->profiling)
                w->xt = w->profiling->xt();
-       }
        else
                w->xt = w->code->xt();
 }