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-05-19 22:45:46
|
Yes, The original code didn't worry about interfaces. But Tim added them. But we never followed through with it. We need to define SchemeEvaluator to have all the abstract methods we need in Evaluator and then use SchemeEvaluator everywhere except where we new an Evaluator. Actually lets reverse that. Evaluator is an interface, or abstract class, and jsint.EvaluatorImpl is the implementation. Some days, i just miss Common Lisp. k At 10:25 AM 5/20/2004 +1200, Toby Allsopp wrote: >On Wed, May 19, 2004 at 06:15:28PM -0400, Ken Anderson wrote: >> I don't think SchemeEvaluator is pulling it's weight. It has no >> methods and the only thing it really does is cause a runtime coersion >> in JS. >> >> I'd just change things to use Evaluator for now, though we could make >> Evaluator abstract and use jsint.EvaluatorImpl. > >Agreed, it serves no useful purpose presently. I put it there to avoid >exposing jsint classes in the interface of jscheme.JS, which seemed to >be the general pattern, and I couldn't think of any useful methods to >expose at that level. > >Toby. > >P.S. Thanks for accepting my changes, it really makes my life a lot >easier! |
From: Toby A. <tob...@pe...> - 2004-05-19 22:25:59
|
On Wed, May 19, 2004 at 06:15:28PM -0400, Ken Anderson wrote: > I don't think SchemeEvaluator is pulling it's weight. It has no > methods and the only thing it really does is cause a runtime coersion > in JS. > > I'd just change things to use Evaluator for now, though we could make > Evaluator abstract and use jsint.EvaluatorImpl. Agreed, it serves no useful purpose presently. I put it there to avoid exposing jsint classes in the interface of jscheme.JS, which seemed to be the general pattern, and I couldn't think of any useful methods to expose at that level. Toby. P.S. Thanks for accepting my changes, it really makes my life a lot easier! |
From: Ken A. <kan...@bb...> - 2004-05-19 22:16:01
|
I don't think SchemeEvaluator is pulling it's weight. It has no methods and the only thing it really does is cause a runtime coersion in JS. I'd just change things to use Evaluator for now, though we could make Evaluator abstract and use jsint.EvaluatorImpl. k |
From: Timothy J. H. <ti...@cs...> - 2004-05-19 19:28:07
|
We've introduced a new module syntax into Jscheme. This is a very lightweight change (mostly just syntax). The new syntax for loading a jscheme file as a module is as follows: (use-module MODULE) (use-module MODULE SPECIFIER) (use-module MODULE SPECIFIER SYMBOLS) (use-module MODULE SPECIFIER SYMBOLS PREFIX) where * MODULE is a either a filename, or a URL, or the name of a compiled Scheme module * SPECIFIER is one of the following: o 'import-procedures o 'import-macros o 'import and it specifies whether to import procedures, macros, or both. The default value is 'import. * SYMBOLS is either the symbol 'all or is a list of symbols. The default value is 'all. In the former case, all symbols defined in the module are imported to the current environment; in the latter case, only those symbols in the list are imported * PREFIX is a string which is prepended to each imported symbol from the module before that value is put into the current environment. The default value is the empty string "". Strings are never prepended to macros as macros are already changing the syntax... Examples: The following are all equivalent: (use-module "elf/basic.scm") (use-module "elf/basic.scm" 'import) (use-module "elf/basic.scm" 'import 'all) (use-module "elf/basic.scm" 'import 'all "") The following examples show how to get more control over what is imported. You can import only procedures, or only macros, or import some subset of the procedure or macros. (use-module "elf/basic.scm" 'import-procedures 'all) (use-module "elf/basic.scm" 'import-procedures '(describe print)) (use-module "elf/basic.scm" 'import-macros 'all) (use-module "elf/basic.scm" 'import-macros '(dotimes)) (use-module "elf/basic.scm" 'import '(describe print dotimes)) Finally, you can add arbitrary prefixes to the symbols that are imported, but prefixes are never applied to the macros. (use-module "elf/basic.scm" 'import-procedures '(describe print) "elf:") (use-module "elf/basic.scm" 'import-procedures '(describe print) "elf-") (use-module "elf/basic.scm" 'import '(describe print dotimes) "elf:") Modules are implemented by creating a new JScheme instance and loading the specified files into that instance. Then copying the specified values to the current environment and binding them to the specified symbols (possibly with prefixes). Each module is cached when it is loaded and that same instance is used for every "use-module". Feedback is welcome. Cheers, ---Tim--- |
From: Michael R H. <bu...@zc...> - 2004-05-19 16:20:38
|
On Wed, 2004-05-19 at 00:56 -0400, Timothy John Hickey wrote: > The jscheme.JS class has been modified so that it allows multiple > Independent JScheme > instances. This requires a change to the way the JS class is used to > call Scheme from Java. > Many thanks to Toby Allsopp for this extension! Very cool. Thanks Toby! mike > Cheers, > ---Tim--- -- Michael R Head <bu...@zc...> ZClipse -- OpenSource Eclipse plugins |
From: Timothy J. H. <tim...@ma...> - 2004-05-19 04:57:01
|
The jscheme.JS class has been modified so that it allows multiple Independent JScheme instances. This requires a change to the way the JS class is used to call Scheme from Java. Many thanks to Toby Allsopp for this extension! Previously, JS defined static methods for evaluating expressions and calling procedures. All of those methods are now instance methods and you first need to construct an instance: JS js = new JS(); js.load(new java.io.File("app.init")); js.call("describe", this); ... or from Scheme (define js (jscheme.JS.)) (.eval js '(define z 5)) (.eval js '(+ z 1)) See the javadoc for jscheme.JS for more examples.... This should make it easier to build JScheme plugins for Eclipse and other IDEs If you run into any problems, please tell us right away so we can fix any bugs that may have been introduced by this fairly major change. Cheers, ---Tim--- |
From: Ken A. <kan...@bb...> - 2004-05-18 18:44:52
|
Sourceforge has once again changed the site where JScheme's cvs is. It is now at: -d:pserver:ano...@cv...:/cvsroot/jscheme The documentation will be updated tomorrow. k |
From: Timothy J. H. <tim...@ma...> - 2004-05-15 18:51:51
|
On Apr 26, 2004, at 1:47 PM, Ken Anderson wrote: > This looks like quasi quote is ultimately invoking (.append > stringBuffer ...) > and we try to invoke a method on java.lang.AbstractStringBuffer . > > Can you do a simple test, like: > > (define x 4) > {x + 3 = [(x + 3)]} > > This should cause the problem. This might be a method lookup problem. I just downloaded java 1.5 and I also found the problem is in .append: > (define z (java.lang.StringBuffer.)) > (.append z "abc") .... this gives a "Bad method application from a private class" error You can get arround this temporarily using the "hack" (set! .append .append#) But we may need to do some deeper work to incorporate the new "generic" type system with the Jscheme javadot notation. Make this leap will probably solve these invocation errors but will require an extension of javadot to generic types.... ---Tim--- > > There is another problem with the class Object[] too... > > k > At 02:08 PM 4/20/2004 -0400, Timothy John Hickey wrote: >> Hi David, >> >> Does this only happen when you load in the elf/classpath.scm >> or does it happen more generally (e.g. for any javadot call, >> for any private javadot call, etc....) I haven't downloaded the >> preview version of Java on any of my machines yet, but I'll try >> to download a version over the weekend and look into the problem.... >> >> Thanks for the bug report, >> Sorry I have to wait a few days before tackling it..... >> >> ----Tim--- >> On Apr 19, 2004, at 1:01 PM, david wrote: >> >>> >>> I am getting errors modifying the classpath >>> in the new java from sun. This works fin with >>> the 1.4 jvm >>> --------------------------------------------------------------------- >>> - >>> newport:~$ >>> newport:~$ java -jar /usr/share/davud/jscheme.jar >>> >>> JScheme 6.3 4/5/04 http://jscheme.sourceforge.net >>> >>>> (load "elf/classpath.scm") >>> (map (lambda (u) (addClasspathUrl u)) >>> '("/opt/postgresql-7.4/share/java/postgresql.jar" >>> "/mnt/hda3/download/napkinlaf.jar" >>> "/mnt/hda3/download/CLooks_120.jar")) >>> >>> >>> #t >>>> (#null #null #null) >>> >>> >>> ---------------------------------------------------------- >>> >>>> newport:~$ /mnt/hda1/j2sdk1.5.0/bin/java -jar >>>> /usr/share/davud/jscheme.jar >>> >>> JScheme 6.3 4/5/04 http://jscheme.sourceforge.net >>> >>>> (load "elf/classpath.scm") >>> (map (lambda (u) (addClasspathUrl u)) >>> '("/opt/postgresql-7.4/share/java/postgresql.jar" >>> "/mnt/hda3/download/napkinlaf.jar" >>> "/mnt/hda3/download/CLooks_120.jar")) >>> ** WARNING: Error during load (lineno 10): jsint.BacktraceException[ >>> >>> (.append sb (U.stringify (car args )#f )) >>> args = ("\nThe class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and (Import.setCl... >>> sb = >>> loop = (lambda !{}~1 (args sb)...) >>> args= = ("\nThe class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and (Import.setCl... >>> sb= = >>> args = ("\nThe class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and (Import.setCl... >>> >>> ==================================== >>> SchemeException: Bad method application from a private class: , >>> "(java.lang.IllegalAccessException: Class jsint.Invoke can not >>> access a member of class java.lang.AbstractStringBuilder with >>> modifiers \"public\" public java.lang.AbstractStringBuilder >>> java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe >>> class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and >>> (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new >>> class loader and resets Jscheme's\nint... >>> >>> (.append sb (U.stringify (car args )#f )) >>> args = ("\nThe class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and (Import.setCl... >>> sb = >>> loop = (lambda !{}~1 (args sb)...) >>> args= = ("\nThe class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and (Import.setCl... >>> sb= = >>> args = ("\nThe class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and (Import.setCl... >>> >>> ==================================== >>> SchemeException: Bad method application from a private class: , >>> "(java.lang.IllegalAccessException: Class jsint.Invoke can not >>> access a member of class java.lang.AbstractStringBuilder with >>> modifiers \"public\" public java.lang.AbstractStringBuilder >>> java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe >>> class loader used by Jscheme can be accessed >>> with\n(Import.getClassLoader) and >>> (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new >>> class loader and resets Jscheme's\ninternal caches, so that classes >>> can be recompiled and tested easily.\n))" >>> ** WARNING: Can't define-method (iterate (items Object[]) action) >>> classes (Object[]) do not exist. >>> #t >>>> (#null #null #null) >>> >>> >>> >>> ------------------------------------------------------- >>> 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 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user > |
From: Ken A. <kan...@bb...> - 2004-05-07 22:45:32
|
At 05:34 PM 5/2/2004 -0400, Timothy John Hickey wrote: >Matthias Felleisen suggests that we call it Scriipt Java since it really can be thought of as a Scripting language >for Java code..... I like "Scriipt Java"! Dyslexic programmers might just think its Java Script. The "ii" might help. one way of advertising it is that we did the simplest thing we could to make Java scriptable - Scheme is just the most basic essentials of a programming language. JScheme is a thin layer on top of java And it has macro's so you can change the language to make things more scriptable. Java programmers think stack traces are a nice feature but an interactive REPL makes the stack trace and Java even more valuable (SmallTalk and Lisp programmers have had this or better for a long time.). Scripts in other languages, such as the windows .bat shell or bash are not portable (bash scripts are not portable from unix to cygwin unless they are written carefully). So the quicker you can get into a Java scripting language the more portable you can be. (I use .bat and bash scripts that are 6 to 9 lines long because once i'm in JScheme, i know i'm safe and can do whatever i want.) With a Scheme based language you don't need to develop things like ant (a Java make facility) and debate whether or not you should be able to write programs in ant, rather than having to writing them in both Java and XML, which seems doubly awful to me. Better yet, with Scheme you can pretty much avoid XML, i just use s-expressions, like McCarthy intended. To me, JScheme is a trade secret. For example, i have a 31 line macro that would be hard to replace in Java, and using it would be much harder in Java. Our management is concerned that our clients don't want to find out that our most important code is in JScheme, rather than in Java. So at one point we had to tell them before they asked. Now we tell them if they ask. It might be easier to just tell them we use a scripting Java for where it seems most appropriate. Much of what i say above should go for SISC as well. Do SISC applications have any issues with language acceptance? k |
From: Timothy J. H. <tim...@ma...> - 2004-05-02 21:34:38
|
On May 2, 2004, at 4:25 PM, Matthew Munz wrote: > Tim, > > I don't think a comparison of SISC to JScheme is off-topic at all, > and I think this thread belongs on the SISC list. I've CC'd this response to the SISC-users list and to the Jscheme-users list. Maybe it should go to the Kawa-users list too? One of the main goals of Jscheme is to provide a Scheme with the "best" interface to Java, where "best" means most powerful, easy-to-use, and transparent interface to Java. I think the SISC philosophy is to provide the very best Java implementation of R5RS Scheme. The SISC developers and users can certainly give a more authoratative statement of SISC's goals viz-a-viz these issues. > >> If you have any questions about Jscheme, feel free to ask... > > Two questions. > > 1) Is JScheme being actively developed? Yes. Ken Anderson and I are the developers and we are actively developing it. We do however take a fairly conservative approach and try to keep the system relatively simple. We have accepted contributions from the Jscheme user community (e.g. modules, R5RS macros, serializable Jscheme terms, etc.). Both Ken and I are actively using Jscheme for various projects, so we are heavy users as well as language developers. Jscheme is being used in other projects, and we should probably maintain a list of back pointers to projects that use Jscheme, but we haven't done so. (Any Jscheme-users that want to have a back-pointer to their work, please send me a link and I'll put it up!) > 2) JScheme's syntax seems to be rather unique. How portable is > JScheme code? If you are talking about porting to other Scheme interpreters, then you can certainly write in a portable subset of Jscheme, but all of the Java interface code will have to be rewritten. Jscheme complies with most of R4RS Scheme with two exceptions: * we don't provide full call/cc (but we do have tryCatch for exception handling, and we do have an interpreter that implements full call/cc if you really need it and can pay the overhead) * strings are not mutable (as they are implemented as Java strings, which are immutable) Also, many of the optional aspects of R4RS are not implemented (e.g. the full numeric tower, although you could easily write a full numeric tower using java.math.BigDecimal....) Jscheme, as with almost all Schemes, does have several extensions that are not portable: * javadot notation -- no one else has this syntax, but it can be converted to SISC or KAWA syntax ... * tryCatch -- which provides exception handling (and exception handling is not part of RNRS yet). * quasistrings -- which can be easily replaced with calls to (string-append .....) * macros -- the "native macro" is a LISP style (define-macro ....), but R5RS macros are also supported as an add on package * modules -- we have a very simple module system that allows you to import all procedures in a module and to add a prefix (using (environment-import FILENAME PREFIX) it also allows you to import macros (using (language-import FILENAME PREFIX). We have used Jscheme to write applets, servlets, and Java Web Start applications, by writing a little wrapper class in Java that reads the Scheme code and calls the JScheme interpreter. Jscheme runs nicely on all Java platforms we've tried (Mac OS, Linux, Windows). > > The thing about JScheme that seems interesting to me is that the > usability of the FFI appears to be quite high. If you think of a > programming language as an organism, living in a larger environment, > then you can classify its charistics by fittness or "survivability" > within that environment. I think that languages that form a symbiosis > with both programmers and other machines/programs will have a > significant competitive advantage. The ease of portability and > integration with existing systems is thus very important, from this > view. Jscheme integrates very nicely with Java and other Java based languages (you can easily write Jscheme programs that call Jython and JRuby interpreters....) It also provides a great debugging tool for Java programs as it gives you a powerful tool for directly calling your Java code in a Scheme REPL loop! > > To put it bluntly, the SISC FFI is important to me because there is > a lot of Java bytecode out there, and I'd like to be able to leverage > it easily! The thing I like most about Jscheme is that it allows me to write Scheme code that can easily call and be called from the Java Universe. Matthias Felleisen suggests that we call it Scriipt Java since it really can be thought of as a Scripting language for Java code..... I find the SISC FFI more difficult to use, but if someone wants a fully-featured R5RS in Scheme with full numeric tower, call/cc, macros, and good efficiency, I always tell them to look at SISC. If on the other hand, their primary interest is in scripting Java using Scheme, then I tell them to look at JScheme! ---Tim Hickey, http://www.cs.brandeis.edu/~tim > > Matthew M. Munz > mat...@em... > http://munz.2y.net/ > > > -- > ___________________________________________________________ > Sign-up for Ads Free at Mail.com > http://promo.mail.com/adsfreejump.htm > |
From: Ken A. <kan...@bb...> - 2004-04-26 18:56:11
|
One problem seems to be that java.lang.AbstractStringBuilder is package protected, and the append methods of StringBuffer comes from it. I think this is a bug. k |
From: Ken A. <kan...@bb...> - 2004-04-26 17:47:46
|
This looks like quasi quote is ultimately invoking (.append stringBuffer ...) and we try to invoke a method on java.lang.AbstractStringBuffer . Can you do a simple test, like: (define x 4) {x + 3 = [(x + 3)]} This should cause the problem. This might be a method lookup problem. There is another problem with the class Object[] too... k At 02:08 PM 4/20/2004 -0400, Timothy John Hickey wrote: >Hi David, > >Does this only happen when you load in the elf/classpath.scm >or does it happen more generally (e.g. for any javadot call, >for any private javadot call, etc....) I haven't downloaded the >preview version of Java on any of my machines yet, but I'll try >to download a version over the weekend and look into the problem.... > >Thanks for the bug report, >Sorry I have to wait a few days before tackling it..... > >----Tim--- >On Apr 19, 2004, at 1:01 PM, david wrote: > >> >>I am getting errors modifying the classpath >>in the new java from sun. This works fin with >>the 1.4 jvm >>---------------------------------------------------------------------- >>newport:~$ >>newport:~$ java -jar /usr/share/davud/jscheme.jar >> >>JScheme 6.3 4/5/04 http://jscheme.sourceforge.net >> >>> (load "elf/classpath.scm") >>(map (lambda (u) (addClasspathUrl u)) >> '("/opt/postgresql-7.4/share/java/postgresql.jar" >> "/mnt/hda3/download/napkinlaf.jar" >> "/mnt/hda3/download/CLooks_120.jar")) >> >> >>#t >>>(#null #null #null) >> >> >>---------------------------------------------------------- >> >>>newport:~$ /mnt/hda1/j2sdk1.5.0/bin/java -jar /usr/share/davud/jscheme.jar >> >>JScheme 6.3 4/5/04 http://jscheme.sourceforge.net >> >>> (load "elf/classpath.scm") >>(map (lambda (u) (addClasspathUrl u)) >> '("/opt/postgresql-7.4/share/java/postgresql.jar" >> "/mnt/hda3/download/napkinlaf.jar" >> "/mnt/hda3/download/CLooks_120.jar")) >>** WARNING: Error during load (lineno 10): jsint.BacktraceException[ >> >>(.append sb (U.stringify (car args )#f )) >> args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... >> sb = >> loop = (lambda !{}~1 (args sb)...) >> args= = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... >> sb= = >> args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... >> >> ==================================== >>SchemeException: Bad method application from a private class: , "(java.lang.IllegalAccessException: Class jsint.Invoke can not access a member of class java.lang.AbstractStringBuilder with modifiers \"public\" public java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new class loader and resets Jscheme's\nint... >> >>(.append sb (U.stringify (car args )#f )) >> args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... >> sb = >> loop = (lambda !{}~1 (args sb)...) >> args= = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... >> sb= = >> args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... >> >> ==================================== >>SchemeException: Bad method application from a private class: , "(java.lang.IllegalAccessException: Class jsint.Invoke can not access a member of class java.lang.AbstractStringBuilder with modifiers \"public\" public java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new class loader and resets Jscheme's\ninternal caches, so that classes can be recompiled and tested easily.\n))" >>** WARNING: Can't define-method (iterate (items Object[]) action) classes (Object[]) do not exist. >>#t >>>(#null #null #null) >> >> >> >>------------------------------------------------------- >>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: Ken A. <kan...@bb...> - 2004-04-26 16:49:40
|
>Date: Mon, 26 Apr 2004 10:21:22 -0500 >To: gui...@gn..., gtk...@gn... >User-Agent: Mutt/1.5.4i >From: li...@li... (Linas Vepstas) >Cc: >Subject: GLib GObject & Javadot Notation for scheme? >X-BeenThere: gui...@gn... >X-Mailman-Version: 2.1.4 >List-Id: General Guile related discussions <guile-user.gnu.org> >List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/guile-user>, > <mailto:gui...@gn...?subject=unsubscribe> >List-Archive: <http://mail.gnu.org/pipermail/guile-user> >List-Post: <mailto:gui...@gn...> >List-Help: <mailto:gui...@gn...?subject=help> >List-Subscribe: <http://mail.gnu.org/mailman/listinfo/guile-user>, > <mailto:gui...@gn...?subject=subscribe> >Sender: guile-user-bounces+kanderson=bb...@gn... >Old-X-Spam-Status: NO >Old-X-Scanned-By: MIMEDefang 2.28 (www . roaringpenguin . com / mimedefang) >Old-X-Scanned-By: MIMEDefang 2.35 >X-Scanned-By: Spam Assassin >X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on zima.bbn.com >X-Spam-Level: >X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham > version=2.63 > > >Hi, > >I was reading about JScheme and in particular 'javadot notation': > > http://jscheme.sourceforge.net/jscheme/doc/javadot.html > >and I was wondering if anybody had done anything similar for >GLib GObjects for guile? The idea seems pretty slick ... > >--linas > >-- >pub 1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <li...@li...> >PGP Key fingerprint = 8305 2521 6000 0B5E 8984 3F54 64A9 9A82 0104 5933 > > >_______________________________________________ >Guile-user mailing list >Gui...@gn... >http://mail.gnu.org/mailman/listinfo/guile-user |
From: Timothy J. H. <ti...@cs...> - 2004-04-20 18:08:10
|
Hi David, Does this only happen when you load in the elf/classpath.scm or does it happen more generally (e.g. for any javadot call, for any private javadot call, etc....) I haven't downloaded the preview version of Java on any of my machines yet, but I'll try to download a version over the weekend and look into the problem.... Thanks for the bug report, Sorry I have to wait a few days before tackling it..... ----Tim--- On Apr 19, 2004, at 1:01 PM, david wrote: > > I am getting errors modifying the classpath > in the new java from sun. This works fin with > the 1.4 jvm > ---------------------------------------------------------------------- > newport:~$ > newport:~$ java -jar /usr/share/davud/jscheme.jar > > JScheme 6.3 4/5/04 http://jscheme.sourceforge.net > >> (load "elf/classpath.scm") > (map (lambda (u) (addClasspathUrl u)) > '("/opt/postgresql-7.4/share/java/postgresql.jar" > "/mnt/hda3/download/napkinlaf.jar" > "/mnt/hda3/download/CLooks_120.jar")) > > > #t >> (#null #null #null) > > > ---------------------------------------------------------- > >> newport:~$ /mnt/hda1/j2sdk1.5.0/bin/java -jar >> /usr/share/davud/jscheme.jar > > JScheme 6.3 4/5/04 http://jscheme.sourceforge.net > >> (load "elf/classpath.scm") > (map (lambda (u) (addClasspathUrl u)) > '("/opt/postgresql-7.4/share/java/postgresql.jar" > "/mnt/hda3/download/napkinlaf.jar" > "/mnt/hda3/download/CLooks_120.jar")) > ** WARNING: Error during load (lineno 10): jsint.BacktraceException[ > > (.append sb (U.stringify (car args )#f )) > args = ("\nThe class loader used by Jscheme can be accessed > with\n(Import.getClassLoader) and (Import.setCl... > sb = > loop = (lambda !{}~1 (args sb)...) > args= = ("\nThe class loader used by Jscheme can be accessed > with\n(Import.getClassLoader) and (Import.setCl... > sb= = > args = ("\nThe class loader used by Jscheme can be accessed > with\n(Import.getClassLoader) and (Import.setCl... > > ==================================== > SchemeException: Bad method application from a private class: , > "(java.lang.IllegalAccessException: Class jsint.Invoke can not access > a member of class java.lang.AbstractStringBuilder with modifiers > \"public\" public java.lang.AbstractStringBuilder > java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe class > loader used by Jscheme can be accessed with\n(Import.getClassLoader) > and (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new > class loader and resets Jscheme's\nint... > > (.append sb (U.stringify (car args )#f )) > args = ("\nThe class loader used by Jscheme can be accessed > with\n(Import.getClassLoader) and (Import.setCl... > sb = > loop = (lambda !{}~1 (args sb)...) > args= = ("\nThe class loader used by Jscheme can be accessed > with\n(Import.getClassLoader) and (Import.setCl... > sb= = > args = ("\nThe class loader used by Jscheme can be accessed > with\n(Import.getClassLoader) and (Import.setCl... > > ==================================== > SchemeException: Bad method application from a private class: , > "(java.lang.IllegalAccessException: Class jsint.Invoke can not access > a member of class java.lang.AbstractStringBuilder with modifiers > \"public\" public java.lang.AbstractStringBuilder > java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe class > loader used by Jscheme can be accessed with\n(Import.getClassLoader) > and (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new > class loader and resets Jscheme's\ninternal caches, so that classes > can be recompiled and tested easily.\n))" > ** WARNING: Can't define-method (iterate (items Object[]) action) > classes (Object[]) do not exist. > #t >> (#null #null #null) >> > > > > ------------------------------------------------------- > 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: david <da...@da...> - 2004-04-19 17:01:36
|
I am getting errors modifying the classpath in the new java from sun. This works fin with the 1.4 jvm ---------------------------------------------------------------------- newport:~$ newport:~$ java -jar /usr/share/davud/jscheme.jar JScheme 6.3 4/5/04 http://jscheme.sourceforge.net > (load "elf/classpath.scm") (map (lambda (u) (addClasspathUrl u)) '("/opt/postgresql-7.4/share/java/postgresql.jar" "/mnt/hda3/download/napkinlaf.jar" "/mnt/hda3/download/CLooks_120.jar")) #t > (#null #null #null) ---------------------------------------------------------- > newport:~$ /mnt/hda1/j2sdk1.5.0/bin/java -jar /usr/share/davud/jscheme.jar JScheme 6.3 4/5/04 http://jscheme.sourceforge.net > (load "elf/classpath.scm") (map (lambda (u) (addClasspathUrl u)) '("/opt/postgresql-7.4/share/java/postgresql.jar" "/mnt/hda3/download/napkinlaf.jar" "/mnt/hda3/download/CLooks_120.jar")) ** WARNING: Error during load (lineno 10): jsint.BacktraceException[ (.append sb (U.stringify (car args )#f )) args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... sb = loop = (lambda !{}~1 (args sb)...) args= = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... sb= = args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... ==================================== SchemeException: Bad method application from a private class: , "(java.lang.IllegalAccessException: Class jsint.Invoke can not access a member of class java.lang.AbstractStringBuilder with modifiers \"public\" public java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new class loader and resets Jscheme's\nint... (.append sb (U.stringify (car args )#f )) args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... sb = loop = (lambda !{}~1 (args sb)...) args= = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... sb= = args = ("\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setCl... ==================================== SchemeException: Bad method application from a private class: , "(java.lang.IllegalAccessException: Class jsint.Invoke can not access a member of class java.lang.AbstractStringBuilder with modifiers \"public\" public java.lang.AbstractStringBuilder java.lang.AbstractStringBuilder.append(java.lang.String) #(\nThe class loader used by Jscheme can be accessed with\n(Import.getClassLoader) and (Import.setClassLoader).\n\n(replaceClassLoaders) creates a new class loader and resets Jscheme's\ninternal caches, so that classes can be recompiled and tested easily.\n))" ** WARNING: Can't define-method (iterate (items Object[]) action) classes (Object[]) do not exist. #t > (#null #null #null) > |
From: Ken A. <kan...@bb...> - 2004-04-13 20:58:07
|
I just checked in elf/infest.scm - get it in tomorrows jscheme.jar. If you put the jscheme.jar in an application's lib/ directory, and start JScheme with something like java -jar lib/jscheme.jar elf/infest.scm you will have access to all the classes in any jar or .zip file under lib/. It's an easy way to help a Java friend debug a problem. I realize this won't work for J2EE or webapp environments, but its a start. k |
From: Timothy J. H. <tim...@ma...> - 2004-04-07 20:14:07
|
On Apr 7, 2004, at 2:35 PM, Borislav Iordanov wrote: > Hi Tim, > > Thanks very much for the explanation. However, I must admit that the > workings of those macros are a bit confusing to me. I can stupidly > remember to unquote the macro arguments in a returned s-expression, but > I don't quite understand why and how it works. > > Ok, define-macro returns an s-expression which will _then_ be > evaluated. > So when a macro is applied, the s-expression is first constructed from > the macro definition and then it is passed to the evaluator. So with > the > following macro: > > (define-macro (my-delay form) `(delay ,form)) > > If I write: > > (define promise (my-delay (display "Hi there!"))) > > what is happening is that first an s-expression is constructed: > > `(delay ,(display "Hi there!")) Not quite.... (my-delay (display "Hi there!") ---> (delay (display "Hi there!")) The quasiquote and unquote are interepreted in the define-macro environment where form is bound to the term (display "Hi there!") So in more detail, with environments you would have Env | (my-delay form) --> (Env,{form=(display "Hi there!")} | (E `(delay ,form))) --> (Env,{form=(display "Hi there!")} | (E (list 'delay '(display "Hi there!")))) --> (Env,{form=(display "Hi there!")} | (E `(delay (display "Hi there!")))) --> (Env} | (delay (display "Hi there!"))) where E is an operator that evaluates the term in the current environment I don't know if this is helpful. Its halfway between an informal explanation and a formal semantics..... > > which is then evaluated to yield the promise. So the 'promise' define > above should be equivalent to: > > (define promise (eval `(delay ,(display "Hi there!")))) The explanation above was to show why this line is incorrect.... Your unquote is taking place in the wrong environment.... Does this help? ---Tim--- > > But evaluating the above expression prints the string "Hi there!" as > one > would expect because (display ...) is unquoted inside the > quasiquotation. > > Evaluating (my-delay (display "Hi there!")) doesn't display anything > which is the intent, but I don't understand why? Given the implied > model > of macro expansion (i.e. build an s-expression, then evaluate it). > > Thanks, > Boris > > | -----Original Message----- > | From: Timothy John Hickey [mailto:tim...@ma...] > | Sent: Wednesday, April 07, 2004 9:38 AM > | To: Borislav Iordanov > | Cc: jsc...@li... > | Subject: Re: [Jscheme-user] a little problem with define-macro > | > | > | > | On Apr 7, 2004, at 12:27 AM, Borislav Iordanov wrote: > | > | > Hi, > | > > | > I tried using define-macro (i.e. the built in macros) to simplify > | > working with streams thus: > | > > | >> (define-macro (make-stream h t) (cons h (delay t))) > | > (macro make-stream (h t)...) > | > | The define-macro should return an s-expression which will > | then be evaluated: > | > | (define-macro (make-stream h t) `(cons ,h (delay ,t))) > | > | This works fine with enum. The quasiquoted expression > | could also be written with standard quote as > | > | (define-macro (make-stream h t) (list 'cons h (list 'delay t))) > | > | which would work as well, but is harder to read... > | > | ---Tim--- > | > | > | > > | > But then: > | > > | >> (define (enum start end) > | > (if (> start end) '() (make-stream start (enum (+ start > | 1) end)))) > | > > | > SchemeException: expected object of type list (i.e. pair or empty), > | > but > | > got: , " > | > (lambda delay~3 ()...)" > | > at jsint.E.error(E.java:14) > | > at jsint.E.typeError(E.java:24) > | > at jsint.U.toList(U.java:180) > | > at jsint.U.listToVector(U.java:772) > | > at jsint.Scheme.analyze(Scheme.java:487) > | > at jsint.Scheme.analyze(Scheme.java:475) > | > at jsint.Scheme.analyze(Scheme.java:490) > | > at jsint.Scheme.analyze(Scheme.java:473) > | > at jsint.Scheme.analyze(Scheme.java:459) > | > at jsint.Scheme.analyze(Scheme.java:490) > | > at jsint.Scheme.analyze(Scheme.java:490) > | > at jsint.Scheme.analyze(Scheme.java:475) > | > at jsint.Scheme.eval(Scheme.java:434) > | > at jsint.Scheme.eval(Scheme.java:424) > | > at jsint.Scheme.readEvalWriteLoop(Scheme.java:208) > | > at jsint.Scheme.runJscheme(Scheme.java:186) > | > at jsint.Scheme.defaultMain(Scheme.java:149) > | > at jsint.Scheme.main(Scheme.java:124) > | > at jscheme.REPL.main(REPL.java:138) > | > > | > > | > If expand "manually" the macro: > | > > | > (define (enum start end) > | > (if (> start end) '() (cons start (delay (enum (+ start > | 1) end))))) > | > > | > there is no problem. > | > > | > BTW, it also works with define-syntax macros.. > | > > | > 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: Borislav I. <bor...@ko...> - 2004-04-07 18:35:15
|
Hi Tim, Thanks very much for the explanation. However, I must admit that the workings of those macros are a bit confusing to me. I can stupidly remember to unquote the macro arguments in a returned s-expression, but I don't quite understand why and how it works. Ok, define-macro returns an s-expression which will _then_ be evaluated. So when a macro is applied, the s-expression is first constructed from the macro definition and then it is passed to the evaluator. So with the following macro: (define-macro (my-delay form) `(delay ,form)) If I write: (define promise (my-delay (display "Hi there!"))) what is happening is that first an s-expression is constructed: `(delay ,(display "Hi there!")) which is then evaluated to yield the promise. So the 'promise' define above should be equivalent to: (define promise (eval `(delay ,(display "Hi there!")))) But evaluating the above expression prints the string "Hi there!" as one would expect because (display ...) is unquoted inside the quasiquotation. Evaluating (my-delay (display "Hi there!")) doesn't display anything which is the intent, but I don't understand why? Given the implied model of macro expansion (i.e. build an s-expression, then evaluate it). Thanks, Boris | -----Original Message----- | From: Timothy John Hickey [mailto:tim...@ma...] | Sent: Wednesday, April 07, 2004 9:38 AM | To: Borislav Iordanov | Cc: jsc...@li... | Subject: Re: [Jscheme-user] a little problem with define-macro | | | | On Apr 7, 2004, at 12:27 AM, Borislav Iordanov wrote: | | > Hi, | > | > I tried using define-macro (i.e. the built in macros) to simplify | > working with streams thus: | > | >> (define-macro (make-stream h t) (cons h (delay t))) | > (macro make-stream (h t)...) | | The define-macro should return an s-expression which will | then be evaluated: | | (define-macro (make-stream h t) `(cons ,h (delay ,t))) | | This works fine with enum. The quasiquoted expression | could also be written with standard quote as | | (define-macro (make-stream h t) (list 'cons h (list 'delay t))) | | which would work as well, but is harder to read... | | ---Tim--- | | | > | > But then: | > | >> (define (enum start end) | > (if (> start end) '() (make-stream start (enum (+ start | 1) end)))) | > | > SchemeException: expected object of type list (i.e. pair or empty), | > but | > got: , " | > (lambda delay~3 ()...)" | > at jsint.E.error(E.java:14) | > at jsint.E.typeError(E.java:24) | > at jsint.U.toList(U.java:180) | > at jsint.U.listToVector(U.java:772) | > at jsint.Scheme.analyze(Scheme.java:487) | > at jsint.Scheme.analyze(Scheme.java:475) | > at jsint.Scheme.analyze(Scheme.java:490) | > at jsint.Scheme.analyze(Scheme.java:473) | > at jsint.Scheme.analyze(Scheme.java:459) | > at jsint.Scheme.analyze(Scheme.java:490) | > at jsint.Scheme.analyze(Scheme.java:490) | > at jsint.Scheme.analyze(Scheme.java:475) | > at jsint.Scheme.eval(Scheme.java:434) | > at jsint.Scheme.eval(Scheme.java:424) | > at jsint.Scheme.readEvalWriteLoop(Scheme.java:208) | > at jsint.Scheme.runJscheme(Scheme.java:186) | > at jsint.Scheme.defaultMain(Scheme.java:149) | > at jsint.Scheme.main(Scheme.java:124) | > at jscheme.REPL.main(REPL.java:138) | > | > | > If expand "manually" the macro: | > | > (define (enum start end) | > (if (> start end) '() (cons start (delay (enum (+ start | 1) end))))) | > | > there is no problem. | > | > BTW, it also works with define-syntax macros.. | > | > 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. <tim...@ma...> - 2004-04-07 13:37:58
|
On Apr 7, 2004, at 12:27 AM, Borislav Iordanov wrote: > Hi, > > I tried using define-macro (i.e. the built in macros) to simplify > working with streams thus: > >> (define-macro (make-stream h t) (cons h (delay t))) > (macro make-stream (h t)...) The define-macro should return an s-expression which will then be evaluated: (define-macro (make-stream h t) `(cons ,h (delay ,t))) This works fine with enum. The quasiquoted expression could also be written with standard quote as (define-macro (make-stream h t) (list 'cons h (list 'delay t))) which would work as well, but is harder to read... ---Tim--- > > But then: > >> (define (enum start end) > (if (> start end) '() (make-stream start (enum (+ start 1) end)))) > > SchemeException: expected object of type list (i.e. pair or empty), but > got: , " > (lambda delay~3 ()...)" > at jsint.E.error(E.java:14) > at jsint.E.typeError(E.java:24) > at jsint.U.toList(U.java:180) > at jsint.U.listToVector(U.java:772) > at jsint.Scheme.analyze(Scheme.java:487) > at jsint.Scheme.analyze(Scheme.java:475) > at jsint.Scheme.analyze(Scheme.java:490) > at jsint.Scheme.analyze(Scheme.java:473) > at jsint.Scheme.analyze(Scheme.java:459) > at jsint.Scheme.analyze(Scheme.java:490) > at jsint.Scheme.analyze(Scheme.java:490) > at jsint.Scheme.analyze(Scheme.java:475) > at jsint.Scheme.eval(Scheme.java:434) > at jsint.Scheme.eval(Scheme.java:424) > at jsint.Scheme.readEvalWriteLoop(Scheme.java:208) > at jsint.Scheme.runJscheme(Scheme.java:186) > at jsint.Scheme.defaultMain(Scheme.java:149) > at jsint.Scheme.main(Scheme.java:124) > at jscheme.REPL.main(REPL.java:138) > > > If expand "manually" the macro: > > (define (enum start end) > (if (> start end) '() (cons start (delay (enum (+ start 1) end))))) > > there is no problem. > > BTW, it also works with define-syntax macros.. > > 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: Borislav I. <bor...@ko...> - 2004-04-07 04:23:19
|
Hi, I tried using define-macro (i.e. the built in macros) to simplify working with streams thus: > (define-macro (make-stream h t) (cons h (delay t))) (macro make-stream (h t)...) But then: > (define (enum start end) (if (> start end) '() (make-stream start (enum (+ start 1) end)))) SchemeException: expected object of type list (i.e. pair or empty), but got: , " (lambda delay~3 ()...)" at jsint.E.error(E.java:14) at jsint.E.typeError(E.java:24) at jsint.U.toList(U.java:180) at jsint.U.listToVector(U.java:772) at jsint.Scheme.analyze(Scheme.java:487) at jsint.Scheme.analyze(Scheme.java:475) at jsint.Scheme.analyze(Scheme.java:490) at jsint.Scheme.analyze(Scheme.java:473) at jsint.Scheme.analyze(Scheme.java:459) at jsint.Scheme.analyze(Scheme.java:490) at jsint.Scheme.analyze(Scheme.java:490) at jsint.Scheme.analyze(Scheme.java:475) at jsint.Scheme.eval(Scheme.java:434) at jsint.Scheme.eval(Scheme.java:424) at jsint.Scheme.readEvalWriteLoop(Scheme.java:208) at jsint.Scheme.runJscheme(Scheme.java:186) at jsint.Scheme.defaultMain(Scheme.java:149) at jsint.Scheme.main(Scheme.java:124) at jscheme.REPL.main(REPL.java:138) If expand "manually" the macro: (define (enum start end) (if (> start end) '() (cons start (delay (enum (+ start 1) end))))) there is no problem. BTW, it also works with define-syntax macros.. Best, Boris |
From: Ken A. <kan...@bb...> - 2004-04-05 19:48:23
|
This is an interesting question. I think that (apply and '(#t #t)) should be a syntax error, because and is considered syntax, and not a procedure. In JScheme, and is an instance of Macro which is a subclass of Procedure. Apply is a primitive that essentially calls .apply on its first argument and the list of remaining arguments. For a Macro, .apply macroexpands the macro and arguments. Scheme.analyze() calls .apply to get macroexpansion done, but for apply it should probably be and error. The right way to apply a macro is like this: (apply (lambda (a b) (and a b)) (list #t #f)) However, i did notice that (apply + 2 3) does not provide an informative error message, i'll fix that. k At 02:49 PM 4/5/2004 -0400, Borislav Iordanov wrote: >Hi, > >I tried and-ing a list of boolean with: > >(apply and values) > >It doesn't work. Why is it possible to do: > >(apply + (list 2 2)) > >But not: > >(apply and (list #t #t))? > >It seems like and is a macro that expands the above into: > >(if #t (and #t) #f) > >Of course, I can 'and' that list in many other ways, but just >wondering.... > >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-04-05 18:49:35
|
Hi, I tried and-ing a list of boolean with: (apply and values) It doesn't work. Why is it possible to do: (apply + (list 2 2)) But not: (apply and (list #t #t))? It seems like and is a macro that expands the above into: (if #t (and #t) #f) Of course, I can 'and' that list in many other ways, but just wondering.... Thanks, Boris |
From: Borislav I. <bor...@ko...> - 2004-04-05 17:49:09
|
Hi, | Yes, unfortunately, the psyntax stuff is pretty difficult to | use. The reason is that it starts out with a letrec with 141 | functions that have been alpha substituted (uniquely | renamed). And these get printed out during the backtrace, | and are fairly useless. I think things are blowing up | because a old define-macro is being defined and the new | macroexapnder blows up for some reason. I'll need to look at this. | | I'll send some code for avoidng loading files twice. | | One thing you might help would be to change the definitions | in the first letrec to be top level defines. I really would | like this to be easier to use. Would it be better if the whole macro system was compiled into Java and loaded all the time, by default? This would potentially make macros more efficient and also allow libraries to freely use macros without worrying about including psyntax. For instance, I am thinking of developing some sort of general documentation facility with macros. A function would be documented with some expression like this: (doc myfunction { general description of myfunction } (param a { description of param a} ) (param b { description of param b} ) (returns { description of return value} ) ) This could then be used to generate help files, or to get information about a function while interacting with scheme: (info myfunction) => (myfunction a b): general description a: description of parameter a etc... I think this would be extremely useful. Even scheme primitives could be documented this way. I'm sure I could use many of the goodies in "elf/*", but there are simply not documented and only to know what's available, I have to read through the source files. Documentation would be included alongside the main code. One would also be able to able to search through the docs based on patterns (like in apropos or emacs) etc. Perhaps, even some sort of literate programming can be implemented by replacing top-level defines by a macro equivalent that processes documentation expressions within the body of the define separately: (define (myfunction a b) (info { myfunction computes the blabla of two numbers } ) (param a { a is the number that ...} ) (let (....) (doc { First, we test whether blabla} ) (if (blabla) (doc { if blabla indeed, then x is returned}) x etc... Hmm, maybe I'm dreaming too much. I have no idea how feasible this is - I only started learning how to use macros. In terms of readability of the resulting code, it shouldn't be a problem with appropriate syntax coloring for documentation "directives". BTW, don't know if this would be a good way to do it, but I patched my Netbeans plugin (which I use exclusively to interact with Jscheme) to implement your workaround in evaluating macros: // 'input' comes from InputPort.read() private static Object evalObject(Object input) { final Symbol EVAL = Symbol.intern("eval"); final Symbol QUOTE = Symbol.QUOTE; Pair to_eval = new Pair(EVAL, new Pair(new Pair(QUOTE, new Pair(input, Pair.EMPTY)), Pair.EMPTY)); return Scheme.eval(to_eval); } Perhaps, this can be used temporarily in jscheme.REPL is it's too complicated fixing "the right way". Best, Boris |
From: Timothy J. H. <tim...@ma...> - 2004-04-04 17:58:31
|
On Apr 3, 2004, at 4:19 PM, david wrote: > > if I create a java object in a let > > (let ((o (java.util.Hashtable.))) ..blah o ) Since "let" is a macro, this gets converted to ( (lambda (o p q ..) ...blah o) (java.util.Hashtable.) ... ) So the o,p,q,... are put into a lexical environment and bound to their corresponding values in the "let" The body is then evaluated (...blah o) and at the end the lexical symbol "o" is evaluated and its value is returned. The lexical closure then will be garbage collected unless it gets captured during the evaluation of the body and is reachable from non-garbage, eg. (define f (let ((o (java.util.Hashtable.)) (y (java.util.Hashtable.)) ) (set! g (lambda(z) (list o y z))) o )) but in normal situations the lexical environment will be garbage collected ... (define f (let ((o (java.util.Hashtable.)) (y (java.util.Hashtable.)) ) (.put y 'a 1) (.put o 'b y) o )) Does this help?? ---Tim--- > > and return that object so that a reference to it > is saved , does this prevent other objects > in the let from being garbage collected? > > davud > > > > > > > > ------------------------------------------------------- > 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: david <da...@da...> - 2004-04-03 21:20:05
|
if I create a java object in a let (let ((o (java.util.Hashtable.))) ..blah o ) and return that object so that a reference to it is saved , does this prevent other objects in the let from being garbage collected? davud |