Common Lisp Tutorial 8f: Functional Programming (more lambdas)

preview_player
Показать описание
In this video I use lambda functions to build what is a very small object system!
Рекомендации по теме
Комментарии
Автор

These videos are great. I'm really enjoying this series and it's perfect timing for me, as I had recently started teaching myself CL.

bmcg
Автор

mm, it should be straight-forward enough to add inheritence by injecting a parent object in the constructor and delegating to that if the current project doesn't have a property.

i'd probably try that by returning a function (lambda (command value)) which wraps a cond expression with tests like (equal? command 'get-name) and (equal? command 'set-age) etc. with the default clause being (parent-object command value), or if you want immutability it would be something like (t (person name age (parent-object command value))).

maybe that's what you do in the 3rd installment of lambdas! i haven't watched it yet :)

EdouardTavinor
join shbcf.ru