scm doesn't do floats or fractions, try for instance: scm -e "(display (/ 4 2))(newline)(display (/ 3 2))" See <http://swiss.csail.mit.edu/~jaffer/scm_2.html#SEC11> for how to build executables with floating-point support (-F inexact).
the results: $ scm -e "(display (/ 4 2))(newline)(display (/ 3 2))" 2 ;ERROR: eval: /: numerical overflow 3 ; in expression: (#@/ 3 2) ; in top level environment. ; defined by eval ;STACK TRACE 1; (#@begin (#@display (#@/ 4 2)) (#@newline) (#@display (#@/ 3 2 ... 2; ((#@thunk) (set! complete #t)) 3; ((#@require (#@quote string-port)) (#@do-thunk (#@lambda () (( ... 4; ((#@case #@option #(#<unspecified> #f #\? #\: #\n #\u #\m #\s ... 5; ((#@cond ((#@not #@*argv*) (#@set! #@*argv* (#@program-argumen ... ; program args: ("scm" "-e" "(display (/ 4 2))(newline)(display (/ 3 2))")
I 've made an "off-hand" attempt to fix this. There is an experimental ebuild in gentoo-lisp's overlay(http://repo.or.cz/w/gentoo-lisp-overlay.git), the scm-5.5.3-r2.ebuild. The build script, is supposed to create some executable script based on rules given from flags, but it just directed its output to stdout instead of execute the commands. The runtime output after the fix: (chroot-one) daidalos gentoo-lisp-overlay # scm SCM version 5e3, Copyright (C) 1990-2002 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/share/slib/require ;done loading /usr/share/slib/require.scm ;loading /usr/lib/scm/Transcen ;done loading /usr/lib/scm/Transcen.scm > (+ 2.2 7.34) 9.539999999999999 > (/ 3 2.22) 1.3513513513513513 > (* 7.1 -7.1) -50.409999999999994 > (quit) ;EXIT (chroot-one) daidalos gentoo-lisp-overlay # It seems to work flawlessly now. I think we can close this bug :) Panagiotis(pchrist)
Created attachment 140992 [details, diff] proposed patch This fixes just the "support floating point numbers issue" Panagiotis
Marijn, This patch just fixes the problem with floats, but I have problems of loading files on startup, with the current version of scm. I don't have these problems with the the scm-5.5.3-r2 ebuild which is in the overlay. For the greater good, may I suggest to push the newest ebuild from the overlay to the main tree? Panagiotis This is what I mean: (chroot-one) daidalos scm # scm -e "(display (/ 4 2))(newline)(display (/ 3 2))" ;ERROR: No such file or directory ERROR: load: Could not open file "Init5e3.scm" ; in top level environment. > (/ 4 2 ) 2 > ( / 3 2) 1.5 > (quit) (chroot-one) daidalos scm # + the QA issue which is fixed in the overlay's ebuild.
I want to know what fixes what. It seems the current 5.5.3 does not even build scm correctly but only scmlit? That is indeed fixed by: ./build --compiler-options="${CFLAGS}" --linker-options="${LDFLAGS}" \ -F macro -F inexact &> _compile.sh sh _compile.sh but without the Init fix it is not much good...
scm-5.5.4 now builds with floating support and also does not suffer from other problems AFAIK.