Define a primitive data type: Difference between revisions
m
→{{header|Sidef}}: minor code improvements
m (→{{header|Sidef}}: simplified example) |
m (→{{header|Sidef}}: minor code improvements) |
||
Line 1,463:
method AUTOLOAD(_, name, *args) {
var
}
}
#
##
#
var a = MyInt(2) # creates a new object of type `MyInt`
Line 1,481:
say a.as_hex.dump # => "9" -- an hexadecimal string
a -=
say c # => 9
say c.class # => MyInt
a
say a+b # error: class `MyInt` does not match MyInt(12)</lang>
|