It's better to define functions in the form "F from G" rather than "G to F", because then the argument and result would be adjacent to the function whose domain/range they are in:
f =: FfG g f =: GtF g On Wed, Nov 2, 2011 at 1:32 AM, Alan Stebbens <[email protected]> wrote: >> How would one parse a hex string back to an integer? > > Two ways: > > Hard way: > > H2D =: [: +/ 16 1 * '0123456789abcdef' I. ] > H2D 'A0' > 160 > > Easy way: > > h2d =: d2h ^:_1 > h2d 'a0' > 160 > h2d d2h i.20 > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
