Abstract type: Difference between revisions

Content added Content deleted
Line 111: Line 111:
There is no constructor for the class. However to prevent the class ever being associated with an instance it suffices to force the validator to fail.
There is no constructor for the class. However to prevent the class ever being associated with an instance it suffices to force the validator to fail.
<lang python>class Stack()
<lang python>class Stack()
def !valid?(object) nil</lang>
def !valid?(object) nil
tag Stack some-object ; always fails</lang>



=={{header|Haskell}}==
=={{header|Haskell}}==