Pierre Neidhardt <[email protected]> writes: > Nope, the current function only forces "Type" (the only mandatory > field), everything else is omitted unless the key is explicitly set by > the user. This is because I looped over ALL-ARGS (the #:rest argument) > and I force-added #:type to it.
Oh, true. I stand corrected. > I did not implement the full specs simply because I decided to draw an > arbitrary line between short code, convenience and completeness. This > is debatable of course and maybe a simple type-checking would not cost > much. I was thinking about a match against key before (match value ...), which would then match value against a chosen predicate, and return an error if it doesn't match. - If key is either :no-display, :hidden, :d-bus-activatable, :terminal, or :startup-notify, predicate should be `boolean?'. - If it is :type, :version, :try-exec, :exec, :path, :startup-wm-class, or :url, it should be `string?`. - If it is :only-show-in, :not-show-in, :actions, :mime-type, :categories, :implements, it should be a string or a list of strings only. - If it is :name, :generic-name, :comment, :icon, :keywords, it should be a a string or an alist. - If key is anything else, it should be an error, because it is a typo. I realize that we don't need numbers actually. > Supporting the full specs would require a significant amount of work > however. Possibly, but we do not need more than this simple value type checking. >> The docstring may explain that, e.g., compound :mime-type key becomes >> MimeType. > > Hmm, OK but why? The procedure produces the expected behaviour with > #:mime-type, is there anything else to clarify? As a packager, I need to know what key is going to produce StartupWMClass (note that :startup-wm-class produces, StartupWmClass, if that matters), or DBusActivatable. Unless I'm missing something, it is not obvious from the docstring. WDYT?
