From: Ken A. <kan...@bb...> - 2003-02-13 23:57:08
|
I thought it was time to get other JSchemers involved. At 06:41 PM 2/13/2003, matthew a. grisius wrote: >Ken Anderson wrote: > >> interact.Interactor is complicated because i wanted to simulate the behavior of an Emac buffer so the text area and a process reading from it and writting to it at the same time. >> >> Tim's SchemeEval approach of using 2 text areas may be easier. >> One thing that complicates SchemeEval is it tries to read the expression you are typing. >> >> Also it does not set standard output to be the text area. >> >> Tell us more about what you'd like to do. >> >> k > >Hello again and thank you both for the quick responses, > >While I was poking around the source code I noticed that there are some synchronized methods. This got me to wondering if the 'scheme kernel' was reentrant or could be. It would be >nice to support multi-processing since the jvm supports threads. What I would like to do is run several apps (java or Jscheme) each with its own scheme listener sharing a common >'scheme kernel'. What I mean is an environment or 'scheme world' analogous to an old fashioned 'lisp world' etc. For all practical purposes the apps could be glued together with >Jscheme within this world. Tim should speak for the new module stuff, but i hope shared things are synchronized properly. For example, interning a new symbol and setting its global value. >It would nice to be able to have many scheme listeners like you can have multiple lisp listeners in Franz, Genera, MCL, etc. These very simple listeners appeared to be like >lightweight processes that only provided bindings for a couple things like *terminal-io* etc. In my previous email I was thinking that multiple listeners could reside inside of a >JFrame, but I guess that they wouldn't have to, it's just how I pictured it in my mind. This was not clearly stated earlier, sorry, I was fishing with a grappling hook there. >Multi-processing also seems to be common with scsh and scwm ala 'fork' and 'process-run-function' functionality. There is no concept of dynamic scoping as there is in Lisp. Currently, there is one equivalent to *terminal-io* which is Scheme.out$. I think the way to do this in JScheme is to make such variables be ThreadLocals. We have not done that for backward compatibility with JDK 1.0.2, but maybe its another reason to move on. >Perhaps this is too big of a desire as it seems beyond my capabilities, but it would be nice to have a complete 'jscheme environment/world' with very tight edit/compile/debug tools >all in one place or at least allow you to build and use them in one place, e.g. using Xemacs and Jscheme. We use JScheme from XEmacs, and getting a pure JScheme editor where you could do some useful development (maybe a shadow of Emacs) would be nice. >It occured to me that the place to start with all of this was with the simplest of 'scheme listeners' and see if I could get more than one to work. They will need to solve the one Scheme.out$ problem. >As a side note: I am not sure but based on my assumptions the implication is that the Jscheme servlet is 'single threaded'?, or am I over my head here? In a webserver situation, each invocation of a servlet runs in its own thread. So, if servlets share access to a large hunk of data, that access must be syncronized. So for example, if your servlets make queries to a database, they should each use their own database connection. Servlets will give you a lot of what you're looking for. >BTW: I downloaded version 5-0-0 and SchemeEval is not in jlib/demo, I will look in the cvs repository instead. Our jar download is hopelessly out of data, we hope to correct this, right Tim? Please check things out of the cvs repository, if you have trouble let us know, it is usually very easy. >Hopefully this is a little clearer now and thanks, I do appreciate your help and curiosity. > >-m. > > >> >> At 10:22 PM 2/11/2003, Timothy Hickey wrote: >> >> >On Tuesday, February 11, 2003, at 07:06 PM, matthew a. grisius wrote: >> > >> >>Hi Tim, >> >Hi Matthew, >> > >> >> >> >>I downloaded Jscheme and poked around a bit. Awesome! Very nice Job! >> >Thanks! >> >> >> >>I want to use Jscheme in a JFrame but didn't see anything similar to >> >>that in the source code. I did see the interact package but it seems >> >>overkill for my very simple usage and there is still much work to do to >> >>use Jscheme with it. I also read all the discussion lists and there >> >>wasn't anything similar there either. >> >Hmmmm. I'm not sure what kind of Jscheme in a JFrame you wanted. >> >Interact sounds likes what you want, but jlib/demo/SchemeEval.scm is >> >another approach to using Jscheme in a JFrame. Were you looking >> >for something with the functionality of >> > java interact.Interactor >> >but written entirely in a few lines of Jscheme? That might be possible, >> >I haven't tried.... >> > >> >> >> >>I have cobbled together a simple usage (25 lines of java) of Jscheme >> >>using jscheme.REPL, keyTyped events from a JTextArea, and >> >>REPL.parseScheme and REPL.eval. But since input, output and error are >> >>defined (System.in, System.out, and System.err respectively) in >> >>jsint.Scheme it doesn't seem that Jscheme was meant to be used from >> >>anything other than an applet or a command line (e.g. a JFrame) without >> >>more work. Is this correct? Am I just missing something obvious? >> >You are right. The main REPL was not set up to be used from anything >> >but a textarea. You can however rebind jsint.Scheme.input, etc. to other >> >Readers and Writers if you want (This is a global rebinding and hence >> >may *not* be what you want). >> >> >> >>I didn't send this question to the sf lists as they seem rather advanced >> >>and I didn't want to waste bandwidth and get flamed. Any suggestions or >> >>help would be appreciated. Thank you very much. >> >There is very little flaming on our lists (so far), so don't worry about >> >posting there. >> > >> >I'm cc'ing to Ken, who wrote the interact package. He might have more >> >ideas for you. >> > >> >Cheers, >> >---Tim--- |