Anonymous user
Talk:Character codes: Difference between revisions
shorten verbs
mNo edit summary |
(shorten verbs) |
||
Line 11:
One such predicate might be "is the input literal?", and so the full solution might look like:
isLiteral =. 2
cc =: {&a.^:(_1^isLiteral)
But this, too, has its limitations. For example, it still doesn't address Unicode. While I don't know enough about Unicode to be confident that it covers every case, we might make this more general (and longer), with:
isLiteral =.
cc =: (8 u:
But since the task doesn't require handling Unicode, either verb will suffice. Both are symmetric, and both have the satisfying property of being self-inverse (obviously), so that <code>cc^:2</code> is the identity, and <code>-: cc^:2</code> a tautology.
Line 23:
--[[User:DanBron|DanBron]] 21:31, 5 January 2009 (UTC)
:PS: If we make this change, my personal preference is that we give the solution(s) succinctly, as <code>{&a.^:(_1^2=3!:0)</code> or <code>(8 u:4 u:])^:(_1^
|