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: Michael T. <mt...@bb...> - 2004-11-04 19:53:42
|
I'm not sure I agree: what is wrong with defining #f and #null as
semantically equivalent? Even if #null printed as #f, it might be
better than the current situation. Bottom line is that #null is a
projection of a non-scheme thing into scheme space - it is up to jscheme
to manage that projection in whatever way makes the most sense. What if
we got rid of #null altogether?... or make #null a variable bound to #f.
cheers,
-mik
P.S. what bugs me is having to do (equal? foo #null):
> (or (null? #null) (not #null))
#f
Geoffrey Knauth wrote:
> As a practical matter, it certainly seems convenient to be able to
> treat #null the same as #f in conditionals--I agree it is
> counterintuitive to have #null be not-false.
>
> But I'm concerned about breaking R5RS 6.3.1., "only #f counts as false
> in conditional expressions,"
>
> http://www.swiss.ai.mit.edu/~jaffer/r5rs_8.html#SEC58
>
> note: (not '()) ==> #f
>
> and 3.2, "no object satisfies more than one of the following
> predicates: boolean? pair? symbol? number? char? string? vector? port?
> procedure?"
>
> http://www.swiss.ai.mit.edu/~jaffer/r5rs_5.html#SEC20
>
> So we'd have to caveat the language standard, and surprise newcomers
> to JScheme from other Schemes. On the principle of least surprise,
> we'd probably be 50-50 between surprising newcomes to JScheme from
> other languages vs. other Schemes.
>
> In Java you can't do: Object o = NULL; if (o) { true-stuff} else {
> false-stuff }
> you have to do: if (o == NULL) ...
> It's a pain in the butt, but it's been drilled into us.
>
> Reluctantly, I suggest leaving #null and the semantics of `if' alone,
> and offering a "new" `if', e.g., `jif', that would treat #null as #f.
>
> By the way, I tried to figure out what #null is in JScheme, and it
> isn't anything:
>
> > (symbol? #null)
> #f
> > (boolean? #null)
> #f
> > (pair? #null)
> #f
> > (vector? #null)
> #f
> > (procedure? #null)
> #f
> > (string? #null)
> #f
> > (port? #null)
> (port? '#null)
> ====================================
> SchemeException: ERROR: undefined variable "port?"
> > (number? #null)
> #f
> > (char? #null)
> #f
>
> Then I remembered that the empty list '() isn't anything either, but
> it also isn't #null:
>
> > (eq? '() #null)
> #f
> > (eqv? '() #null)
> #f
> > (equal? '() #null)
> #f
and, of course,
> (null? #null)
#f
As an alternative, what about defining #f and #null as the same object?
|
|
From: Ken A. <kan...@bb...> - 2004-11-04 18:32:48
|
Thanks for the nice description. I guess i never thought of using Tiny CLOS, that's a clever idea! You get most applicable method lookup for free, and objects on the Scheme side. We would have had to move Tiny into Java for speed though anyway. Developing some benchmarks would be good eventually. At 12:03 PM 11/4/2004 -0500, Joe Marshall wrote: >It'd be >interesting to compare the utility, performance and the edge cases. |
|
From: Joe M. <jr...@cc...> - 2004-11-04 17:03:34
|
Ken Anderson <kan...@bb...> writes:
> Joe,
> Your talk made me want to look at code i haven't looked at for
> a long while - how Java methods are invoked. They are like Common
> Lisp generic functions, the right method is looked up at runtime
> based on the types of all aguments. There is not "type widening".
> There is no MOP, like you may have.
>
> For a Java class i was teaching i put all constructor/method/field
> invocation into a class Invoke, which was easily separated from
> JScheme, though we didn't advertise that.
>
> Basically an application of an instance method does a cache lookup
> on (list isStatic methodName ClassName canAccessPrivateData) The
> comments below shows the calling sequence for a JavaMethod. We do
> nothing fancy for method lookup except if there is only one, a
> common case, we invoke it and hope for the best.
>
> Instance methods do a lookup on isStatic, and methodName which we
> should memoize in the JavaMethod. It looks like we should
> specialize JavaMethod into JavaStaticMethod JavaInstanceMethod and
> JavaSpecifiedMethod (where both the class and name are specified) .
Wow. It looks as if our approaches are very different.
Larceny (the Scheme runtime) provides a `syscall' primitive that
simply transfers control to a known C# method. The Larceny runtime
leaves the arguments to syscall in known `registers' and expects the
Result register to be updated before control is returned.
Larceny also provides a primitive type called a ForeignBox. It has no
functionality whatsoever beyond being a first-class Scheme object, but
it is a useful wrapper for holding reflection objects.
So there is no attempt at all to integrate the .NET system with the
Scheme system at the primitive implementation level. Everything is
done at arms length and mediated via wrappers and `syscalls'.
The syscall for method invocation expects to find three Scheme objects
in the `registers': a foreign box holding the reflected method, a
foreign box holding the instance, and an array of foreign boxes
holding the arguments. It simply unboxes everything and attempts to
invoke the contents of the first box on the contents of the remainging
boxes:
// Get the arguments
SObject arg1 = Reg.register3;
SObject arg2 = Reg.register4;
SObject arg3 = Reg.register5;
// Unbox the method
MethodInfo mi = (MethodInfo) ((ForeignBox)arg1).value;
// Unbox the arguments
SObject[] sargv = ((SVL)arg3).elements;
object[] args = new object[sargv.Length];
for (int i = 0; i < args.Length; i++)
args [i] = ((ForeignBox)(sargv[i])).value;
// Call the method
object result = mi.Invoke (mi.IsStatic ? null : ((ForeignBox)arg2).value, args);
// Box up the result
Reg.Result = Factory.makeForeignBox (result);
return;
There are two ways to get a handle to a reflected method. There is a
syscall that can return a reflected method given a reflected type and
the types of the arguments, or one could invoke the GetMembers method
on the type and get an array of all the methods, fields, properties,
and constructors associated with the type. I use the former mechanism
only for bootstrapping (maybe a dozen or so methods).
It is in Scheme that everything interesting happens. I adapted an
object system based on Tiny-CLOS to Larceny (it started as Tiny-CLOS,
Eli Barzilay adapted it to PLT Scheme and enhanced it to make
`Swindle'. I adapted it and tailored it for Larceny and .NET) .NET
methods get wrapped within CLOS methods which are installed in the
appropriate CLOS generic functions. .NET type descriptors are wrapped
in CLOS class objects, and .NET objects are wrapped in CLOS
instances (hence the need for a MOP: a .NET type must be both an
instance and a class).
Suppose that we had invoked a .NET method (through my code) and it
returned a .NET object (in a ForeignBox). My code determines the
runtime type of the object in the box (via another syscall) and finds
the CLOS class object that represents that type. It instantiates an
instance of the class with a slot holding the ForeignBox. The
instance is what the user sees.
All .NET methods are instances of classes that inherit from the .NET
type `System.MethodBase'. My code knows about this and has
special-cased this particular class to inherit from both its reflected
meta-type *and* the Tiny-CLOS method class. Thus wrappers for
reflected methods are themselves CLOS methods.
When instantiating a wrapper for a reflected method, we need to
compute the specializers (to determine under what conditions it is
called) and a procedure (to determine what happens when it is called).
The specializers are determined by taking the declared types of the
method arguments and finding an appropriate reflected class object.
For the most part, this is simply the class object that represents the
reflected type, but some classes need special treatment. Therefore,
the generic function `argument-specializer' (which is the identity
function by default) is overridden in some particular cases. For
example, the specializer for the .NET string class is the Scheme
string class and the specializer for the .NET System.Object (the root
class) is instead the class of all Scheme objects. Arrays and enums
are handled specially here, too.
The procedure that gets invoked has to package things up for the
invoke syscall. .NET objects will already be in their foreign boxes,
but the boxes themselves need to be unwrapped from the CLOS
instances. Boxes holding integers and strings will need to be
constructed. So there is a generic function `argument-marshaler' that
given a reflected .NET type, returns a function that can correctly
convert a scheme object to a foreign box.
In addition, if the .NET method has optional arguments, the CLOS
method must supply the defaults which are specified in the reflected
method parameter list. The end result, in all its gory detail, is
this:
(define (clr-method-info->method class info)
(call-with-values
(lambda () (clr-methodbase/get-parameters info))
(lambda (required-parameter-count
optional-parameter-count
default-values
specializers
out-marshalers)
(let* ((declaring-type (clr-memberinfo/declaring-type info))
(name (clr-memberinfo/name info))
(instance-marshaler (argument-marshaler declaring-type))
(arity (if (= optional-parameter-count 0)
(+ required-parameter-count 1)
(make-arity-at-least (+ required-parameter-count 1))))
(max-arity (+ optional-parameter-count required-parameter-count 2))
(in-marshaler (return-marshaler (clr-methodinfo/return-type info))))
(make class
:arity arity
:max-arity max-arity
:clr-handle info
:name name
:specializers (cons (argument-specializer declaring-type) specializers)
:procedure (nary->fixed-arity
(lambda (call-next-method instance . args)
(dotnet-message 4 "Invoking method" name)
(in-marshaler
(clr/%invoke info
(instance-marshaler instance)
(marshal-out (+ optional-parameter-count required-parameter-count)
out-marshalers args default-values))))
(arity-plus arity 1)))))))
So if a method object is somehow returned from the .NET code to
Scheme, a CLOS instance that multiply inherits from both its
appropriate .NET class and the CLOS method class is constructed with
the appropriate specializers, marshalers, and defaults.
There is one more thing to do. When this method object is
instantiated, it should be registered with the appropriate generic
function to invoke it. There is a post-initialization method that is
added to subclasses of the System.MethodBase reflected class. This
registers the method:
(add-method initialize-instance
(make (*default-method-class*)
:arity 2
:specializers (list methodbase-class)
:procedure (lambda (call-next-method instance initargs)
(call-next-method)
(process-method
instance
(clr-methodbase/is-public?
(clr-object/clr-handle instance))))))
(define (process-method clr-info public?)
(let ((handle (clr-object/clr-handle clr-info)))
(if (clr-methodbase/is-static? handle)
(install-static-method (make-static-name handle) clr-info public?)
(install-instance-method (clr-memberinfo/name handle) clr-info public?))))
Since all this is part of the instance creation protocol, the only
thing that needs to be done at this point is to get the syscall layer
to return method objects. To bootstrap the system, I just walk the
type tree and ask it to list the methods.
Here's an example of method invocation. Suppose I call the .ToString
method on an object.
(.ToString foo)
The javadot syntax is handled by the macro expander, so this becomes
((clr/find-generic #f 'tostring) foo)
The #f indicates public method rather than private. The
*clr-public-generics* hash table will be searched to find the CLOS
generic function named 'tostring.
The CLOS generic function does the usual multimethod dispatch on the
types of its arguments (using the standard CLOS cacheing tricks to
make it fast). Supposing that foo were an instance of a CLOS wrapper
to a .NET object, the generic function would find that method
specialized to the class of (the wrapper to) foo. That method would
now be invoked. Recall that it will be something like this:
(lambda (instance . args)
(in-marshaler
(clr/%invoke info
(instance-marshaler instance)
(marshal-out (+ optional-parameter-count required-parameter-count)
out-marshalers args
default-values))))
But since there are no arguments beyond the instance, we can ignore
them and the effect is more like this:
(lambda (instance)
(in-marshaler
(clr/%invoke info
(instance-marshaler instance)
))
Info is the ForeignBox containing the reflected method and
instance-marshaler will simply be a function that unwraps the CLOS
wrapper. clr/%invoke is the syscall, so we end up passing the
appropriate ForeignBoxes to the C# code above.
The in-marshaler is a function that performs an appropriate action on
the return value. In this case, the return type of the .NET method is
System.String, so the return value of .ToString will be a ForeignBox
containing a .NET string object. The in-marshaler for most .NET
objects is to simply wrap them with the appropriate CLOS wrapper, but
we special case the in-marshaler for .NET strings to convert the
ForeignBoxed .NET string into a Scheme string.
--------------------
I'm sure your eyes have glazed over by now, so I'll finish here. It
looks as if we are both taking the same information into account when
trying to go from a Scheme generic to a Java or .NET method. It'd be
interesting to compare the utility, performance and the edge cases.
At this point, I'm the sole user of my code, so I really don't know
what end users will perceive as advantages or disadvantages to my
approach. From what I can tell, the overhead of tiny-CLOS is minimal
compared to the other overheads of going across the syscall boundary
and the interpreter overhead. In the simple, usual case, where there
is one method to invoke, we'll get the same results, but I wonder if
there are more complex cases where your method and mine diverge.
~jrm
|
|
From: Robert J. B. <ru...@bb...> - 2004-11-03 23:49:27
|
Ken, While you reference my preferences in your initial note, I think that Geoffrey has a good point. I guess most of my (and your) use cases would be easily satisfied with a macro that was a short-circuit operation like or (didn't evaluate the second or later arguments if it didn't need to) and treated #null as or treats #f. Thus (orJ x y) would return x if x != #null, and y otherwise. This doesn't simplify (if x y z), but Geoffrey's jif would work there... --Rusty Ken Anderson wrote: >This is a good point. This is why i wanted language lawyers/developers to weigh in. > >JScheme has taken the policy of "bending the rules toward Java". My question is, really, is this change worth it from the Java/Scheme perspective and our current code base. > >k > >At 05:59 PM 11/3/2004 -0500, Geoffrey Knauth wrote: > > >>As a practical matter, it certainly seems convenient to be able to treat #null the same as #f in conditionals--I agree it is counterintuitive to have #null be not-false. >> >>But I'm concerned about breaking R5RS 6.3.1., "only #f counts as false in conditional expressions," >> >>http://www.swiss.ai.mit.edu/~jaffer/r5rs_8.html#SEC58 >> >>note: (not '()) ==> #f >> >>and 3.2, "no object satisfies more than one of the following predicates: boolean? pair? symbol? number? char? string? vector? port? procedure?" >> >>http://www.swiss.ai.mit.edu/~jaffer/r5rs_5.html#SEC20 >> >>So we'd have to caveat the language standard, and surprise newcomers to JScheme from other Schemes. On the principle of least surprise, we'd probably be 50-50 between surprising newcomes to JScheme from other languages vs. other Schemes. >> >>In Java you can't do: Object o = NULL; if (o) { true-stuff} else { false-stuff } >>you have to do: if (o == NULL) ... >>It's a pain in the butt, but it's been drilled into us. >> >>Reluctantly, I suggest leaving #null and the semantics of `if' alone, and offering a "new" `if', e.g., `jif', that would treat #null as #f. >> >>By the way, I tried to figure out what #null is in JScheme, and it isn't anything: >> >> >> >>>(symbol? #null) >>> >>> >>#f >> >> >>>(boolean? #null) >>> >>> >>#f >> >> >>>(pair? #null) >>> >>> >>#f >> >> >>>(vector? #null) >>> >>> >>#f >> >> >>>(procedure? #null) >>> >>> >>#f >> >> >>>(string? #null) >>> >>> >>#f >> >> >>>(port? #null) >>> >>> >>(port? '#null) >> ==================================== >>SchemeException: ERROR: undefined variable "port?" >> >> >>>(number? #null) >>> >>> >>#f >> >> >>>(char? #null) >>> >>> >>#f >> >>Then I remembered that the empty list '() isn't anything either, but it also isn't #null: >> >> >> >>>(eq? '() #null) >>> >>> >>#f >> >> >>>(eqv? '() #null) >>> >>> >>#f >> >> >>>(equal? '() #null) >>> >>> >>#f >> >>Geoffrey >>-- >>Geoffrey S. Knauth | http://knauth.org/gsk >> >>On Nov 3, 2004, at 16:32, Ken Anderson wrote: >> >> >> >>>Here's a proposal. >>> >>>I think (and i know Rusty really does) think JScheme handling of #null is awk weird. What if in conditionals we treated #null as #f. This would make code more scheme like, here are 2 examples. >>> >>>#null is currently treated at #t in conditionals but this change may not break much code. >>> >>> >>>(define (default value default) >>> ;; Before >>> (if (isNull value) default >>> value)) >>> >>>(define (default value default) >>> ;; After. >>> (or value default)) >>> >>>(define (memoize key table computation) >>> ;; Before. >>> (let ((it (.get key table))) >>> (if (not (isNull it)) it >>> (let ((it (computation key))) >>> (.put table key it) >>> it)))) >>> >>>(define (memoize key table computation) >>> ;; After. >>> (or (.get key table) >>> (let ((it (computation key))) >>> (.put table key it) >>> it))) >>> >>> > > > >------------------------------------------------------- >This SF.Net email is sponsored by: >Sybase ASE Linux Express Edition - download now for FREE >LinuxWorld Reader's Choice Award Winner for best database on Linux. >http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user > > > > |
|
From: Ken A. <kan...@bb...> - 2004-11-03 23:20:07
|
This is a good point. This is why i wanted language lawyers/developers to weigh in. JScheme has taken the policy of "bending the rules toward Java". My question is, really, is this change worth it from the Java/Scheme perspective and our current code base. k At 05:59 PM 11/3/2004 -0500, Geoffrey Knauth wrote: >As a practical matter, it certainly seems convenient to be able to treat #null the same as #f in conditionals--I agree it is counterintuitive to have #null be not-false. > >But I'm concerned about breaking R5RS 6.3.1., "only #f counts as false in conditional expressions," > >http://www.swiss.ai.mit.edu/~jaffer/r5rs_8.html#SEC58 > >note: (not '()) ==> #f > >and 3.2, "no object satisfies more than one of the following predicates: boolean? pair? symbol? number? char? string? vector? port? procedure?" > >http://www.swiss.ai.mit.edu/~jaffer/r5rs_5.html#SEC20 > >So we'd have to caveat the language standard, and surprise newcomers to JScheme from other Schemes. On the principle of least surprise, we'd probably be 50-50 between surprising newcomes to JScheme from other languages vs. other Schemes. > >In Java you can't do: Object o = NULL; if (o) { true-stuff} else { false-stuff } >you have to do: if (o == NULL) ... >It's a pain in the butt, but it's been drilled into us. > >Reluctantly, I suggest leaving #null and the semantics of `if' alone, and offering a "new" `if', e.g., `jif', that would treat #null as #f. > >By the way, I tried to figure out what #null is in JScheme, and it isn't anything: > >> (symbol? #null) >#f >> (boolean? #null) >#f >> (pair? #null) >#f >> (vector? #null) >#f >> (procedure? #null) >#f >> (string? #null) >#f >> (port? #null) >(port? '#null) > ==================================== >SchemeException: ERROR: undefined variable "port?" >> (number? #null) >#f >> (char? #null) >#f > >Then I remembered that the empty list '() isn't anything either, but it also isn't #null: > >> (eq? '() #null) >#f >> (eqv? '() #null) >#f >> (equal? '() #null) >#f > >Geoffrey >-- >Geoffrey S. Knauth | http://knauth.org/gsk > >On Nov 3, 2004, at 16:32, Ken Anderson wrote: > >>Here's a proposal. >> >>I think (and i know Rusty really does) think JScheme handling of #null is awk weird. What if in conditionals we treated #null as #f. This would make code more scheme like, here are 2 examples. >> >>#null is currently treated at #t in conditionals but this change may not break much code. >> >> >>(define (default value default) >> ;; Before >> (if (isNull value) default >> value)) >> >>(define (default value default) >> ;; After. >> (or value default)) >> >>(define (memoize key table computation) >> ;; Before. >> (let ((it (.get key table))) >> (if (not (isNull it)) it >> (let ((it (computation key))) >> (.put table key it) >> it)))) >> >>(define (memoize key table computation) >> ;; After. >> (or (.get key table) >> (let ((it (computation key))) >> (.put table key it) >> it))) |
|
From: Ken A. <kan...@bb...> - 2004-11-03 23:16:40
|
Joe,
Your talk made me want to look at code i haven't looked at for a long while - how Java methods are invoked. They are like Common Lisp generic functions, the right method is looked up at runtime based on the types of all aguments. There is not "type widening". There is no MOP, like you may have.
For a Java class i was teaching i put all constructor/method/field invocation into a class Invoke, which was easily separated from JScheme, though we didn't advertise that.
Basically an application of an instance method does a cache lookup on
(list isStatic methodName ClassName canAccessPrivateData)
The comments below shows the calling sequence for a JavaMethod.
We do nothing fancy for method lookup except if there is only one, a common case, we invoke it and hope for the best.
Instance methods do a lookup on isStatic, and methodName which we should memoize in the JavaMethod. It looks like we should specialize JavaMethod into JavaStaticMethod JavaInstanceMethod and JavaSpecifiedMethod (where both the class and name are specified) .
It may be that HotSpot does some or most of that for us.
public Object apply(Object[] args) {
if (!(isSpecific))
return Invoke.invokeInstance
(args[0], this.name, (Object[]) args[1], canAccessPrivateData);
/** What goes on from here?
invokeMethod(target.getClass(), target, name, args, false, canAccessPrivateData);
methodTable(c, name, isStatic,canAccessPrivateData);
! methodTable0(c, name, isStatic,canAccessPrivateData);
! string cons if #
! getCachedMethodTable(c, internalName, isStatic);
! getMethodCache(isStatic)
! getNameTable(getMethodCache(isStatic), name) .get(c));
! table.get(name));
.get(c)
findMethod(ms, args)
findMethodNoOpt(methods,args);
loop over methods
isApplicable
loop over parameter types
isArgApplicable
isAssignableFrom
moreApplicable
isAssignableFrom
invokeRawMethod((Method) findMethod(ms, args), target, args);
invoke(target, args);
**/
|
|
From: Geoffrey K. <ge...@kn...> - 2004-11-03 23:00:06
|
As a practical matter, it certainly seems convenient to be able to treat #null the same as #f in conditionals--I agree it is counterintuitive to have #null be not-false. But I'm concerned about breaking R5RS 6.3.1., "only #f counts as false in conditional expressions," http://www.swiss.ai.mit.edu/~jaffer/r5rs_8.html#SEC58 note: (not '()) ==> #f and 3.2, "no object satisfies more than one of the following predicates: boolean? pair? symbol? number? char? string? vector? port? procedure?" http://www.swiss.ai.mit.edu/~jaffer/r5rs_5.html#SEC20 So we'd have to caveat the language standard, and surprise newcomers to JScheme from other Schemes. On the principle of least surprise, we'd probably be 50-50 between surprising newcomes to JScheme from other languages vs. other Schemes. In Java you can't do: Object o = NULL; if (o) { true-stuff} else { false-stuff } you have to do: if (o == NULL) ... It's a pain in the butt, but it's been drilled into us. Reluctantly, I suggest leaving #null and the semantics of `if' alone, and offering a "new" `if', e.g., `jif', that would treat #null as #f. By the way, I tried to figure out what #null is in JScheme, and it isn't anything: > (symbol? #null) #f > (boolean? #null) #f > (pair? #null) #f > (vector? #null) #f > (procedure? #null) #f > (string? #null) #f > (port? #null) (port? '#null) ==================================== SchemeException: ERROR: undefined variable "port?" > (number? #null) #f > (char? #null) #f Then I remembered that the empty list '() isn't anything either, but it also isn't #null: > (eq? '() #null) #f > (eqv? '() #null) #f > (equal? '() #null) #f Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Nov 3, 2004, at 16:32, Ken Anderson wrote: > Here's a proposal. > > I think (and i know Rusty really does) think JScheme handling of #null > is awk weird. What if in conditionals we treated #null as #f. This > would make code more scheme like, here are 2 examples. > > #null is currently treated at #t in conditionals but this change may > not break much code. > > > (define (default value default) > ;; Before > (if (isNull value) default > value)) > > (define (default value default) > ;; After. > (or value default)) > > (define (memoize key table computation) > ;; Before. > (let ((it (.get key table))) > (if (not (isNull it)) it > (let ((it (computation key))) > (.put table key it) > it)))) > > (define (memoize key table computation) > ;; After. > (or (.get key table) > (let ((it (computation key))) > (.put table key it) > it))) |
|
From: Ken A. <kan...@bb...> - 2004-11-03 21:32:41
|
Here's a proposal.
I think (and i know Rusty really does) think JScheme handling of #null is awk weird. What if in conditionals we treated #null as #f. This would make code more scheme like, here are 2 examples.
#null is currently treated at #t in conditionals but this change may not break much code.
(define (default value default)
;; Before
(if (isNull value) default
value))
(define (default value default)
;; After.
(or value default))
(define (memoize key table computation)
;; Before.
(let ((it (.get key table)))
(if (not (isNull it)) it
(let ((it (computation key)))
(.put table key it)
it))))
(define (memoize key table computation)
;; After.
(or (.get key table)
(let ((it (computation key)))
(.put table key it)
it)))
|
|
From: Ken A. <kan...@bb...> - 2004-11-02 19:28:37
|
Dispite what SISC says about JScheme. JScheme is currently faster than SISC. You can also write servlets in scheme. Here's an introduction to computers course http://popper.cs-i.brandeis.edu:8080/cs2a04/index.html using JScheme servlets. At 02:00 PM 11/2/2004 -0500, Dominique Boucher wrote: > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > >Hi Jaime, > >> I found this page >> (http://sisc.sourceforge.net/comparison.php) that compares >> Kawa, JScheme, Bigloo and SISC, and I went to their web sites >> to read, but I havent test myself anything (I need to learn >> Scheme first, I guess :) > >Don't base your decision on benchmarks like those. Choose >a Scheme system that suits your needs (libraries, features, >compliance to a standard, etc.). Unless you have to implement >very CPU-intensive algorithms, almost all Scheme implementations >will do, in terms of performance (at least in the context of web >applications). Even interpreted systems will do well. > >> What I didn't like from Kawa is that you have to compile and >> deploy your servlets like regular java servlets, and you >> don't have a REPL so you loose some of Scheme's good >> qualities. (Is that so in your experience? ) > >First, you are not required to compile your Scheme code. You >can simply load all your Scheme files at startup time, and the >performance will not suffer that much. > >Also, Kawa does provide a REPL. I use it all the time to test my >code. But like many other Scheme systems, it does not let you >inspect local stack frames when an error occur (like in Gambit-C). >You're dumped to the top level. > >> There are also some restrictions about continuations, tail >> recursion, etc but at this point I don't know it those will >> matter at all for my project. > >In my case, I missed tail calls only once in the last year or so. >But YMMV. Depends on you problem domain. > >> Same for the slower JScheme and the faster Bigloo. > >Also, last time I checked, Bigloo required the -noverify flag to >be passed to the JVM. You don't want this in a production >environment like Bea Weblogic or IBM WebSphere...! > >> SISC is the more flexible but then, I don't know, would it be >> possible to build a highly scalable site on top of an >> interpreter made in java? > >I don't have a lot of experience with SISC. I can't comment. > >> I would really appreciate if you tell me a little about your >> experience with Kawa. > >I use Kawa Scheme at work for the development of a DSL >(domain-specific language) for developing industrial-strength >speech (VoiceXML) applications for use by large call-centers, as well as >some other speech-related technologies. (The speech applications >are web-based.) The DSL is itself a S-expression-based language, >with embedded Scheme code fragments/scripts (instead of >the usual XML/JavaScript pair). > >(Last year, one of our applications served about 70,000 calls in >three weeks on 48 phone lines. This may not seem much for a >web application, but for a speech application, it is. Also, the >Java/Scheme application server was by far the most stable part of the >whole solution.) > >I chose Kawa because most of our clients work in J2EE >environments and for its speed. I also looked at Bigloo, but >didn't like its Java-Scheme interface. > >Kawa itself is quite stable. When you find a bug, Per Bothner >(the author of Kawa) is very responsive and usually fixes >the bug in a matter of hours. > >Since I must interface my Scheme code with a lot of Java code >(written by me or my colleagues), I have to use the Eclipse >environment. But Scheme is not supported in Eclipse, and all >Scheme plugins available were of poor quality. So I wrote my >Scheme editor plug-in for Eclipse: http://schemeway.sourceforge.net. >It is quite stable now (I will release the latest version this evening) >and is a fairly decent editor, with lots of customizations. > >> I was wondering if it would be to much of an "impedance gap" >> between the java libraries (say, jdbc, >> jndi) and Scheme as a language. Can you really "think in >> Scheme" having to use libraries that weren't designed for that? > >Kawa does a nice job of interfacing Scheme and Java. With the >help of a few macros, one can turn a Java API into a new mini-language >embedded inside Scheme. But whatever Scheme system you choose, >you'll have to interface with existing libraries (usually in C). You will >face the same "impedance gap". Macros are the key, here. > >And how do you defined "think in Scheme"? For me, this means: > - dynamic typing (tagged values) > - S-expressions and the list data-type > - closures with indefinite extent > - higher-order functions > - powerful macros for building syntactic abstractions > - tail-call optimization > - continuations >Most of my problems do not require the last two. But all others >are very important to me. For this reason, I tend to minimize the interface >between Java libraries and my own Scheme code. > >I think the real question is: why are you interested by Scheme? >If it's the concept of continuation-based servers, then take a >closer look at SISC and PLT-Scheme. IMHO, this could >be the future of web server technologies (even if there are >a number of challenges that still need be addressed, like Matthias >pointed out in another message). > > >Regards, > >Dominique Boucher >Lead Developer >Nu Echo Inc. >www.nuecho.com |
|
From: Ken A. <kan...@bb...> - 2004-10-29 21:17:12
|
{
One of the nice things Scheme is good for is writing embedded
minilangauges. You can write a lot less code if you tailor such
languages for your application.
For example, since you main a triathlon sight a common idiom might be
to do a database lookup and generate HTML.
Here's one way to do it, there are many others. Also, i cut some corners.
There is a lot going on in this example, so its OK if you don't
understand it right a way.
}
(load "elf/jdbc.scm")
(load "elf/html-gen.scm")
(java.sql.DriverManager.registerDriver (oracle.jdbc.driver.OracleDriver.))
;;; dbConnection: -> java.sql.Connection
(define (dbConnection)
(DriverManager.getConnection dbUrl dbUser dbPassword))
;;; withDbConnection: Connection thunk -> Object
(define (withDbConnection con action)
;; Action is a procedure with a Connection argument.
;; The connection is closed when this returns.
(tryCatch
(Procedure.tryFinally (lambda () (action con))
(lambda () (.close con)))
(lambda (e) (print e)(.close con))))
{
Here is a simple macro. I use collect-query for simplicity.
}
(define-macro (mapQuery con query args . body)
`(withDbConnection
,con
(let ((f (lambda ,args ,@body)))
(lambda (con)
(map (lambda (row) (apply f (array->list row)))
(cdr (collect-query con ,query)))))))
{
Here's an example of using the macro. It uses the <> macro for
generating HTML. So we're mixing Scheme, JScheme's quasi-string and 2
embedded languages here. While this example doesn't show it,
<> also uses quasquote so there is 1 language (scheme) and 4 sublanguages used here.
This sounds pretty complicated, but our experience is that it has
worked pretty well.
}
(define (runwayData icao)
(<> p {Airport [icao] has runways:}
(<> table
(<> tr (<> td "High") (<> td "Low") (<> td "Length"))
(mapQuery
(dbConnection)
{select r.high_ident, r.low_ident, r.length
from runway r, airport a
where r.arpt_ident = a.arpt_ident and a.icao = '[icao]'}
(high low length)
(<> tr (<> td high) (<> td low) (<> td length))))))
{
If you wanted a cascade of transformations and were willing to use
scheme s-expressions as an intermediate representation, this would
even be simpler.
}
(define (runwayData icao)
`(airport
(icao ,icao)
,@(mapQuery
(dbConnection)
{select r.high_ident, r.low_ident, r.length
from runway r, airport a
where r.arpt_ident = a.arpt_ident and a.icao = '[icao]'}
(high low length)
(runway (highend ,high) (lowend ,low) (length ,length)))))
|
|
From: Ken A. <kan...@bb...> - 2004-10-28 22:21:04
|
After talking to Joe Marshal, and getting JScheme working in 1.5.0, i thought i'd write a cartoon document describing how JScheme works. I also hoped it would lead to identify opportunites for optimization. One thing i found was that Scheme.execute() which calls Scheme.currentEvaluator().execute() was happening a lot. So i added an Evaluator argument to most of those sites. This lead to a 20% improvement in the Gabriel benchmarks. Not a bad thing to do during OOPSLA (though i didn't go). |
|
From: Ken A. <kan...@bb...> - 2004-10-27 20:13:23
|
I went to Joe Marshalls talk on Common Larceny today. Joe has adopted the javadot notation to Common Larceny to get reflective access to .net objects. http://www.ccs.neu.edu/home/will/Larceny/ even has a pointer to our javadot page. Since Common Larceny is written in C, it was a bit more work to marshal and unmarshal the arguments. His system is based on the Swindle object system which has a Tiny Clos mop. Matthais suggested that we could write scripts that were portable between Java and .net if we had a library, such as JLib that could hide the differences. If we need to make extensions to Java dot for JDK 1.5 we should work them out with Joe. |
|
From: Ken A. <kan...@bb...> - 2004-10-26 17:31:09
|
The CVS version of JScheme now runs in JDK 1.5.0. I did some testing using a large JScheme application we're developing. The major version in the .class file has changed so you will need to recompile everything. |
|
From: Mitchell W. <wa...@cc...> - 2004-10-26 12:35:12
|
NU Programming Languages Seminar Wednesday, October 27, 2004 Room **166** West Village H (http://www.ccs.neu.edu/home/wand/directions.html) 11:45am-1:30pm **note non-standard room** Joe Marshall, NU PRL Integrating the .NET Libraries with Scheme or Look, Ma! No FFI! Common Larceny.NET is a Scheme implementation hosted on Microsoft's .NET framework. One goal of the project is to make it easy for Scheme to use the libraries provided by the .NET framework. Another goal is to make it easy for Scheme to interoperate with other programs hosted by the .NET framework. I have adapted Ken Anderson and Timothy Hickey's `Java-dot' notation to enable Scheme programs to construct and manipulate .NET objects. .NET methods are integrated as first-class Scheme procedures. A traditional `foreign function interface' is unnecessary with this approach. This short talk covers the Java-dot notation and provides some simple examples in how to use it. A few of the underlying details will be described, and some of the tricks of using Scheme to script other .NET applications will be discussed. Upcoming Events: Open. Any volunteers? --Mitch _______________________________________________ pl-seminar mailing list pl-...@li... https://lists.ccs.neu.edu/bin/listinfo/pl-seminar |
|
From: Ken A. <kan...@bb...> - 2004-10-25 21:43:30
|
Wait for tomorrow for the cvs update to become available and then try it. k At 02:34 PM 10/25/2004 -0700, david wrote: >Ken Anderson wrote: > >>I've been able to load jscheme/SchemeTests.scm and run all the tests in jdk1.5.0. One problem appeared which was that (Queue.) did not run. This is because JScheme automatically imports jsints.* and java.util.* each of which provide a Queue class. An error is not printed because we don't give details about the error as the default. >> >>Maybe we shouldn't import anything but java.lang.* by default. This would make our code more robust to such changes. >> >>k >>At 10:39 AM 10/25/2004 -0700, david wrote: >> >> >>>I just tried to do a build of Jscheme with the >>>new Java and got a bunch of errors. >>>The latest Tomcat expects Java 1.5, although there >>>is a work around to get it working with 1.4. >>>Is there a patch I can apply to get Jscheme working >>>with java 1.5? >>> >>> >>> >>>david@newport:/mnt/hda1/jscheme/jscheme$ sh bin/make -all >>>In openResource(elf/describe.scm): >>>java.lang.OutOfMemoryError: Java heap space >>>** WARNING: (load) can't open "elf/describe.scm" >>>In openResource(elf/inspect.scm): >>>java.lang.OutOfMemoryError: Java heap space >>>** WARNING: (load) can't open "elf/inspect.scm" >>>In openResource(elf/basic.scm): >>>java.lang.OutOfMemoryError: Java heap space >>>** WARNING: (load) can't open "elf/basic.scm" >>>while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" >>>In openResource(elf/basic.scm): >>>java.lang.OutOfMemoryError: Java heap space >>>** WARNING: (load) can't open "elf/basic.scm" >>>SchemeException: ERROR: undefined variable "backtraceValueString" >>>Error in BacktraceException.printStackTrace: >>>java.lang.OutOfMemoryError: Java heap space >>>** WARNING: Error during load (lineno 13): jsint.BacktraceException[ >>> >>> >>>] >>> >>>In openResource(elf/basic.scm): >>>java.lang.OutOfMemoryError: Java heap space >>>** WARNING: (load) can't open "elf/basic.scm" >>>while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" >>> >>>In openResource(elf/basic.scm): >>>java.lang.OutOfMemoryError: Java heap space >>>** WARNING: (load) can't open "elf/basic.scm" >>>david@newport:/mnt/hda1/jscheme/jscheme$ >>> >>> >>> >>>------------------------------------------------------- >>>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-user mailing list >>>Jsc...@li... >>>https://lists.sourceforge.net/lists/listinfo/jscheme-user >>> >Thanks ken ,for such a quick response! |
|
From: Ken A. <kan...@bb...> - 2004-10-25 21:16:38
|
I've been able to load jscheme/SchemeTests.scm and run all the tests in jdk1.5.0. One problem appeared which was that (Queue.) did not run. This is because JScheme automatically imports jsints.* and java.util.* each of which provide a Queue class. An error is not printed because we don't give details about the error as the default. Maybe we shouldn't import anything but java.lang.* by default. This would make our code more robust to such changes. k At 10:39 AM 10/25/2004 -0700, david wrote: >I just tried to do a build of Jscheme with the >new Java and got a bunch of errors. >The latest Tomcat expects Java 1.5, although there >is a work around to get it working with 1.4. >Is there a patch I can apply to get Jscheme working >with java 1.5? > > > >david@newport:/mnt/hda1/jscheme/jscheme$ sh bin/make -all >In openResource(elf/describe.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/describe.scm" >In openResource(elf/inspect.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/inspect.scm" >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >SchemeException: ERROR: undefined variable "backtraceValueString" >Error in BacktraceException.printStackTrace: >java.lang.OutOfMemoryError: Java heap space >** WARNING: Error during load (lineno 13): jsint.BacktraceException[ > > >] > >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" > >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >david@newport:/mnt/hda1/jscheme/jscheme$ > > > >------------------------------------------------------- >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-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |
|
From: Ken A. <kan...@bb...> - 2004-10-25 20:57:30
|
I've made several changes that will help with running in 1.5, you shuould see them in cvs tomorrow, though i did just update the jscheme.jar you can download (not a sourceforge release). There now seems to be a problem with importing, which i'll try to track down. k At 10:39 AM 10/25/2004 -0700, david wrote: >I just tried to do a build of Jscheme with the >new Java and got a bunch of errors. >The latest Tomcat expects Java 1.5, although there >is a work around to get it working with 1.4. >Is there a patch I can apply to get Jscheme working >with java 1.5? > > > >david@newport:/mnt/hda1/jscheme/jscheme$ sh bin/make -all >In openResource(elf/describe.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/describe.scm" >In openResource(elf/inspect.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/inspect.scm" >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >SchemeException: ERROR: undefined variable "backtraceValueString" >Error in BacktraceException.printStackTrace: >java.lang.OutOfMemoryError: Java heap space >** WARNING: Error during load (lineno 13): jsint.BacktraceException[ > > >] > >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" > >In openResource(elf/basic.scm): >java.lang.OutOfMemoryError: Java heap space >** WARNING: (load) can't open "elf/basic.scm" >david@newport:/mnt/hda1/jscheme/jscheme$ > > > >------------------------------------------------------- >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-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |
|
From: david <da...@da...> - 2004-10-25 17:36:48
|
I just tried to do a build of Jscheme with the new Java and got a bunch of errors. The latest Tomcat expects Java 1.5, although there is a work around to get it working with 1.4. Is there a patch I can apply to get Jscheme working with java 1.5? david@newport:/mnt/hda1/jscheme/jscheme$ sh bin/make -all In openResource(elf/describe.scm): java.lang.OutOfMemoryError: Java heap space ** WARNING: (load) can't open "elf/describe.scm" In openResource(elf/inspect.scm): java.lang.OutOfMemoryError: Java heap space ** WARNING: (load) can't open "elf/inspect.scm" In openResource(elf/basic.scm): java.lang.OutOfMemoryError: Java heap space ** WARNING: (load) can't open "elf/basic.scm" while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" In openResource(elf/basic.scm): java.lang.OutOfMemoryError: Java heap space ** WARNING: (load) can't open "elf/basic.scm" SchemeException: ERROR: undefined variable "backtraceValueString" Error in BacktraceException.printStackTrace: java.lang.OutOfMemoryError: Java heap space ** WARNING: Error during load (lineno 13): jsint.BacktraceException[ ] In openResource(elf/basic.scm): java.lang.OutOfMemoryError: Java heap space ** WARNING: (load) can't open "elf/basic.scm" while backtrace loading describe: SchemeException: ERROR: undefined variable "backtraceBody" In openResource(elf/basic.scm): java.lang.OutOfMemoryError: Java heap space ** WARNING: (load) can't open "elf/basic.scm" david@newport:/mnt/hda1/jscheme/jscheme$ |
|
From: Timothy J H. <tjh...@br...> - 2004-10-22 14:37:43
|
On Oct 22, 2004, at 10:27 AM, Ken Anderson wrote: > If you just want the macros, you just load > "elf/eopl2/jscheme/psyntax-init.scm" > the "jscheme-init.scm" assumes you have downloaded the eopl2 code. > Thanks! Now I understand.... ---Tim--- > sllgen.scm is a LL1 parser generator. > > At 10:01 AM 10/22/2004 -0400, Timothy J Hickey wrote: > >> On Oct 22, 2004, at 9:17 AM, Borislav Iordanov wrote: >> >>> Hi all, >>> >>> Are macros supposed to work from the latest download? I tried: >>> >>> (load "elf/eopl2/jscheme/jscheme-init.scm") >>> >>> and it produces a sequence of errors for failed loads and undefined >>> variables. I'd managed to get them to work with a prior download >>> from my >>> NetBeans plugin for Jscheme. But now, it seems that this part is in >>> pure >>> "development state". For instance, the file r5rs.scm is nowhere to be >>> found. Isn't anybody else trying to use the macro system? >> >> Running the query you provided gives the following errors ... >>>> ^C[Timothy-Hickeys-Computer:/tmp/jscheme] tim% java -classpath >>>> "src/eopl2:lib/jscheme.jar" jscheme.REPL >>>> elf/eopl2/jscheme/jscheme-init.scm >>> ** WARNING: (load) can't open "r5rs.scm" >>> ** WARNING: (load) can't open "sllgen.scm" >>> ** WARNING: (load) can't open "define-datatype.scm" >>> ** WARNING: (load) can't open "test-harness.scm" >>> ** WARNING: (load) can't open "test-suite.scm" >> commenting out those five loads from the file >> src/elf/eopl2/jscheme/jscheme-init.scm seems to solve the problem. >> >> A google search finds that these five files are part of a homework >> assignment >> http://www.cs.wustl.edu/~sck/425/current-semester/hws/hw4/ >> Perhaps we should add them to the jscheme distribution if they are >> desireable inside the jscheme/eopl2 package.... >> >> ---Tim--- >> >> >> >> >>> >>> Best, >>> Boris >>> >>> >>> >>> ------------------------------------------------------- >>> 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-user mailing list >>> Jsc...@li... >>> https://lists.sourceforge.net/lists/listinfo/jscheme-user > |
|
From: Borislav I. <bor...@ko...> - 2004-10-22 13:17:36
|
Hi all, Are macros supposed to work from the latest download? I tried: (load "elf/eopl2/jscheme/jscheme-init.scm") and it produces a sequence of errors for failed loads and undefined variables. I'd managed to get them to work with a prior download from my NetBeans plugin for Jscheme. But now, it seems that this part is in pure "development state". For instance, the file r5rs.scm is nowhere to be found. Isn't anybody else trying to use the macro system? Best, Boris |
|
From: <gk...@su...> - 2004-10-20 16:24:37
|
Also check out Schematics Cookbook: http://schemecookbook.org/ The site in and of itself is nice, also the left-hand side of the wiki's pages has some good scheme links. Geoffrey Ken Anderson <kan...@bb...> wrote: > Here are some scheme links [...] |
|
From: Ken A. <kan...@bb...> - 2004-10-20 15:46:45
|
Here are some scheme links The think i wrote for tracker is docs/scripting-templates.html. http://www.swiss.ai.mit.edu/~jaffer/r5rs_toc.html Scheme spec, there are also postscript versions only 50 pages including examples and index. http://jscheme.sourceforge.net - JScheme down load and play with it. http://popper.cs-i.brandeis.edu:8080/cs2a04/index.html - an intro to computer science course that uses JScheme servlets, wiki, and colaborative editor, for not cs majors. http://www.plt-scheme.org/ PLT-scheme down load it and play with it. http://www.htdp.org - Book How to design programs - everyone should learn how to design programs. http://mitpress.mit.edu/sicp/full-text/book/book.html structure and interpretation of computer programs. If you could only have one computer science book, this should be it. http://www.scheme.com/tspl2d/ The scheme programming language - good chapters on macros. http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/Programming Languages: Application and Interpretation Shriram Krishnamurthi Brown University http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html teach yourself scheme in fixnum days. http://www.cs.indiana.edu/eopl/ Essentials of Programming Languages http://srfi.schemers.org/ SRFI's are proposals for extensions/libraries. |
|
From: Geoffrey K. <ge...@kn...> - 2004-10-15 17:03:35
|
Thanks for the reminder. I'd completely forgotten about YAML. The key is having bindings to XML. Use YAML internally if I wish, but if customers demand my output be XML, they can have that for their piggy disks. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Oct 15, 2004, at 12:43, Ken Anderson wrote: > It turns out, thank god, that there are several interesting > alternatives to XML. > http://www.yaml.org uses indentation, as does python to indicate > nesting. |
|
From: Ken A. <kan...@bb...> - 2004-10-15 16:44:36
|
It turns out, thank god, that there are several interesting alternatives to XML. http://www.yaml.org uses indentation, as does python to indicate nesting. |
|
From: Geoffrey K. <ge...@kn...> - 2004-10-13 09:47:27
|
On Oct 12, 2004, at 16:19, Ken Anderson wrote: > Tim and i where at the NEPLS conference Friday and we talked about > http://www.cs.auc.dk/~normark/schemedoc/ > which a scheme version of javadoc. There are actually at least 5 =20 > scheme systems to do this. > Lets develop a simple version, perhaps called jsdoc, for JScheme. I was pretty impressed with Kurt N=F8rmark's Elucidator 2 example: http://www.cs.auc.dk/~normark/scheme/examples/elucidator-2/scheme-=20 documentation-tools/html/index.html What I hope Scheme (and Java) documention systems will evolve into is =20= not just pretty web pages or typeset manuals, but also a registry of =20 capabilities, like JDocs [1] or the Scheme Cookbook [2], but more =20 dynamic. I want to Google a capability I need and find a list of =20 implementations meeting that need, scored by metrics of usability and =20= compatibility with Scheme systems. At that point the literate =20 programming tools would help me understand the discovered code well =20 enough to reference it in my code without fear, and when I ran my =20 program the Scheme system I was using would be smart enough to go get =20= the referenced code if I hadn't already downloaded it. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk [1] http://www.jdocs.org/ [2] http://schemecookbook.org/= |