Search code examples
syntaxeiffel

Eiffel - Don't know why I have syntax error


I'm new to Eiffel and I'm trying to create a simple class called "Monomio", I have 3 features that are attributes and a feature that's a function. The problem is that I'm getting a syntax error, I compared it to other classes I found but can't find the error here. This is my code

class
   MONOMIO
create
   make

feature {NONE} -- Initialization

    make
        -- Initialization for `Current'.
        do

        end;

    coeficiente: INTEGER;
        -- El número que será el coeficiente del monomio
    exponenteX: INTEGER;
        -- El exponente de la variable X
    exponenteY: INTEGER;
        -- El exponente de la variable Y

    evaluar(valX: INTEGER; valY: INTEGER): INTEGER is
        do
            Result := coeficiente*(valX^expX)*(valY^expY)
        end;

end

And this is the error I'm getting:

Syntax error at line 28 in class MONOMIO


evaluar(valX: INTEGER; valY: INTEGER): INTEGER is
---------------------------------------------^
    do          

I hope anyone can help me with this. Thanks.


Solution

  • I think the problem is the keyword "is". This has been deprecated, and if you are compiling with standard syntax (as you will be by default), then it is an error.

    Just remove "is".

    The problem of "syntax error" as an uninformative error message is one I have long been complaining about. It is entirely fixable, and no compiler should use it.