Philip A. Viton asked:
>       Has anyone come up with a way to pass equality-separated strings
>       (eg, ('a=2';'b=5')  or maybe for us ('a=.2';'b=.5'))?

Easy:

Welcome to J! (ctrl+d to quit) 4.05+GDS changes/Feb 16 2008/19:19:49

   foo =: verb define
        a=.0  [  b=.0  [  c=.1          NB. default values
        ".@> y.                         NB. actual parameters
        (a + b) * c
)

   foo 'a=.2';'b=.5'
7

Variations could use:
        0!:100  >y.
        ".;._2 y     NB. for passing  'a=.5; b=.10;'

Not that I'm really advocating this scheme.  In J, you don't have
the safety net of a compiler which catches typos in parameter names
(as, say, Ada compilers would do).

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

Reply via email to