![]() What the documentation does not make clear, which is why I may have missed this functionality, is that when you essentially call a parameterized object (except you are not really calling it so much as just constructing an ordinary Prolog term) you get a pure value you can carry around and then send messages to, e.g.: :- object(circle(_Radius, _Color)). Again, though, I am welcome to hearing what I may be missing here. However, this does not seem like a good mechanism for creating instances of abstract data structures because it is not a pure and declarative operation in particular, the last thing that I want to do in a language like Prolog is to bring in the need to manually manage instances of data structures like I would have to do in an imperative language without garbage collection! So this is the source of much of my confusion because it seems like LogTalk is trying to make it easier to work with data structures but in practice it seems like it does so by turning Prolog into an imperative programming language. This makes sense if it should be viewed as creating a module, because it is a bit like asserting new clauses in the database. The reason for me saying this is that, assuming I understand the documentation correctly, creating a new object is inherently a side-effectful act. ![]() From it I get the impression that, rather than thinking of LogTalk as being about object-oriented programming, I should be thinking of it as being a system for writing composable modules, which makes a lot more sense.Īs for abstract data types, I agree that having a nice way to define them would be a boon, but I don't see how LogTalk really helps with this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |