Search code examples
linked-listeiffel

Eiffel - How can I initialize a LINKED_LIST?


I'm new to Eiffel and I'm trying to create an instance of Linked_List. I'm not really sure of how to do this with this class because I receive an syntax error whenever I try to do it that way. This is what I have:

class
    APPLICATION

inherit
    ARGUMENTS

create
    make

feature {NONE} -- Initialization

    make
        --  
        local
            lista:LINKED_LIST[MONOMIO]

        do
        lista.make
    end
end

And the error I'm getting is:

Error code: VUEX(2)

Error: feature of qualified call is not available to client class.
What to do: make sure feature after dot is exported to caller.

I hope somebody can help me with this, thanks.


Solution

  • Objects are created with a creation instruction, so in your example you need to add a keyword create in front of lista.make to indicate that this is not a plain feature call:

    create lista.make