You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(39) |
May
(41) |
Jun
(20) |
Jul
(8) |
Aug
(15) |
Sep
(18) |
Oct
(15) |
Nov
(6) |
Dec
(48) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(28) |
Feb
(6) |
Mar
(23) |
Apr
(13) |
May
(3) |
Jun
(12) |
Jul
(26) |
Aug
(1) |
Sep
|
Oct
(14) |
Nov
(2) |
Dec
(18) |
2004 |
Jan
(10) |
Feb
(5) |
Mar
(24) |
Apr
(7) |
May
(79) |
Jun
(25) |
Jul
|
Aug
(2) |
Sep
(11) |
Oct
(5) |
Nov
|
Dec
(1) |
2005 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(6) |
Oct
|
Nov
|
Dec
|
From: Geoffrey K. <ge...@kn...> - 2004-09-28 21:18:57
|
On Sep 28, 2004, at 4:34 PM, Ken Anderson wrote: > Could we get a servlet that only reads the file once? Or maybe even > never - it calls a function that its already loaded? I think it should be an option. load-always or load-once, so to speak. At the customer site where I've been using JScheme servlets to demo screen designs and change them on the spot, it's been very nice that little tweaks to my html.scm and defs.scm "libraries" get reflected immediately in the browser, and fellow developers were impressed that I never had to stop/restart the Jetty server. I can see the value of load-once too, so long as there is a way to dump ("forget") something in memory dynamically so a new version can be loaded. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Timothy J. H. <ti...@cs...> - 2004-09-28 20:49:37
|
On Sep 28, 2004, at 4:34 PM, Ken Anderson wrote: > Tim, > > Your various servlets always read and evaluate a file, which is fine > for your course and development, but what about performance? > > Could we get a servlet that only reads the file once? Or maybe even > never - it calls a function that its already loaded? I haven't though much about it, but its a good idea. A partial solution would be to write servlets as follows: (servlet (a b c ... z) (use-module "/full/path/to/file/F.scm") (F a b c ... z) ) The server would still have to read and parse the file, but it would be a relatively small file. One could also skip even this small amount of parsing by using a cache to see if the file has been read before... (This would go in WEB-INF/scheme/scheme.sss) I haven't tried either of these, but it would be interesting to see how much they improve performance. (I've found httperf to be a nice tool for measuring servlet performance....) ---Tim--- > k > |
From: Geoffrey K. <ge...@kn...> - 2004-09-28 20:37:43
|
Ken and Tim -- Thanks for your suggestions. What I discovered was close to what Ken suggested (hidden parameters), but I can see utility for Tim suggested (session parameters). Here is the test code I used. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk ;;;;; send.servlet (servlet () (define (buttonSend buttonValue action att val) (sa-form (catt (s-method "post") (s-action action)) (s-input (s-type "submit") (s-value buttonValue)) (s-input (s-name att) (s-type "hidden") (s-value val)))) (load "webapp/jscheme/test/html.scm") (buttonSend "Send my name" "recv.servlet" "firstName" "Geoffrey")) ;;;;; recv.servlet (servlet () (load "webapp/jscheme/test/html.scm") (let ((name (.getParameter request "firstName"))) (s-html (s-p "Your first name is: " name) (go-button "again" "send.servlet")))) |
From: Ken A. <kan...@bb...> - 2004-09-28 20:35:11
|
Tim, Your various servlets always read and evaluate a file, which is fine for your course and development, but what about performance? Could we get a servlet that only reads the file once? Or maybe even never - it calls a function that its already loaded? k |
From: Timothy J. H. <ti...@cs...> - 2004-09-28 20:16:09
|
On Sep 28, 2004, at 2:12 PM, Geoffrey Knauth wrote: > How do I pass parameters between JScheme servlets? There are several techniques ... As Ken suggests, hidden parameters is a standard one > <input name="abc" type="hidden" value="xyz"> .. Another approach is to use session parameters which are stored on the server and accessible to servlets in the same session. I do this using the following two procedures for storing and accessing session values (which is in the jscheme webapp from CVS in WEB-INF/scheme/servletlib/session.scm > ;; storing session data > (define (session-set request N V) > (.setAttribute (.getSession request) N V)) > > (define (session-get request N Default) > (let ((x (.getAttribute (.getSession request) N))) > (if (equal? x #null) Default x))) This approach is good for passwords where you get them once from the user and the store them in a session attribute. Does this help?? You could probably also "call a servlet" and get its return value by doing a read on a URL... > > (define result > (http-read > > "http://my.company.com:8080/jscheme/my.servlet?a=1&b=2&c=3&d=hi")) > but this can expose you to the danger of infinite servlet loops where servlet A calls servlet B who calls servlet C, etc. The http-read procedure can be defined as follows (but there might be a more elegant solution....) > (define (http-read url-string) > ;; this reads a string from a given url > (define url (java.net.URL. url-string)) > (define http-con (.openConnection url)) > (define buf (java.lang.reflect.Array.newInstance char.class 65536)) > > (define (drain-from-in in) ;; read input lines into a list in > reverse order > (let loop ((n (.read in buf 0 65535)) > (L ())) > (if (equal? n -1) > L > (let ((z (java.lang.String. buf 0 n))) > (loop (.read in buf 0 65535) (cons z L)))))) > > (define (strip-out-header L) ; L is a reversed list of lines from > an http file > (let loop ((L L) (R ())) > (cond ((null? L) R) > ((equal? (first L) "") R) > (else (loop (rest L) (cons (first L) R)))))) > > (define (list->string L) > (let loop ((L L) (z (java.lang.StringBuffer.))) > (if (null? L) > (.toString z) > (loop (rest L) (.append (.append z (first L)) "\n"))))) > > (let ( > (in (java.io.BufferedReader. > (java.io.InputStreamReader. > (.getInputStream http-con))))) > (let* ((result (drain-from-in in))) > (.disconnect http-con) > (list->string (strip-out-header result)) > ))) ---Tim--- > > Geoffrey > -- > Geoffrey S. Knauth | http://knauth.org/gsk > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on > ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give > us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Jscheme-devel mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-devel |
From: Ken A. <kan...@bb...> - 2004-09-28 19:10:52
|
Tim can probably answer this better than i can. Also a bit more context of what you want to do would help. Can you put the information in a hidden field in a form? At 02:12 PM 9/28/2004 -0400, Geoffrey Knauth wrote: >How do I pass parameters between JScheme servlets? > >Geoffrey >-- >Geoffrey S. Knauth | http://knauth.org/gsk > > > >------------------------------------------------------- >This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >Use IT products in your business? Tell us what you think of them. Give us >Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >http://productguide.itmanagersjournal.com/guidepromo.tmpl >_______________________________________________ >Jscheme-devel mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-devel |
From: Geoffrey K. <ge...@kn...> - 2004-09-28 18:13:20
|
How do I pass parameters between JScheme servlets? Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Geoffrey K. <ge...@kn...> - 2004-09-28 14:14:23
|
To get bin/make.bat to work on Windows (our tech lead's machine), I had to change all the / chars to \ chars. Subsequently, he was very impressed with JScheme's capabilities. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Timothy J. H. <ti...@cs...> - 2004-08-05 18:07:42
|
On Aug 5, 2004, at 12:57 PM, Geoffrey Knauth wrote: > Maybe this is a FAQ. I guess I was surprised I got 0 instead of #f > and/or an exception of some kind. > > $ java -cp lib/jscheme.jar jscheme.REPL > JScheme 7.1 (8/5/04 3:06 AM) http://jscheme.sourceforge.net > > (* 256 256 256 256) > 0 > > (* 256 256 256) > 16777216 > > (* 256 256 256 128) > -2147483648 > > I guess we need a FAQ for JScheme and questions about numerics need to be there... --------------------- Q: Why does integer arithemetic give numerically incorrect results in JScheme? A: JScheme numbers and operators are taken from Java so, for example, 256 in an "int" and hence raising 256 to the fourth power gives zero in JScheme > (display (* 256 256 256 256)) 0 This gives zero because it gives the same result as a corresponding Java program, such as the following: public class Demo { public static void main(String[] args) { int x = 256; System.out.println(x * x * x * x); } } Java integer arithmetic is does not throw exceptions on overflow and just returns the lower order 32 bits of the answer, hence you get 0 for If you want the Scheme numeric tower (which is an optional part of R4RS) you can import the SISC tower and use the siscnum.scm module described here: http://localhost:8080/jscheme/src/using/package.html However, if you use this you must explicity convert SISC numbers to Java numbers before using those numbers in javadot calls. ---Tim--- > > Geoffrey > -- > Geoffrey S. Knauth | http://knauth.org/gsk > > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source > Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Jscheme-devel mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-devel |
From: Geoffrey K. <ge...@kn...> - 2004-08-05 16:57:17
|
Maybe this is a FAQ. I guess I was surprised I got 0 instead of #f and/or an exception of some kind. $ java -cp lib/jscheme.jar jscheme.REPL JScheme 7.1 (8/5/04 3:06 AM) http://jscheme.sourceforge.net > (* 256 256 256 256) 0 > (* 256 256 256) 16777216 > (* 256 256 256 128) -2147483648 > Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Geoffrey K. <ge...@kn...> - 2004-06-24 20:26:54
|
I did that too, with (addClasspathUrl JAR). I was just looking for a way to start off with the right classpath. Thanks. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Jun 24, 2004, at 16:18, Ken Anderson wrote: > java -jar lib/jscheme.jar should be fine, just grow the class path at > runtime, see elf/infest.scm for an example. |
From: Ken A. <kan...@bb...> - 2004-06-24 20:18:41
|
java -jar lib/jscheme.jar should be fine, just grow the class path at runtime, see elf/infest.scm for an example. At 03:46 PM 6/24/2004 -0400, Geoffrey Knauth wrote: >OK, I see your logic. > >I wrote my note after I imported some classes from JAR files, and then to my surprise found, from (classpathURLs), that the classes were never actually loaded and various symbols remained undefined. It turned out that happened because I launched JScheme via "-jar jscheme.jar" instead of "jscheme.REPL". > >I guess I'd call the `import' facility that requires classes to exist `import-exist' or `import-now'. > >Geoffrey >-- >Geoffrey S. Knauth | http://knauth.org/gsk > >On Jun 24, 2004, at 15:35, Ken Anderson wrote: > >>I don't think it should check, though you can write a version that does. >>Since i use JScheme to build my applications its normal for classes not to exist until after i've compiled them. |
From: Geoffrey K. <ge...@kn...> - 2004-06-24 19:47:10
|
OK, I see your logic. I wrote my note after I imported some classes from JAR files, and then to my surprise found, from (classpathURLs), that the classes were never actually loaded and various symbols remained undefined. It turned out that happened because I launched JScheme via "-jar jscheme.jar" instead of "jscheme.REPL". I guess I'd call the `import' facility that requires classes to exist `import-exist' or `import-now'. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Jun 24, 2004, at 15:35, Ken Anderson wrote: > I don't think it should check, though you can write a version that > does. > Since i use JScheme to build my applications its normal for classes > not to exist until after i've compiled them. |
From: Ken A. <kan...@bb...> - 2004-06-24 19:35:18
|
I don't think it should check, though you can write a version that does. Since i use JScheme to build my applications its normal for classes not to exist until after i've compiled them. k At 10:24 PM 6/23/2004 -0400, Geoffrey Knauth wrote: >I think I should get an error when an import is invalid or fails: > >> (import "java.io.File") >#t ; OK >> (import "yada.yada.Yada") >#t ; Huh? > >Geoffrey >-- >Geoffrey S. Knauth | http://knauth.org/gsk > > > >------------------------------------------------------- >This SF.Net email sponsored by Black Hat Briefings & Training. >Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com >_______________________________________________ >Jscheme-devel mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-devel |
From: Ken A. <kan...@bb...> - 2004-06-24 13:28:12
|
Somehow, i convinced myself that i could build JScheme without the Version.java. I did not want it in CVS because it caused conflicts that caused the nightly build to fail. I'll fix src/build/bootstrap.bat and change things so the version string is read as a resource. k At 07:54 AM 6/24/2004 -0400, Timothy John Hickey wrote: >On Jun 24, 2004, at 4:08 AM, Geoffrey Knauth wrote: > >>On Jun 24, 2004, at 03:44, I wrote: >>>For now I'll just make my own Version.java using what I see in (make-version). >> >>I take that back. It seems Version.java was really supposed to go away, and (make-version) is out of date. >The problem was that the new version (represented as a final static field in Version.java) was >not making it into jsint/Evaluator.java > > >I've fixed the problem for non-Windows machines by adding Version.java back into the CVS >(so that the initial compilation of jscheme.REPL can generate an initial JScheme system), >But I've modified the bootstrap code so that it first removes all class files before compiling that >initial JScheme system. I think the problem was that the static final VERSION field was being >compiled "in place" into the jsint/Evaluator.class file and hence could only be changed by >removing the Evaluator.class file. This is a general problem that can arise so I think it is safer >to remove all class files before beginning a build. > >I also modified the (make-version) code in build/jscheme-bootstrapl.scm so that it include the >short version of the time as well as the date. This allows one to better distinguish between builds. >I guess our policy is to have the date/time represent the build counter for any given version. >Thus, rather than produce versions 7.1.1 7.1.2, 7.1.3, ... we produce versions 7.1 (date/time1) >7.1(date/time2),... > >I'll work on the windows version src/build/bootstrap.bat when I get access to a windows machine >so I can test it.... > > >> Instead, I commented out line 85 of src/jsint/Evaluator.java: >> >> //error.println("\n\n"+Version.VERSION+"\n\n"); >> >>Now, src/build/bootstrap works. >> >>Personally, I'm happy enough with just a "> " prompt when I start up JScheme. But maybe there should be a (help) or (jscheme-version) users could type if they're going through Emacs buffers and can't remember which ones are running JScheme / mzscheme / MIT/GNU Scheme / Kawa / Guile / SISC / ... > >You can always type jsint.Version.VERSION$ >but we probably do want a simpler way to access the version, e.g. (jscheme-version) >(or how about (JScheme.version) , i.e. a static method of jscheme.JScheme.java > >a (help) or (help x) might be nice too.... >(apropos x) goes a long way toward helping.... as does (describe x) > >---Tim--- >> >>Geoffrey >>-- >>Geoffrey S. Knauth | http://knauth.org/gsk >> >> >> >>------------------------------------------------------- >>This SF.Net email sponsored by Black Hat Briefings & Training. >>Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com >>_______________________________________________ >>Jscheme-devel mailing list >>Jsc...@li... >>https://lists.sourceforge.net/lists/listinfo/jscheme-devel > > > >------------------------------------------------------- >This SF.Net email sponsored by Black Hat Briefings & Training. >Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com >_______________________________________________ >Jscheme-devel mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-devel |
From: Timothy J. H. <tim...@ma...> - 2004-06-24 11:54:48
|
On Jun 24, 2004, at 4:08 AM, Geoffrey Knauth wrote: > On Jun 24, 2004, at 03:44, I wrote: >> For now I'll just make my own Version.java using what I see in >> (make-version). > > I take that back. It seems Version.java was really supposed to go > away, and (make-version) is out of date. The problem was that the new version (represented as a final static field in Version.java) was not making it into jsint/Evaluator.java I've fixed the problem for non-Windows machines by adding Version.java back into the CVS (so that the initial compilation of jscheme.REPL can generate an initial JScheme system), But I've modified the bootstrap code so that it first removes all class files before compiling that initial JScheme system. I think the problem was that the static final VERSION field was being compiled "in place" into the jsint/Evaluator.class file and hence could only be changed by removing the Evaluator.class file. This is a general problem that can arise so I think it is safer to remove all class files before beginning a build. I also modified the (make-version) code in build/jscheme-bootstrapl.scm so that it include the short version of the time as well as the date. This allows one to better distinguish between builds. I guess our policy is to have the date/time represent the build counter for any given version. Thus, rather than produce versions 7.1.1 7.1.2, 7.1.3, ... we produce versions 7.1 (date/time1) 7.1(date/time2),... I'll work on the windows version src/build/bootstrap.bat when I get access to a windows machine so I can test it.... > Instead, I commented out line 85 of src/jsint/Evaluator.java: > > //error.println("\n\n"+Version.VERSION+"\n\n"); > > Now, src/build/bootstrap works. > > Personally, I'm happy enough with just a "> " prompt when I start up > JScheme. But maybe there should be a (help) or (jscheme-version) > users could type if they're going through Emacs buffers and can't > remember which ones are running JScheme / mzscheme / MIT/GNU Scheme / > Kawa / Guile / SISC / ... You can always type jsint.Version.VERSION$ but we probably do want a simpler way to access the version, e.g. (jscheme-version) (or how about (JScheme.version) , i.e. a static method of jscheme.JScheme.java a (help) or (help x) might be nice too.... (apropos x) goes a long way toward helping.... as does (describe x) ---Tim--- > > Geoffrey > -- > Geoffrey S. Knauth | http://knauth.org/gsk > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital > self defense, top technical experts, no vendor pitches, unmatched > networking opportunities. Visit www.blackhat.com > _______________________________________________ > Jscheme-devel mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-devel |
From: Geoffrey K. <ge...@kn...> - 2004-06-24 08:08:29
|
On Jun 24, 2004, at 03:44, I wrote: > For now I'll just make my own Version.java using what I see in > (make-version). I take that back. It seems Version.java was really supposed to go away, and (make-version) is out of date. Instead, I commented out line 85 of src/jsint/Evaluator.java: //error.println("\n\n"+Version.VERSION+"\n\n"); Now, src/build/bootstrap works. Personally, I'm happy enough with just a "> " prompt when I start up JScheme. But maybe there should be a (help) or (jscheme-version) users could type if they're going through Emacs buffers and can't remember which ones are running JScheme / mzscheme / MIT/GNU Scheme / Kawa / Guile / SISC / ... Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Geoffrey K. <ge...@kn...> - 2004-06-24 07:45:08
|
[ following CVS checkout ] -------------------------------- $ cd jscheme $ src/build/bootstrap src/jsint/Evaluator.java:85: cannot resolve symbol symbol : variable Version location: class jsint.Evaluator error.println("\n\n"+Version.VERSION+"\n\n"); ^ 1 error Exception in thread "main" java.lang.NoClassDefFoundError: jscheme/SchemeEvaluator at jscheme.REPL.main(REPL.java:138) -------------------------------- I see (make-version) in jscheme-bootstrap.scm, but it looks as though it hasn't been called before Evaluator.java needs it. For now I'll just make my own Version.java using what I see in (make-version). Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Timothy J. H. <tim...@ma...> - 2004-06-24 04:06:25
|
On Jun 23, 2004, at 6:35 PM, Ken Anderson wrote: > I think the idea that JScheme is an alternative "skin" for java > programs is an important one, and your idea of allowing alternative > languages to provide java behavior by using JScheme as a back end is a > good one. > > We could support multiple syntax by allowing a customizable #macro, or > as Common Lisp did, allow a customizable (read) so you could change > its read-table. One way to allowing multiple syntaxes is just provide a reader (stream->s-expressions+errors) and then to provide a way of setting the reader for a JScheme instance. For example, one might say > (define js (jscheme.JScheme.)) ;; create a JScheme instance > (.setReader js infix-reader) ;; set its reader to infix > (.eval js #{ square(x) := x*x }#) ;; define the square function > (let ((z (.eval js 'square))) ;; grab that function and apply it to 35 (z 35)) > (.setReader js norvig-reader) ;; now set the reader to norvig-reader > (.eval js #{ define(sq(x),*(x,x)) }# ) ;; define square with this syntax ;; note that define is a macro which operates after reading... > ((.eval js 'sq) 35) ;; apply it, > (.REPL js) ;; now start a norvig-reader REPL ... > define(fib(n),if(<(n,3),1,+(fib(-(n,1)),fib(-(n,2))))) > fib(10) > exit() > > > After TCL/TK came out Stallman i believe criticized it for being a bad > scripting language, because string hacking was everywhere, especially > in the inner loop. > He said something like "translate TCL into Scheme and win big". I > believe the outcome was that the people who tried to translate TCL > into Scheme had to make semantic changes to TCL for things to work > out, much as PLT Scheme needs changes to Python for their analysis to > be userful. This might not be a bad thing if one is thinking of creating a new language that combines Python syntax and Scheme semantics.... > I'm sure that the amount of effort provided from the Scheme side to > the other language was substantial. > > Eventually, someone wrote a TCL "compiler" that ran at about as well > as the Scheme implementation. Which just proves that bad ideas will > continue to win as long as someone is willing to put more effort into > them. > > While you can translate the code into Scheme, its harder to translate > the error messages. True... > Why am i getting a JScheme and Java backtracke when i'm talking to > prolog? I was actually thinking about defining new readers for Scheme so the syntax would be infix (or operator/precedence/associativity) but the semantics would be Scheme. The idea about compiling language L into Scheme is interesting too but much more complex, I was thinking more about low hanging fruit. I think Peter Norvig once said that he provided a LISP reader that converted F(A,B,...,Z) to (F A B ... Z) and won some converts to Scheme on that simple change alone, e.g. define( fib(n), if( <(n,3), 1, +( fib(-(n,1)), fib(-(n,2))))) This makes it look like a non-LISP syntax, but its really just a slight twist on s-expressions. > We can hide this to some extent, but to provide "good" language > specific runtime error message may be hard. Of course, the JScheme > attitude should be, that that doesn't make it worth trying! JScheme - > you can get a lot more than you might expect from a little language. Moreover, it may be worthwhile creating a Python-like language which looks like Python but compiles to Scheme, or a Java-like language that compiles to Scheme... Another alternative is just to explore clean interfaces between Java versions of Python, Ruby, Prolog, etc. and use JScheme to be the glue that holds them all together. (When I get some time I want to create a SISC procedure for invoking JScheme eval, this would allow users of SISC to have full access to JScheme and the javadot notation. Likewise, providing links from Jython, JRuby, and Java versions of Prolog would be interesting too.....) ---Tim--- > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Geoffrey K. <ge...@kn...> - 2004-06-24 02:24:15
|
I think I should get an error when an import is invalid or fails: > (import "java.io.File") #t ; OK > (import "yada.yada.Yada") #t ; Huh? Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Ken A. <kan...@bb...> - 2004-06-18 14:31:16
|
object equality is one of those things that seem like it should be simple, but it gets pretty complicated after you think about it, especially if you thinking about it in terms of parallel or distributed computation. Here's a nice paper by Henry Baker about equality: http://home.pipeline.com/~hbaker1/ObjectIdentity.html What it means to copy an object is another example. Scheme has 4 equality procedures eq? eqv? = and equal? while Java has only = and .equals. If you only want to use only 2 procedures, use eqv? and equal?. Here's what http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_idx_216 says about eqv?: Briefly, it returns #t if obj1 and obj2 should normally be regarded as the same object. This relation is left slightly open to interpretation, but the following partial specification of eqv? holds for all implementations of Scheme. There's a lot of wiggle room to allow different Schemes to have different implementation choices. For example, in a C based implementation of Scheme low order bits (typically) are used for type information so objects like small integers, small floats, characters ... can be implemented as one word "objects", rather than a pointer to memory. In JScheme, every object is a Java object, but some objects like ascii characters and small integers are cached so eq? may seem to work when you really should be using eqv?. One difference between JScheme and other Schemes is that literal strings are eq? following Java semantics. Also, simple tests can full you, so for example (eq? 3 3) may return #t but (eq? 123456789 123456789) may return #f. One nice thing you can do in Common Lisp is create a hashtable and give it the equality operator to use. Java only provides .equals HashTables and HashSets. k At 11:02 AM 6/17/2004 -0400, Geoffrey Knauth wrote: >Never mind. I should have tried eqv? too. For the record: > >JScheme: >(eq? 128 128) => #f ;; 2^8 >(eq? 127 127) => #t >(eqv? 128 128) => #t > >PLT Scheme v207: >(eq? 1073741824 1073741824) => #f ;; 2^30 >(eq? 1073741823 1073741823) => #t >(eqv? 1073741824 1073741824) => #t > >Geoffrey >-- >Geoffrey S. Knauth | http://knauth.org/gsk > >On Jun 17, 2004, at 06:50, Geoffrey Knauth wrote: > >>I ran into this while calculating azimuths. >> >>> (eq? 180 180) >>#f >>> (= 180 180) >>#t >>> (eq? 0 0) >>#t >>> (eq? 1 1) >>#t >>> (eq? 2 2) >>#t >>> (eq? 3 3) >>#t >>> (eq? 180 180) >>#f >> >>After poking around, I found this: >> >>> (eq? 127 127) >>#t >>> (eq? 128 128) >>#f >>> (eq? -127 -127) >>#t >>> (eq? -128 -128) >>#f >> >>For now I'll use = instead of eq?. I was just wondering if this was documented. >> >>Geoffrey >>-- >>Geoffrey S. Knauth | http://knauth.org/gsk >> >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference >>Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer >>Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA >>REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND >>_______________________________________________ >>Jscheme-devel mailing list >>Jsc...@li... >>https://lists.sourceforge.net/lists/listinfo/jscheme-devel > > > >------------------------------------------------------- >This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference >Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer >Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA >REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND >_______________________________________________ >Jscheme-devel mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-devel |
From: Timothy J. H. <ti...@cs...> - 2004-06-17 22:00:06
|
I ran into a little problem using the new jscheme.jar for servlets. It seems that Jetty creates several threads for handling the servlets and each thread now creates its own interpreter which has its own environment! Before, I could just do a define in one servlet and all later servlets would have access to the definition. I may be able to switch back to that model (by using the jscheme.JS class instead of jscheme.JScheme), but its an interesting example of the kind of bugs that can arise when adding new features.... Another fix is to explicitly import any modules that you need when you generate a webpage. Since modules are cached, this won't slow down the servlet engine much and it is cleaner than my old adhoc approach... From a development point of view though, this will require the addition of a "reload-module" procedure that disregards the caching when a module is changed..... ---Tim--- |
From: Timothy J. H. <ti...@cs...> - 2004-06-17 20:48:16
|
On Jun 17, 2004, at 1:07 PM, Ken Anderson wrote: > Just to be clear my proposal was to use #{ ... }# and #[ ...]#. (ie # > is outside). > > Well, there's a tradition in common lisp, at least that we'd be > against if we use > #{ ... #} and #[ ... #]. > > In CL you have: > #<... ># to indicate the print representation of a thing that can be > read by (read). > #| ... |# for an extended comment. I think PLT Scheme has this too. I see. The ide is that the initial token is HASH-SYMBOL and the close token is just the reverse..... Since there are precedences in Common Lisp and PLT scheme, not to mention the /* ... */ for Java or the case ... esac of Ada, I think it makes sense. I'll work on changing the syntax, before anyone has become too heavily invested in it.... I've already used this syntax in my class (but I noticed that I frequently wrote ]# instead of #] ... maybe its a sign....). ---Tim--- > > Though vectors are #(1 2 3) not #(1 2 3)#. > > While #{ is a macro character, #} really isn't, and i don't think its > right think of it as one. > > Johnathan, or Rusty do you have an opinion on this? > > At 06:29 PM 6/16/2004 -0400, Timothy John Hickey wrote: >> I guess my feeling was that it might get confusing for people to >> remember >> whether we were using #{... }# or {#....#} >> and if we escaped with #[...]# or [#...#] >> So having a simple HASH-SYMBOL syntax for each delimiter makes it >> somewhat easier >> to remember... > |
From: Ken A. <kan...@bb...> - 2004-06-17 17:07:55
|
Just to be clear my proposal was to use #{ ... }# and #[ ...]#. (ie # is outside). Well, there's a tradition in common lisp, at least that we'd be against if we use #{ ... #} and #[ ... #]. In CL you have: #<... ># to indicate the print representation of a thing that can be read by (read). #| ... |# for an extended comment. I think PLT Scheme has this too. Though vectors are #(1 2 3) not #(1 2 3)#. While #{ is a macro character, #} really isn't, and i don't think its right think of it as one. Johnathan, or Rusty do you have an opinion on this? At 06:29 PM 6/16/2004 -0400, Timothy John Hickey wrote: >I guess my feeling was that it might get confusing for people to remember >whether we were using #{... }# or {#....#} >and if we escaped with #[...]# or [#...#] >So having a simple HASH-SYMBOL syntax for each delimiter makes it somewhat easier >to remember... |
From: Geoffrey K. <ge...@kn...> - 2004-06-17 15:04:36
|
Never mind. I should have tried eqv? too. For the record: JScheme: (eq? 128 128) => #f ;; 2^8 (eq? 127 127) => #t (eqv? 128 128) => #t PLT Scheme v207: (eq? 1073741824 1073741824) => #f ;; 2^30 (eq? 1073741823 1073741823) => #t (eqv? 1073741824 1073741824) => #t Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Jun 17, 2004, at 06:50, Geoffrey Knauth wrote: > I ran into this while calculating azimuths. > > > (eq? 180 180) > #f > > (= 180 180) > #t > > (eq? 0 0) > #t > > (eq? 1 1) > #t > > (eq? 2 2) > #t > > (eq? 3 3) > #t > > (eq? 180 180) > #f > > After poking around, I found this: > > > (eq? 127 127) > #t > > (eq? 128 128) > #f > > (eq? -127 -127) > #t > > (eq? -128 -128) > #f > > For now I'll use = instead of eq?. I was just wondering if this was > documented. > > Geoffrey > -- > Geoffrey S. Knauth | http://knauth.org/gsk > > > > ------------------------------------------------------- > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer > Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code > NWMGYKND > _______________________________________________ > Jscheme-devel mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-devel > |