In my waiting-for-people-to-leave-so-I-can-get-into-classrooms time at work I wrote a roman numeral translator in Factor. It’s a bit different from your normal implementation as Factor’s parser actually does almost all the work: USING: strings parser kernel words sequences math ; : NUMERAL: CREATE dup reset-generic dup t “parsing” set-word-prop parse-definition \ parsed add define-compound ; parsing [...]
-
Home > factor