In the pseudocode guide for my syllabus, an example of a record data type is given as below:

TYPE Student
    DECLARE Surname : STRING
    DECLARE FirstName : STRING
    DECLARE DateOfBirth : DATE
    DECLARE FormGroup : CHAR

However, for enums and pointers it gives the following examples:

TYPE Planet = (Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune)

TYPE Pointer = ^<Type name>

There seem to be 2 inconsistencies here: the lack of the opening/closing "tag" structure from the record type, and also the use of equals signs in the enum and pointer examples.

I'n not sure if there is a conceptual difference between these types of types which explains the difference, of if it is due to an oversight on the writers of the guide.

Could someone please clarity this for me and explain the conceptual difference if there is one?

  • 1
    $\begingroup$ We can only guess the intent of your teacher. You should ask them. $\endgroup$ – Raphael Jan 20 at 10:31
  • $\begingroup$ FWIW, I think Student is a "record" whereas Planet is an "enum". Pointer seems to be a mix of definining syntax and a type with a type parameter; I'm not convinved by that choice of notation. $\endgroup$ – Raphael Jan 20 at 10:32
  • $\begingroup$ It's the official pseudocode guide for the course. Not a teacher's idiosyncrasy $\endgroup$ – Robin Jan 20 at 10:39
  • $\begingroup$ And who do you think wrote this guide? $\endgroup$ – Raphael Jan 20 at 12:25
  • 1
    $\begingroup$ If the specific publication is that relevant, please give a proper reference in your question. That being said, all teaching material is written by teachers who are humans with opinions, tastes, and who can make mistakes. Generally, nothing is more dangerous in higher learning than assuming your teacher is infallible. As such, questions of this type are hard to answer: there is no single truth about notation, and nobody but the original author can really know their intent. $\endgroup$ – Raphael Jan 20 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.