Character codes: Difference between revisions

Added LFE example
(Added LFE example)
Line 432:
'a ord . # 97
97 chr . # a</lang>
 
=={{header|LFE}}==
In LFE/Erlang, lists and strings are the same, only the representation changes. For example:
<lang lisp>
> (list 68 111 110 39 116 32 80 97 110 105 99 46)
"Don't Panic."
</lang>
 
As for this exercise, here's how you could print out the ASCII code for a letter, and a letter from the ASCII code:
<lang lisp>
> (: io format '"~w~n" '"a")
97
ok
> (: io format '"~p~n" (list '(97)))
"a"
ok
</lang>
 
=={{header|Liberty BASIC}}==
Anonymous user