This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-13
Channels
- # 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)
- # 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)
- # xtdb (11)
- # 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...
The second case is setting a static field
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.
Whatâs the question?
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.
user=> (def p (java.awt.Point. 1 1))
#'user/p
user=> (set! (. p x) 10)
10
In this example, it's just saying that p
will be evaluated, then 10
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
Not sure if it should be interpreted as referring to the classname case, even. ÂŻ\(ă)/ÂŻ
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 DOT
, AssignExpr
, 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.
I thought 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
That's the 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?
Aha, I found it. type
! I was looking at instance?
to no avail
you probably want class
actually
but type
will work too
Ah, cool. They seem to give the same output, what's the difference?
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.
Thanks!
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
thanks @U0K064KQV I will try to have that in mind.
People like different stuff and have created a variety of forums, such is the internet
Revel in your choices
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.
no, that's not available right now - you can supply exclusions on a per-dep basis
@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
are you using java 9? does it work with java 8?
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
Recently renamed to just #calva
Thanks. A bit of evidence that my memory isn't fooling me all of the time đ
(I only found they'd renamed it when I tried to type it in đ )
@grierson I think Calva has superceded both of those VS Code packages -- it's getting a lot of active development and there's a #calva channel for it.