[chuck-users] making a duration into a string?

Robert Poor rdpoor at gmail.com
Sat Jan 9 15:50:00 EST 2010


How can I cast a duration into a string (e.g. for passing as a string
argument)?  Consider:

// =============
fun void log(string message) {
  // do something to log the message
}

1::second => dur d;
log("the duration is " + d);  // fails with "cannot perform '+' on
object references"
log("the duration is " + d.toString()); // fails with "type 'dur' does
not have members"
// =============

Same question for time objects.

TIA.

- Rob


More information about the chuck-users mailing list