On Jan 7, 2008 1:50 PM, Kassen <<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<snip><div><div><br><<<now /minute>>>; is quite legal and will return a float expressing the amount of minutes the VM has been alive. I see "now" and other times as a duration with the start of the VM as it's start.
<br><br>So; we can divide "now" by a duration and get a float but a float times a duration will always be a "duration" and not a "time", so far, in practice.<br> </div></div></blockquote><div>
<br>Oh, but that's far weirder! I would not have expected that to be legal. So "now" is a strange animal indeed, having traits of both time and duration...<br><br>Actually, it looks like any time type divided by a duration returns a float. hrm... I wouldn't have guessed.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><br>A keyword for this may not be enough. The following is a attempt to create my own "birth" keyword expressing this. I can't get it smaller then this and I would say this is quite perverse in a way;
<br><br> //strongly typed meets strongly timed :¬p<br>//at least it runs and works....<br>now - ((now /samp)::samp) => time birth;<br><br>I'd say this means casting can make sense but I'm open to ideas.</div></div>
</blockquote><div><br>I still don't like the idea that a time can be cast as a duration-from-vm-start, however, a "birth" keyword makes sense. Consider this:<br><br>2::second => now; // is kind of like "for the next two seconds" or "two seconds from now", etc.
<br><br>if we had some idiom for "since"... like:<br><br>since(now, birth) => dur aliveTime; // which you could build...<br><br>or:<br><br>2::second + birth => time twoSecAfterBirth;<br><br>You're right, that would make timing relative to the VM starting up much simpler.
<br><br>your way is clever:<br> //strongly typed meets strongly timed :¬p<br>//at least it runs and works....<br>now - ((now /samp)::samp) => time birth;<br><br>But I feel like you shouldn't have to do that. I see how you could easily abstract this using functions, but a keyword for the time that the VM started seems like it would be easier, more global, etc.
<br><br>at least, this returns a -1:<br><br>now - ((now /samp)::samp) => time birth;<br><<<(birth - 2::second) /2::second>>>;<br><br>I was worried... :)<br><br>-mike<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><br> <br>
<br><br></div><div class="Ih2E3d"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Of course, you could just approximate this functionality by having this line run the moment the vm starts:
<br><br>now => time vmstart;<br><br>Then, you'd be able to the do everything relative to that time. At least, that's how I would solve it.
</blockquote></div><div><br>Maybe you'll like my attempt above too.... well, I think it works....<br><br>Kas.<br><br><br></div></div>
<br>_______________________________________________<br>chuck-users mailing list<br><a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br><br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://semiotech.org">http://semiotech.org</a><br><a href="http://blog.deadlylittlepills.com">
http://blog.deadlylittlepills.com</a><br><a href="http://www.murderkills.com">http://www.murderkills.com</a><br><a href="http://shadowofaculture.blogspot.com">http://shadowofaculture.blogspot.com</a>