benknoble / frosthaven-manager

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

Improve formatting of enum values #93

Closed benknoble closed 1 month ago

benknoble commented 2 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