This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # asami (2)
- # babashka (1)
- # beginners (31)
- # calva (11)
- # clj-together (3)
- # clojure (43)
- # clojure-europe (6)
- # clojure-norway (1)
- # clojurescript (14)
- # core-async (3)
- # core-logic (24)
- # cryogen (6)
- # datascript (2)
- # datomic (3)
- # fulcro (35)
- # honeysql (2)
- # hyperfiddle (12)
- # kaocha (3)
- # lsp (11)
- # off-topic (10)
- # pathom (2)
- # reagent (14)
- # releases (1)
- # sci (11)
- # shadow-cljs (27)
- # tools-deps (7)
Are there any conventions that exist for providing a library/program that has an API designed to be used in the REPL? Or any gotchas to be aware of? As far as I can tell the user just has to ensure the library is on the classpath, and then import it and work with it like any other function(s).
Hello, I am trying to setup my spacemacs configuration using the https://practical.li/spacemacs/. When I start spacemacs I get the following warnings.
Is this something I should fix? Any tips on what could I do to fix this? Many thanks Merry Christmas and happy new year to everyone.
Error (use-package): org/:config: Symbol's function definition is void: org-assert-version Error (use-package): ligature/:init: Symbol's function definition is void: ligature-set-ligatures Error (use-package): Cannot load ligature Error (use-package): org/:config: Symbol's function definition is void: org-assert-version Error (use-package): flycheck/:config: Wrong type argument: listp, t
I'll take a look and try replicate the error (Update: having carried out a package update and Spacemacs update I havent been able to replicate the error) In the mean time there is a troubleshooting guide at https://practical.li/spacemacs/install-spacemacs/troubleshooting.html
The errors may be from packages installed in an order that doesnt meet all their requirements (although usually these are only warnings, not errors), so a quick check is to restart Emacs after all packages have been installed. Some errors mention Ligatures, so it may be the font that is defined in the Spacemacs configuration is not installed. The practicalli/spacemacs.d configuration uses Fira Code which has ligature support. Check if Fira Code is installed or change the configuration to use an a Font that is installed on the operating system
FYI: there is also a #C09C8GRLY channel for future questions about using Spacemacs and an #C099W16KZ channel for more general Emacs questions
I John, I think that I have installed Fira Code font
I have updated the init.el from .spacemacs.d with as
fc-list | grep firacode ─╯ /usr/share/fonts/truetype/firacode/FiraCode-Bold.ttf: Fira Code:style=Bold /usr/share/fonts/truetype/firacode/FiraCode-SemiBold.ttf: Fira Code,Fira Code SemiBold:style=SemiBold,Regular /usr/share/fonts/truetype/firacode/FiraCode-Retina.ttf: Fira Code,Fira Code Retina:style=Retina,Regular /usr/share/fonts/truetype/firacode/FiraCode-Medium.ttf: Fira Code,Fira Code Medium:style=Medium,Regular /usr/share/fonts/truetype/firacode/FiraCode-Regular.ttf: Fira Code:style=Regular /usr/share/fonts/truetype/firacode/FiraCode-Light.ttf: Fira Code,Fira Code Light:style=Light,Regular
dotspacemacs-default-font '("Ubuntu Mono" :size 12.0 :weight normal :width normal)
I got the same warning, but no worries if these are only warning I will leave it and progress my learning 🙂
The doc string for
name defines a return value if the parameter is a string, symbol, or keyword. It promises nothing if the parameter is not one of those types.
When the doc string promises nothing, in some cases you may get something you don't like, e.g. an exception.
That is the case in general for all Clojure functions, not just
name -- if you call them with parameters that are not documented, all bets are off for the return value / behavior.
clojure typically handles nil inputs to functions well. in the case of
name it may be better that bad inputs throw, and in this case
nil is a bad input.
(symbol nil) should be ok input. I can imagine the case where you have a map of keys you expect to be strings or keywords, and one of the keys is
nil this is pretty common with output from
group-by and maybe it makes sense in your case to have (name nil) => "nil" you can do this via the
fnil function i believe.
I'm trying to build a personal blog site using Clojurescript. What would be some best practice to serve it? Could github page be an option?
I use GitHub pages for the https://practical.li/blog/ (using https://cryogenweb.org/) and all the books I've written. The main http://Practical.li page is a ClojureScript app created with figwheel and reagent, deployed to GitHub pages (using a GitHub actions workflow) If more dynamic storage should be needed, then GirHub pages for the build of ClojureScript code backed with https://firebase.google.com/ for dynamic state, e.g login account s, etc. (if GitHub pages is not enough)
If you need the backend to do something, any of the popular Clojure libs are fine. Personally, I like to use Pedestal (Jetty) and—as of late—Caddy as a reverse proxy (it used to be nginx).
Oh hey TIL you can use vectors instead of lists in
ns macro clauses:
I always thought it was weird that
(ns foo [:require [...] [...]] [:import (...)])
()with keyword verbs, since it is very unlike any other clojure code. It's usually always
()with symbols, or
with keywords, not
Yeah, the elements just have to be sequential so you can use either vectors or lists. But idiomatically: https://stuartsierra.com/2016/clojure-how-to-ns.html
@U06BE1L6T Yeah, I think I've seen them both disagree with
() there and if you look at modern code they've written, such as https://github.com/clojure/tools.deps/blob/master/src/main/clojure/clojure/tools/deps/extensions/maven.clj#L17-L28 it uses
. Although some of the older code in Clojure itself uses
() -- even for require/refer/exclude/etc.
I think that deps.edn is technically open, so other tools could potentially get things from deps.edn that aren't used by the deps CLI itself, however I believe <https://clojure.org/reference/deps_and_cli#_deps_edn> should cover the things that would be most cromulent to clojure itself
That page omits a lot of specifics about what each directive really is doing or exactly what all the directives are.
I'm left to infer things like how :exec-args interacts with :exec-fn - or how :main-opts interacts with :exec-fn among other things
<https://clojure.org/reference/deps_and_cli#_arg_map_keys> mentions the exec ones being tied to -X (and based on the tool section, I guess -T by extension) and main-opts being tied to -M
@U01188CHUFL this may be of use for understanding the deps.edn keys - https://practical.li/blog/posts/clojure-cli-tools-understanding-aliases/ and this for the execution options - https://practical.li/blog/posts/clojure-which-execution-option-to-use/