In what language can a class member be dynamically changed at runtime?

I know that in Ruby you can dynamically add and change a class method at runtime. what about another language? what is C #, can any method be changed or added in this language and ... at runtime and dynamically?

+3
source share
5 answers

I think you are looking for prototype inheritance . A list of languages ​​is mentioned on the same wikipedia page.

There is the same question that you can look at.

+2
source

, # .

# 4.0 # - Expando object. , , ( , ) .

: .NET, VB.Net F #.

+2

, #, , , , ( ) .

foo.jump(42);

, foo , jump, .

# dynamic, , , , .

, , Ruby, ( ).

, JavaScript , , Ruby.

+1

Python - : Python:

Lisp : http://en.wikipedia.org/wiki/Common_Lisp_Object_System "CLOS , , , . CLOS " "( ), change-class. CLOS , ."

+1

# 4 , / .

0

Source: https://habr.com/ru/post/1762170/


All Articles