Kassen,
That actually doesn't make sense to me. 2::second has no reference point to
when it started or when it ends. It's just 2 seconds of duration. So, for
me, this:
2::second $ time => time later;
seems so implicit that it's ambiguous. I would, however, agree that there
ought to be a (dare I say) keyword for the time at which the VM started so
that you could basically do the same thing that you did in the first line.
vmstart + 2::second => time afterVmStarted;
Of course, you could just approximate this functionality by having this line
run the moment the vm starts:
now => time vmstart;
Then, you'd be able to the do everything relative to that time. At least,
that's how I would solve it.
-Mike
On Jan 7, 2008 10:11 AM, Kassen
Dear list (and language designers in particular),
this is legal; now + 2::second => time later;
so, we know that time and duration are quite similar things (we already knew that ourselves but now we know ChucK agrees).
However, this isn't legal;
2::second $ time => time later;
I tried this, intending "later" to refer to the moment 2 seconds after the VM sprang to life.
Are there good reasons not to allow the casting from time to dur and dur to time?
Yours, Kas.
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-- http://semiotech.org http://blog.deadlylittlepills.com http://www.murderkills.com http://shadowofaculture.blogspot.com