People,
please, what is wrong in this Spad code?
---------------------------------------------------------------
)abbrev package PARSEI ParseInt
ParseInt() : with
parseInteger : String -> Integer
==
add
parseInteger(str : String) : Integer ==
base : Integer := 48
l : Integer := # str
s : Integer := 0
for i in 1 .. l repeat
(dNum := ord(elt(str, i)) - base; s := (10*s) + dNum)
s
---------------------------------------------------------------
?
It compiles and produces -> parseInteger "0"
46
It looks like the part of ``for i in 1 .. l repeat'' is responsible.
The same program in t.input
(with the first lines including `add' skipped) runs correct in the
interpreter:
parseInteger "0"
0
parseInteger "201"
201
This is FriCAS-1.1.5 made from source under GNU CLISP 2.49,
Debian Linux.
Thanks,
------
Sergei
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.