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

[Question] How do you develop for the project? #14

Open
Joe-Withey opened this issue May 2, 2018 · 2 comments
Open

[Question] How do you develop for the project? #14

Joe-Withey opened this issue May 2, 2018 · 2 comments

Comments

@Joe-Withey
Copy link
Contributor

Could you give some information on how you work on the editor?
Specifically, how could you run the editor and use a repl to interact with it?

@mogenslund
Copy link
Owner

Hi Joe

Most of the functions in the editor are pure. They take some input and evaluate to some output.
These pure functions are then applied to parts of the state to do the mutation (editor actions).
This means that I usually can focus on a single function at the time.

Since the editor itself is sort of a repl, I usually just create an empty work-file, write pieces of the function and interact with the pieces using evaluation of s-expressions. Then I assemble the pieces.

Since I usually do not need to evaluate the whole file, I can also write notes and test data in the work-file. Test data is also just evaluated and thereby loaded into variables.

When I think the function works, I copy it to the Liquid source. And in some cases my tests are modified to become unit tests. I have a lot of experiments lying around that may or may not go into Liquid and some of them are just private stuff that are probably only useful to myself.

If I do something a lot, I might just assign it to a key on the keyboard by evaluating something like this (editor/set-global-key "f3" my-fancy-function).

So my work-file might contain temporary useful changes to the editor itself.

I like having all my pieces available in the editor to experiment with, copy/paste, partly evaluate and with any number of versions. I actually feel quite limited when using a traditional repl.

I use this work-file approach in many situations. Sometimes in tmp files and sometimes in files that I keep for the future.

If I work on another project I usually just add the classpath for that project to my local liquid deps.edn.

@Joe-Withey
Copy link
Contributor Author

Joe-Withey commented May 8, 2018

Thanks for the speedy reply and great insight. Such a cool project, so many possibilities. I have taken to running nrepl server in my home/joe/liq folder to connect to the running liquid instance and browsing the codebase in vim with fireplace connected for repl interaction :)

This is as I am interested in the implementation of liquid but am not so proficient outside of vim or in liquid yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants