Jon (>>>), Carl (>>), Jon (>): >>> Here's my proposal for how to handle dimensionality in Perl 6: >>> >>> [...] >>> >>> Thoughts? >> >> The idea has come up before, everyone thinks that Perl 6 and unit >> handling are a good fit for each other, and we're basically waiting >> for someone to write such a module. Incidentally, your phrase "a >> complication that we needn't deal with up front" is exactly why >> there's no pressing need to put this in Perl 6 "core" (fsvo "core"). > > I'm suggesting this because the recent thread about Duration indicates > to me that there _is_ a need to put at least a minimally-featured unit > handling system into the core, if for no other reason than to ensure > that Durations will be part of said system. The trick is to come up > with something that's simple enough that including it in the core > won't unduly delay release of Perl 6, but robust enough that we can > build on it after release.
Heh, I wasn't even thinking of it in terms of "delaying release of Perl 6". Maybe because I'm using Perl 6 on a daily basis, rather than waiting for it to come out. Anyway, since I don't see the need for all this unit handling with Duration in the first place, I don't agree that there is a need to put even a minimally-features unit handling system into the core. >> See also the Physical::Unit example in a blog post of mine, for an >> example of how postfix ops can be used to mark the units: >> >> <http://strangelyconsistent.org/blog/6-builtins-in-perl-6-that-you-never-knew-you-needed> > > Nice. "5 sec" definitely beats "5 but units<sec>" for legibility, and > would be a very nice way of generating Durations on the fly. Note that due to the nature of postcircumfixes, you can't actually write "5 sec" with whitespace between the "5" and the "sec". Either "5sec" or "5\ sec" is fine, though. // Carl