Ralf Hemmecke
unread,Jan 17, 2023, 9:02:08 AM1/17/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fricas-devel
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)