So i was thinking about pylog yesterday. I still haven't had time to really figure it out yet, but the idea of having bindings for a logic programming language really intrigues me. In particular I had an idea for an application for it.
Lets say i have a map class which is a 2d array of tiles, and each tile stores information about the map at the location: height, terrain, etc. I might have another class called cartographer which does stuff with the map class but unfortunately the cartographer and the tile class are interlinked. If i want the cartographer to give a certain tile a color, I would have to make a color field in the tile class.
Now obviously the solution is to have a space that can be written to in some notation (maybe xml,yaml) and then be reinterpreted by the cartographer class. This of course isn't done because its not practical and not a really common feature of any language i can think of.
But wouldn't it be really cool if these spaces for writing were actually little spaces of logic programming who all used common rules. Im not sure that this is the right encapsulation, but it would be fun.
ps. i need new hobbies for doing in class.
Mar 16, 2009
Mar 14, 2009
something i just thought about
Ive recently hit upon something about programming. There are two different kinds of objects that don't represent a data structure:
Most objects written by programmers have only one intended meaning. I could for example create a height class which would allow me to add heights and the embedded semantics of the operations would prevent me from adding height and apples together.
Whats interesting is creating classes of the first type and then being asked what the class is for.
- Generic objects with multiple possible meanings
- Concrete objects with only one intended meaning
Most objects written by programmers have only one intended meaning. I could for example create a height class which would allow me to add heights and the embedded semantics of the operations would prevent me from adding height and apples together.
Whats interesting is creating classes of the first type and then being asked what the class is for.
Subscribe to:
Posts (Atom)