From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: Incompatible types for array conversion Date: Tue, 21 Jul 2015 22:19:37 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net wnB+BPcshtzaxJ0SG4aOUwLb3MlHxBSElIVWBP9YdWbq623ZMe Cancel-Lock: sha1:Aj4xYc8pHSN02PkMByXc6yoKwPc= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 Xref: news.eternal-september.org comp.lang.ada:26951 Date: 2015-07-21T22:19:37-03:00 List-Id: I have a generic vector package: generic dim: positive; type Real is digits <>; package Vectors is type Vector is array (1..dim) of Real; function "*" (a: Vector; b: Real) return Vector; end Vectors; In another package I want to model the definition of a (physical) position vector by its direction and module: package Basic is type Real is new Interfaces.IEEE_Float_64; type Length is new Real; package Positions is new Gen.Vectors (3, Length); package Directions is new Gen.Vectors (3, Real); subtype Position is Positions.Vector; subtype Direction is Directions.Vector; function "*" (l: Direction; r: Length) return Position; end Basic; Now my attempt to define this function: function "*" (l: Direction; r: Length) return Position is begin return Positions."*"(Position(l), r); end "*"; gets me the error message in the subject line. Do I have to convert the vector element by element in a loop or is there a more elegant way? -- Frank Hrebabetzky +55 / 48 / 3235 1106 Florianopolis, Brazil