From: Ken A. <kan...@bb...> - 2003-03-04 22:23:41
|
I don't believe anyone has yet, though it has been suggested. If you know how to do Eclipse plugin's maybe we can wipe up something together. I have not tried Eclipse yet. k At 01:27 PM 3/4/2003 -0800, Boris Tschirschwitz wrote: >Hello and sorry for polluting your inbox. > >Do you know if anyone has written an eclipse plugin for jscheme, yet. >Sorry, I ask b/c I'd like to use one, not write one. > >Thanks, >Boris. |
From: Timothy H. <tim...@ma...> - 2003-03-04 22:42:53
|
On Tuesday, March 4, 2003, at 05:23 PM, Ken Anderson wrote: > I don't believe anyone has yet, though it has been suggested. > If you know how to do Eclipse plugin's maybe we can wipe up something > together. I have not tried Eclipse yet. I've forwarded this to someone in my group that works with Eclipse. He might have a plug-in for Eclipse already... I let you know what he says. ---Tim--- > > k > At 01:27 PM 3/4/2003 -0800, Boris Tschirschwitz wrote: >> Hello and sorry for polluting your inbox. >> >> Do you know if anyone has written an eclipse plugin for jscheme, yet. >> Sorry, I ask b/c I'd like to use one, not write one. >> >> Thanks, >> Boris. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The > debugger > for complex code. Debugging C/C++ programs can leave you feeling lost > and > disoriented. TotalView can help you find your way. Available on major > UNIX > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user > |
From: Boris T. <bo...@ma...> - 2003-03-09 05:55:46
|
Hi. Assuming that my ignorance mostly stems from not having studied jscheme long enough, I checked the list archives for answers, but I couldn't find anything and the sf system seems to be really terrible. I am wondering about the following: If I want to program using classes and objects, do I have to make all my structures Java classes, objects, ...? I wonder if this might restrict me in manipulating these objects in the scheme way. Yes, this sounds very vague, b/c I am not absolutely sure what I am asking and hope that someone on the list might understand it better than I do. Would it be beneficial to use something like Meroon? Boris. |
From: Timothy H. <tim...@ma...> - 2003-03-09 22:48:19
|
Hi Boris, On Sunday, March 9, 2003, at 12:55 AM, Boris Tschirschwitz wrote: > Hi. > > Assuming that my ignorance mostly stems from not having studied jscheme > long enough, I checked the list archives for answers, Thanks for checking first! > but I couldn't find > anything and the sf system seems to be really terrible. What made it so horrible? Response time, organization,...? > > I am wondering about the following: If I want to program using classes > and > objects, do I have to make all my structures Java classes, objects, ...? > I wonder if this might restrict me in manipulating these objects in the > scheme way. Yes, this sounds very vague, b/c I am not absolutely sure > what > I am asking and hope that someone on the list might understand it better > than I do. You should look at the webpage: http://jscheme.sourceforge.net/jscheme/src/dclass/dclass.html which describes several approaches for working with Java classes from Jscheme. In summary, the main approaches we've tried are: * don't define any new classes (i.e. use Java as a library language), e.g. see the jlib/Swing.scm library * when this doesn't work, define a wrapper class that allows you to dynamically assign functionality to a Java class from Jscheme (e.g. see the jlib/SchemeCanvas.java class) * for an interface you can use the Proxy class to implement that interface at runtime in Jscheme * for a non-interface, you can use the dclass package to define Java classes in Scheme and compile them to Java, e.g. the weblink above gives an example of defining a class "Compare" in a package "frog". This example is in dclass/test.scm, reproduced below: > > (define-class > (package frog) > (import java.util.Comparator) > (public class Compare implements Comparator) > ;; Design issue, fields must be public for Jscheme code to access. > > (public Procedure predicate) > > (public Compare (Procedure predicate) > (.predicate$ this predicate)) > > (public boolean predicate (Object a Object b) > ((.predicate$ this) a b)) > > (public int compare (Object a Object b) > (cond ((.predicate this a b) -1) > ((.predicate this b a) 1) > (else 0))) > > (public boolean equals (Object that) > (and (eq? (.getClass this) (.getClass that)) > (eq? (.predicate$ this) (.predicate$ that)))) > > (public int hashCode () 0)) > > The following script shows how to run that example: > % java -cp lib/jscheme.jar:src jscheme.REPL Note: we have to add a folder "src" to the classpath as dclass will compile all new classes into this folder.. > > > Jscheme 6.1.0 3/7/2003 http://jscheme.sourceforge.net > > > > (load "elf/basic.scm") > #t > > (load "dclass/dclass.scm") > #t At this point we have loaded in the dclass compiler... we are now ready to compile a new class, we could do this interactively by making a call to > (define-class (package-frog) ....) But that can be error-prone...., so we load it in from a file.... > > (load "dclass/test.scm") ; the compiler echoes the generated code to the console as well as to the file > Writing Java code for frog.Compare to > /Users/tim/Research/Software/jscheme/src/frog/Compare.java > // Generated by Jscheme by tim on Sun Mar 09 04:16:20 EST 2003 > package frog; > import java.util.Comparator; > import jsint.Procedure; > import jscheme.JS; > public class Compare implements Comparator { public Procedure predicate; > public Compare(Procedure predicate) { JS.call(DCLASS_C_Compare0, this, > predicate); > } > private static final Procedure DCLASS_C_Compare0 =(Procedure) > JS.eval("(lambda (this predicate) (.predicate$ this predicate))"); > public boolean predicate(Object a, Object b) { return > JS.booleanValue(JS.call(DCLASS_M_I_predicate1, this, a, b)); > } > private static final Procedure DCLASS_M_I_predicate1 =(Procedure) > JS.eval("(lambda (this a b) ((.predicate$ this) a b))"); > public int compare(Object a, Object b) { return > JS.intValue(JS.call(DCLASS_M_I_compare2, this, a, b)); > } > private static final Procedure DCLASS_M_I_compare2 =(Procedure) > JS.eval("(lambda (this a b) (cond ((.predicate this a b) -1) > ((.predicate this b a) 1) (else 0)))"); > public boolean equals(Object that) { return > JS.booleanValue(JS.call(DCLASS_M_I_equals3, this, that)); > } > private static final Procedure DCLASS_M_I_equals3 =(Procedure) > JS.eval("(lambda (this that) (and (eq? (.getClass this) (.getClass > that)) (eq? (.predicate$ this) (.predicate$ that))))"); > public int hashCode() { return > JS.intValue(JS.call(DCLASS_M_I_hashCode4, this)); > } > private static final Procedure DCLASS_M_I_hashCode4 =(Procedure) > JS.eval("(lambda (this) 0)"); > } > Compiling Java code for frog.Compare and it compiles the new code to src/from/Compare.class where it is immediately available to us > #t > Next we use it to sort two arrays.... using two different comparators c1 and c2 > > (define c (frog.Compare. <)) > frog.Compare@0 > > (define arr #(1 4 2 5 6 79 3 4 8 5 3)) > #(1 4 2 5 6 79 3 4 8 5 3) > > (Arrays.sort arr c) > #null > > arr > #(1 2 3 3 4 4 5 5 6 8 79) > > > (define c2 (frog.Compare. (lambda(x y) (or (< (first x) (first y)) (> > (second x) (second y)))))) .... this is a wierd sorting predicate, you can have A<B and B<A for certain lists A,B, e.g. (1 5) and (4 6) > frog.Compare@0 > > (define arr2 #((1 5) (4 3) (4 6) (5 3) (1 3) (1 6) (5 3) (5 4))) > #((1 5) (4 3) (4 6) (5 3) (1 3) (1 6) (5 3) (5 4)) > > (Arrays.sort arr2 c2) > #null > > arr2 > #((1 6) (1 5) (4 6) (1 3) (4 3) (5 4) (5 3) (5 3)) > > > (exit) > #t > % > I hope this starts to answer your question... > Would it be beneficial to use something like Meroon? Perhaps, but then you may have to worry about interacting with two object systems, Java's and Meroon's. I haven't tried to get Meroon working in Jscheme and it might be interesting! Best, ---Tim--- |
From: Boris T. <bo...@ma...> - 2003-03-10 07:52:15
|
> > I checked the list archives for answers, > Thanks for checking first! > > > but I couldn't find > > anything and the sf system seems to be really terrible. > What made it so horrible? Response time, organization,...? I was hoping for a search option--enter 'object' and get all emails containing that word--but didn't find it. The monthly view didn't seem to show the expected results either and the daily check was a pain, so I just went through the titles by the hundeds--fortunately there are not so many, yet. Well, lots of 'cvs update'. Anyway, thanks a lot for the detailed answer, I'll study it next weekend--after all, there's a thesis to write... Boris. |
From: Timothy H. <tim...@ma...> - 2003-03-10 20:35:44
|
On Monday, March 10, 2003, at 02:51 AM, Boris Tschirschwitz wrote: >>> I checked the list archives for answers, >> Thanks for checking first! >> >>> but I couldn't find >>> anything and the sf system seems to be really terrible. >> What made it so horrible? Response time, organization,...? > > I was hoping for a search option--enter 'object' and get all emails > containing that word--but didn't find it. The monthly view didn't seem > to > show the expected results either and the daily check was a pain, so I > just > went through the titles by the hundeds--fortunately there are not so > many, yet. Well, lots of 'cvs update'. Thanks for the report. There actually is a "search" feature, but its over in the sourceforge.net panel on the left side and has a "search This Mailing List" option. I don't know why they put it over there, it is way too easy to miss. Actually running a search with the word "classes" brings up about a dozen entries (including some using JavaAssist which I had forgotten about..., yet another way to create dynamic Java classes). > > Anyway, thanks a lot for the detailed answer, I'll study it next > weekend--after all, there's a thesis to write... First things first! Good luck, ---Tim--- > > Boris. > |
From: Ken A. <kan...@bb...> - 2003-03-09 19:04:35
|
We have not developed an object system for JScheme, however you can define Java classes in JScheme, see http://jscheme.sourceforge.net/jscheme/src/dclass/dclass.html for several ways. There is also http://jscheme.sourceforge.net/jscheme/src/dclass/record.scm for defining simple record structures more easily than using define-class directly. You can also define common lisp like methods. see http://jscheme.sourceforge.net/jscheme/src/elf/iterate.scm I do have a simple prototype based system that i use. I may check it is as an example. One of the main issues of an Object System for JScheme is how it would interact with Java classes. At 09:55 PM 3/8/2003 -0800, Boris Tschirschwitz wrote: >Hi. > >Assuming that my ignorance mostly stems from not having studied jscheme >long enough, I checked the list archives for answers, but I couldn't find >anything and the sf system seems to be really terrible. > >I am wondering about the following: If I want to program using classes and >objects, do I have to make all my structures Java classes, objects, ...? >I wonder if this might restrict me in manipulating these objects in the >scheme way. Yes, this sounds very vague, b/c I am not absolutely sure what >I am asking and hope that someone on the list might understand it better >than I do. >Would it be beneficial to use something like Meroon? > >Boris. > > > > > >------------------------------------------------------- >This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger >for complex code. Debugging C/C++ programs can leave you feeling lost and >disoriented. TotalView can help you find your way. Available on major UNIX >and Linux platforms. Try it free. www.etnus.com >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |