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

Re: Char To ASCII



On Sun, 12 Mar 2000, Bruce Hoult wrote:
> 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

Note that, although this is probably portable across all current
implementations, there's no *DRM-conformant* way to do this.  The DRM
specifies that methods from <character> to <integer> and back exist but
leave the behaviour undefined: they could use, say, EBCDIC and still be
compliant ;-)  Dylan really needs a better story about characters,
particularly Unicode ... 

-- Hugh




Follow-Ups: References: