scsh-users
[Top] [All Lists]

Subtracting integers

To: scsh-news@zurich.ai.mit.edu
Subject: Subtracting integers
From: Norman Gray <norman@astro.gla.ac.uk>
Date: 21 Apr 2003 19:42:03 +0100
Organization: University of Glasgow
Greetings,

Subtracting integers isn't working as I for one would expect:

Millie:norman/stuff> scsh
Welcome to scsh 0.6.4 (Olin Shivers)
Type ,? for help.
> (- 3 4)
-1
> (- 3 4 5)

Warning: invalid arguments
         (- 3 4 5)
         (procedure wants: (:number &opt :number))
         (arguments are: (:exact-integer :exact-integer :exact-integer))

Error: wrong number of arguments
       ('#{Procedure 48 (- in scheme-level-0)} 3 4 5)
1> ^D
> ,exit

Ought I to have expected that?  I'm no Lisp expert, but I can read R4RS,
and that suggests the latter should be perfectly OK.

There's no mention of numerics gotchas in the scsh FAQ, nor in the
Scheme-48 manual (since this is presumably more of a Scheme-48 issue
than a scsh one).  Since this behaviour is described in R4RS I take it
that I don't have to worry about SRFIs, or loading other modules.  Am
I misunderstanding something horrible, and embarrassingly basic?

(I mention R4RS above simply because I happen to have a copy of that
handy where I'm writing this -- I don't imagine it's changed in R5RS)

Thanks for any insights.

All the best,

Norman

-- 
---------------------------------------------------------------------------
Norman Gray                        http://www.astro.gla.ac.uk/users/norman/

<Prev in Thread] Current Thread [Next in Thread>