[Jprogramming] Feedback on beginner's code

Adam Tornhill adam at adamtornhill.com
Sun Mar 13 15:21:15 UTC 2016


Hi all,
I finally decided to try to understand this fascinating language. So far I've spent some evenings reading and experimenting with the language. J is fun. Real fun. I also like how J forces me to re-consider how I view programming. Of course, that also means I'm still at a complete beginner's stage, so I'd like to ask for some feedback and suggestions on my first J code. I'm sure there's a lot I can simplify in my code.
Here's the code I put together by digging around in the J Dictionary:
isAnagramOf=:(0:`((*/)@(=&((/:~@tolower)@(' ' & i.#])))))@.(=&(#@:(' ' & i.#])))

Some examples: 
  'Nag a Ram ' isAnagramOf 'Anagram'1
   'ab' isAnagramOf 'aa'0
All tips and hints on both the code and learning J in general would be much welcome.
Thanks!/Adam--  Homepage: www.adamtornhill.com  Twitter: @AdamTornhill 
Your Code as a Crime Scene: https://pragprog.com/book/atcrime/your-code-as-a-crime-sceneLisp for the Web:  https://leanpub.com/lispwebPatterns in C: https://leanpub.com/patternsinc


More information about the Programming mailing list