Fork me on GitHub

I have a function defined

(defn sentence [] (concat (noun-phrase) (verb-phrase)))
With the functions noun-phrase and verb-phrase not yet defined. The compiler doesn't like this:
Syntax error compiling at (REPL:1:27).
Unable to resolve symbol: noun-phrase in this context
But it's not really an "error", at least to me considering the function did get compiled and so is really a warning. Is there a way to temporarily disable/mute this? Within Cider (Emacs) it's especially annoying with a popup every time.


In Clojure, all symbols must be defined before you use them.


Essentially, Clojure namespaces need their functions defined "bottom-up".


There's a couple options: 1. you can place the noun-phrase and verb-phrase definitions before the sentence definition (my preference) 2. you can add a (declare noun-phrase verb-phrase) statement before the sentence definition


I've always found the cider error popup annoying, you can customize cider-auto-jump-to-error and cider-auto-select-error-buffer to nil to prevent that behavior.


If you do M-x customize-group and go to the cider group, then you can browse the options under "Cider Auto Jump To Error" and "Cider Auto Select Error Buffer"


Thank you both for the clarification and suggestions.


Making that change to cider now, hate that.


How does a perennial beginner up their proficiency/expertise when they don't code/develop for a living?


Probably the same as the professionals: build stuff, collaborate


Tried building stuff but it's always basic. I’ve never used multimethods, see their utility but nothing compels me to use them. Dabbled in the datalog variants but didn't get past rules


@U06GMV0B0 Are there open source projects you depend on? You can get involved with those to expand your horizon in terms of experience. But also remember that not all Clojure features are in common production usage (multimethods, yes, I'd say so but not everything).

Bob B02:07:08

I think the things I personally find helpful outside of work are: • practice (obvs) • helping others - often people with questions have problems that are different from what I'm used to, and answering those questions (even if someone else gets there first and I don't actually send my answer) can help new ideas click for me

👍 1

@U04V70XH6 good point I remember reading Stu's book a decade ago and pretty sure defstruct was a thing. Haven't seen it since. Wrt to libs I’ll take a closer look


"Basic" can work. I am doing nothing but adding localstorage for persistence to a ClojureDart TodoMVC and, unlike with the Web variant, I am getting killed -- and learning a ton. You might need a variety of small projects. A bigger project building sth that amuses you (think Wordle) is preferred.

👍 1
Jim Strieter05:07:50

Does anyone know a general way of inverting a matrix in neanderthal? I found the method of (upper triangular) x (lower triangular) but, from what I've read, that only works for some invertible matrices, not all invertible matrices. Am I correct or am I missing something? Is there some straightforward way of doing this that I'm not picking up on?


not transpose? invert?

blueberry21:07:34 search for inverse. In general, you triangularize the matrix first, and then cal tri, or tri!. Maybe there's something else for specific cases, but this one is the first thing that comes to my mind (I'd have to check out my book to refresh my memory, and I don't have time for that now :)


what the heck is a matrix inversion


can I implement a constructor with reify ? - ah I think I should use proxy (still don't get how to provide a constructor with 1 arg)

Ben Sless14:07:21

Might have to gen-class


@benjamin.schwerdtner construct what? (Object. ___) is a way to construct an Object named _


I meant providing a constructor implementation. This is for interacting with some existing api, not normal clojure