[Prev][Next][Index][Thread]

Re: Char To ASCII



In article <XhCy4.374$SRc1.1507367@news.xtra.co.nz>, "Brett Sheeran"
<bsheeran@xtra.co.nz> wrote:

> Can anyone tell me the syntax to convert a <character> to an ASCII value &
> visa versa?

All type conversion in Dylan follow a standard pattern, using the "as"
generic function:

   as(<character>, 65)    =>  'A'

   as(<integer>, ' ')     =>  32

The "as" generic function is open -- you can add your own conversions to
it for your own types.

See <http://www.gwydiondylan.org/drm/drm_101.htm#HEADING101-16>

-- Bruce



Follow-Ups: References: