• Io talk:

    • Every thing is an object
    • Every interaction is an object
    • Types are declared using uppercase names
    • Instances are declared using lowercase names
    • Objects remember their prototypes
    • Objects have slots to hold data
    • Messages either invoke methods, or return the contents of a slot
    • When an object doesn’t respond to a message it passes that message onto it’s prototype
    • Singletons
    • Defining operators
    • Redefining core methods
  • Objects are containers for things:

    • numbers: 1, 2, 4, 8
    • strings of text: "this is a string"
    • booleans: true, false
    • lists of objects: list(1, 2, 3, 4), list(true, false)
  • When you want to interact with an object, you ‘pass’ it a message, in Backus Naur form: <Object> ::= <Object> <Message>, or a little less abstract… `Io> Object slotNames

  • In general you use uppercase names for objects that you’ll use as a template or class. E.g. Vehicle := Object clone, gives you an object called Vehicle with type Vehicle. These are meant to be abstract things: generalisations, or abstractions. If you want a concrete object to do something, for example a ferrari you can use ferrari := Vehicle clone which gives you an object ferrari, with the type Vehicle (as we used a lower case name, a new type isn’t defined).

  • Objects have slots where you put data, this is like an object within an object:

    Vehicle := Object clone
    Vehicle x := 0
    Vehicle y := 0

    So Vehicle has 2 slots: x, and y.

  • Slots can be accessed by passing the name of the slot as a message to Vehicle. For example: Vehicle x yields 0.

    {"cards":[{"_id":"36fba09105610d05a200001a","treeId":"36fba08505610d05a2000017","seq":828149,"position":1,"parentId":null,"content":"Io talk:\n------\n* Every *thing* is an object\n* Every *interaction* is an object\n* Types are declared using uppercase names\n* Instances are declared using lowercase names\n* Objects remember their prototypes\n* Objects have slots to hold data\n* Messages either invoke methods, or return the contents of a slot\n* When an object doesn't respond to a message it passes that message onto it's prototype\n* Singletons\n* Defining operators\n* Redefining core methods"},{"_id":"36fba86805610d05a200001b","treeId":"36fba08505610d05a2000017","seq":1,"position":1,"parentId":"36fba09105610d05a200001a","content":"Objects are containers for things: \n* *numbers: `1, 2, 4, 8`*\n* *strings of text: `\"this is a string\"`*\n* *booleans: `true, false`*\n* *lists of objects: `list(1, 2, 3, 4), list(true, false)`*"},{"_id":"370817aad6920103a200000e","treeId":"36fba08505610d05a2000017","seq":1,"position":1,"parentId":"36fba86805610d05a200001b","content":"Objects have slots where you put data, this is like an object within an object: \n```\nVehicle := Object clone\nVehicle x := 0\nVehicle y := 0\n```\nSo Vehicle has 2 slots: `x`, and `y`.\n\n"},{"_id":"36fbd46505610d05a200001f","treeId":"36fba08505610d05a2000017","seq":1,"position":1.5,"parentId":"36fba09105610d05a200001a","content":"When you want to interact with an object, you 'pass' it a message, in Backus Naur form: `<Object> ::= <Object> <Message>`, or a little less abstract... `Io> Object slotNames"},{"_id":"3708227cd6920103a200000f","treeId":"36fba08505610d05a2000017","seq":1,"position":1,"parentId":"36fbd46505610d05a200001f","content":"Slots can be accessed by passing the name of the slot as a message to `Vehicle`. For example: `Vehicle x` yields `0`."},{"_id":"36fbd3c405610d05a200001d","treeId":"36fba08505610d05a2000017","seq":1,"position":2,"parentId":"36fba09105610d05a200001a","content":"In general you use uppercase names for objects that you'll use as a template or class. E.g. `Vehicle := Object clone`, gives you an object called `Vehicle` with type `Vehicle`. These are meant to be abstract things: generalisations, or abstractions. If you want a concrete object to do something, for example a `ferrari` you can use `ferrari := Vehicle clone` which gives you an object `ferrari`, with the type `Vehicle` (as we used a lower case name, a new type isn't defined)."}],"tree":{"_id":"36fba08505610d05a2000017","name":"Io","publicUrl":"36fba08505610d05a2000017"}}