Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev env questions #4

Open
schoettl opened this issue Jan 18, 2020 · 6 comments
Open

Dev env questions #4

schoettl opened this issue Jan 18, 2020 · 6 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@schoettl
Copy link
Collaborator

Can a clojure developer help me with a few things?

1

How do you compare lein test output?

FAIL in (timestamp) (parser_test.cljc:261)
date timestamp with day and time with seconds
expected: (= [:timestamp [:timestamp-active [:timestamp-inner [:timestamp-inner-w-time [:ts-date "2020-01-18"] [:ts-day "Sat"] [:ts-time "12:00:00"] [:ts-modifiers]]]]] (parse "<2020-01-18 Sat 12:00:00>"))
  actual: (not (= [:timestamp [:timestamp-active [:timestamp-inner [:timestamp-inner-w-time [:ts-date "2020-01-18"] [:ts-day "Sat"] [:ts-time "12:00:00"] [:ts-modifiers]]]]] [:timestamp [:timestamp-active [:timestamp-inner [:timestamp-inner-w-time [:ts-date "2020-01-18"] [:ts-day "Sat"] [:ts-time "12:00:00"]] [:ts-modifiers]]]]))

Is there a lein test diff tool to get around copy & paste?

2

(deftest timestamp
  (let [parse #(parser/org % :start :timestamp)]
    (testing "date-only timestamp"
      (is (= [:timestamp [:timestamp-active [:timestamp-inner [:timestamp-inner-wo-time [:ts-date "2020-01-18"]] [:ts-modifiers]]]]
             (parse "<2020-01-18>"))))

How can I def a helper function that creates this huge [:timestamp [...?

3

Can I speed up the tests by running them in lein repl instead of lein test. lein test already takes 5.5 seconds to run, not funny...

@munen
Copy link
Contributor

munen commented Jan 20, 2020

Hi @schoettl

Thank you for your great questions. Since the questions are tooling related, I opted to make a quick screencast for the answer: https://www.dropbox.com/s/f9htbxmfjdd5pzw/2020-01-20_11-quick-intro-to-lisp-and-clojure-and-the-repl.mpv?dl=0

Does that help?

@munen munen added the question Further information is requested label Jan 20, 2020
@schoettl
Copy link
Collaborator Author

Thanks! That's definetly helpful. I have to check out soon, if I can do the same in my emacs :)

I'd like to leave this issue open for a while, until I made it – and for the case I have further questions.

@munen
Copy link
Contributor

munen commented Jan 21, 2020

Sure thing, good luck!

And if you're not warm with Emacs, yet, I hear good things about VIM fireplace^^

@aspiers
Copy link

aspiers commented Jan 21, 2020

Excellent video @munen, thanks a lot! I've hacked elisp for many years, but never clojure, so this was really helpful for me, and makes me want to get stuck into this project :-) Hoping to get some free time soon...

@munen
Copy link
Contributor

munen commented Jan 22, 2020

@aspiers Thank you very much!

Clojure is a lot of fun. With your elisp experience, you'll easily grasp it. The big difference is that Clojure emphasizes immutable data structures and functional programming.

Having said that, the org-parser repo doesn't require a whole lot of Clojure coding. The parser is written in EBNF - so it's only down to the tests for which the existing tests likely include most required syntax. So it's a good starting ground to have a little go at Clojure(;

One last thing, if you do get to know Clojure data structures, there's one more benefit: In organice, we're making extensive use of ImmutableJS which is pretty much a port of Clojures data structures to JavaScript and have a high correlation in how the APIs work.

Looking forward to seeing more org-parser PRs coming in(;

@munen
Copy link
Contributor

munen commented May 5, 2020

@schoettl I've added a little bit of documentation and the video to the readme: #14

@schoettl schoettl added the documentation Improvements or additions to documentation label Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants