3 ms·
As someone who is not exactly in the know about this subject: is there a cleaner way to write this stuff, or is that the usual way to do it? (I can write nasty
by koenigdavidmj 16y ago
As someone who is not exactly in the know about this subject: is there a cleaner way to write this stuff, or is that the usual way to do it? (I can write nasty Perl, but choose to write pretty Perl, because I like my job. What would an APL user do?)
- klettow 16y agoBy cleaner, do you mean more verbose? For example, the well known phrase for average in J is (average=: +/ % #). You would have no problem assigning names to the parts of the function, i.e. (sum=: +/), (divide=: %), (tally=: #) and defining the function as (average=: sum divide tally). It is tempting to learn J this way, but once you are familiar with the primitives, it makes more sense to just use them. You can pack a lot of thought into very few character, which is one of J's strengths.