Ada中缺少操作数错误

时间:2015-03-04 22:43:10

标签: ada

编译用Ada编程语言编写的代码时,会显示下一条消息:missing operand in deg:=degree();为什么 如何解决此问题?

With Ada.Text_IO; Use Ada.Text_IO;
With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
With Ada.Strings.Unbounded; Use Ada.Strings.Unbounded;

procedure polynomial is

    -- constructs a new polynomial term of the form a * x^b:
    function Polynomial(a,b : Integer) return Integer is
        type coef is array(Integer range <>)of Integer;
        type deg is new Integer;
        type c is new Integer;
    begin
        coef:=new int(b+1);
        coef(b):=a;
        deg:=degree(); --missing operand
        return a;
    end Polynomial;

1 个答案:

答案 0 :(得分:5)

Ada不接受空参数列表。如果函数不接受参数,则完全省略参数列表。