DynamoDS / DesignScript

About the DesignScript language
Apache License 2.0
11 stars 10 forks source link

Duck typing interfaces? #26

Open pboyer opened 7 years ago

pboyer commented 7 years ago

Something similar to this would allow us to still have custom types for users, but still have simplicity in replication.

interface Qux {
   foo : string;
}

def baz(a : Qux){
   return a.foo;
}

https://www.typescriptlang.org/docs/handbook/interfaces.html

pboyer commented 7 years ago

They could also support inheritance via a similar mechanism to Go:

interface Solid {
   Geometry;
   Volume() : number;
}