You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(10) |
Jun
(6) |
Jul
(1) |
Aug
(10) |
Sep
(20) |
Oct
(5) |
Nov
(2) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(25) |
Feb
(6) |
Mar
(59) |
Apr
(9) |
May
(3) |
Jun
(13) |
Jul
(6) |
Aug
(16) |
Sep
(14) |
Oct
(12) |
Nov
(4) |
Dec
(10) |
2004 |
Jan
(16) |
Feb
(12) |
Mar
(53) |
Apr
(16) |
May
(43) |
Jun
(40) |
Jul
(48) |
Aug
(20) |
Sep
(23) |
Oct
(27) |
Nov
(33) |
Dec
(8) |
2005 |
Jan
(2) |
Feb
(20) |
Mar
(7) |
Apr
(9) |
May
(2) |
Jun
(6) |
Jul
(5) |
Aug
|
Sep
|
Oct
(3) |
Nov
(3) |
Dec
(6) |
2006 |
Jan
(6) |
Feb
(6) |
Mar
(1) |
Apr
(4) |
May
|
Jun
(1) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
(2) |
2009 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ken A. <kan...@bb...> - 2004-04-01 19:42:30
|
JSchemer's, this is an interesting question that came up while i was reviewing a draft of Paul's book, "Hackers & Painters". http://www.oreilly.com/catalog/hackpaint/ At 04:08 PM 3/29/2004 +0000, Paul Graham wrote: >What causes flexibility? Is it simply succinctness? Succinctness is important, but its not the only issue. That JScheme is interactive is also very important, and a giant win over Java. Programming becomes very playful. A friend ,Mary, taught me that a ball is a great toy for a toddler, because you do something simple, like drop it, and you get a big payoff - it bounces and rolls in an unexpected way. Big suprise! You chase it, pick it up, and do it again. JScheme is like this,i don't program, i play. People ask me Java questions. I type JScheme and give them answers. Succinctness comes from several sources. Since JScheme does not need type declarations, coercions, and checked exceptions ..., typicaly, JScheme code is at least 1/3 less lines of code. This may not seem like much, but its like working 5.3 hours a day, rather than 8. However, if you simply write JScheme following a Java API, the lines of code counts can be similar. One reason is because of what i call "setter rafting style". A Java constructor can't take keyword arguments, so after you construct an object you may call setter methods on it For example, to make a red quit button that exists the application: JButton b = new JButton("Quit!"); b.setBackground(Color.red); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); }}; doing this in JScheme is only 50% shorter: (let ((b (JButton. "Quit!"))) (.setBackground b (Color.red$)) (.addActionListener b (Listener. (lambda (e) (exit)))) ...) We've found that if you wrap a JScheme API around a Java API you can get real succinctness. For example, with the JLIB GUI library this becomes a one liner: (button red "Quit!" (Listener. (lambda (e) (exit)))) Having procedures that can take any number of arguments is a win. (button) takes its arguments and guesses where they should go, which has worked pretty well in practice. I use a similar style where the setter methods themselves become keywords in a constructor. This works for any object. So the trick is to look at a programming task, and come up with a JScheme style (minilanguage) for it. We've done GUI styles where Gui code can look pretty close to how the gui components are layed out. In Java, components are defined and then wired together in an apparently haphazard fashion. Macro's can be a big win from minilanguages, of course, since i'm talking to a master: http://www.paulgraham.com/onlisp.html Here's an example of shell scripting, basically from ideas from Olin Shivers: (define (directories dir) (map* File. (inputReader (run (cmd find ,dir -type d) (cmd grep -v CVS))))) This defines a procedure that takes a directory, dir and returns a list of all the directories under it. (run) is a macro that pipes shell commands together. There are two commands (cmd) one that finds the directories below dir, and one that filters out the CVS directories. The ",dir" is there because (run) has an implicit quasiquote (thanks to Olin). (run) returns a Process and the second line of the procedure uses map* and inputReader which are generic functions, as in Common Lisp. Together they return a list of Files from the output of the (run). Here's another example of generating JavaDoc for your application: (define-command (-javadoc) "Generate API documentation." (out (run (cmd (javadoc -private -author -version -use -windowtitle ,{[appName] API} -sourcepath ,srcDir -classpath ,classDir -doctitle ,appName -d ,apiDir ,packages))))) (define-command) is another macro for defining top level commands so i would typically invoke this from a shell as: bin/make -javac The {[appName] API} is "quasi-string" an alternative syntax for string-append that in this case would be equivalent to (string-append appNam " API"). This syntax is great for doing things like generating web pages. Olin's insight of switching in and out between Scheme and minilanguages is extremely powerful. It may seem confusing to beginners, but Tim has taught this stuff (well, at least the quasi-string stuff) to nonprogrammers with success. Succinctness becomes astronomical with the right minilanguage. For example, i need to read latitude and longitudes in formats from all over the world for one application. I currently have 30 different regular expressions for the different types. I have a macro that handles each type with only 3 lines of code: (disjunctionMatcher ("([NSEW])(\\d+) ?(\\d+).(\\d+).(\\d+)" ; Regex pattern. (dir deg min sleft sright) ; Names of pieces. (makeDMSDir deg min (makeFloat sleft sright) dir)) ; The result. ... Now that i think about it, if i used generic names, like $1, $2, ... there would only be two lines per disjunction. The 91 line macro use expands into 320 lines, which is nice, but not suprising. What is surprising is imaging writing and maintaining the equivalent of the macroexpansion in Java. The 30 disjunctive regular expressions produce one regular expression that is 1169 characters long, containing 115 fragments (an expression that matches something of value, like (\\d+), which will become part of a result in the 3rd line). To make a change, say to the 17'th disjunction, you'd need find the 17th (maybe 16th?) "|" in the regular expression and find the 17th if statement in the code. What makes it worse squared!, is that if you add or remove a fragment, you need to increment or decrement each line of code that tests or extracts a fragment after where you are. What a pain! Not sure how i'd do this in Java. Maybe just change the macro to generate Java for me. Constructing and iterating over objects needs to be succinct. So, when i actually have to write Java, i find it annoying. In JScheme, i've been playing with some ideas from Arc, like variations on (lt) and (if) and alternatives for lambda, which seem pretty nice. k >--Ken Anderson wrote: >> Another point about Chapter 11. - flexibility vs speed. >> >> JScheme is so flexible compared to Java that i write code in it as often as i can. We have one project that is almost entirely JScheme. Dispite the fact that JScheme is probably 100 time slower than compiled (no declarations) Common Lisp, the performance is still extremely good. We commonly grind over 100,000 or more objects at a time. We have moved a hairy regular expression matcher into Java, for speed, but still use JScheme to control interaction with it. In such an environment, where JScheme is a thin control layer on top of Java objects the performance reduction due to JScheme is typically 2x or 3x at the most. Quite reasonable cost for an interactive development environment. >> >> In Common Lisp, of course, we could have stayed in the language using the profiler to guide our optimizations. >> >> I think this flexiblity is what makes langauges like Python and Ruby so interesting to C people. As larger programs get written, such as Zope in Python, performance becomes more of an issue and and people focus more on compilers. JScheme has a compiler, but compiled code is no faster than interpeted. While a better compiler would be useful its never gotten to be a high priority. >> >> k >> |
From: Ken A. <kan...@bb...> - 2004-03-31 19:58:37
|
Tim, I added a form to the mainwebpage.html to allow google to search the JScheme site for us, since Peter is head of search quality, it seemed like a good thing to do. However, i was so confused by your nested tables that i just simplified it, though it looks much the same. There is still a link to the old tutorial. Can we link to the new one at some point? k |
From: Timothy J. H. <tim...@ma...> - 2004-03-31 02:54:50
|
Hi Boris, On Mar 30, 2004, at 7:05 PM, Borislav Iordanov wrote: > Hi, > > I've added a few things jlib/swing.scm that I needed (toolbar and > togglebutton). The additions simply follow the established pattern. > What > is the process of submitting a patch? I'm not familiar at all how those > patch file are made and applied :( Just send me the swing.scm file and I'll look it over and check in the changes.... > > And a question: what would be an elegant way to define a paint > procedure > for a generic component. Right now, my program has only one Java class > that extends Jcomponent only in order to override the painProc method > (which invokes a scheme procedure). It would be nice to have something > like this: > > (component > (paint (lambda (graphics) ...do the painting))) It would be nice, but alas the awt toolkits was designed so that the user must subclass a component to change the paint method. IBM's SWT seems to be better designed in this regard as it has an .addPaintListener method which allows one to add a listener which is called whenever the component needs to be painted. http://www.erights.org/javadoc/org/eclipse/swt/widgets/ Control.html#addPaintListener(org.eclipse.swt.events.PaintListener) Just what we'd like for swing. We should probably create SWT version of jlib (although it is not as convenient as SWT is not part of the standard Java distribution). For the Swing toolkit we could use the javax.swing.RepaintManager class to implement a paintListener pattern for Swing.... The idea (which I haven't tested) would be to define a wrapper class SchemeRepaintManager which would allow the user to specify the RepaintManager methods functionality using Scheme procedures. Then one could use RepaintManager.setCurrentManager(MyManager) to set the manager for the current threadgroup. The new manager could implement a paint listener that would allow users to associate scheme procedures to repaint methods (e.g. MyManager.paintDirtyRegions could be overridden to call the appropriate paint listeners or the default paint procedures on all components which have dirty regions. So it looks possible, but it doesn't look extremely easy... ---Tim--- > > Isn't something of the sort that (canvas) and jlib.SchemeCanvas should > be doing. But I'm not sure it works. There is paintHandler method in > SchemeCanvas, but it doesn't seem to be set anywhere in the generic > construction processing in swing.scm. SchemeCanvas is a subclass of Canvas that allows one to manipulate an offscreen buffer directly, and the repaint method has been overridden to copy the offscreen buffer to the screen. Its not too fancy, but quite useful. Hope this helps, (and send me your revised Swing.scm, I have some other extensions, JTables, that need to be added to it as well....) ---Tim--- > > Thanks, > Boris > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Borislav I. <bor...@ko...> - 2004-03-31 00:05:20
|
Hi, I've added a few things jlib/swing.scm that I needed (toolbar and togglebutton). The additions simply follow the established pattern. What is the process of submitting a patch? I'm not familiar at all how those patch file are made and applied :( And a question: what would be an elegant way to define a paint procedure for a generic component. Right now, my program has only one Java class that extends Jcomponent only in order to override the painProc method (which invokes a scheme procedure). It would be nice to have something like this: (component (paint (lambda (graphics) ...do the painting))) Isn't something of the sort that (canvas) and jlib.SchemeCanvas should be doing. But I'm not sure it works. There is paintHandler method in SchemeCanvas, but it doesn't seem to be set anywhere in the generic construction processing in swing.scm. Thanks, Boris |
From: Ken A. <kan...@bb...> - 2004-03-30 21:13:02
|
OK. I forgot to mention that you could just add the url for the slib file and use it that way too. k At 08:41 AM 3/31/2004 +1200, Toby Allsopp wrote: >On Tue, Mar 30, 2004 at 03:19:20PM -0500, Ken Anderson wrote: >> It looks like this this patch fixes a line >> >> - (not eq? (Scheme.openResource "slib/require.scm") #null)) >> + (not (eq? (Scheme.openResource "slib/require.scm") #null))) >> >> how does it effect renaming. >> At 08:17 AM 3/16/2004 +1300, Toby Allsopp wrote: >> >This patch allows putting slib3a1.zip on the classpath without renaming >> >it to slib.zip. >> >> I think i can remove the slib.zip-on-classpath? call because because >> the resource check will work if its on the classpath, no matter what >> name it is. > >Yes, I think that's right. The slib.zip-on-classpath? stuff is >redundant if the above fix is made. > >Toby. |
From: Toby A. <tob...@pe...> - 2004-03-30 20:46:56
|
On Tue, Mar 30, 2004 at 03:19:20PM -0500, Ken Anderson wrote: > It looks like this this patch fixes a line > > - (not eq? (Scheme.openResource "slib/require.scm") #null)) > + (not (eq? (Scheme.openResource "slib/require.scm") #null))) > > how does it effect renaming. > At 08:17 AM 3/16/2004 +1300, Toby Allsopp wrote: > >This patch allows putting slib3a1.zip on the classpath without renaming > >it to slib.zip. > > I think i can remove the slib.zip-on-classpath? call because because > the resource check will work if its on the classpath, no matter what > name it is. Yes, I think that's right. The slib.zip-on-classpath? stuff is redundant if the above fix is made. Toby. |
From: Ken A. <kan...@bb...> - 2004-03-30 20:19:42
|
It looks like this this patch fixes a line - (not eq? (Scheme.openResource "slib/require.scm") #null)) + (not (eq? (Scheme.openResource "slib/require.scm") #null))) how does it effect renaming. At 08:17 AM 3/16/2004 +1300, Toby Allsopp wrote: >This patch allows putting slib3a1.zip on the classpath without renaming >it to slib.zip. I think i can remove the slib.zip-on-classpath? call because because the resource check will work if its on the classpath, no matter what name it is. |
From: Ken A. <kan...@bb...> - 2004-03-30 15:41:08
|
Here's a contest to build the tinniest genetic programming system: http://cswww.essex.ac.uk/staff/sml/gecco/TinyGP.html There is a C++ version that is about 1600 lines of code http://www.gel.ulaval.ca/~beagle/puppy/index.html Since Koza's original code was in Common Lisp, I'd expect a Lisp implementation to be about as tiny as you can get. It looks like you can get his implementation down to under 1,000 lines of code. I'm wondering if JScheme (or Arc) can do any better. The code needed to read the input data is surprisingly small: (load "elf/basic.scm") (load "elf/sort.scm") (define (read-data file) ;; Returns (listOf FitnessCase) where a FitnessCase is a list of ;; X1 ... Xn TARGET. (let* ((data (call-with-input-file file (lambda (s) (map* identity s))))) (by (+ (car data) 1) (cddr data)))) I'm not sure if i could submit something myself, so anybody want to participate with me? k |
From: Timothy J. H. <tim...@ma...> - 2004-03-29 02:12:24
|
On Mar 28, 2004, at 8:33 PM, Borislav Iordanov wrote: > Hi all, > > In a program, I'm trying to construct and store an expression for later > evaluation. Consider: > > (define l (LinkedList.)) > (define point (java.awt.Point. 50 50)) > (.add l point) > (define expr `(.remove l ,point)) > > Then: > > (eval expr) > > properly removes the point from the linked list. This is fine. But > after > replacing the point with a pair: > > (define l (LinkedList.)) > (define line (cons (java.awt.Point. 100 100) (java.awt.Point. 10 10))) > (.add l line) > (define expr `(.remove l ,line)) > > Trying to evaluate the expression produces an error: > > (eval expr) > => SchemeException: expected object of type list (i.e. pair or empty), > but got: , "java.awt.Point[x=10,y=10]" > > Why and what to do? The problem is that eval expects to try an evaluate an s-expression constructed from lists, atoms, and other objects. When it encounters the cons-cell of line it interprets it as part of the syntax of the expression, not as part of the value of the object. The simple theoretical fix is to not allow any "values" in expressions that are being evaluated, i.e., only allow expressions that would result from reading input from a string. In practice, we allow the expression to be evaluated to contain any values whatsoever with the proviso that any cons cells are considered part of the expression to be evaluated. You can solve this particular problem by evaluating expr2 defined by (define expr2 `(.remove l line)) or by quoting the lin (define expr5 `(.remove l ',line)) where the quote here is similarly extended to create an expression which the eval procedure will leave as is... Hope this helps.... ---Tim--- > > Thanks a lot in advance, > Boris > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Borislav I. <bor...@ko...> - 2004-03-29 01:33:41
|
Hi all, In a program, I'm trying to construct and store an expression for later evaluation. Consider: (define l (LinkedList.)) (define point (java.awt.Point. 50 50)) (.add l point) (define expr `(.remove l ,point)) Then: (eval expr) properly removes the point from the linked list. This is fine. But after replacing the point with a pair: (define l (LinkedList.)) (define line (cons (java.awt.Point. 100 100) (java.awt.Point. 10 10))) (.add l line) (define expr `(.remove l ,line)) Trying to evaluate the expression produces an error: (eval expr) => SchemeException: expected object of type list (i.e. pair or empty), but got: , "java.awt.Point[x=10,y=10]" Why and what to do? Thanks a lot in advance, Boris |
From: Ken A. <kan...@bb...> - 2004-03-26 22:15:19
|
I just changed src/elf/apropos.scm. (apropos) is now case insensitive. There is also (findClass) for finding the full name and jar of a class. It does this by grovelling over the jars in your classpath. I find this useful for finding where a class really is when reading a Java file with lots of import ...*'s . > (findClass "Object") 11245 classes (("org.omg.CORBA.Object" c:\j2sdk1.4.2_02\jre\lib\rt.jar) ("java.lang.Object" c:\j2sdk1.4.2_02\jre\lib\rt.jar)) > (findClass "ImageIcon") (("javax.swing.ImageIcon" c:\j2sdk1.4.2_02\jre\lib\rt.jar)) > (findClass "Font") (("java.awt.Font" c:\j2sdk1.4.2_02\jre\lib\rt.jar)) > |
From: Timothy J. H. <tim...@ma...> - 2004-03-26 03:29:38
|
On Mar 25, 2004, at 4:45 PM, Ken Anderson wrote: > I think this would be great! And Tim, i like the new interactive > Tutorial! Thanks.... its starting to take shape nicely.... I'm having fun teaching CS concepts (abstraction, procedure calling) without doing any numerical calculation at all, and still doing interesting examples.... I just presented this curriculum in the SIGCSE 2004 conference and the talk went pretty well. I'd like to provide a machine that anyone could use to try out the web programming ideas, but I have to work on the security issues a little more first. For now, the tutorial is available here: http://tat.cs.brandeis.edu:8090/spr04/typcs04/tutorial/intro.servlet This uses the latest version of the jscheme teaching webapp which includes a U-method for uploading and editing servlets with a web interface, and the V-method for getting color coded error checked versions of servlets and applets using a web interface. I can give U-method access to interested jscheme-users who want to play with it. Or you can download the webapp at http://tat.cs.brandeis.edu:8090/spr04/jscm.tgz and install it in a servlet container like tomcat, jetty, or resin.... > > I think we should exchange some code as you write the tutorial so we > can come up with an appropriate style. Good idea. I'm including the code I use for databases below. I usually create a connection when the webapp is first loaded and then use that connection to define a procedure dbquery that sends strings to the database and gets a list of lists back. The first row gives the types of the columns (metainfo). The db.scm procedure below defines the following procedures ;(define database 'mysql) (define database 'hsqldb) ;; this specifies which of the databases is going to be used mysql or hsqldb ;; This defines the proper driver (define jdbc-driver .... (define jdbc-driver-class (java.lang.Class.forName jdbc-driver)) (define (connect host/db user pw) ; this creates a connection to the specified DB (define (handlequery con query) ; this sends the query to the DB and returns a list of lists as above (define (runquery host/db user pw query) ;; this combines connect and handlequery (define (toMYSQL x) ;; this generates an SQL quoted string from a JScheme string (define (toHSQL x) ;; this generates an HSQL quoted string, with all (')s doubled (''), (define toSQL ;; this selects the quoting mechanism based on which database is being used.... |
From: Ken A. <kan...@bb...> - 2004-03-24 19:21:44
|
The problem is that while loadking psyntax-init.scm changes (eval) and (load), the old (eval) and (load) is being used by jscheme.REPL. I fixed this once, but it got broken when dynamic enviroments were added. I'll try fixinig it again. For now, you can either put the macro definition in a file and load it, or use (eval '(define-syntax swap ...)) (eval '(swap x y)) BTW, you can see the macroexpansion using sc-expand. k At 10:58 AM 3/22/2004 -0500, Borislav Iordanov wrote: >Hi all, > >I have a problem getting macros to work. As I understand, I need to load >the following two files: > >elf/eopl2/jscheme/genwrite.scm >elf/eopl2/jscheme/psyntax-init.scm > >I do that and then try something simple like: > >(define-syntax swap > (syntax-rules () > ((swap a b) (let ((tmp b)) (set! b a) (set! a tmp))))) > >Evaluating the last expression tells me "undefined variable >'define-syntax'". > >I also tried loading a the OO style code using/friedman-init.scm which >makes heavy use of macros and I get an error saying that 'pretty-print' >is not defined. > >This is with the latest code from CVS, patched not to set the current >thread's classloader to Import.CLASSLOADER. > >I am quite a beginner in Scheme and I've never used macros, so the >problem may be a really straightforward misunderstanding on my part. > >Thanks, >Boris > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Borislav I. <bor...@ko...> - 2004-03-22 18:33:10
|
Ok, thanks! I can wait... :) Boris | -----Original Message----- | From: jsc...@li... | [mailto:jsc...@li...] On Behalf | Of Timothy John Hickey | Sent: Monday, March 22, 2004 12:58 PM | To: Borislav Iordanov | Cc: jsc...@li... | Subject: Re: [Jscheme-user] macros | | | Ken Anderson is the best person to answer this question, but | he is away until 3/23.... | ---Tim--- | | On Mar 22, 2004, at 10:58 AM, Borislav Iordanov wrote: | | > Hi all, | > | > I have a problem getting macros to work. As I understand, I need to | > load | > the following two files: | > | > elf/eopl2/jscheme/genwrite.scm elf/eopl2/jscheme/psyntax-init.scm | > | > I do that and then try something simple like: | > | > (define-syntax swap | > (syntax-rules () | > ((swap a b) (let ((tmp b)) (set! b a) (set! a tmp))))) | > | > Evaluating the last expression tells me "undefined variable | > 'define-syntax'". | > | > I also tried loading a the OO style code | using/friedman-init.scm which | > makes heavy use of macros and I get an error saying that | > 'pretty-print' is not defined. | > | > This is with the latest code from CVS, patched not to set | the current | > thread's classloader to Import.CLASSLOADER. | > | > I am quite a beginner in Scheme and I've never used macros, so the | > problem may be a really straightforward misunderstanding on my part. | > | > Thanks, | > Boris | > | > | > | > ------------------------------------------------------- | > This SF.Net email is sponsored by: IBM Linux Tutorials | > Free Linux tutorial presented by Daniel Robbins, President | and CEO of | > GenToo technologies. Learn everything from fundamentals to system | > | administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click | > _______________________________________________ | > Jscheme-user mailing list | > Jsc...@li... | > https://lists.sourceforge.net/lists/listinfo/jscheme-user | | | | ------------------------------------------------------- | This SF.Net email is sponsored by: IBM Linux Tutorials | Free Linux tutorial presented by Daniel Robbins, President | and CEO of GenToo technologies. Learn everything from | fundamentals to system | administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click | _______________________________________________ | Jscheme-user mailing list | Jsc...@li... | https://lists.sourceforge.net/lists/listinfo/jscheme-user | |
From: Timothy J. H. <ti...@cs...> - 2004-03-22 18:04:33
|
On Mar 22, 2004, at 2:58 AM, Borislav Iordanov wrote: > Hi all, > > Here is a small, but already useful NetBeans plugin for Jscheme, in > case > anyone is using both Jscheme and Netbeans (list of features, > installation instructions etc. at the link): > > http://www.kobrix.com:8080/netscheme > > I called it "NetScheme". Hope the name is not already taken by > something > fairly known. It sounds a bit too common. > > Let me know if you've tried it, bugs, suggestions etc... It sounds great! As soon as I get a free moment I'll download, install, and try it out. ---Tim--- > > Best, > Boris > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Timothy J. H. <ti...@cs...> - 2004-03-22 17:58:19
|
Ken Anderson is the best person to answer this question, but he is away until 3/23.... ---Tim--- On Mar 22, 2004, at 10:58 AM, Borislav Iordanov wrote: > Hi all, > > I have a problem getting macros to work. As I understand, I need to > load > the following two files: > > elf/eopl2/jscheme/genwrite.scm > elf/eopl2/jscheme/psyntax-init.scm > > I do that and then try something simple like: > > (define-syntax swap > (syntax-rules () > ((swap a b) (let ((tmp b)) (set! b a) (set! a tmp))))) > > Evaluating the last expression tells me "undefined variable > 'define-syntax'". > > I also tried loading a the OO style code using/friedman-init.scm which > makes heavy use of macros and I get an error saying that 'pretty-print' > is not defined. > > This is with the latest code from CVS, patched not to set the current > thread's classloader to Import.CLASSLOADER. > > I am quite a beginner in Scheme and I've never used macros, so the > problem may be a really straightforward misunderstanding on my part. > > Thanks, > Boris > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Borislav I. <bor...@ko...> - 2004-03-22 15:58:18
|
Hi all, I have a problem getting macros to work. As I understand, I need to load the following two files: elf/eopl2/jscheme/genwrite.scm elf/eopl2/jscheme/psyntax-init.scm I do that and then try something simple like: (define-syntax swap (syntax-rules () ((swap a b) (let ((tmp b)) (set! b a) (set! a tmp))))) Evaluating the last expression tells me "undefined variable 'define-syntax'". I also tried loading a the OO style code using/friedman-init.scm which makes heavy use of macros and I get an error saying that 'pretty-print' is not defined. This is with the latest code from CVS, patched not to set the current thread's classloader to Import.CLASSLOADER. I am quite a beginner in Scheme and I've never used macros, so the problem may be a really straightforward misunderstanding on my part. Thanks, Boris |
From: Borislav I. <bor...@ko...> - 2004-03-22 07:58:29
|
Hi all, Here is a small, but already useful NetBeans plugin for Jscheme, in case anyone is using both Jscheme and Netbeans (list of features, installation instructions etc. at the link): http://www.kobrix.com:8080/netscheme I called it "NetScheme". Hope the name is not already taken by something fairly known. It sounds a bit too common. Let me know if you've tried it, bugs, suggestions etc... Best, Boris |
From: Michael R H. <bu...@zc...> - 2004-03-19 19:46:21
|
I just saw this on lambda the ultimate and it seems like a nice, new piece of scheme advocacy of interest around here, though it is somewhat specific to PLT scheme. "When I tell programmers that my favorite programming language is Scheme, they tend to react as though I'd told them my favorite snack were packing styrofoam or my favorite music were junior high orchestra recordings: those who can even bring themselves to believe me mostly wonder what on Earth I could be thinking. " http://www.kuro5hin.org/story/2004/3/17/93442/8657 mike -- Michael R Head <bu...@zc...> ZClipse -- OpenSource Eclipse plugins |
From: Toby A. <tob...@pe...> - 2004-03-16 00:21:55
|
On Mon, Mar 15, 2004 at 05:12:00PM -0500, Ken Anderson wrote: > At 08:20 AM 3/15/2004 +1300, Toby Allsopp wrote: > > The expected usage is that any Java code that wants to make calls to > > JScheme needs to wrap them in: > > > > JS.enter(); > > try { > > ... > > } finally { > > JS.exit(); > > } > > At first look, i don't like this. I don't like having to do a > try/finally in Java to get something done for me by Scheme. My first > suggestion of leaving the JS interface alone is probably wrong. > > The way JS is typically used is you define a Java class that loads > some Scheme code as a static init and then defines some Java methods > that do JS.call() to get the behavior done for it. So putting a > try/finally around one line is too costly. Okay, this usage suggests that you probably want to create an instance of JS and call non-static methods on it. > You may also want to turn an s-expression as a string into an Object. > Maybe, JS should just be a wrapper around an Evaluator and a class or > a Thread that wanted Scheme evaluated would just set up the Scheme > environment it want the Evaluator to have and call the appropriate JS > functions. I'm not sure I follow what you mean there. My interpretation is to basically make all JS methods non-static and provide a constructor that takes an evaluator as an argument (and one that doesn't). > > I don't think ARGS is referred to outside of jsint.Scheme, so it > > doesn't really make much difference either way. I'd probably prefer > > it to be an instance field in Evaluator so that you can run multiple > > scripts that use the args and don't know about each other. > > ARGS is there to allow Scheme code to see what arguments were passed > in. > Any piece of code might want that, but it certainly doesn't make much > sense in a "container environment". So maybe ARGS should just be a > global variable in the initial environment so it can be used by any > Evaluator down stream, was my initial thought. However, Looking at > all the arguments doesn't make much sense because the arguments are > processed by Scheme in a particular way and you can use the -main > option to take over interpreting the rest of the arguments, as in > src/using/command.scm for example. So, my proposal now is to get rid > of ARGS. In Common Lisp, proposals were named like this: > get-rid-of-args. It turns out that it doesn't bother me either way :-). I'll probably leave it with the easiest to implement semantics and let it be removed or retained by someone who has an interest in it. > > > What arguments should the constructor take? Probably a > > > DynamicEnvironment at least optionally, but probably also the > > > input, output, and error. Try to avoid setter methods, we want to > > > think functionally when we can. > > > > Do you intend the DynamicEnvironment argument to intialise > > INTERACTION_ENVIRONMENT? > > The idea was that evaluators could somehow share environments so > either an evaluator could load specific code, as you might want in > scheme-server-pages or could share code that was only loaded once, > which you might want if you're a server spawing a new evalutor for > each thread, but they all have the same behavior. Oh, I see. I'd expect the threads to just share an evaluator. There's not much difference, but it does make more sense to just share the environment if that's what you want. > > A fair amount of existing code assigns to the input and output > > fields. Do you mean to replace that with code that instead creates > > a new Evaluator? > > No, this code must bechanged into nonstatic calls. This is what I currently have, I think. Once we have the try...finally issue above sorted out I'll post the code and we can get into specifics. > > > Also, i once made eval and load replaceable procedures, so for > > > example you could get R5RS macros. But that disappeared when Tim > > > put in DynamicEnvironments. > > > > Sounds cool :-) I don't know what it means though :-( > > (load) and (eval) are Scheme procedures that have fixed semantics > written in Java. By redefining them, you can change the semantics for > example by adding a more powerful macro system than Scheme has by > default. Or you could play with new evaluation models as in Paul > Graham's ARC language > http://www.paulgraham.com/arc.html > > so you could do things like > > (define v #(0 1 2 3)) > (v 1) -> 1; apply a vector. > > or even > (1 v) -> 1; apply a number to a vector. Ok, this is outside the scope of what I'm thinking about, I think :-) Toby. |
From: Ken A. <kan...@bb...> - 2004-03-15 22:12:27
|
At 08:20 AM 3/15/2004 +1300, Toby Allsopp wrote: >On Thu, Mar 11, 2004 at 05:10:20PM -0500, Ken Anderson wrote: >> OK, since you've got 3 or 4 votes for your proposal, and none against, >> give it a shot. >> >> Why don't you email Tim and i as you do it, for guidence. >> >> What i'd do is copy jsint.Scheme into either jsint.REPL or >> jsint.Evaluator. make most of the static fields non static ... Then >> get jscheme.REPL to use it rather than jsint.Scheme in main(). Maybe >> we'll just get rid of Scheme eventually. In fact, remove it and let >> the compiler tell you where you need to change the code. > >My first cut (which seems to work for my purposes) is basically exactly >that. There are a ton of calls to static Scheme methods all through >everything, so I think I'll leave those alone as much as possible and >just redirect them to the appropriate Evaluator instance. References to >static fields in Scheme need to be changed anyway though. right. >In order to determine the appropriate Evaluator instance, I've set up a >thread-local stack of them, the interface to which is four methods in >JS: > >Evalutor enter() >Evalutor enterNew() >void enter(Evaluator) >void exit() > >The expected usage is that any Java code that wants to make calls to >JScheme needs to wrap them in: > > JS.enter(); > try { > ... > } finally { > JS.exit(); > } > >The parameterless enter() method will use an existing Evaluator if there >is one for the current thread, or will create a new one. The enterNew() >method will always create a fresh, new Evaluator instance. > >New threads get a copy of their parent's Evaluator stack (but the actual >Evaluator instances are shared). At first look, i don't like this. I don't like having to do a try/finally in Java to get something done for me by Scheme. My first suggestion of leaving the JS interface alone is probably wrong. The way JS is typically used is you define a Java class that loads some Scheme code as a static init and then defines some Java methods that do JS.call() to get the behavior done for it. So putting a try/finally around one line is too costly. You may also want to turn an s-expression as a string into an Object. Maybe, JS should just be a wrapper around an Evaluator and a class or a Thread that wanted Scheme evaluated would just set up the Scheme environment it want the Evaluator to have and call the appropriate JS functions. >> Scheme.ARGS only makes sense for the first Evaluator. So it should >> just become a global variable on the Scheme side. > >I don't think ARGS is referred to outside of jsint.Scheme, so it doesn't >really make much difference either way. I'd probably prefer it to be an >instance field in Evaluator so that you can run multiple scripts that >use the args and don't know about each other. ARGS is there to allow Scheme code to see what arguments were passed in. Any piece of code might want that, but it certainly doesn't make much sense in a "container environment". So maybe ARGS should just be a global variable in the initial environment so it can be used by any Evaluator down stream, was my initial thought. However, Looking at all the arguments doesn't make much sense because the arguments are processed by Scheme in a particular way and you can use the -main option to take over interpreting the rest of the arguments, as in src/using/command.scm for example. So, my proposal now is to get rid of ARGS. In Common Lisp, proposals were named like this: get-rid-of-args. >> What arguments should the constructor take? Probably a >> DynamicEnvironment at least optionally, but probably also the input, >> output, and error. Try to avoid setter methods, we want to think >> functionally when we can. > >Do you intend the DynamicEnvironment argument to intialise >INTERACTION_ENVIRONMENT? The idea was that evaluators could somehow share environments so either an evaluator could load specific code, as you might want in scheme-server-pages or could share code that was only loaded once, which you might want if you're a server spawing a new evalutor for each thread, but they all have the same behavior. >A fair amount of existing code assigns to the input and output fields. >Do you mean to replace that with code that instead creates a new >Evaluator? No, this code must bechanged into nonstatic calls. >> The jscheme.JS class that interfaces from Java to Scheme will need to >> be changed. For now, have that class create a static final instance >> to use to keep the code simple. > >I think I've covered this with the methods I propose adding to JS above. > >> This may be a good tern of events because it may guide us into some >> good refactorings. For example, i've thought that the REPL (Read Eval >> Print Loop) could be split up. The E would be an object that too >> s-expressions and returned their value. It could be attached in the >> usual REPL way or it could be controled by a GUI that passed commands >> to it as the user clicked on things and updated the screen accordinly. > >Sounds like a good idea. My changes will get you everything rolled into >the E and you can split out the R and the P later if it looks like a >good idea. > >> Also, i once made eval and load replaceable procedures, so for example >> you could get R5RS macros. But that disappeared when Tim put in >> DynamicEnvironments. >Sounds cool :-) I don't know what it means though :-( (load) and (eval) are Scheme procedures that have fixed semantics written in Java. By redefining them, you can change the semantics for example by adding a more powerful macro system than Scheme has by default. Or you could play with new evaluation models as in Paul Graham's ARC language http://www.paulgraham.com/arc.html so you could do things like (define v #(0 1 2 3)) (v 1) -> 1; apply a vector. or even (1 v) -> 1; apply a number to a vector. |
From: Ken A. <kan...@bb...> - 2004-03-15 21:25:26
|
Thanks Jonathan, this is a great way to look these changes. "When you're in Java know one knows you're using JScheme." k At 02:11 PM 3/12/2004 -0500, Jonathan A Rees wrote: >Each interpreter instance potentially also needs its own class loader >(for use by scheme code, not by jscheme itself). Don't forget to >provide a way to set it in a newly created instance. > >I'm really glad that multiple interpreter instances is being >discussed. The demand for this is an inevitable consequence of the >project's success. Soon you may find two applications that both use >jscheme, that need to interoperate in the same Java VM, and neither >even *knows* that the other is using jscheme, and this is as it should >be. > >Jonathan > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Toby A. <tob...@pe...> - 2004-03-15 19:18:18
|
This patch allows putting slib3a1.zip on the classpath without renaming it to slib.zip. Toby. |
From: Toby A. <tob...@pe...> - 2004-03-15 18:38:48
|
Attached (assuming I remember to do so this time) is a small patch to Import.java that I think has more sensible semantics (i.e. the semantics I described below). Toby. On Mon, Mar 15, 2004 at 11:36:44AM -0500, bor...@ko... wrote: > Hi, > > I'd like to put 1 vote on that particular change. I already have the need > to patch JScheme and remove the assignment of the classloader to the > thread's context in my NetBeans plugin development (the IDE manages threads > and class loading its own way and gets completely confused by what Import > does). > > Best, > Boris > > Original Message: > ----------------- > From: Toby Allsopp tob...@pe... > Date: Mon, 15 Mar 2004 08:04:03 +1300 > To: jsc...@li... > Subject: Re: [Jscheme-user] Re: Multiple independent interpreters > > On Fri, Mar 12, 2004 at 02:11:17PM -0500, Jonathan A Rees wrote: > > > > Each interpreter instance potentially also needs its own class loader > > (for use by scheme code, not by jscheme itself). Don't forget to > > provide a way to set it in a newly created instance. > > Yes, I was just looking at the class loader stuff in jsint.Import, and > that will need attention for any serious J2EE use, and probably any > serious use embedded in a larger application. > > The current behaviour is to set the current thread's context class > loader to the class loader that loaded jsint.Import when jsint.Import is > initialised, then always use the class loader that loaded jsint.Import. > > I propose that better behaviour is to never change the context class > loader and to use either a user-specified class loader or, if none has > been specified, the current thread's context class loader. |
From: <bor...@ko...> - 2004-03-15 16:37:03
|
Hi, I'd like to put 1 vote on that particular change=2E I already have the nee= d to patch JScheme and remove the assignment of the classloader to the thread's context in my NetBeans plugin development (the IDE manages thread= s and class loading its own way and gets completely confused by what Import does)=2E=20 Best, Boris Original Message: ----------------- From: Toby Allsopp toby=2Eallsopp@peace=2Ecom Date: Mon, 15 Mar 2004 08:04:03 +1300 To: jscheme-user@lists=2Esourceforge=2Enet Subject: Re: [Jscheme-user] Re: Multiple independent interpreters On Fri, Mar 12, 2004 at 02:11:17PM -0500, Jonathan A Rees wrote: >=20 > Each interpreter instance potentially also needs its own class loader > (for use by scheme code, not by jscheme itself)=2E Don't forget to > provide a way to set it in a newly created instance=2E Yes, I was just looking at the class loader stuff in jsint=2EImport, and that will need attention for any serious J2EE use, and probably any serious use embedded in a larger application=2E The current behaviour is to set the current thread's context class loader to the class loader that loaded jsint=2EImport when jsint=2EImport = is initialised, then always use the class loader that loaded jsint=2EImport=2E= I propose that better behaviour is to never change the context class loader and to use either a user-specified class loader or, if none has been specified, the current thread's context class loader=2E > I'm really glad that multiple interpreter instances is being > discussed=2E The demand for this is an inevitable consequence of the > project's success=2E Soon you may find two applications that both use > jscheme, that need to interoperate in the same Java VM, and neither > even *knows* that the other is using jscheme, and this is as it should > be=2E I absolutely agree=2E Toby=2E ------------------------------------------------------- This SF=2ENet email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies=2E Learn everything from fundamentals to system administration=2Ehttp://ads=2Eosdn=2Ecom/?ad_id=3D1470&alloc_id=3D3638&op=3D= click _______________________________________________ Jscheme-user mailing list Jscheme-user@lists=2Esourceforge=2Enet https://lists=2Esourceforge=2Enet/lists/listinfo/jscheme-user -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web=2Ecom/ =2E |