benknoble / frosthaven-manager

GUI Frosthaven Scenario Manager
https://benknoble.github.io/frosthaven-manager
Other
11 stars 3 forks source link

Improve formatting of enum values #93

Closed benknoble closed 5 months ago

benknoble commented 7 months ago

The current formatting is fine for developers, but the app should show nicely formatted values like "Axenut" and "+ 1."

I imagine a simple implementation of the following macro(s):

(define-constant-formatter-parser
  conditions
  ["Impair" impair] …) ; expands to =>
(define-constant-formatter
  conditions
  ["Impair" impair] …)
; and
(define-constant-parser
  conditions
  ["Impair" impair] …)
;; binds: conditions-formatter, conditions-parser, conditions-formatter-parser (unhygienic!)
;; provide an operation that takes one of those values and can run the parser (resp. formatter)
;; should the "operations" be macros, and I could bind "conditions" in different spaces instead?
;; -> that might be nicer as long as there is a provide macro