Fork me on GitHub
#clojure
<
2016-02-08
>
reefersleep00:02:13

@meow: What do you do then? Some sort of managerial work? Or conceptual architecture, stuff like that?

reefersleep01:02:55

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?

meow03:02:37

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.

meow03:02:45

nil is nil but separate from "truthiness" - what is your specific issue with nil

meow03:02:25

nil is not ambiguous at all, at least not to me

kul05:02:53

is it possible to add a hook to existing boot tasks?

reefersleep07:02:34

@meow: Well, null pointer exceptions suck simple_smile 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 simple_smile

reefersleep07:02:29

I am really enticed by monads, though. (And yes, I know there are the algo.monads and cats libraries available for Clojure ; )

meow07:02:04

All exceptions in Clojure are less than ideal and some suck bigtime, yes.

reefersleep07:02:26

Also, Erlang is touted as a very robust system, though this seems to be because of the Actor model.

meow07:02:32

I don't know Haskell.

reefersleep07:02:02

I just know there's got to be a better alternative to what's going on in Java/Clojure simple_smile With respect to error handling.

meow07:02:23

I don't have a problem with how nil is treated in Clojure.

reefersleep07:02:49

I've read that some-> is actually a monad, acting much like Haskell's maybe.

meow07:02:56

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.

reefersleep07:02:25

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.

reefersleep07:02:27

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!

meow07:02:48

I really should have said exceptions up there. Yes, the exception messages suck.

meow07:02:10

Colin is awesome.

meow07:02:28

I use Cursive.

meow07:02:28

Just write perfect code and this problem goes away.

meow07:02:30

Seriously, if you write good code Clojure is more fun.

meow07:02:15

Or maybe learn a debugger, which I never did.

meow07:02:52

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.

meow07:02:15

I've just been programming for 30 years, so I've earned my battle scars. 😎

reefersleep08:02:31

@meow: I endevaour to write excellent code 😉

reefersleep08:02:17

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.

reefersleep08:02:13

And I try to get the code reviewed when I think I have done my best, just in case I haven't.

meow09:02:48

Excellent strategy @reefersleep

meow09:02:18

Do you have a github?

reefersleep11:02:59

@meow: yeah, and it excellently demonstrates why I should work harder on my readability issues simple_smile

reefersleep11:02:20

I'm a newbie and haven't written much.

meow11:02:47

Cool, thanks.

reefersleep11:02:26

derpa/derpanet in particular are painful to me, the step function is terrible x) Have asked for help on Code Review for that.

reefersleep11:02:39

But on the other hand, it's the only thing that you can see running as of now, so there's that.

reefersleep11:02:30

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.

meow11:02:18

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.

meow11:02:06

Avoid loop / recur whenever you can.

meow11:02:44

You'll pick it up quickly.

meow11:02:26

I've read a ton of clojure code and some people can really create awful code with clojure.

meow11:02:11

Check your email. simple_smile

jan.zy12:02:08

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.zy12:02:36

I would expect that START would be written out to the console as well

jan.zy12:02:50

any hints?

pesterhazy12:02:53

@jan.zy: probably a CIDER thing

pesterhazy12:02:14

check your buffers for a cider buffer, which should include your stdout

pesterhazy12:02:43

if you run it in a plain terminal (using e.g. lein repl) output should be as epexted

jan.zy12:02:30

confirmed, works for me now

bozhidar12:02:55

cider buffer?

bozhidar12:02:03

I’m not sure what you mean by this

bozhidar12:02:50

I’m cider’s author and I’m generally puzzled simple_smile

bozhidar12:02:12

in the past some output would end up in the nREPL server buffer

jan.zy12:02:16

but when I ran these commands from standard REPL (Without profiles.clj) then I saw the expected output

bozhidar12:02:30

due to reasons beyond cider

bozhidar12:02:46

e.g. the output being attached to the server process

bozhidar12:02:03

but we’ve added some redirection for this in 0.10

jan.zy12:02:13

so, the follow up question is: how can I see output of System.out java method in cider repl ? simple_smile

bozhidar12:02:15

so in theory everything should end up in the REPL

bozhidar12:02:32

you should be able to

bozhidar12:02:39

there’s nothing magical about it

bozhidar12:02:51

you should check the nREPL messages buffer

bozhidar12:02:00

to see what happens for you then

jan.zy12:02:04

uhoh, I have a LOT of them,

jan.zy12:02:07

give me a sec..

bozhidar12:02:04

anyways, you can file some issue

bozhidar12:02:33

with some repro steps for the problem and we’ll (eventually) investigate it

bozhidar12:02:41

it definitely comes as a surprise

jan.zy12:02:17

ok, I’ll investigate it deeper tonight, thanks for help!

dominicm14:02:15

You might want to look at using instaparse, if you can figure out how that file is encoded.

rickmoynihan15:02:39

has anyone here ever run into a problem where leiningen doesn't merge profiles from ~/.lein/profiles.clj when you run the uberjar task?

rickmoynihan15:02:16

even with-profiles doesn't work

lvh15:02:45

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

lvh16:02:06

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

jotaro17:02:16

hi folks!!

jotaro17:02:02

i have question. simple_smile I have a mixed ( clojure and java) project

jotaro17:02:45

Is there any method auto-compile and reload on repl when java file saved?

jotaro17:02:17

or reload java at least without restarting repl

mpenet17:02:53

i think ztellman released a lib just for that

jotaro17:02:55

oh my this is exactly what I wanted. much appreciated. but looks like it's at very early stage.

mpenet17:02:22

if it works, should be good enough

quephird22:02:51

Has anyone here tried using quil with seesaw?

meow22:02:42

#C0FM7N1SM

meow22:02:13

@quephird: Might find help on the #C0FM7N1SM channel.