On Thu, Nov 18, 2010 at 8:25 PM, Carl Mäsak <cma...@gmail.com> wrote: > 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. > 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. -- Jonathan "Dataweaver" Lang