Hello, I have never been able to get Clojurescript examples to work properly when I try them. The defaults seem to be broken. For example, I tried following the instructions here (https://clojurescript.org/guides/quick-start) and the first repl page is broken. The error I get is goog.require could not find: cljs.pprint. The webpage just says "Item1". What am I missing?
The main Clojurescript repl page appears for a short moment, then disappears.
The problem is replicated whenever I reload the page. I am using Firefox on the most recent version of Mint Linux.
Where does Item1
come from?
I'm not sure. It's not in any of my source files.
I think Clojurescript is using files from a completely different directory.
If you follow all the directions up to the point of executing the first clj
command - does it work correctly?
Curiously, it flashes the screen that I'm supposed to see for a fraction of a second, and then it switches to something else.
I think that clojurescript is executing an old clojurescript file from a completely different project.
That's some very bizarre hidden state.
I don't think your setup is correct.
Try creating a project from the ground up. Just in case, make sure there's nothing in ~/.clojure/
. Clear the browser cache.
that's curious because this project was from the ground up. I'll check the cache.
I'm going to delete the old project and try again.
Deleting the old project solved the problem.
thank you!
Hi all! I am currently writing tests for some cljs functions used in a Fulcro app. The result of a certain function is:
({:id :app.client/buttonchange1, :states (:initial :state/state1 :state/state2), :active-state :state/button1} {:id :app.client/buttonchange2, :states (:initial :state/button1 :state/button2), :active-state :initial})
How should I define an expected result in this case?
Just making a def and pasting this result doesn't work as the :states won't show using ()
@dmaltbie Did you mean to ask in this particular thread or in #clojurescript?
yes. i miss-placed it. I'll move it over. thanks.
Are you using just ()
or '()
?
Using it without quoting is the same as (get {...} {...})
.
Also note that in Clojure (= [...] '(...))
if both ...
are the same.
This helps, Thanks! Pretty new to cljs 🙂
Just to make my second statement clear - it's only like that for maps and keywords. Because they're both callable via implementing IFn
and their invoke
implementations work like get
.
(something ...)
just invokes something
on ...
when evaluated. something
can be anything, not just a symbol.
Team, (re-matches #"^[a-z\-]+$" "abc--") will give us the result, But if i send 2 hypen it should return nil, How can I achieve this
What exactly do you mean? Just --
? Or two consecutive hyphens anywhere in a larger string? Or just two hyphens anywhere in the string?
I.e. what strings from these should not be matched? --
, a--
, a-b-
.