[kepler-dev] [Ptolemy] Re: DateToken

Marten Lohstroh marten at eecs.berkeley.edu
Mon Jun 23 14:48:40 PDT 2014


On Mon, Jun 23, 2014 at 10:53 AM, Christopher Brooks
<cxh at eecs.berkeley.edu> wrote:
> I added a convert() method to DateToken which seems to work well. I did hack
> in a check for StringToken which will try to instantiate a DateToken.  I'm
> not sure if that is right.
This seems wrong to me. It is not generally possible to convert a
String into a Date. Also, the type lattice doesn't permit that
conversion. Type inference is supposed to yield a typing of which the
automatic type conversions that it imposes during run time work
without exception. We should not misuse the conversion method to build
a customized parser.

Marten

--
Marten Lohstroh, Msc. | Associate Specialist
University of California | 545Q Cory Hall
Berkeley, CA 94720  | +1 510 282 9135


More information about the Kepler-dev mailing list