Problem
You want to convert an ASCII character to it’s ASCII (integer) value and back.
Solution
! ?x ! “x”[0] ! 120.chr
Discussion
Characters in their raw form (?x) are already in ASCII value form. To convert a particular character in a string instance to it’s ordinal value, simply access that character by index. To convert an integer into it’s ASCII character, simply call it’s chr method.
Contrast
Many C-flavored languages have ord and chr functions for converting back and forth. Perl, C, and BASIC come to mind.
Status: In Progress