5 ms·
> You mean that you accidentally "overwrite" (declare again) a function with the same name as the one you're now declaring, but you didn't mean to? I mean I us
by aidenn0 3y ago
> You mean that you accidentally "overwrite" (declare again) a function with the same name as the one you're now declaring, but you didn't mean to?
I mean I use let to bind a variable with the same name as a function. This is idiomatic in Common Lisp, and totally breaks things in most other languages.
> This I'm also curious about, what exactly SLIME gives you that for example Conjure for neovim wouldn't already? Maybe something about continuations perhaps? That seems to be the only feature I've seen from Common Lisp (besides actually being able to compile to binaries) that I'd love to have in Clojure.
I watched a video and it does seem rather complete, but [1] indicates there is no debugger? That's a rather glaring omission. I also don't see a profiler mentioned, and SLIME with SBCL gives me a profiler (down to the assembly level if needed). I'm sure Java in general has great profiling tools, but how are the integrated into the Clojure system?
As an aside, by "continuations" did you mean "restarts"? First-class continuations are a feature of scheme, not CL. Indeed a huge boost to CL productivity is simply allowing you to handle an exception before the stack is unwound.
1: https://github.com/Olical/conjure/wiki/Client-features https://github.com/Olical/conjure/wiki/Client-features
- capableweb 3y ago> I mean I use let to bind a variable with the same name as a function. This is idiomatic in Common Lisp, and totally breaks things in most other languages. Aha, that should be working fine? (defn add [x y] (let [add clojure.core/+] (add x y))) The `let` binding is local, so it's referring to clojure.core/+, and outside the function `add` I can use the name `add` to call it. Seems it's handling that case correct? > I watched a video and it does seem rather complete, but [1] indicates there is no debugger? I think debuggers tend to be used as a library across many different editors, rather than the editor/plugin providing that functionality. Personally, I don't use debuggers much as the functions I write tend to be small and evaluating small executions with the repl tends to reveal the issue quickly. Sometimes when refactoring others code I've used https://github.com/philoskim/debux https://github.com/philoskim/debux to various degrees of success. I do think cider (https://github.com/clojure-emacs/cider https://github.com/clojure-emacs/cider) has stuff regarding stepping debuggers, but I'm not sure how common it is to use it. Maybe other Clojure users can fill me in :) > . I also don't see a profiler mentioned Yeah, as you said, the Java ecosystem basically covers that. For OSS stuff, I use VisualVM, and for professional stuff I use YourKit, both of them work well with Clojure and points out my user-space code with ease. And I've never been paid anything for actually writing/maintaining Java code, so even with that, seems I'm able to use those tools just for Clojure :) > As an aside, by "continuations" did you mean "restarts"? Ah yes, of course. The condition system and restarts :) Thanks!
- aidenn0 3y agoHere's a stupid example of what I mean by shadowing: user=> (defn foo [seq] #_=> (every? seq seq)) #'user/foo user=> (foo ["1" [1] '(1) {:1 1} #{1}]) Execution error (IllegalArgumentException) at user/foo (REPL:2). Key must be integer Note that in a CL with a "seq" function foo would look like: (defun foo (seq) (every #'seq seq)) So there would be no ambiguity.
- deleted 3y ago[deleted]
- aidenn0 3y ago> I do think cider (https://github.com/clojure-emacs/cider https://github.com/clojure-emacs/cider) has stuff regarding stepping debuggers, but I'm not sure how common it is to use it. Maybe other Clojure users can fill me in :) I don't really care about stepping; for me the debugger is about inspecting the state of my program when an exception (maybe because I interrupted it, or because I inserted a breakpoint, or just because something went wrong) happens. Backtrace, local variables, evaluating forms at different stack frames and so-forth.
- fiddlerwoaroof 3y agoI use Cider exclusively when I write Clojure, but it’s not really a match for slime, more of an echo.