On 02/18/2012 02:19 PM, Serge D. Mechveliani wrote:
Please, how to fix this program?
You probably have a reason to call one package from the other.
And suggesting the following is probably not helpful for you.
)abbrev package FOO1 Foo1
Foo1() : with
f : Integer -> Integer
g : Integer -> Integer
== add
f(n : Integer) : Integer ==
n = 0 => 0
1 + g(n-1)
g(n : Integer) : Integer == 1 + f(n-1)
Are there possible two packages which call each other?
The following program compiles with
aldor -laldor t.as
---rhxBEGIN t.as
#include "aldor"
Foo1: with {
f: Integer -> Integer
} == add {
f(n: Integer): Integer == {
n = 0 => 0;
1 + g(n-1) $Foo2
}
}
Foo2: with {g : Integer -> Integer
} == add {
g(n : Integer) : Integer == 1 + f(n-1)$Foo1
}
---rhxEND t.as
The only idea to work around this problem is to redefine the domain in
the same file (starting with a dummy implementation. Unfortunately, just
writing
Foo2: with g: Integer->Integer
doesn't work.
---rhxBEGIN t.spad
)abbrev package FOO2 Foo2
Foo2 : with g : Integer -> Integer == add
g(n : Integer) : Integer == 1
)abbrev package FOO1 Foo1
Foo1 : with f : Integer -> Integer ==
add
f(n : Integer) : Integer ==
n <= 0 => 0
1 + g(n-1)$Foo2
Foo2: with g : Integer -> Integer == add
g(n : Integer) : Integer == 1 + f(n-1)$Foo1
---rhxEND t.spad
Ralf
--
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.