Four problems with Scheme 48 1.8

Martin Ward <[email protected]>
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
(1) Compiling with gcc version 4.4.0 gives an error on "make test":

FAILURES:
Test case *3 [misc-big-tests] FAILED:
From expression (* 47123 46039) EXPECTED value 2169495797 of 2169495797
INSTEAD got -2125471499

'(#{Check-failure #{Test-case *3} (actual (* 47123 46039) -2125471499) 
(expected 2169495797 2169495797) #{Procedure 983 (equal? in 
scheme-level-1)}})

Compiling with gcc 4.0.1 seems to work OK.


(2) I cannot figure out how to define a macro such as:

(defmacro substr (str from . rest)
  (if (null? rest)
      ; two argument form of substr:
      `(let ((s ,str))
         (substring s ,from (string-length s)))
      ; three argument form of substr:
      `(substring ,str ,from (+ ,from ,@rest))))

SCM and the Hobbit compiler support defmacro, Gambit can define defmacro as:

(define-macro (defmacro name args . body)
  `(define-macro (,name ,@args) ,@body))


(3) scheme48 won't accept ++ as a symbol name for some reason:

(define (++ a b)
  (if (or (null? a) (pair? a))
    (append a b)
    (string-append (@string a) (@string b))))

gives the error:

Error: unsupported number syntax
       "++"
       (&i/o-port-error (port . #{Input-port #{Input-channel "standard 
input"}}))
       (&i/o-read-error (port . #{Input-port #{Input-channel "standard 
input"}}))


(4) After compiling scheme48 with gcc 4.0.1, expanding all the macros
in my source file and renaming symbol "++" to "s++", I get the following
error when trying to load my source:

scheme48
Welcome to Scheme 48 1.8 (made by martin on Mon Jul 13 10:50:38 BST 2009)
Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees.
Please report bugs to [email protected].
Get more information at http://www.s48.org/.
Type ,? (comma question-mark) for help.
> (load "ALL2.scm")
ALL2.scm
Condition: (&interrupt post-major-gc)
1> 
Condition: (&interrupt post-major-gc)
2> 


ALL2.scm is 6.7MB of scheme source.
Pressing Control-D to exit gives a repeat of the error:


Condition: (&interrupt post-major-gc)
1> 
Condition: (&interrupt post-major-gc)
2> 


I had to use Control-Z and then kill the background process.

I can send you a copy of ALL2.scm if you are interested.
(This file works fine with SCM, Hobbit, Gambit, Guile and bigloo
versions of Scheme).

-- 
			Martin

[email protected] http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.