The if-then statement in this piece of code is badly compiled: spad )abb package FOO Foo
Foo(R,VCR): Exports == Implementation where
R : FloatingPointSystem
VCR : VectorCategory R
Exports == with
bar : (Boolean, VCR) -> Integer
++ bar(t,v)
Implementation == add
import OutputPackage
bar(b, v) ==
if b then
--output("")
for i in minIndex v..maxIndex v repeat
if v.i <= 0 then return -1
else
for i in minIndex v ..maxIndex v repeat
v.i := 1
output(v::OutputForm)
0
spad Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/7796249095078486632-25px001.spad using
old system compiler.
FOO abbreviates package Foo
------------------------------------------------------------------------
initializing NRLIB FOO for Foo
compiling into NRLIB FOO
importing OutputPackage
compiling exported bar : (Boolean,VCR) -> Integer
Time: 0.12 SEC.axiom v:=new(5,0)$Vector(SF)
Type: Vector DoubleFloat?
axiom bar(false,v)
Type: NonNegativeInteger
Axiom should display [1.0,1.0,1.0,1.0,1.0]? since b is set to false. If a statement is added just before the first |