Elias Mårtenson
2017-03-14 14:20:42 UTC
In a discussion on the #lisp IRC channel recently, someone wanted to remove
a certain substring from a larger string. In Lisp, the solution is to
simply use cl-ppcre and remove by regex.
But, I started thinking about how to do this in APL, and this is what I
came up with:
RemoveSubstrings â {,/ âµ ââš â~âš/ (-â³âŽâº) °.✠ââºâ·âµ}
Is this a good way of solving the problem? I realise that I have a bug when
the resulting string is empty:
* "foo" RemoveSubstrings "foo"*
DOMAIN ERROR
λ1[1] λâ,/âµââšââŒâš/(-â³âŽâº)°.âœââºâžâµ
^ ^
Does anyone have a better solution?
Regards,
Elias
a certain substring from a larger string. In Lisp, the solution is to
simply use cl-ppcre and remove by regex.
But, I started thinking about how to do this in APL, and this is what I
came up with:
RemoveSubstrings â {,/ âµ ââš â~âš/ (-â³âŽâº) °.✠ââºâ·âµ}
Is this a good way of solving the problem? I realise that I have a bug when
the resulting string is empty:
* "foo" RemoveSubstrings "foo"*
DOMAIN ERROR
λ1[1] λâ,/âµââšââŒâš/(-â³âŽâº)°.âœââºâžâµ
^ ^
Does anyone have a better solution?
Regards,
Elias