##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: August 2016 # Modified: 2016-10-03/22:36-0400 ##+ # # abstract.icn, demonstrate an abstract method declaration # class animal(tag, position) # all animals conceptually move by changing position method moving(d) position +:= d write(tag, " moved to ", position) end # a generic animal needs a specific way of speaking abstract method speak(words) initially position := 0 end # the dog class class dog : animal(tag) method speak(words) write("bark? woof? grr? eloquent soliloquy?") end end # create a dog, move it and ask it to speak procedure main() fido := dog("fido") fido.moving(4) fido.speak() end