> determine the value of the digit. Wait; forget the loop. I should use a
> goto. ...
Loops are just syntactice sugar. The original APL
notation did not have loops and used an intelligent goto ->.
But you can go even lower than that: the state machine.
Speaking of which, regex is a good choice for
arbitrary kind of input format. Especially, the richer PCRE.
Recently I employed regex for a simple plug-in mechanism:
given a file name, load it, identify class name in it
and run the instance (the Animate script).
It could be taken even further: given a folder,
locate files, classes and descriptive names in them.
--- Dan Bron <[EMAIL PROTECTED]> wrote:
> Raul D Miller wrote:
> > 99 ;@(".&.> ;:) '123 123x bad_number'
> > 123 123 99
>
> 99 ;@(".&.> ;:) '123 123x #VALUE!' NB. I love Excel
> 123 123 99 99 99
>
> Yes, of course, I can improve the solution. That's my job as a programmer.
>
> But if I have to handle all these details, what's the point of using a
> high level language like J? I might as well start with:
>
> (#&10@:# #. '0123456789'&i.) '123'
> 123
>
> and build up from there. Or, better yet, forget about #. and i. and
> use an explicit loop over the characters in y. and a select statement to
> determine the value of the digit. Wait; forget the loop. I should use a
> goto. ...
>
> -Dan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm