This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-08
Channels
- # aatree (3)
- # announcements (1)
- # architecture (5)
- # beginners (27)
- # boot (22)
- # cider (17)
- # cljsrn (8)
- # clojure (93)
- # clojure-canada (1)
- # clojure-dev (7)
- # clojure-nl (10)
- # clojure-poland (216)
- # clojure-russia (35)
- # clojurescript (163)
- # community-development (6)
- # cursive (25)
- # datavis (6)
- # datomic (18)
- # dirac (10)
- # dysphemism (4)
- # editors (3)
- # editors-rus (1)
- # emacs (15)
- # hoplon (124)
- # instaparse (25)
- # jobs (10)
- # ldnclj (78)
- # lein-figwheel (11)
- # leiningen (6)
- # off-topic (20)
- # om (149)
- # onyx (2)
- # parinfer (5)
- # portland-or (1)
- # proton (62)
- # quil (2)
- # re-frame (8)
- # spacemacs (4)
- # yada (20)
@meow: What do you do then? Some sort of managerial work? Or conceptual architecture, stuff like that?
In general, nil
seems as ambiguous to me as Java's (bread-and-butter-lang) null
. Sometimes it means "nothing", but at other times, it means "something other than nothing". And that seems pretty terrible. Am I alone in this?
I just cause trouble for the Braid developers, encourage them to fix my messes, then reward them with sincere praise because they are truly fabulous and brilliant.
@meow: Well, null pointer exceptions suck And in Java and Clojure, they can appear just about anywhere. I've read about Haskells monads which (among other things) seem to handle the possibility of "nothing" in a more elegant, safe way. I think that the ubiquity of nil/null in Java and Clojure encourages programmers to use them as valid values where they should really use something else - this is what I mean by ambiguous. I may be wrong and just in an unfortunate minority environment here
I am really enticed by monads, though. (And yes, I know there are the algo.monads and cats libraries available for Clojure ; )
Also, Erlang is touted as a very robust system, though this seems to be because of the Actor model.
I just know there's got to be a better alternative to what's going on in Java/Clojure With respect to error handling.
I've read that some->
is actually a monad, acting much like Haskell's maybe
.
I don't think nil
is the source of your problems. Except perhaps on the Java side. But the real problem is error handling and unitl Clojure becomes second nature the error messages are often worthless and frustrating.
Actually, now that you put it like that, I remember when I started out reading about Clojure, being all swept up in its awesomeness, and then I arrived at try/catch. Really? That seemed like one area where it would really have paid off to come up with something smarter. Especially because exceptions in Clojure read so foreign to how the language is written.
For sure!
I saw Colin Flemming's video on improving error messages with grammars. He used the technique in Cursive, but it is applicable everywhere. I hope other people pick up on it, it looked great!
I've only working in Clojure for 8 months and don't know Java and only a little of Javascript so I'm no expert. on any of this. These are just my opnions.
@meow: I endevaour to write excellent code 😉
I put a lot of thought into readability and using the correct idioms at the moment, and I'm going to learn how to use Schema soon so that I can make more assurances about data structures.
And I try to get the code reviewed when I think I have done my best, just in case I haven't.
Excellent strategy @reefersleep
@meow: yeah, and it excellently demonstrates why I should work harder on my readability issues
I'm a newbie and haven't written much.
derpa/derpanet in particular are painful to me, the step
function is terrible x) Have asked for help on Code Review for that.
But on the other hand, it's the only thing that you can see running as of now, so there's that.
And the cljs is all over the place in general. I'm hoping to make l-mayer a model of friendliness in terms of both API, source code and README. It's still in the infant stage, though.
I looked at the l-system code. Not bad. Reflects your newness with the language but at least you understand functional coding. Clojure was the first functional language for me. Prior to that I did QML and Python.
I've read a ton of clojure code and some people can really create awful code with clojure.
Hi, how can I evaluate java code in REPL?
I have following Java class in directory listed in :java-source-paths
in project.clj
:
public class Main {
public static void go() {
System.out.println("START");
}
}
and here is my REPL session:
; CIDER 0.10.1 (Java 1.8.0_25, Clojure 1.8.0, nREPL 0.2.12)
x> (import Main)
;; => Main
x> (Main/go)
;; => nil
@jan.zy: probably a CIDER thing
check your buffers for a cider buffer, which should include your stdout
if you run it in a plain terminal (using e.g. lein repl) output should be as epexted
but when I ran these commands from standard REPL (Without profiles.clj
) then I saw the expected output
so, the follow up question is: how can I see output of System.out
java method in cider repl ?
this is the relevant middleware, btw - https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/out.clj
You might want to look at using instaparse, if you can figure out how that file is encoded.
has anyone here ever run into a problem where leiningen doesn't merge profiles from ~/.lein/profiles.clj
when you run the uberjar
task?
even with-profiles
doesn't work
danielgrosse: what are you optimizing for? readability? if that is a well-defined format (with a real grammar), try instaparse to get a better parser
Does anyone have any particular suggestions for writing a forms-to-forms DSL compiler? I’m currently using core.match, but it’s not quite as pleasant as I had hoped; I’m having to put :seq
everywhere… I am mostly just trying to compile something like (a (b :c) d)
to something like (whatever a (:c b) d)
; I can do the optimizations later