rofinn / Interfaces.jl

An implementation of interfaces for Julia
MIT License
7 stars 3 forks source link

Attributes support #2

Open rofinn opened 9 years ago

rofinn commented 9 years ago

While checking methods is more important for proper design, there really isn't much of a reason we couldn't support checking required attribute names and types.

Ex)

@interface MyInterface begin
    x::Int

   func(self::MyInterface)
end

Then we could just use fieldnames(<ImpType>) and fieldtypes(<ImpType>, <fieldname>) when implements gets called.