On Sun, Mar 9, 2014 at 7:51 PM, Daniel Carrera <[email protected]> wrote:
> Hello, > > I hope nobody minds an R7RS question. This list seems to have people > knowledgeable of R7RS. It seems weird that R7RS would specify the functions: > There's also [email protected] but I doubt people mind here. (current-jiffy) --> An exact integer representing the number of jiffies > (arbitrary unit of time) since some arbitrary epoch. > > (jiffies-per-second) --> Integer representing the number of jiffies in one > second. > > > What could possibly be the value of these functions, given that R7RS > already specifies (current-second) as the number of seconds since the Unix > epoch? This seems like an oddly useless concept for a language that tries > to be minimalist. > There are actually a number of motivations for this. (current-second) is expensive, and in the presence of NTP not guaranteed to be monotonic. It will also generally cons to return a bignum or flonum, whereas current-jiffy could always return fixnums. In general, for timing you want to use jiffies, and for calendar operations you want want seconds. The utility is not disputed. Whether this belongs in the small language is debatable (as is _everything_), but it's there and is easy to implement. -- Alex
_______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
