scm-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scm-discuss] Re: there might a bug with scm compiler


From: Aubrey Jaffer
Subject: [Scm-discuss] Re: there might a bug with scm compiler
Date: Sat, 23 Aug 2008 17:33:14 -0400 (EDT)

 | Date: Tue, 12 Aug 2008 06:56:59 +0000
 | From: "naruto canada" <address@hidden>
 | 
 | I'm rewriting my small lib and compiling with several different
 | scheme compilers and interpreters, I hit one snag with scm
 | compiler: (scm interpreter is ok with the code)
 | 
 | (define (display x . port)
 |   (if (not (null? port))
 |       (write x (car port))
 |       (write x           ) ))
 | 
 | (define (print x . port)
 |   (if (not (null? port))
 |       (begin (display x (car port)) (newline (car port)) 'void)
 |       (begin (display x           ) (newline           ) 'void)  ))
 | 
 | (define (for-loop x x-max do-stuff)
 |   (if (<= x x-max)
 |       (begin (do-stuff x) (for-loop (+ x 1) x-max do-stuff))
 |       'void))
 | 
 | (define (map-print lst . port)
 |   (if (not (null? port))
 |       (for-loop 1 (length lst) (lambda (x) (print x (car port))) )
 |       (for-loop 1 (length lst) print                             )))
 | 
 | (map-print '())
 | (map-print '(1))
 | (map-print '(1 2))
 | (map-print '(1 2 3))
 | 
 | scm -rcompile -e '(compile->executable "graph" "graph.scm")'
 | ./graph
 | SCM version 5e5, Copyright (C) 1990-2006 Free Software Foundation.
 | SCM comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'.
 | This is free software, and you are welcome to redistribute it
 | under certain conditions; type `(terms)' for details.
 | ;loading /usr/scm/slib/require
 | ;done loading /usr/scm/slib/require.scm
 | ;loading /usr/scm/Transcen
 | ;done loading /usr/scm/Transcen.scm
 | 
 | ;ERROR: write: Wrong type in arg2 #<unknown-heap 0xbfb4f468>
 | ; in top level environment.

There is a SCM/Hobbit GC bug which was fixed a couple weeks ago.
http://groups.csail.mit.edu/mac/ftpdir/users/jaffer/scm.zip
Also, the CVS repository is updated:
https://savannah.gnu.org/cvs/?group=slib

However, your "graph.scm" still fails.  It seems that compiled
procedures taking optional arguments don't work when they are passed
as arguments -- but not always.  Compiling (for-each print '(1 2 3))
works.

I am overloaded with work.  I am copying address@hidden in case
someone there would like to take a crack at solving it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]