Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191829 - scm doesn't do floats or fractions
Summary: scm doesn't do floats or fractions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Scheme Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-09 15:28 UTC by Marijn Schouten (RETIRED)
Modified: 2008-01-18 13:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed patch (scm-5.5.3.ebuild.patch,620 bytes, patch)
2008-01-15 16:08 UTC, Panagiotis Christopoulos (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marijn Schouten (RETIRED) gentoo-dev 2007-09-09 15:28:02 UTC
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).
Comment 1 Marijn Schouten (RETIRED) gentoo-dev 2007-10-09 15:40:30 UTC
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))")
Comment 2 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-01-01 23:44:19 UTC
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)
Comment 3 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-01-15 16:08:54 UTC
Created attachment 140992 [details, diff]
proposed patch

This fixes just the "support floating point numbers issue"

Panagiotis
Comment 4 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-01-15 16:21:56 UTC
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.
Comment 5 Marijn Schouten (RETIRED) gentoo-dev 2008-01-16 15:39:54 UTC
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...
Comment 6 Marijn Schouten (RETIRED) gentoo-dev 2008-01-18 13:29:25 UTC
scm-5.5.4 now builds with floating support and also does not suffer from other problems AFAIK.