> Date: Mon, 5 Nov 2007 16:19:16 -0500
> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: Re: [Jprogramming] My first adverb - doesn't work!
>
> I think the "x" and "y" confuse it. Try
> CHAR=: 1 : '(a. i. [) u a. i. ]'
>
'z' CHAR> 'a'
|syntax error: CHAR
| (a.i.[)u a.i.]
> On 11/5/07, Richard Donovan wrote:
>>
>>
>> I want an adverb that will convert 1-byte-characters to their numeric
>> equivalent then operate the verb on them. For instance I want to be able to
>> easily test 'c'> 'a' or '5' < '6' which gives domain errors (although 'c'
>> = 'c' does not!)
>>
>> So I wrote this adverb:
>>
>> NB. adverb that converts characters
>> NB. into their numeric equivalents
>> NB. then operates the given verb on them
>> NB. e.g. 'z'> CHAR 'a'
>> NB. should return 1
>>
>> CHAR =: 1 :0
>> t1=: a.i.x
>> t2=: a.i.y
>> t1 u t2
>> )
>>
>> but...
>>
>> 'z'> CHAR 'a'
>> |domain error
>> | 'z'>CHAR'a'
>> t1
>> 33
>> t2
>> 97
>> t1{a.
>> !
>> t2{a.
>> a
>>
>> I am missing something obvious (again!)
>> _________________________________________________________________
>> Feel like a local wherever you go.
>>
>> http://www.backofmyhand.com----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
>
> --
> Devon McCormick, CFA
> ^me^ at acm.
> org is my
> preferred e-mail
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
_________________________________________________________________
Feel like a local wherever you go.
http://www.backofmyhand.com----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm