Skip to content

Verlet implementation in Common Lisp #608

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

Merged
merged 11 commits into from
Oct 8, 2019

Conversation

Trashtalk217
Copy link
Contributor

Not completely happy with this one, it's still a bit of a work in progress.

@june128 june128 added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Jun 8, 2019
@june128 june128 changed the title Verlet implementation in Common Lisp WIP Verlet implementation in Common Lisp Jun 8, 2019
@Trashtalk217
Copy link
Contributor Author

Fixed some things and I think it looks pretty good now. Open for review!

@Trashtalk217 Trashtalk217 changed the title WIP Verlet implementation in Common Lisp Verlet implementation in Common Lisp Jul 18, 2019
Copy link
Member

@berquist berquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no issues with the algorithm, it's idiomatic as far as I can tell. Just a few nits.

@Trashtalk217
Copy link
Contributor Author

Trashtalk217 commented Sep 8, 2019

When looking back at the function descriptions now, I don't like them that much. They are awkwardly worded. If somebody knows a better wording while keeping it on one line, please let me know. Otherwise, all of the problems noticed by @berquist are fixed.

@berquist berquist self-assigned this Sep 9, 2019
Copy link
Member

@berquist berquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy with the code but will wait for your comments on the docstring wording.

;;;; Verlet integration implementation in Common Lisp

(defun verlet (pos acc dt)
"Finds the time it takes for an object to hit the ground using Verlet integration."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, and think the problem is "hits the ground". That's an application of the method, sure, but we are really just integrating Newton's equation of motion from position = pos (greater than 0) to position = 0. Maybe this helps with the reword?

@berquist
Copy link
Member

berquist commented Oct 6, 2019

@Trashtalk217 poke.

@Trashtalk217
Copy link
Contributor Author

Who dares disturb me in my slumber. I've tried something other doc-strings. But I'm not sure this is an improvement.

@berquist
Copy link
Member

berquist commented Oct 8, 2019

If we look at a "real" CL program (https://github.com/rigetti/quilc/blob/master/src/analysis/fusion.lisp), docstrings can be as long as you want on a single line. Elisp often has paragraphs (https://github.com/greghendershott/racket-mode/blob/master/racket-common.el), usually with line breaks at reasonable places (logical lines or 50-100 characters long).

This is to say that if you feel constrained by the docstring length, they can be made longer. I'm going to merge this rather than have it sit around, and if you want to change the docstrings, by all means submit another PR.

@berquist berquist merged commit d926cb9 into algorithm-archivists:master Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants