Recent site activity

A structured point

Next we are going to develope a class which is the next step in our hierarchical system. We will write the prototype for a class which describes a structured point. Initially we must decide whether such a class will contain the abstract class Nothing, or will be derived from it. In this instance I will use the inheritance mechanism supported by Python. Sometimes it may be more efficient to merely contain an instance of another class, sometimes it is more efficient to inherit characteristics from a super-class. It is often a matter of taste. The most important thing is to move forward, and since we are using two languages, in terms of two natural languages, we can move at great speed. We will name our classes Point and Ponc. In this instance they will be derived from their respective super-classes Nothing and Tada, so we must firstly import the super-class prototypes. We will also write two very simple scripts so that you can test them. Note that for the Irish versions of classes and methods, I will omit the sínte fada from the code, we can build this in later.

The initial classes do nothing, except to import the prototypes of their super classes. Please note the the Irish language versions are not working properly yet. Try and run it anyway, and you will see that you will get an error, in relation to language encoding. This is due to my use of the sínte fada, the signifier of a long vowel in Irish, in some of the comments. A similar error will happen when you adapt the scripts to your own language. We will deal with that later. The English language versions do work. So let's examine them.

Run the script, structured_point_examination_1.py. It prints out the documentation string of the class Point.

Now in debugging mode, run the script until just before the print statement, and examine the instance variable point. You will notice that there is also a classobj type, this is the class definition of Point. If you don't know how to use the debugger in your Python environment, I strongly urge you to find the relevant information and run through some examples. It is where we can really quickly develop our understanding of both Python and Real Space Geometry.

That's enough for the moment. We will continue later with more development. I will resolve the issue regarding encoding, and examine the Irish version of our class structure. You might be interested in developing a similar approach in your own language. If your principle language is English I would suggest that you try another language, perhaps Latin or Greek. Both of these would be very usefull in our work.

One final point is to ensure that all the scripts are in the same folder or directory for them to work. We will also create a hirearchical folder structure for our class library.

So,

slán bháile

Attachments (6)

  • aicme_fod.py - on 2 Oct 2008 07:11 by Unknown user (version 1)
    1k Download
  • foundation_class.py - on 2 Oct 2008 07:11 by Unknown user (version 1)
    1k Download
  • ponc_greasain_1.py - on 2 Oct 2008 07:11 by Unknown user (version 1)
    1k Download
  • ponc_greasain_scrudu_1.py - on 2 Oct 2008 07:12 by Unknown user (version 1)
    1k Download
  • structured_point_1.py - on 2 Oct 2008 07:12 by Unknown user (version 1)
    1k Download
  • structured_point_examination_1.py - on 2 Oct 2008 07:12 by Unknown user (version 1)
    1k Download