@alwalo the second line should be replaced by the last one, that resolves the INDEX ERROR. if WS FULL, it could be your MAXWS isn't large enough, mine is set at 512M. (Unlike J which can dynamically allocate memory via malloc, APL has to decide the max amount of memory available when the program startup)
but iterating over the entire set sounds a little wasteful, and as much as this is only a small problem, more important problems occur when i try to compute the value of this function for a larger m
for 1626, the function should return 11
meanwhile it DOMAIN ERRORs, because it goes through the entire range unnecessarily
that's like, 1615 values computed unnecessarily and it errors to top it off
is there an relatively elegant and relatively fast way to do short-circuiting here?
Or if you know roughly how large m can be at max, you can construct a vector of 2^r-r-1 for up to some hardcoded r, and just do binary search on it in the function
Also I have written some APL solutions to hamming code problems on CGCC, might worth checking it out
For how to invoke dyalog with custom parameters, reference "Dyalog for Microsoft Windows Installation and Configuration Guide.pdf" even you are not using Windows.