How will the LISP developer solve the problem that AutoMapper solves in .NET?

those. state transfer from one object to another object that shares some (but not all) of the first members of the object.

I do not apply this question to any real problem, but, I think, I ask him to feel the differences between problem solving in LISP, as opposed to object-oriented languages ​​like C #.

+4
source share
2 answers

Just as an object is an instance of a class, a class is also an object that is an instance of the class (meta) of the class. You can give each of your classes a list of its slot definitions and compare the two lists to find common features. http://www.lisp.org/mop/concepts.html

+1
source

It is pretty simple.

You simply write a small function that looks at which slots feature classes (using the metaobject protocol) and copy their values. 10 lines max.

+1
source

All Articles