1/3/2023 0 Comments Duck typing![]() ![]() ![]() When you're talking about type systems, "dynamic" really doesn't make much sense to talk about. It's interesting as a development away from inheritance and towards composition and loose coupling of static program components. Golang furthers the notion of capabilities as shared method signatures, by loosely binding this into interfaces, and enforcing many errors by static type checks at compile time. Errorhandling thus delegated almost entirely to runtime beyond basic syntax parsing. Thus, you could dynamically invoke any object with any methods, without regards to compile-time constraints or "types". It's not unheard of monkey patching Integer or Array classes, core parts of standard library and language. you can modify behaviour of almost all classes/objects by adding/removing methods, mixin, etc. With ruby, most everything you interact with is a true object, ie. ![]() Duck typing as a concept was re(?)-popularized around the advent of ruby, so might make sense to talk from a ruby perspective: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |