From: Geoffrey K. <ge...@kn...> - 2005-04-03 18:44:20
|
This makes JScheme + Lava3 Printf easier still: ; from Tim (load "elf/classpath.scm") (addClasspathUrl "lava3-core.jar") (addClasspathUrl "lava3-printf.jar") (import "com.sharkysoft.printf.Printf") ; new (define (sprintf fmt . args) (Printf.format fmt (list->array Object.class args))) (sprintf "%s, the answer to everything is %d" "Geoff" 42) => "Geoff, the answer to everything is 42" On Mar 31, 2005, at 09:13, Timothy John Hickey wrote: > (define (for n N by L) > (if (> n N) #f > (begin (L n) (for (+ n by) N by L)))) > > (for 3 20000 3 (lambda(i) > (Printf.out "(%5d, %6.2f, %#10x)\n" > (list->array Object.class (list i > (.floatValue (Math.sqrt i)) (* i i) > ))))) |