Luhn, again
USING: combinators.short-circuit.smart kernel math math.parser rosetta-code.luhn-test sequences sets unicode ;
: ex-luhn? ( str -- ? )
" " without
dup {
[ length 2 < ]
[ [ digit? ] all? not ]
} || [ drop f ] [
string>number luhn?
] if
;
Luhn, a third time
USING: combinators.short-circuit.smart kernel math sequences sets unicode validators ;
: ex-luhn? ( str -- ? )
" " without
dup {
[ length 2 < ]
[ [ digit? ] all? not ]
} || [ drop f ] [ luhn? ] if
;
I'll just second the suggestion that KDE Plasma is worth a try, as it's very adaptable once you know what you want. You don't need to install any addons for the functionality you describe, just open the Shortcuts settings, KWin category, and have at it.