From: Timothy J H. <tjh...@br...> - 2005-02-11 02:52:37
|
Hi Joseph, On Feb 10, 2005, at 4:34 PM, Joseph Toman wrote: > Hi, > > I don't know if this is a JScheme question or just a scheme question, > but I was wondering why (if (apply and '(#t #f)) #t #f) returns #t ? Its partly a Scheme question and partly JScheme. We have implemented "and" as a macro and hence it cannot appear as an argument to apply (as it is primarily syntax not a real operator). When you evaluate (apply and '(#t #f)) it expands the macro and returns an expression indeed > (apply and '(A B)) (if A (and B) #f) > It probably should throw an error as that would make your example less confusing... Anyway, when you evaluate (if (apply and '(#t #f)) #t #f) the condition in the evaluates to a non-false quantity which is treated by Scheme as true and hence it returns #t. > > Why doesn't the command line interpreter recognize many of the special > forms as being bound ? The special forms are part of the syntax of Scheme expressions but they are not bound to procedures. > > This is more of a "just curious how other people do it" sort of > question: > How do people use JScheme? I'd like to know the answer to this one too! I can tell you how I use it and I'd like to hear about others approaches to the language. > Is it Scheme with a nice set of libraries? I use it to teach Scheme to beginners (but it doesn't have full call/cc so its not good for teaching the full Scheme language). > A looser java-ish scripting language? This is how I use it. I've used it to build Scheme servlets for writing dynamic websites (e.g. http://www.4collegewomen.org is all written in JScheme) and I use it to teach non-science students how to webprogram (e.g. http://popper.cs-i.brandeis.edu:8080/cs2a04 links to a Intro to Computers course based in Scheme also http://popper.cs-i.brandeis.edu:8080/classes/spr05/cs33b/blog2/ source.html points to a blogsite written in Scheme for another non-science major class on Internet and Society) I've used it in to build groupware in an NSF sponsored project (http://www.cs.brandeis.edu/~tim/GMCP where we've build a collaborative editor that allows many people to simultaneously edit a single document with no locks .... I use the GrewpEdit tool (written in JScheme) almost every day in another Intro class I'm teaching http://popper.cs-i.brandeis.edu:8080/classes/spr05/typcs ) Two summers ago I used it to teach a course in 3D graphics in which we used the gl4j OpenGL bindings to write OpenGL programs. Most recently, I've been using it for some exploratory Neuroscience research where we are using dimension stacking to study high dimensional computational models of neurons. (see http://www.cs.brandeis.edu/~tim/neuron for some pretty pictures) In all of these cases (and others) I use JScheme because it gives me access to all of the Java libraries that I want to use and yet it allows me to use the Scheme conceptual world to think about and implement the programs I need to write. Since its written in Java it runs anywhere and interoperates with all sorts of great applications, and it can be used to write Java servlets, Java applets, and Java Web Start applications. > Somewhere in between? How do people choose where the Scheme ends and > the Java begins? I usually write directly in Javadot when I first start using a Java API and then later build a Scheme library to hide the Java API details and allow me to program in a more declarative style. > Is that time dependent, i.e. does code migrate from Scheme to Java or > visa versa? I have had a need to convert Scheme code to Java (e.g. a student wants to extend a Scheme program I wrote but would much rather write in Java, so they convert my Scheme to Java and it usually turns out to be very nice looking Java code!) I don't think I've ever tried converting Java to Scheme, I would usually just stick it in a Jar and call it from Scheme.... > > At my company we write CAD software for the wireless industry, placing > transmitter sites, assigning channels, etc.. > We use JScheme to allow our legacy C++ code base to control a JVM that > currently runs some secondary utilities, but will become more > important as we try to port the C++ to Java. Nice application... > The combination of Scheme and JavaDot provides a nice regular syntax > that doesn't frighten C++ programmers too much, Thats nice to hear! > and of particular importance to me is that I didn't have to hack > together a scripting language! JScheme is not much more than the combination of the javadot interface with most of the R4RS language. Thanks for your feedback and questions, If anyone else wants to give their perspective, I for one would love to hear it. Best, ---Tim--- > > J. Toman > EDX Wireless LLC > > > ------------------------------------------------------- > 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 |