This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (3)
- # babashka (130)
- # beginners (73)
- # calva (22)
- # cider (46)
- # cljdoc (18)
- # cljs-dev (196)
- # cljsrn (18)
- # clojure (255)
- # clojure-europe (2)
- # clojure-finland (8)
- # clojure-gamedev (1)
- # clojure-germany (2)
- # clojure-losangeles (6)
- # clojure-nl (1)
- # clojure-spec (16)
- # clojure-uk (33)
- # clojurescript (32)
- # community-development (1)
- # conjure (40)
- # core-logic (11)
- # crux (11)
- # cursive (4)
- # datascript (8)
- # devcards (17)
- # emacs (21)
- # exercism (2)
- # fulcro (29)
- # funcool (15)
- # graalvm (18)
- # jobs (17)
- # jobs-rus (1)
- # lambdaisland (1)
- # lumo (1)
- # malli (19)
- # off-topic (15)
- # pathom (22)
- # quil (7)
- # re-frame (3)
- # reagent (3)
- # shadow-cljs (14)
- # spacemacs (41)
- # specter (2)
- # sql (5)
- # tree-sitter (1)
- # unrepl (16)
- # vscode (3)
- # yada (1)
I went for a long time in vim just using the % key to jump between matching delimiters and generally editing forms manually. (described it here: https://jacobobryant.com/post/2020/editing-sexprs/) Now I also use vim-sexp which adds some paredit-like features.
What kind of tool/logging method do you use to monitor heap size consumption of your Clojure/JVM process?
At https://clojure.org/reference/java_interop, I find this: > (set! (. instance-expr instanceFieldName-symbol) expr) > (set! (. Classname-symbol staticFieldName-symbol) expr) > Assignment special form. > > When the first operand is a field member access form, the assignment is to the corresponding field. If it is an instance field, the instance expr will be evaluated, then the expr. I am not quite following the second case there...
Thanks. I was a bit unclear with my question, though. I mean the second case in the paragraph below: > If it is an instance field, the instance expr will be evaluated, then the expr.
If you’re setting an instance field, it first evaluates the instance expression, then the value expression. It’s just what it says, so doesn’t seem unclear to me.
In this example, it's just saying that
user=> (def p (java.awt.Point. 1 1)) #'user/p user=> (set! (. p x) 10) 10
pwill be evaluated, then
Thanks! So then maybe it is the first sentence I don't get. I'll reread the docs up to that sentence and see what I have missed.
I think the first sentence is talking about the second case, and the second sentence is talking about the first case
or maybe the first sentence is trying to distinguish from invocation which has since been split apart, not actually sure
i find the text confusing as well.
overall though i think the purpose of the doc is to explain interop.
for this case, the point has to do with how one uses
set! in these situations.
the second sentence of the paragraph starting "When" does not make sense if applied to the class case because there is no "instance expr" that would apply. so i think it's reasonable to deduce we are talking about the first
set! form there.
the first sentence does seem like it could apply to either though.
ime, this type of doc is sometimes a brain dump of someone who has the implementation in mind. it could be that reading Compiler.java and looking for
analyze, etc. might give some insight, though that may take some time.
i already spent some minutes there but my stack is currently not so spacious to take it all in 🙂
I don't seem to understand why putting it inside of a
str makes it print out the lazy sequence instead of the expected
"(2 1 :b :a)" .
or how to get the expected result because doall doesn't seem to work either
str delegates to Java's
Object.toString() (the right
overload override). It will not force the lazy sequence.
doall would fix that though? isn't it supposed to walk through the list and make it eager?
It is still a lazy seq. There is no
overload override for
.toString() in LazySeq that will print out the contents.
But when you dump the contents of the laze seq into a real collection like list or a vector, it will work as you expect it to.
I guess I just thought that it had a .toString implementation because it printed out into the console correctly
Object.toString() getting hit. Prints the type followed by the memory location I believe.
But the hashCode() implementation of
Object just returns the memory address, so I was right.
> But the hashCode() implementation of `Object` just returns the memory address, so I was right. That's JVM implementation specific.
Yes, I was not advocating its use. Noone should parse the output of
.toString() for whatever purpose.
Is there a way to check what type of record a specific record is an instance of?
If I am not mistaken,
class returns an object's underlying Java class, whereas
type takes into account Clojure's dynamic custom type hierarchies, if you define or use them.
Take a look here: https://clojuredocs.org/clojure.core/isa_q and its "SEE ALSO" section.
Hi. Just found two active Clojure forums https://ask.clojure.org (maintained by cognitect) and https://clojureverse.org (don’t know who is behind it). Question: wouldn’t our community benefit on having only one strong forum? meanwhile which one should I use? (don’t want to start a flamewar)
ClojureVerse is more for discussions, http://ask.clojure.org is for Q/A style and reporting bugs or feature request
People like different stuff and have created a variety of forums, such is the internet
Or use Go lang if I don't want to learn a dozen different 3 year old libraries before I can figure out which one can be used for my goals? : )
@U0VQ4N5EE That seems like unnecessary snark and is not an appropriate response.
I am sorry, I was not handed a book about what is appropriate here, if you let me know where these rules are rest assured that I will do my best to follow them to the letter. I also do not understand what snark is, will have to look it up in the dictionary, but I did not indented to incite emotions I merely wanted to highlight the inherent blindness in this community towards the extraordinary amount of work that it requires to join it.
@include http://ask.clojure.org is more of a StackOverflow kind of thing -- and it's how feature requests and bug reports can move from community submission to JIRA and action by core/Contrib maintainers. http://clojureverse.org is more of a general discussion forum, where folks announce and discuss projects or have a back and forth about process/architecture/etc.
@seancorfield great. thanks for your enlightenment. I think (as newbie) I will stick with the general discussion forum for a while 🙂
Hello all! I was trying to go through some of the clojure tutorials and got stuck here https://github.com/ClojureBridge/drawing/blob/master/curriculum/first-program.md Problem is that when I run the code with REPL, I am getting the following error. Anyone have an idea of what's going wrong with my setup? I had followed the setup up as instructed as far as I know
user=> Execution error (ClassNotFoundException) at jdk.internal.loader.BuiltinClassLoader/loadClass (BuiltinClassLoader.java:602). com.apple.eawt.QuitHandler
Does anybody use VSCode and clojureVScode or clover plugins? Would like to output eval results back to connected REPL not the built in VSCode output window which has no colours or pretty print
If you do not get an answer here, there are #vscode and #calva channels that might help