I would definitely call the below behaviour a bug.
Isn't it weird that adding type information makes things worse?
And even in case that the interpreter must go another path when I add
"$List(REC)", I don't understand, why it ignores the information that l
is of type List(Integer).
Ralf
(1) -> REC==>Record(foo: Integer, bar: Integer)
Type: Void
(2) -> l: List(Integer) := empty()
(2) []
Type: List(Integer)
(3) -> [[1,1]$REC for x in l]
(3) []
Type: List(Record(foo: Integer,bar: Integer))
(4) -> [[1,1]$REC for x in l]$List(REC)
(4) [[]]
Type: List(Any)
The version [[1,1]$REC for x in l] @ List(REC) works as expected.
When I ")set message bottom on" the output shows the following.
(3) -> [[1,1]$REC for x in l]
(3) []
Type: List(Record(foo: Integer,bar: Integer))
(4) -> [[1,1]$REC for x in l]$List(REC)
Function Selection for map by coercion facility (map)
Arguments: ((ANY -> Record(foo: INT,bar: INT)), LIST(ANY))
Target type: LIST(Record(foo: INT,bar: INT))
-> no appropriate map found in List(Any)
-> no appropriate map found in List(Record(foo: Integer,bar: Integer))
-> no appropriate map found in Record(foo: Integer,bar: Integer)
-> no appropriate map found in Any
-> no appropriate map found in Integer
-> no appropriate map found in Any
-> no appropriate map found in Record(foo: Integer,bar: Integer)
Modemaps from Associated Packages
[1] ((D4 -> D5),List(D4)) -> List(D5) from ListFunctions2(D4,D5)
if D4 has TYPE and D5 has TYPE
[1] signature: ((ANY -> Record(foo: INT,bar: INT)), LIST(ANY)) ->
LIST(Record(foo: INT,bar: INT))
implemented: slot (List (Record (: foo (Integer)) (: bar
(Integer))))(Mapping (Record (: foo (Integer)) (: bar (Integer)))
(Any))(List (Any)) from LIST2(ANY,Record(foo: INT,bar: INT))
(4) [[]]
Type: List(Any)
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/8c87ded7-4479-9e2d-131a-a6bf22706ab7%40hemmecke.org.