There is also a resistant bug in  the linear representation that might be 
important to (tacit) adverbial programmers; see 
http://www.jsoftware.com/pipermail/general/2009-August/033231.html

________________________________________
From: programming-boun...@jsoftware.com [programming-boun...@jsoftware.com] On 
Behalf Of Ian Clark [earthspo...@gmail.com]
Sent: Tuesday, January 03, 2012 10:18 PM
To: Programming forum
Subject: Re: [Jprogramming] Turning verbs to and from strings

Yes, that's my understanding about 5!:5 too.

> Am I missing something important?

Yes you are missing something important ...to me.

I guess you're puzzled by repnoun in:

repn=: 3 : 0
        NB. Re-inputtable represn of item (y)
if. 'NB.' -: 3{. y do. y return. end.   NB. output a comment as-is
select. t=. >type y
case. 'invalid name'    do. y repnerr t
case. 'not defined'     do. y repnerr t
case. 'noun'            do. repnoun y
case. 'adverb'          do. 5!:5 <y
case. 'conjunction'     do. 5!:5 <y
case. 'verb'            do. 5!:5 <y
case. 'unknown'         do. y repnerr t
end.
)

repnoun is a sort of plugboard to help me quickly slot-in a special
treatment without need for debugging or side-effects. In the untouched
cases (most of them, in fact) it falls back on: cr -which is just a
cover for 5!:5 .

Why?

I generate a lot of scripts with Lobrow, intended for hand-editing,
and I now-and-then encounter cases where 5!:5 gives IMO an unhappy
result, which I fix-up on-the-fly.

For instance:

   zz=: 'alpha',LF,'bravo',LF,'charlie'

   5!:5 <'zz'
97 108 112 104 97 10 98 114 97 118 111 10 99 104 97 114 108 105 101{a.

But...

   repnoun 'zz'
}: 0 : 0
alpha
bravo
charlie
)


On Mon, Jan 2, 2012 at 4:50 PM, Raul Miller <rauldmil...@gmail.com> wrote:
> I believe that
>
>   name,'=: ',5!:5 <name
>
> should give a definition for any valid name which is suitable for use
> in a script file.
>
> The deficiencies I am aware of for 5!:5 have to do with using its
> result as an argument for (".)
>
> When I looked at your code to see what you were not using 5!:5 for, I
> see that you are not using it for nouns.  But I believe that all bugs
> involving 5!:5's treatment of nouns have long since been fixed.
>
> Am I missing something important?
>
> Thanks,
>
> --
> Raul
>
>
>
> On Sun, Jan 1, 2012 at 7:33 AM, Ian Clark <earthspo...@gmail.com> wrote:
>> If you're writing your own IDE for J, then see sample code at:
>>  http://www.jsoftware.com/jwiki/IanClark/LoBrow
>>
>> LoBrow makes a legible char array from not just an explicit verb but
>> any J word. To do that it handles each case separately. See the verb:
>> repn (which mainly uses 5!:5), called by: item2panel.
>>
>> But the reverse operation, broadly comparable to []FX, is done using
>> 0!:111 -which works for everything. Provided you handle your
>> "character matrix" as a LF-separated string.
>>
>> Or 0!:110 if you don't want it to display in the session window.
>>
>> On Sat, Dec 31, 2011 at 3:50 PM, Blake McBride <bl...@mcbride.name> wrote:
>>> Greetings,
>>>
>>> More than 25 years ago I wrote an IDE for APL.  At the core what I did
>>> (which I don't remember how now) is that I executed something to turn
>>> an APL function into a character matrix.  I would then edit it with me
>>> IDE editing facility.  When I saved the edited function it would turn
>>> the edited character matrix back into a function (was that quad FX?).
>>>
>>> I also used this ability (to turn an APL function to and from a
>>> character matrix) to write programs that generated other functions.
>>> This was very nice.
>>>
>>> This leads me to my question - how can I turn a J verb into a
>>> character matrix, and how can I turn a character matrix back into a
>>> verb?
>>>
>>> Thanks!
>>>
>>> Blake McBride
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to