On Mon, Jun 1, 2009 at 10:58 PM, Mike Powell <[email protected]> wrote:
> Is it too late to debate this? Or has the concrete truly set?

I prefer ascii, but if you just want to replace some symbols, you
don't really need to change the j kernel for that.  Try the following
J script.

NB. string replacement verb stolen from
http://www.jsoftware.com/jwiki/Essays/Substring+Replacement
replace=: 4 : 0
 'p q'=. y
 j=. p nosindx x
 if. ''-:j do. x return. end.
 d=. p-&#q
 k=. (j+(0>.-d)*i.#j)+/i.#q
 select. *d
  case.  1 do. (0 (j+/(#q)+i.d)}1$~#x) # q k}x
  case.  0 do. q k}x
  case. _1 do. q k} (0 (d{."1 k)}1$~(#x)+(#j)*|d) #^:_1 x
 end.
)
nosindx=: 4 : 0
 s=. x i...@e. y
 i=. s I. s+#x
 (i.&_1 {. ]) (s,_1) {~ (i,_1) {~^:a: 0
)
apltable=: ('Ă';' * '),('ĂŽ';' i. '),:('á';' % ')
apltrans=: 3 :'>replace~/&.>/ (<"1 apltable),<y'
apl=: 3 :'0!:101 apltrans 0 :0'
apl 0
1+(Î10)á2
)
exit 0

There might be complications if you want to reassign the meaning of a
symbol J already uses, like * , or when an apl symbol doesn't
correspond one-to-one to a J symbol, eg. apl / has to be replaced
sometimes with / and sometimes with # though you may be able to fix
that with user-written functions that emulate the apl slash.

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

Reply via email to