This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: home-directory in .kawarc.scm; kawa.init for SLIB; hash tables


Doug Orleans <dougo@ccs.neu.edu> writes:

> Bug: if you refer to home-directory in your ~/.kawarc.scm init file,
> it throws an UnboundSymbol exception.  This looks like a pretty simple 
> fix to kawa.repl.checkInit(),  but I haven't tried it.

Yep - a patch is below.

> Suggestion: I've been writing a kawa.init for SLIB, and just noticed
> that someone posted one to this list in 1999.  Perhaps you could put
> this on the Kawa home page, or else make some sort of third-party
> contrib directory/page?  (Or, just add it to the main distribution.)
> I can send you my version if you like; it's a little more up to date
> with respect to Kawa features.

Look in the gnu/kawa/slib directory.  That is how I prefer to
"import" slib packages.  People should not have to deal with kawa.init
files.

> Question: has anyone written a Scheme interface to the Java Hashtable
> (or HashMap) class?  I don't like the SLIB hashtable implementation
> for various reasons (e.g. doesn't use an opaque type, doesn't allow
> for a user-defined hash function) and rather than writing one from
> scratch I figured it'd make sense to just piggy-back onto Java's.  But
> no sense in doing the work if someone else has already done it.  (This
> would be another candidate for a contrib page.)

I'm sure someone has.  I think the thing to do is propose a Schme API,
preferable one used by other Scheme implementation(s) and/or slib
and/or Common Lisp.  Of course you'd use Java's hashCode, but not
necessarily java.util.Hashtable - though perhaps that would make
sense.

Index: repl.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/repl.java,v
retrieving revision 1.34
diff -u -r1.34 repl.java
--- repl.java	2001/03/09 06:42:14	1.34
+++ repl.java	2001/03/23 05:30:13
@@ -49,6 +49,7 @@
     /* Set homeDirectory;  if first time called, run ~/.kawarc.scm. */
     if (homeDirectory == null)
       {
+	File initFile = null;
 	homeDirectory = System.getProperty ("user.home");
 	Object scmHomeDirectory;
 	if (homeDirectory != null)
@@ -58,13 +59,13 @@
 	    String kawarc_name =
 	      "/".equals(file_separator) ? ".kawarc.scm"
 	      : "kawarc.scm";
-	    File initFile = new File(homeDirectory, kawarc_name);
-	    if (initFile.exists())
-	      Shell.runFile(initFile.getPath());
+	    initFile = new File(homeDirectory, kawarc_name);
 	  }
 	else
 	  scmHomeDirectory = Scheme.falseObject;
 	Environment.define_global("home-directory", scmHomeDirectory);
+	if (initFile != null && initFile.exists())
+	  Shell.runFile(initFile.getPath());
       }
   }
 

-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]