[racket] An error with dates and types
On 2011 Aug 22, at 01:30, Carl Eastlund wrote:
>> I wrote so. That's why I believe that the existing TR confused Norman into requiring date->seconds from an UNTYPED
>> module. I really think we need require:.
>
> There might be some confusion here because there are two kinds of
> typed modules: those written in Typed Racket, and those untyped
> modules in the core for which TR has an assigned type.
I'll freely admit to a fair amount of confusion on my part.
For what it's worth, my rather ragged working picture of what goes on with Typed Racket is something like this:
"When you have #lang typed/racket at the top, Racket gathers type information through a mixture of declaration and inference. Because of the magic #lang line, Racket somehow uses typed versions of all its stuff. Except when it doesn't. Because there's inference going on, it's not a surprise to me that some things end up with types without me doing anything about it. If I'm using something obviously rather disjoint from the core of racket (eg SRFIs) then it's no surprise that the typing doesn't work, and something like require/typed is necessary. date->seconds has a sort of core-ish feel."
That's a pretty informal picture -- I'm at the stage of trying to get something (anything non-trivial) working with TR, for the sake of experiment, without much success so far. If I do press on and manage to 'type-ify' some module, then at _that_ point, I'll make more of an effort to understand what's going on Properly (so this is not a request for anyone to unconfuse me, and I offer this as data). Carl's remark above is illuminating enough for now.
Having said that, it would obviously be nice if the type system can spot that it's been bounced off the road into the typeless wastes, and gently point that out, rather than anything quite as graphic as I discovered!
All the best,
Norman
--
Norman Gray : http://nxg.me.uk
School of Physics and Astronomy, University of Glasgow, UK