ForNext
Only Do What Only You Can Do
166. define exception
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
none
PHP
class Bam extends Exception { function __construct() { parent::__construct("bam!"); } }
Python
class Bam(Exception): def __init__(self): super(Bam, self).__init__('bam!')
Ruby
class Bam < Exception def initialize super("bam!") end end