Define a primitive data type: Difference between revisions

Content added Content deleted
m (Added the Sidef language)
m (→‎{{header|Sidef}}: improved example)
Line 1,441: Line 1,441:
say a.to_hex; # => "0x9" -- an hexadecimal string
say a.to_hex; # => "0x9" -- an hexadecimal string


say a+b; # error: Invalid value '15'; must be between 1 and 10</lang>
a -= 7; # a=2
say (a + b); # => 8 -- the result of (2 + 6)

a += 4; # a=6
say a+b; # error: Invalid value '12'; must be between 1 and 10</lang>


=={{header|Tcl}}==
=={{header|Tcl}}==