guile 2.0 support in slib

2013-01-10 Thread Andy Wingo
Hi Aubrey,

Attached is a patch to get slib working on Guile 2.0.  I've only given
it minimal testing, but it seems to work OK.

Regards,

Andy
cvs diff: Diffing .
Index: ChangeLog
===
RCS file: /sources/slib/slib/ChangeLog,v
retrieving revision 1.563
diff -u -r1.563 ChangeLog
--- ChangeLog	27 Jun 2012 17:10:25 -	1.563
+++ ChangeLog	10 Jan 2013 16:16:34 -
@@ -1,3 +1,16 @@
+2013-01-10  Andy Wingo  
+
+	* README: Update documentation for Guile.
+
+	* guile-2.init:
+	* guile.init: Factor an initialization file for Guile 2.0 and
+	later out of guile.init.  This does not change the interface,
+	though -- loading guile.init will load guile-2.init if
+	appropriate, and otherwise executes its own code.
+
+	* slib.nsi:
+	* Makefile (ifiles): Update build scripts.
+
 2012-06-27  Aubrey Jaffer  
 
 	* structure.scm (define-structure): Reconciled with documentation.
Index: Makefile
===
RCS file: /sources/slib/slib/Makefile,v
retrieving revision 1.273
diff -u -r1.273 Makefile
--- Makefile	27 Jun 2012 17:10:25 -	1.273
+++ Makefile	10 Jan 2013 16:16:34 -
@@ -112,7 +112,7 @@
 	scheme2c.init scheme48.init gambit.init t3.init vscm.init \
 	scm.init scsh.init sisc.init pscheme.init STk.init kawa.init \
 	RScheme.init mzscheme.init umbscheme.init jscheme.init s7.init \
-	guile.init guile.use
+	guile.init guile.use guile-2.init
 tfiles = macrotst.scm dwindtst.scm formatst.scm
 sfiles = $(ffiles) $(lfiles) $(revfiles) $(afiles) $(scfiles) $(efiles) \
 	$(rfiles) colorspc.scm $(scafiles) $(txiscms) $(srfiles)
Index: README
===
RCS file: /sources/slib/slib/README,v
retrieving revision 1.103
diff -u -r1.103 README
--- README	20 Dec 2010 19:56:23 -	1.103
+++ README	10 Jan 2013 16:16:34 -
@@ -35,7 +35,8 @@
   `s7.init' is a configuration file for S7, part of Snd sound-editor.
   `umbscheme.init' is a configuration file for umb-scheme.
   `vscm.init' is a configuration file for VSCM.
-  `guile.init' is a configuration file for guile.
+  `guile-2.init' is a configuration file for Guile version 2.0 or later.
+  `guile.init' is a configuration file for older versions of Guile.
   `jscheme.init' is a configuration file for JScheme.
   `kawa.init' is a configuration file for Kawa.
   `mklibcat.scm' builds the *catalog* cache.
@@ -351,8 +352,11 @@
   kawa -f ${SCHEME_LIBRARY_PATH}kawa.init --
 
  -- Implementation: Guile
- Guile versions 1.6 and earlier link to an archaic SLIB version.  In
- RedHat or Fedora installations:
+ For Guile 1.8 or later, use:
+  guile -l ${SCHEME_LIBRARY_PATH}guile.init
+
+ For prehistoric Guile, you may have to remove a prehistoric copy of
+ SLIB that was included with Guile:
 
   rm /usr/share/guile/slib
   ln -s ${SCHEME_LIBRARY_PATH} /usr/share/guile/slib
@@ -364,10 +368,6 @@
 
  `${SCHEME_LIBRARY_PATH}' is where SLIB gets installed.
 
- Guile with SLIB can then be started thus:
-
-  guile -l ${SCHEME_LIBRARY_PATH}guile.init
-
  -- Implementation: Scheme48
  To make a Scheme48 image for an installation under `',
 
Index: guile-2.init
===
RCS file: guile-2.init
diff -N guile-2.init
--- /dev/null	1 Jan 1970 00:00:00 -
+++ guile-2.init	10 Jan 2013 16:16:35 -
@@ -0,0 +1,718 @@
+;"guile.init" Configuration file for SLIB for Guile	-*-scheme-*-
+;;; Author: Aubrey Jaffer
+;;; Author: Andy Wingo
+;;;
+;;; This code is in the public domain.
+
+(cond-expand
+ (guile-2)
+ (else
+  (error "Guile 2.0 or later is required.")))
+
+(define-module (ice-9 slib)
+  #:use-module ((ice-9 popen) #:select (open-input-pipe close-pipe))
+  #:use-module ((ice-9 rdelim) #:select (read-line read-line! write-line))
+  #:re-export (read-line read-line! write-line)
+  #:export (<=?
+=?
+>?
+A:bool
+A:fixN16b
+A:fixN32b
+A:fixN64b
+A:fixN8b
+A:fixZ16b
+A:fixZ32b
+A:fixZ64b
+A:fixZ8b
+A:floC128b
+A:floC16b
+A:floC32b
+A:floC64b
+A:floR128b
+A:floR128d
+A:floR16b
+A:floR32b
+A:floR32d
+A:floR64b
+A:floR64d
+a:bool
+a:fixn16b
+a:fixn32b
+a:fixn64b
+a:fixn8b
+a:fixz16b
+a:fixz32b
+a:fixz64b
+a:fixz8b
+a:floc128b
+a:floc16b
+a:floc32b
+a:floc64b
+a:flor128b
+a:flor128d
+a:flor16b
+a:flor32b
+a:flor32d
+a:flor64b
+a:flor64d
+any-bits-set?
+arithmetic-shift
+array

Re: Guile 2 birthday potluck

2013-01-10 Thread Limbo Peng
On 01/08, Andy Wingo wrote:
> February 16 will mark 2 years of Guile 2, and following Ludovic's
> example I thought it might be a nice idea to organize a little
> hack-potluck :-)
> 
> For those of you that are unfamiliar with the term, a "potluck" is a
> dinner where everyone cooks something at home and brings it for all to
> share.  A hack-potluck would be a more virtual feast, in which the
> diners show off some little program they've been cooking.
> 
> So start your emacsen and get cooking!  We've got 5 weeks until 16
> February, ample time for a delicious concoction :)

This idea is quite new to me, and I'm gonna give it a try :)

BTW: did you guys have a hack-potluck last year?