This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-07
Channels
@roberto: highlight from just before (a-fn)
to past (b-
and call align-repeat-left-paren
will give you that state
Well, right now I'm still too dumb for emacs beyond the basic editor commands, so that's what I'm using until I gain some proficiency.
But now if I edit my cmaze.png/draw
method, paste it into the repl to update it, then boom
If you have that set up, though, you can reload a namespace with: (require '[cmaze.util :as util] :reload)
Do I have to do that with every repl or is that a shortcoming of the intellij environment?
Yes. You need to tell the REPL when something has changed (unless you have a harness that can manage that transparently)
I think I hit a typical beginner's problem. I think I am using too many variables in my let forms, but I see no simple way to break it up
I'm having a difficult time using OOP refactorings like extract-method or parameter-group in this context
The code in question: http://pastebin.com/5w9eURyu
I've verified that the code works and does as it should, I just want to clean it up to conform to clean coding standards
A general principle is that fns should do only one thing, and should try to be pure.
This draw fn does all the things and is hard to test interactively or reuse in other contexts.
You might consider splitting into into a pure fn that generates a data structure describing the line segments that comprise the maze, and an impure fn that writes an image file given such a data structure.
Fair point, sorry, I read this hastily
You could split it apart into a pure fn which renders a maze as a seq of lines, then an impure fn to .draw them to the graphics image, but I dunno if there's significant benefit to be gained thereby
Yes, I was thinking about your data structure advice; perhaps an intermediate vector which contains (x,y),(x',y') coordinates
Oh yeah, it worked nicely! Thanks @donaldball
Although I feel that I'm still using fairly primitive tools to code and clean up clojure with
If you do the emacs thing, some folk enjoy clj-refactor
I think cursive has similar factoring tools