Hi Martin,

without looking into topology.spad I guess the reason for you problem comes from the line

h : Homset(source,target) := homset()

The interpreter remembers now the type of h. And this cannot change in a session unless you say

)clear prop h

)co fricas/topology.spad
source := topoSpaceFiniteLeftOrder(["a","b","c"])
target := topoSpaceFiniteLeftOrder(["d","e"])
h : Homset(source,target) := homset()

)co fricas/topology.spad
source := topoSpaceFiniteLeftOrder(["a","b","c"])
target := topoSpaceFiniteLeftOrder(["d","e"])
h : Homset(source,target) := homset()

You declare a new variable "source" (no, it is not the same as in the first definition/assignment). Well, it's the same variable, but it value changed in the sense that it now points to a different memory location.

Then you use it in "h : Homset(source,target) := homset()". Fine,
but after the second "source := ...", "Homset(source,target)" and the one you used before are "two different types".

FriCAS ensures that, for example Polynomial(Integer) and Polynomial(Integer) are the same types, but not that Foo(v1) is the same as Foo(v2) even if v1 and v2 represent the same value (that is NOT a domain or category).

Maybe I am wrong, but I have seen such errors

    You cannot declare h to be of type Homset([[a,b,c],CONCAT(topology=,
       [BRACE(1),BRACE(1,2),BRACE(1,2,3)])],[[d,e],CONCAT(topology=,[
       BRACE(1),BRACE(1,2)])]) because either the declared type of h or
       the type of the value of h is different from Homset([[a,b,c],
       CONCAT(topology=,[BRACE(1),BRACE(1,2),BRACE(1,2,3)])],[[d,e],
       CONCAT(topology=,[BRACE(1),BRACE(1,2)])]) .

several times.

The way around this is that you do not declare h to be of a certain type, but rather put the type onto the right-hand side.

I guess

h := homset() $ Homset(source,target)

should do the trick. (I haven't actually tested it locally.)

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/bdfc014f-f71f-4705-ba6f-47a4184d15e4%40hemmecke.org.

Reply via email to