This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-10
Channels
- # beginners (9)
- # boot (8)
- # calva (9)
- # cider (11)
- # cljs-dev (6)
- # clojure (21)
- # clojure-austin (1)
- # clojure-spec (55)
- # clojure-uk (24)
- # clojurescript (30)
- # cursive (1)
- # datomic (3)
- # defnpodcast (1)
- # emacs (3)
- # figwheel-main (9)
- # fulcro (8)
- # jobs-discuss (3)
- # nrepl (7)
- # pathom (8)
- # pedestal (4)
- # perun (4)
- # planck (79)
- # shadow-cljs (46)
- # sql (5)
- # vim (29)
does anyone know why Jetty would be serving a css page as text/plain? Or maybe something I am doing wrong in Hiccup? I am getting the following message in the browser:
Resource interpreted as Stylesheet but transferred with MIME type text/plain
@ryan.russell011 how do you have your app configured to serve resources (files)?
how might i go about writing a Clojure spec that restricts a map to only contain keys that are a subset of a superset of keys? for example, given valid keys #{:test/a :test/b :test/c :test/d}
, map {:test/a nil :test/c nil}
is valid.
hmm. looks like disallowing keys is not the right paradigm after all. https://stackoverflow.com/questions/38131252/forbidden-keys-in-clojure-spec
anywho i solved it with s/map-of
:
(s/conform (s/map-of #{:test/a :test/b} string?) {:test/a "test" :test/b "test" :test/c "test"})
=> :clojure.spec.alpha/invalid
🙂As you already discovered, that's not idiomatic. Clojure is mean to be open for extension -- and closed key maps run counter to that.