97jaz / gregor

Date and time library for Racket
45 stars 10 forks source link

`moment?` broken #20

Closed sorpaas closed 7 years ago

sorpaas commented 7 years ago

In the current release (racket 6.7), (moment? (moment 1970)) returns #f.

97jaz commented 7 years ago

Interesting. I checked on 6.6, and it works there. I should probably get 6.7 on this machine now. Let's see... Hmm, I just installed 6.7 (OS X, 64-bit), and it worked there too:

screen shot 2016-12-24 at 1 25 25 am

What build are you using?

sorpaas commented 7 years ago

I'm using NixOS's Racket build (https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/racket/default.nix).

Turns out that I messed up Racket's phase system. I tried to create some really complicated macros, that have some code (using gregor) running in phase 1, and then pass that along to get compared in phase 0. At some stage in requiring all the modules, #t turned to #f. It never worked. I managed to solve the problem by reducing the number of macros I use.

How important it is to keep a good diet of macros...