From: Timothy J. H. <tim...@ma...> - 2005-04-04 22:44:41
|
On Apr 3, 2005, at 2:44 PM, Geoffrey Knauth wrote: > This makes JScheme + Lava3 Printf easier still: Cool!! Maybe we should have a section of the JScheme website (and the jscheme.zip download) that shows how to extend JScheme by combining open source java jar files (like lava3-*.jar) with simple Scheme programs (like this one). For example, we could also add * jdbc jar files with code for accessing databases * jogl.jar file with code for doing 3d graphics (though this requires some installation) * smath.jar file with code for doing interval arithmetic (this we have already) * jetty.jar files with code for running an html server To minimize download space we could include an installer that would download the needed jar from the appropriate URL ... Does anyone think this would be a worthwhile effort? Does anyone know any other examples of jar files/scheme interfaces that we could use? I like the idea of building simple scheme interfaces to Java libraries that add useful functionality with only a little bit of code (big jar, small scheme interface) Geoff's sprintf example captures 90% of the desired usage of lava-core and one can still use straight javadot to get the last 10%! Best, ---Tim--- > > ; 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) >> ))))) > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |