libera/#commonlisp - IRC Chatlog
Search
13:26:39
gin
I have been away from this channel for sometime but I haven't stopped learning CL. I think all the effort is finally paying off. I have a small collection of personal tools all written in CL.
17:31:01
alcor
if the data is indeed "just data" then a struct is probably is arguably a better choice than either
17:31:25
_death
it's a pretty general question and I'm inclined to say "it depends".. but then, I think in most cases you should use the most convenient internal representation for your program, and think of the json external data as just something to be translated into this internal representation
17:33:43
alcor
Although I must say, I'm not really a fan of the "anemic data model"-school of design i.e. https://www.martinfowler.com/bliki/AnemicDomainModel.html, especially not in CL. CL has a powerful object model. You can easily have proper domain objects with useful behavior.
17:57:35
beach
A standard class is usually the most convenient choice. The semantics of structs are not so great, and they don't allow multiple inheritance.
17:57:57
beach
mi6x3m: Careful with terminology. Every Common Lisp object is an instance of a class.
18:06:54
mi6x3m
i think i'll just go ahead with a alist / plist thing with semantically processed data
18:17:22
edwlan[m]
e.g. instead of using (cdr (assoc 'foo...)) all over you should typially use a function called FOO that hides that implementation detail